added an eos handler so that gstreamer-launch quits when the first element fires it

Original commit message from CVS:
added an eos handler so that gstreamer-launch quits when the first element
fires it
This commit is contained in:
Thomas Vander Stichele 2001-06-04 15:38:44 +00:00
parent d008889f00
commit 7f41ebff13

View 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;
}