Number of output/capture plane buffers

hi.
How to correctly calculate the number of buffers for:

  • decoder output plane
  • encoder output plane
  • encoder capture plane ?

How to calculate their size correctly?

Hi,
Take code in 01_video_encode as example. After calling

ret = ctx.enc->output_plane.setupPlane(V4L2_MEMORY_MMAP, 10, true, false);

You can get total buffer number by calling

ctx.enc->output_plane.getNumBuffers();

Buffer size is size of YUV420 and depends on resolutions. For 1280x720, it is 1280x720x1.5. For certain resolutions, the size is a bit larger for data alignment.

ret = ctx.enc->output_plane.setupPlane(V4L2_MEMORY_MMAP, 10, true, false);

this.

why exactly 10? why not 8 or 5? How do you define this? when 10 will be enough? or this can not be?

what about V4L2_CID_MIN_BUFFERS_FOR_OUTPUT?

Hi,
10 is the value configured in app but may exceed maximum of encoder/decoder. Please call getNumBuffers() to get actual number.