[FFmpeg-devel] [PATCHv3 4/4] libavcodec: v4l2: add support for v4l2 mem2mem codecs

Jorge Ramirez jorge.ramirez-ortiz at linaro.org
Fri Aug 4 16:06:30 EEST 2017


On 08/04/2017 01:51 PM, Mark Thompson wrote:
>> +    if (ret)
>> +        return 0;
>> +
>> +    return avpriv_v4l_dequeue(cap_pool, frame, NULL, timeout);
>> +}
> What happens to the decoder if some parameters like resolution change mid-stream?  (Try the stream h264/reinit-large_420_8-to-small_420_8.h264 in the fate samples.)

yes, it breaks - the player still shows and image but it is corrupted.
I am not sure how to handle this situation to be honest...so need to 
look into this.

>
> Also, are the frames returned here actually still used by the decoder internally as reference frames, or is the reference frame copied somewhere else?

I think once the buffers are dequeued, the v4l2 decoder doesnt keep any 
references to it.
>   (Seems slightly unlikely that they would be copied given the additional memory requirements, but I know discrete desktop GPUs (which admittedly have 9001x the memory bandwidth and power budget) do do this to hide the possible issues.)  I think, though I'm not entirely sure because I haven't run it, that the returned buffers will only have the user reference, so will appear to be writable to following filters - if that ends up writing on reference frames then the decoder will break.

ack



More information about the ffmpeg-devel mailing list