Re: [PATCH v2 2/2] media: docs-rst: Document memory-to-memory video encoder interface

From: Nicolas Dufresne
Date: Sat Nov 17 2018 - 20:34:20 EST


Le samedi 17 novembre 2018 Ã 12:37 +0100, Hans Verkuil a Ãcrit :
> > > Does V4L2_CID_MIN_BUFFERS_FOR_CAPTURE make any sense for encoders?
> >
> > We do account for it in GStreamer (the capture/output handling is
> > generic), but I don't know if it's being used anywhere.
>
> Do you use this value directly for REQBUFS, or do you use it as the minimum
> value but in practice use more buffers?

We add more buffers to that value. We assume this value is what will be
held by the driver, hence without adding some buffers, the driver would
go idle as soon as one is dequeued. We also need to allocate for the
importing driver.

In general, if we have a pipeline with Driver A sending to Driver B,
both driver will require a certain amount of buffers to operate. E.g.
with DRM display, the driver will hold on 1 buffer (the scannout
buffer).

In GStreamer, it's implemented generically, so we do:

MIN_BUFFERS_FOR + remote_min + 1

If only MIN_BUFFERS_FOR was allocated, ignoring remote driver
requirement, the streaming will likely get stuck.

regards,
Nicolas