gst/switch/gstswitch.*: Add `block' and `switch' signals.
authorAndy Wingo <wingo@pobox.com>
Mon, 17 Dec 2007 14:46:26 +0000 (14:46 +0000)
committerAndy Wingo <wingo@pobox.com>
Mon, 17 Dec 2007 14:46:26 +0000 (14:46 +0000)
Original commit message from CVS:
2007-12-17  Andy Wingo  <wingo@pobox.com>

* gst/switch/gstswitch.h (struct _GstStreamSelectorClass):
* gst/switch/gstswitch.c (gst_stream_selector_class_init): Add
`block' and `switch' signals.

* gst/switch/Makefile.am:
* gst/switch/gstswitch-marshal.list: Add foo to generate a
marshaller for the `switch' signal. Patch 2/12.

ChangeLog
gst/switch/Makefile.am
gst/switch/gstswitch-marshal.list [new file with mode: 0644]
gst/switch/gstswitch.c
gst/switch/gstswitch.h

index 7d1065a4bd2320d7f2a500150ec6fabd4569e4bf..7de180e53d155c2845c664f349ca6ba811fef113 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2007-12-17  Andy Wingo  <wingo@pobox.com>
 
+       * gst/switch/gstswitch.h (struct _GstStreamSelectorClass): 
+       * gst/switch/gstswitch.c (gst_stream_selector_class_init): Add
+       `block' and `switch' signals.
+
+       * gst/switch/Makefile.am: 
+       * gst/switch/gstswitch-marshal.list: Add foo to generate a
+       marshaller for the `switch' signal. Patch 2/12.
+
        * gst/switch/gstswitch.h: 
        * gst/switch/gstswitch.c: Replace with files from
        gststreamselector.[ch], registered as the "switch" plugin, with
index b5a550380bfaff1589b1cd8e3d9bd9e257779750..b829095d5c7a085dfbd8147a533294071c76674f 100644 (file)
@@ -1,9 +1,22 @@
+glib_enum_prefix = gst_switch
+
+include $(top_srcdir)/common/glib-gen.mak
+
+built_sources = gstswitch-marshal.c
+built_headers = gstswitch-marshal.h
+
+BUILT_SOURCES = $(built_sources) $(built_headers)
+
+CLEANFILES = $(BUILT_SOURCES)
+
+EXTRA_DIST = gstswitch-marshal.list
 
 plugin_LTLIBRARIES = libgstswitch.la
 
 libgstswitch_la_SOURCES = gstswitch.c
+nodist_libgstswitch_la_SOURCES = $(built_sources)
 libgstswitch_la_CFLAGS = $(GST_CFLAGS)
 libgstswitch_la_LIBADD =
 libgstswitch_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS)
 
-noinst_HEADERS = gstswitch.h
+noinst_HEADERS = gstswitch.h $(built_headers)
diff --git a/gst/switch/gstswitch-marshal.list b/gst/switch/gstswitch-marshal.list
new file mode 100644 (file)
index 0000000..57ed247
--- /dev/null
@@ -0,0 +1 @@
+VOID:STRING,UINT64,UINT64
index c1f48bde399772756d14697877d3f12829740b9c..c1f4b53b10016ef1c69ef0c62aa07b0811ef2f88 100644 (file)
@@ -27,6 +27,7 @@
 #include <string.h>
 
 #include "gstswitch.h"
+#include "gstswitch-marshal.h"
 
 GST_DEBUG_CATEGORY_STATIC (stream_selector_debug);
 #define GST_CAT_DEFAULT stream_selector_debug
@@ -57,6 +58,15 @@ enum
   PROP_ACTIVE_PAD = 1
 };
 
+enum
+{
+  /* methods */
+  SIGNAL_BLOCK,
+  SIGNAL_SWITCH,
+  LAST_SIGNAL
+};
+static guint gst_stream_selector_signals[LAST_SIGNAL] = { 0 };
+
 static gboolean gst_stream_selector_is_active_sinkpad (GstStreamSelector * sel,
     GstPad * pad);
 static GstPad *gst_stream_selector_activate_sinkpad (GstStreamSelector * sel,
@@ -429,6 +439,34 @@ gst_stream_selector_class_init (GstStreamSelectorClass * klass)
   gobject_class->dispose = gst_stream_selector_dispose;
   gstelement_class->request_new_pad = gst_stream_selector_request_new_pad;
   gstelement_class->release_pad = gst_stream_selector_release_pad;
+
+  /**
+   * GstStreamSelector::block:
+   * @streamselector: the streamselector element to emit this signal on
+   *
+   * Block all sink pads in preparation for a switch.
+   */
+  gst_stream_selector_signals[SIGNAL_BLOCK] =
+      g_signal_new ("block", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
+      G_STRUCT_OFFSET (GstStreamSelectorClass, block),
+      NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+  /**
+   * GstStreamSelector::switch:
+   * @streamselector: the streamselector element to emit this signal on
+   * @pad:            name of pad to switch to
+   * @stop_time:      time at which to close the previous segment, or
+   *                  #GST_CLOCK_TIME_NONE for the last time on the previously
+   *                  active pad
+   * @start_time:     start time for new segment, or foo
+   *
+   * Switch the given open file descriptor to multifdsink to write to and
+   * specify the burst parameters for the new connection.
+   */
+  gst_stream_selector_signals[SIGNAL_SWITCH] =
+      g_signal_new ("switch", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
+      G_STRUCT_OFFSET (GstStreamSelectorClass, switch_),
+      NULL, NULL, gst_switch_marshal_VOID__STRING_UINT64_UINT64,
+      G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_UINT64, G_TYPE_UINT64);
 }
 
 static void
index a7c4b22fc1c7ca22d1957d5075f31d0f29e3fe38..3d88ca2bacd1873deb2e164d3c2babf28769ff1b 100644 (file)
@@ -52,6 +52,10 @@ struct _GstStreamSelector {
 
 struct _GstStreamSelectorClass {
   GstElementClass parent_class;
+
+  void (*block)                (void);
+  void (*switch_)      (const gchar *pad_name, GstClockTime stop_time,
+                         GstClockTime start_time);
 };
 
 GType gst_stream_selector_get_type (void);