added an eos handler so that gstreamer-launch quits when the first element fires it
authorThomas Vander Stichele <thomas@apestaart.org>
Mon, 4 Jun 2001 15:38:44 +0000 (15:38 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Mon, 4 Jun 2001 15:38:44 +0000 (15:38 +0000)
Original commit message from CVS:
added an eos handler so that gstreamer-launch quits when the first element
fires it

gst/gstparse.c

index 3bddee4..5574878 100644 (file)
@@ -67,6 +67,12 @@ typedef struct {
   GstPad *target;
 } dyn_connect;
 
+static void have_eos (void)
+{
+  DEBUG ("I have eos on the first element\n");
+  exit (0);
+}
+
 static void
 dynamic_connect (GstElement *element, GstPad *newpad, gpointer data)
 {
@@ -284,6 +290,13 @@ if (GST_IS_GHOST_PAD(srcpad)) GST_DEBUG(0,"it's a ghost pad\n");
       }
       
 
+      // thomas: if we're the first element, connect eos signal
+      if (elementcount == 1) 
+      {
+        gtk_signal_connect (GTK_OBJECT (element), "eos",
+                      GTK_SIGNAL_FUNC (have_eos), NULL);
+
+      }
       // if we're the first element, ghost all the sinkpads
       if (elementcount == 1) {
         DEBUG("first element, ghosting all of %s's sink pads to parent %s\n",
@@ -451,3 +464,4 @@ gst_parse_launch(const gchar *cmdline,GstBin *parent)
 
   return i;
 }
+