Decoders or other devices that expose a minimum buffers required produce
an first output. We use this information to calculate latency.
https://bugzilla.gnome.org/show_bug.cgi?id=722128
if (v4l2_ioctl (obj->video_fd, VIDIOC_G_CTRL, &ctl) >= 0) {
GST_DEBUG_OBJECT (obj->element, "driver require a minimum of %d buffers",
ctl.value);
+ obj->min_buffers_for_capture = ctl.value;
min += ctl.value;
}
*/
gboolean prefered_non_contiguous;
+ /* This will be set if supported in decide_allocation. It can be used to
+ * calculate the minimum latency of a m2m decoder. */
+ guint32 min_buffers_for_capture;
+
/* wanted mode */
GstV4l2IOMode req_mode;
GstQuery * query)
{
GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (decoder);
+ GstClockTime latency;
gboolean ret = FALSE;
if (gst_v4l2_object_decide_allocation (self->v4l2capture, query))
ret = GST_VIDEO_DECODER_CLASS (parent_class)->decide_allocation (decoder,
query);
+ latency = self->v4l2capture->min_buffers_for_capture *
+ self->v4l2capture->duration;
+ gst_video_decoder_set_latency (decoder, latency, latency);
+
return ret;
}