From: Nicolas Dufresne Date: Tue, 25 Oct 2022 12:14:18 +0000 (-0400) Subject: alphacombine: Add missing query handler for gaps X-Git-Tag: 1.22.0~688 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a8fe360a2f936f31a60c8ce973f9866805f5e5e;p=platform%2Fupstream%2Fgstreamer.git alphacombine: Add missing query handler for gaps The gap handling was in place, but there was no event handler to trigger it. Implement the alpha sink event handler for the gaps. This fixes handling of valid streams which may not refresh the alpha frames for every video frames. It will also allow a clean error if the stream was missing the initial alpha frame, at least until we find a better way to handle these invalid frames. Related to #1518 Part-of: --- diff --git a/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.c b/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.c index d9149f7..2f47191 100644 --- a/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.c +++ b/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.c @@ -469,6 +469,14 @@ gst_alpha_combine_set_alpha_format (GstAlphaCombine * self, GstCaps * caps) return TRUE; } +static void +gst_alpha_combine_handle_gap (GstAlphaCombine * self) +{ + GstBuffer *gap_buffer = gst_buffer_new (); + GST_BUFFER_FLAG_SET (gap_buffer, GST_BUFFER_FLAG_GAP); + gst_alpha_combine_push_alpha_buffer (self, gap_buffer); +} + static gboolean gst_alpha_combine_sink_event (GstPad * pad, GstObject * object, GstEvent * event) @@ -519,6 +527,12 @@ gst_alpha_combine_alpha_event (GstPad * pad, GstObject * object, GstCaps *caps; gst_event_parse_caps (event, &caps); gst_alpha_combine_set_alpha_format (self, caps); + break; + } + case GST_EVENT_GAP: + { + gst_alpha_combine_handle_gap (self); + break; } default: break;