From 9546949ebffea74377a115e7ed00296c33422e94 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Fri, 7 Jun 2002 19:34:52 +0000 Subject: [PATCH] added a "iterate_started" signal which fires before the iterate of a bin. useful for non-threadsafe operations like s... Original commit message from CVS: added a "iterate_started" signal which fires before the iterate of a bin. useful for non-threadsafe operations like seek in threaded pipelines --- gst/gstbin.c | 7 +++++++ gst/gstbin.h | 1 + 2 files changed, 8 insertions(+) diff --git a/gst/gstbin.c b/gst/gstbin.c index 4fab79305f..c7b6d9eda3 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -59,6 +59,7 @@ static void gst_bin_restore_thyself (GstObject * object, xmlNodePtr self); enum { OBJECT_ADDED, + ITERATE_STARTED, LAST_SIGNAL }; @@ -113,6 +114,10 @@ gst_bin_class_init (GstBinClass * klass) g_signal_new ("object_added", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GstBinClass, object_added), NULL, NULL, gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); + gst_bin_signals[ITERATE_STARTED] = + g_signal_new ("iterate_started", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GstBinClass, iterate_started), NULL, NULL, + gst_marshal_VOID__VOID, G_TYPE_NONE, 0); gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_bin_dispose); @@ -845,6 +850,8 @@ gst_bin_iterate (GstBin * bin) oclass = GST_BIN_CLASS (G_OBJECT_GET_CLASS (bin)); + g_signal_emit (G_OBJECT (bin), gst_bin_signals[ITERATE_STARTED], 0); + if (oclass->iterate) running = (oclass->iterate) (bin); diff --git a/gst/gstbin.h b/gst/gstbin.h index 9a61e4763d..ec397bd637 100644 --- a/gst/gstbin.h +++ b/gst/gstbin.h @@ -88,6 +88,7 @@ struct _GstBinClass { /* signals */ void (*object_added) (GstObject *object, GstObject *child); void (*object_removed) (GstObject *object, GstObject *child); + void (*iterate_started) (GstObject *object); /* change the state of elements of the given type */ gboolean (*change_state_type) (GstBin *bin,