mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-08 21:28:45 +00:00
codecalphademux: Remove eos flow return workaround
It turns out that downstream returning OK after EOS is a bug in multiqueue. As we moved to queue, we no longer have this issue. Let's keep the code clean and just assuming that downstream will keep returning EOS and allow convergence of flow. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2247>
This commit is contained in:
parent
761206291b
commit
35775f1aec
1 changed files with 6 additions and 28 deletions
|
@ -101,46 +101,24 @@ gst_codec_alpha_demux_chain (GstPad * pad, GstObject * object,
|
||||||
GstBuffer *alpha_buffer = NULL;
|
GstBuffer *alpha_buffer = NULL;
|
||||||
GstClockTime pts = GST_BUFFER_PTS (buffer);
|
GstClockTime pts = GST_BUFFER_PTS (buffer);
|
||||||
GstClockTime duration = GST_BUFFER_DURATION (buffer);
|
GstClockTime duration = GST_BUFFER_DURATION (buffer);
|
||||||
GstFlowReturn ret;
|
GstFlowReturn ret = GST_FLOW_EOS;
|
||||||
gboolean src_pad_eos, alpha_pad_eos;
|
|
||||||
|
|
||||||
if (alpha_meta)
|
if (alpha_meta)
|
||||||
alpha_buffer = gst_buffer_ref (alpha_meta->buffer);
|
alpha_buffer = gst_buffer_ref (alpha_meta->buffer);
|
||||||
|
|
||||||
/* To satisfy the alphacombine requirement, we need to push in pair here, so we
|
|
||||||
* can't just stop pushing at EOS. For this reason, remember if pad had a
|
|
||||||
* flow return of EOS and set it back if needed. */
|
|
||||||
src_pad_eos = (GST_PAD_LAST_FLOW_RETURN (self->src_pad) == GST_FLOW_EOS);
|
|
||||||
alpha_pad_eos = (GST_PAD_LAST_FLOW_RETURN (self->alpha_pad) == GST_FLOW_EOS);
|
|
||||||
|
|
||||||
if (src_pad_eos && alpha_pad_eos) {
|
|
||||||
gst_buffer_unref (alpha_buffer);
|
|
||||||
gst_buffer_unref (buffer);
|
|
||||||
return GST_FLOW_EOS;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = gst_pad_push (self->src_pad, buffer);
|
ret = gst_pad_push (self->src_pad, buffer);
|
||||||
|
ret = gst_flow_combiner_update_flow (self->flow_combiner, ret);
|
||||||
|
|
||||||
/* we lost ownership here */
|
/* we lost ownership here */
|
||||||
buffer = NULL;
|
buffer = NULL;
|
||||||
alpha_meta = NULL;
|
alpha_meta = NULL;
|
||||||
|
|
||||||
if (ret == GST_FLOW_OK && src_pad_eos)
|
if (alpha_buffer) {
|
||||||
gst_flow_combiner_update_pad_flow (self->flow_combiner, self->src_pad,
|
|
||||||
GST_FLOW_EOS);
|
|
||||||
else
|
|
||||||
gst_flow_combiner_update_flow (self->flow_combiner, ret);
|
|
||||||
|
|
||||||
if (alpha_buffer)
|
|
||||||
ret = gst_pad_push (self->alpha_pad, alpha_buffer);
|
ret = gst_pad_push (self->alpha_pad, alpha_buffer);
|
||||||
else
|
} else {
|
||||||
ret = gst_pad_push_event (self->alpha_pad,
|
ret = gst_pad_push_event (self->alpha_pad,
|
||||||
gst_event_new_gap (pts, duration));
|
gst_event_new_gap (pts, duration));
|
||||||
|
}
|
||||||
if (ret == GST_FLOW_OK && alpha_pad_eos)
|
|
||||||
ret = gst_flow_combiner_update_pad_flow (self->flow_combiner,
|
|
||||||
self->alpha_pad, GST_FLOW_EOS);
|
|
||||||
else
|
|
||||||
ret = gst_flow_combiner_update_flow (self->flow_combiner, ret);
|
ret = gst_flow_combiner_update_flow (self->flow_combiner, ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue