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

Mark Thompson sw at jkqxz.net
Sun Sep 3 20:57:57 EEST 2017

On 03/09/17 14:21, Jorge Ramirez wrote:
> 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...

Well, if this is likely to be entirely broken then maybe it should be disabled if the event isn't available?

More information about the ffmpeg-devel mailing list