[Mesa-dev] [PATCH v3 09/12] gst-decoder.c: Improve synchronicity of video output

Carlos Rafael Giani dv at pseudoterminal.org
Wed Apr 26 18:56:21 UTC 2017


From: Nicolas Dufresne <nicolas.dufresne at collabora.com>

This is done by setting a max-lateness and enable QoS messaging. This
will have the effect that buffer arriving late to the appsink won't will
be dropped instead of being queued. This is similar to what GstVideoSink
base class would do.

Signed-off-by: Nicolas Dufresne <nicolas at ndufresne.ca>
---
 gst-decoder.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gst-decoder.c b/gst-decoder.c
index fc4207c..2001cba 100644
--- a/gst-decoder.c
+++ b/gst-decoder.c
@@ -261,6 +261,10 @@ video_init(const struct egl *egl, const struct gbm *gbm, const char *filename)
 	g_object_set(G_OBJECT(src), "location", filename, NULL);
 	gst_object_unref(src);
 
+	/* Configure the sink like a video sink (mimic GstVideoSink) */
+	gst_base_sink_set_max_lateness(GST_BASE_SINK(dec->sink), 20 * GST_MSECOND);
+	gst_base_sink_set_qos_enabled(GST_BASE_SINK(dec->sink), TRUE);
+
 	/* if we don't limit max-buffers then we can let the decoder outrun
 	 * vsync and quickly chew up 100's of MB of buffers:
 	 */
-- 
2.7.4



More information about the mesa-dev mailing list