[farsight2/master] add get-recvonly-filter signal

Olivier Crête olivier.crete at collabora.co.uk
Thu Feb 5 06:32:04 PST 2009


---
 docs/libs/farsight2-libs-sections.txt  |    1 +
 gst-libs/gst/farsight/fs-transmitter.c |   49 ++++++++++++++++++++++++++++++++
 gst-libs/gst/farsight/fs-transmitter.h |    6 ++-
 3 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/docs/libs/farsight2-libs-sections.txt b/docs/libs/farsight2-libs-sections.txt
index 7d0e270..e798f36 100644
--- a/docs/libs/farsight2-libs-sections.txt
+++ b/docs/libs/farsight2-libs-sections.txt
@@ -169,6 +169,7 @@ fs_transmitter_new
 fs_transmitter_new_stream_transmitter
 fs_transmitter_get_stream_transmitter_type
 fs_transmitter_emit_error
+fs_transmitter_get_recvonly_filter
 fs_transmitter_list_available
 <SUBSECTION Standard>
 FS_IS_TRANSMITTER
diff --git a/gst-libs/gst/farsight/fs-transmitter.c b/gst-libs/gst/farsight/fs-transmitter.c
index 769f0fd..e4ca2fd 100644
--- a/gst-libs/gst/farsight/fs-transmitter.c
+++ b/gst-libs/gst/farsight/fs-transmitter.c
@@ -52,6 +52,7 @@
 enum
 {
   ERROR_SIGNAL,
+  GET_RECVONLY_FILTER_SIGNAL,
   LAST_SIGNAL
 };
 
@@ -174,6 +175,30 @@ fs_transmitter_class_init (FsTransmitterClass *klass)
       _fs_marshal_VOID__ENUM_STRING_STRING,
       G_TYPE_NONE, 3, FS_TYPE_ERROR, G_TYPE_STRING, G_TYPE_STRING);
 
+  /**
+   * FsTransmitter::get-recvonly-filter
+   * @self: #FsTransmitter that emitted the signal
+   * @component: The component that the filter will be used for
+   *
+   * This signal is emitted when the transmitter wants to get a filter for
+   * to use if sending is disabled. If you want to drop all buffers, just
+   * don't listen to the signal.
+   *
+   * This element should have a "sending" property that can be changed with the
+   * sending state of the stream. It should default to %TRUE.
+   *
+   * Returns: the #GstElement to use as the filter, or %NULL to drop everything
+   */
+
+  signals[GET_RECVONLY_FILTER_SIGNAL] = g_signal_new ("get-recvonly-filter",
+      G_TYPE_FROM_CLASS (klass),
+      G_SIGNAL_RUN_LAST,
+      0,
+      NULL,
+      NULL,
+      _fs_marshal_OBJECT__UINT,
+      GST_TYPE_ELEMENT, 1, G_TYPE_UINT);
+
 
   gobject_class->dispose = fs_transmitter_dispose;
   gobject_class->finalize = fs_transmitter_finalize;
@@ -364,3 +389,27 @@ fs_transmitter_list_available (void)
 {
   return fs_plugin_list_available ("transmitter");
 }
+
+/**
+ * fs_transmitter_get_recvonly_filter:
+ * @transmitter: A #FsTransmitter object
+ * @component: The component to get the filter for
+ *
+ * Get the filter to add on the send pipeline if sending is disabled.
+ *
+ * Only for use by subclasses.
+ *
+ * Returns: a #GstElement to use as the filter or %NULL
+ */
+
+GstElement *
+fs_transmitter_get_recvonly_filter (FsTransmitter *transmitter,
+    guint component)
+{
+  GstElement *element = NULL;
+
+  g_signal_emit (transmitter, signals[GET_RECVONLY_FILTER_SIGNAL], 0, component,
+      &element);
+
+  return element;
+}
diff --git a/gst-libs/gst/farsight/fs-transmitter.h b/gst-libs/gst/farsight/fs-transmitter.h
index b7d3e1e..7ba8058 100644
--- a/gst-libs/gst/farsight/fs-transmitter.h
+++ b/gst-libs/gst/farsight/fs-transmitter.h
@@ -25,8 +25,7 @@
 #ifndef __FS_TRANSMITTER_H__
 #define __FS_TRANSMITTER_H__
 
-#include <glib.h>
-#include <glib-object.h>
+#include <gst/gst.h>
 
 #include <gst/farsight/fs-participant.h>
 #include <gst/farsight/fs-stream-transmitter.h>
@@ -116,6 +115,9 @@ void fs_transmitter_emit_error (FsTransmitter *transmitter,
 
 char **fs_transmitter_list_available (void);
 
+GstElement *
+fs_transmitter_get_recvonly_filter (FsTransmitter *transmitter,
+    guint component);
 
 G_END_DECLS
 
-- 
1.5.6.5




More information about the farsight-commits mailing list