[farsight2/master] Add fs_stream_add_id api

Olivier Crête olivier.crete at collabora.co.uk
Wed May 20 16:07:13 PDT 2009


---
 docs/libs/farsight2-libs-sections.txt |    1 +
 gst-libs/gst/farsight/fs-stream.c     |   28 ++++++++++++++++++++++++++++
 gst-libs/gst/farsight/fs-stream.h     |    7 ++++++-
 3 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/docs/libs/farsight2-libs-sections.txt b/docs/libs/farsight2-libs-sections.txt
index e798f36..fecf3a4 100644
--- a/docs/libs/farsight2-libs-sections.txt
+++ b/docs/libs/farsight2-libs-sections.txt
@@ -29,6 +29,7 @@ FsStreamState
 fs_stream_set_remote_candidates
 fs_stream_set_remote_codecs
 fs_stream_force_remote_candidates
+fs_stream_add_id
 fs_stream_emit_error
 fs_stream_emit_src_pad_added
 <SUBSECTION Standard>
diff --git a/gst-libs/gst/farsight/fs-stream.c b/gst-libs/gst/farsight/fs-stream.c
index 0b82a79..4cb37f2 100644
--- a/gst-libs/gst/farsight/fs-stream.c
+++ b/gst-libs/gst/farsight/fs-stream.c
@@ -475,6 +475,34 @@ fs_stream_set_remote_codecs (FsStream *stream,
   return FALSE;
 }
 
+/**
+ * fs_stream_add_id:
+ * @stream: a #FsStream
+ * @id: The id to add to the stream
+ *
+ * This function is used to add data identifiers that allow the
+ * plugin to recognize packets that are meant for id. For example, in RTP,
+ * one would set the SSRCs that are expected.
+ *
+ * Depending on the protocol, one may be able to add more than one ID
+ * to a stream (in RTP you can have multiple SSRCs in a stream).
+ * If a protocol supports only one id, adding a new one will overwrite it.
+ * If an ID was already set on a stream, adding it to another stream will
+ * override the previdous decision.
+ *
+ * For most protocols, calling this function is optional as the incoming data
+ * can be matched with a stream by its source IP address. This is mostly useful
+ * if one is using multicast or is behind a muxer server.
+ */
+void
+fs_stream_add_id (FsStream *stream,
+                  guint id)
+{
+  FsStreamClass *klass = FS_STREAM_GET_CLASS (stream);
+
+  if (klass->add_id)
+    klass->add_id (stream, id);
+}
 
 /**
  * fs_stream_emit_error:
diff --git a/gst-libs/gst/farsight/fs-stream.h b/gst-libs/gst/farsight/fs-stream.h
index dab2304..1e32e15 100644
--- a/gst-libs/gst/farsight/fs-stream.h
+++ b/gst-libs/gst/farsight/fs-stream.h
@@ -123,8 +123,11 @@ struct _FsStreamClass
   gboolean (*set_remote_codecs) (FsStream *stream,
                                  GList *remote_codecs, GError **error);
 
+  void (*add_id) (FsStream *stream,
+                  guint id);
+
   /*< private >*/
-  gpointer _padding[8];
+  gpointer _padding[7];
 };
 
 /**
@@ -156,6 +159,8 @@ gboolean fs_stream_force_remote_candidates (FsStream *stream,
 gboolean fs_stream_set_remote_codecs (FsStream *stream,
                                       GList *remote_codecs, GError **error);
 
+void fs_stream_add_id (FsStream *stream, guint id);
+
 void fs_stream_emit_error (FsStream *stream,
     gint error_no,
     const gchar *error_msg,
-- 
1.5.6.5




More information about the farsight-commits mailing list