On Sun, Nov 18, 2018 at 10:34 AM Nicolas Dufresne <nicolas@xxxxxxxxxxxx> wrote: > > 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. What happens if the driver doesn't report it? Best regards, Tomasz