Configuration of the v4l2src buffer pool size.

Louis-Antoine Blais-Morin lablaismorin at genetec.com
Thu Sep 22 12:42:11 UTC 2022


Hi,

We are working on an application where the pipeline is configured as follow:

v4l2src ! capsfilter caps=[...] ! tee name=t ! appsink ! t. [remaining of pipeline not important for this discussion]

The v4l2src video source uses DMABUF acquisition, which is great to reduce memory copies.
However, to completely prevent memory copies, the buffer pool in v4l2src should have enough buffers available for the v4l2 driver while acquired buffers are sent to the downstream elements.
If I understand correctly, the number of buffers in the v4l2src buffer pool is decided (amongst other things) according to the GST_QUERY_ALLOCATION query response to the downstream elements. The downstream elements could inform the upstream v4l2src of their needs (for example, if they need to keep references to the acquired buffers).

Here is where things get complicated: our application keeps references on many buffers sent to the app via appsink. The application needs to have some short time history of the buffers. We allowed the app to keep references to a fixed number of buffers. As far as I investigated, there seems to be no way for the appsink to inform the upstream elements (v4l2src) about this fact, via GST_QUERY_ALLOCATION reply or via other means.

My question:
What is the best way to configure the v4l2src to allocate a pool with a larger number of buffers?
Is it possible via a reply to GST_QUERY_ALLOCATION from the downstream appsink (or other)?
Is there a hidden way to configure the v42lsrc buffer pool size directly?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220922/0ef5d3cb/attachment.htm>


More information about the gstreamer-devel mailing list