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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3279>
This commit is contained in:
Nicolas Dufresne 2022-10-25 08:14:18 -04:00 committed by Tim-Philipp Müller
parent 049737966d
commit ea1dc750ae

View file

@ -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;