From 4ac9f919216e567642f9e91c42061c163b1fec02 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Mon, 14 Jun 2021 16:04:52 -0400 Subject: [PATCH] alphadecodebin: Fix stall due to QoS alphacombine element is a simple element that assumes buffers are always paired, or at least that missing buffers are signalled with a GAP. The QoS implementation in the GstVideoDecoder base class allow decoders dropping frames independently and that could lead to stall in alphacombine. Part-of: --- gst/codecalpha/gstalphadecodebin.c | 5 +++++ sys/v4l2codecs/gstv4l2codecalphadecodebin.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/gst/codecalpha/gstalphadecodebin.c b/gst/codecalpha/gstalphadecodebin.c index 9f0a0a3..16b6285 100644 --- a/gst/codecalpha/gstalphadecodebin.c +++ b/gst/codecalpha/gstalphadecodebin.c @@ -138,6 +138,11 @@ gst_alpha_decode_bin_constructed (GObject * obj) goto cleanup; } + /* We disable QoS on decoders because we need to maintain frame pairing in + * order for alphacombine to work. */ + g_object_set (decoder, "qos", FALSE, NULL); + g_object_set (alpha_decoder, "qos", FALSE, NULL); + alphacombine = gst_element_factory_make ("alphacombine", NULL); if (!alphacombine) { priv->missing_element = "alphacombine"; diff --git a/sys/v4l2codecs/gstv4l2codecalphadecodebin.c b/sys/v4l2codecs/gstv4l2codecalphadecodebin.c index 61c2612..72927d8 100644 --- a/sys/v4l2codecs/gstv4l2codecalphadecodebin.c +++ b/sys/v4l2codecs/gstv4l2codecalphadecodebin.c @@ -141,6 +141,11 @@ gst_v4l2_codec_alpha_decode_bin_constructed (GObject * obj) goto cleanup; } + /* We disable QoS on decoders because we need to maintain frame pairing in + * order for alphacombine to work. */ + g_object_set (decoder, "qos", FALSE, NULL); + g_object_set (alpha_decoder, "qos", FALSE, NULL); + alphacombine = gst_element_factory_make ("alphacombine", NULL); if (!alphacombine) { priv->missing_element = "alphacombine"; -- 2.7.4