From: Nicolas Dufresne <nicolas.dufre...@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 <nico...@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

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to