[FFmpeg-devel] [PATCHv8] libavcodec: v4l2: add support for v4l2 mem2mem codecs

Jorge Ramirez jorge.ramirez-ortiz at linaro.org
Sun Sep 3 16:21:37 EEST 2017

On 09/03/2017 02:27 AM, Mark Thompson wrote:
>> +    /* 0. subscribe to source change event */
>> +    memset(&sub, 0, sizeof(sub));
>> +    sub.type = V4L2_EVENT_SOURCE_CHANGE;
>> +    ret = ioctl(s->fd, VIDIOC_SUBSCRIBE_EVENT, &sub);
>> +    if ( ret < 0)
>> +        av_log(avctx, AV_LOG_WARNING, "decoding does not support resolution change\n");
> How fatal should that be?  What happens if it changes anyway?
the buffers are allocated and queued in the driver with a size for a 
resolution and format: if the resolution changes down-up the image will 
not fit in the previously allocated buffers - not sure if that will 
cause some drivers to generate bus errors....I guess it will depend on 
each driver; also the sizes reported back with the frame after decoding 
to ffmpeg will not have been fixed properly since we couldnt receive the 
event so I doubt the images can be recomposed.

Basically the v4l2 kernel driver will have no way to report changes back 
to ffmpeg...

More information about the ffmpeg-devel mailing list