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

Mark Thompson sw at jkqxz.net
Tue Aug 8 01:22:39 EEST 2017


On 07/08/17 20:28, Jorge Ramirez wrote:
> On 08/03/2017 01:53 AM, Mark Thompson wrote:
>>> +        AV_OPT_TYPE_INT,\
>>> +        {.i64 = V4L2_MEMORY_MMAP},\
>>> +        0, INT_MAX, FLAGS },\
>>> +    { "output_memory",\
>>> +        "Output memory model: See V4L2_MEMORY_* in videodev2.h. This depends on the HW but default should work with most.",\
>>> +        OFFSET(capture_pool.memory),\
>>> +        AV_OPT_TYPE_INT,\
>>> +        {.i64 = V4L2_MEMORY_MMAP},\
>>> +        0, INT_MAX, FLAGS },\
>>> +    { "num_output_pool_buffers",\
>>> +        "Number of buffers in the output pool",\
>>> +        OFFSET(output_pool.num_buffers),\
>>> +        AV_OPT_TYPE_INT,\
>>> +        { .i64 = 16 },\
>>> +        4, INT_MAX, FLAGS }
>> Can we attempt to set this automatically based on the codec?  16 won't be enough for worst-case H.264/H.265.
>>
> 
> please could you suggest some defaults so I can prepare the table?

If, as you've suggested elsewhere, the decoder doesn't actually use these frames for reference and instead has its own copies internally then this won't actually matter.

If it turns out that you do need the buffering here then the numbers of surfaces used by other hardware decoders are probably good - e.g. <http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/vaapi_decode.c;h=cf58aae4c6f1a815e391cc4095afb16edb0bfed8;hb=HEAD#l434>.


More information about the ffmpeg-devel mailing list