From b55c61c93345319e98b131c7cd34e69f54cbeab9 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 30 Oct 2007 15:07:58 +0000 Subject: [PATCH] gst/playback/gstdecodebin2.c: Be a bit more useful, unblock the pads after we fired the no-more-pads signal so that w... Original commit message from CVS: * gst/playback/gstdecodebin2.c: (gst_decode_group_expose): Be a bit more useful, unblock the pads after we fired the no-more-pads signal so that we can use the signal to inspect and connect all pads without having to keep extra state outside of decodebin. --- ChangeLog | 7 +++++++ gst/playback/gstdecodebin2.c | 18 +++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e14f4406a..c3bc7876ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-10-30 Wim Taymans + + * gst/playback/gstdecodebin2.c: (gst_decode_group_expose): + Be a bit more useful, unblock the pads after we fired the no-more-pads + signal so that we can use the signal to inspect and connect all pads + without having to keep extra state outside of decodebin. + 2007-10-30 Wim Taymans * gst/playback/gsturidecodebin.c: diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index f0a481c3bd..4bdd9a9bb8 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -1941,13 +1941,24 @@ gst_decode_group_expose (GstDecodeGroup * group) gst_decode_bin_signals[SIGNAL_NEW_DECODED_PAD], 0, ghost, (next == NULL)); GST_DEBUG_OBJECT (group->dbin, "emitted new-decoded-pad"); + } + + /* signal no-more-pads. This allows the application to hook stuff to the + * exposed pads */ + GST_LOG_OBJECT (group->dbin, "signalling no-more-pads"); + gst_element_no_more_pads (GST_ELEMENT (group->dbin)); + + /* 3. Unblock internal pads. The application should have connected stuff now + * so that streaming can continue. */ + for (tmp = group->endpads; tmp; tmp = next) { + GstDecodePad *dpad = (GstDecodePad *) tmp->data; + + next = g_list_next (tmp); - /* 3. Unblock internal pad */ GST_DEBUG_OBJECT (dpad->pad, "unblocking"); gst_pad_set_blocked_async (dpad->pad, FALSE, (GstPadBlockCallback) source_pad_blocked_cb, dpad); GST_DEBUG_OBJECT (dpad->pad, "unblocked"); - } group->dbin->activegroup = group; @@ -1960,9 +1971,6 @@ gst_decode_group_expose (GstDecodeGroup * group) group->exposed = TRUE; - GST_LOG_OBJECT (group->dbin, "signalling no-more-pads"); - gst_element_no_more_pads (GST_ELEMENT (group->dbin)); - GST_LOG_OBJECT (group->dbin, "Group %p exposed", group); return TRUE; }