gst/playback/gstdecodebin2.c: Be a bit more useful, unblock the pads after we fired...
authorWim Taymans <wim.taymans@gmail.com>
Tue, 30 Oct 2007 15:07:58 +0000 (15:07 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Tue, 30 Oct 2007 15:07:58 +0000 (15:07 +0000)
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
gst/playback/gstdecodebin2.c

index 9e14f44..c3bc787 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2007-10-30  Wim Taymans  <wim.taymans@gmail.com>
 
+       * 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  <wim.taymans@gmail.com>
+
        * gst/playback/gsturidecodebin.c:
        (gst_uri_decode_bin_autoplug_continue),
        (gst_uri_decode_bin_class_init), (no_more_pads_full):
index f0a481c..4bdd9a9 100644 (file)
@@ -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;
 }