mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
decodebin3: fix EOS event sequence
See docs: https://gstreamer.freedesktop.org/documentation/additional/design/seqnums.html?gi-language=c#seqnums-sequence-numbers Per docs: When a sink element receives an EOS event and creates a new EOS message to post, it should copy the seqnum from the event to the message because the EOS message is a consequence of the EOS event being received. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2837>
This commit is contained in:
parent
afa0549c0c
commit
1fff4ef635
2 changed files with 8 additions and 7 deletions
|
@ -117,7 +117,7 @@ all_inputs_are_eos (GstDecodebin3 * dbin)
|
|||
|
||||
/* WITH SELECTION_LOCK TAKEN! */
|
||||
static void
|
||||
check_all_streams_for_eos (GstDecodebin3 * dbin)
|
||||
check_all_streams_for_eos (GstDecodebin3 * dbin, GstEvent * event)
|
||||
{
|
||||
GList *tmp;
|
||||
GList *outputpads = NULL;
|
||||
|
@ -144,7 +144,7 @@ check_all_streams_for_eos (GstDecodebin3 * dbin)
|
|||
GstPad *peer = (GstPad *) tmp->data;
|
||||
|
||||
/* Send EOS and then remove elements */
|
||||
gst_pad_send_event (peer, gst_event_new_eos ());
|
||||
gst_pad_send_event (peer, gst_event_ref (event));
|
||||
GST_FIXME_OBJECT (peer, "Remove input stream");
|
||||
gst_object_unref (peer);
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ parse_chain_output_probe (GstPad * pad, GstPadProbeInfo * info,
|
|||
if (all_inputs_are_eos (input->dbin)) {
|
||||
GST_DEBUG_OBJECT (pad, "real input pad, marking as EOS");
|
||||
SELECTION_LOCK (input->dbin);
|
||||
check_all_streams_for_eos (input->dbin);
|
||||
check_all_streams_for_eos (input->dbin, ev);
|
||||
SELECTION_UNLOCK (input->dbin);
|
||||
} else {
|
||||
GstPad *peer = gst_pad_get_peer (input->srcpad);
|
||||
|
@ -553,7 +553,7 @@ parsebin_pending_event_probe (GstPad * pad, GstPadProbeInfo * info,
|
|||
g_free (ppad);
|
||||
|
||||
SELECTION_LOCK (dbin);
|
||||
check_all_streams_for_eos (dbin);
|
||||
check_all_streams_for_eos (dbin, ev);
|
||||
SELECTION_UNLOCK (dbin);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -1752,7 +1752,7 @@ is_selection_done (GstDecodebin3 * dbin)
|
|||
|
||||
/* Must be called with SELECTION_LOCK taken */
|
||||
static void
|
||||
check_all_slot_for_eos (GstDecodebin3 * dbin)
|
||||
check_all_slot_for_eos (GstDecodebin3 * dbin, GstEvent * ev)
|
||||
{
|
||||
gboolean all_drained = TRUE;
|
||||
GList *iter;
|
||||
|
@ -1817,6 +1817,7 @@ check_all_slot_for_eos (GstDecodebin3 * dbin)
|
|||
}
|
||||
|
||||
eos = gst_event_new_eos ();
|
||||
gst_event_set_seqnum (eos, gst_event_get_seqnum (ev));
|
||||
gst_mini_object_set_qdata (GST_MINI_OBJECT_CAST (eos),
|
||||
CUSTOM_FINAL_EOS_QUARK, (gchar *) CUSTOM_FINAL_EOS_QUARK_DATA,
|
||||
NULL);
|
||||
|
@ -1947,7 +1948,7 @@ multiqueue_src_probe (GstPad * pad, GstPadProbeInfo * info,
|
|||
free_multiqueue_slot_async (dbin, slot);
|
||||
ret = GST_PAD_PROBE_REMOVE;
|
||||
} else if (!was_drained) {
|
||||
check_all_slot_for_eos (dbin);
|
||||
check_all_slot_for_eos (dbin, ev);
|
||||
}
|
||||
if (ret == GST_PAD_PROBE_HANDLED)
|
||||
gst_event_unref (ev);
|
||||
|
@ -1992,7 +1993,7 @@ multiqueue_src_probe (GstPad * pad, GstPadProbeInfo * info,
|
|||
* when all output streams are also eos */
|
||||
ret = GST_PAD_PROBE_DROP;
|
||||
SELECTION_LOCK (dbin);
|
||||
check_all_slot_for_eos (dbin);
|
||||
check_all_slot_for_eos (dbin, ev);
|
||||
SELECTION_UNLOCK (dbin);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue