[farsight2/master] Add a list of the new recv codecs to the bus message

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:22:10 PST 2008


---
 gst-libs/gst/farsight/fs-stream.c   |    7 +++++--
 gst/fsrtpconference/fs-rtp-stream.c |   18 +++++++++++++-----
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/gst-libs/gst/farsight/fs-stream.c b/gst-libs/gst/farsight/fs-stream.c
index 381e3f3..3b23124 100644
--- a/gst-libs/gst/farsight/fs-stream.c
+++ b/gst-libs/gst/farsight/fs-stream.c
@@ -71,6 +71,7 @@
  * <refsect2><title>The "<literal>farsight-current-recv-codecs-changed</literal>" message</title>
  * |[
  * "stream"           #FsStream          The stream that emits the message
+ * "codecs"           #FsCodecGList      A #GList of #FsCodec
  * ]|
  * <para>
  * This message is emitted when the content of the
@@ -78,6 +79,7 @@
  * right after the #FsStream::src-pad-added signal only if that codec was not
  * previously received in this stream, but it can also be emitted if the pad
  * already exists, but the source material that will come to it is different.
+ * The list of new recv-codecs is included in the message
  * </para>
  * </refsect2>
  * <para>
@@ -195,8 +197,9 @@ fs_stream_class_init (FsStreamClass *klass)
    *
    * This is the list of codecs that have been received by this stream.
    * The user must free the list if fs_codec_list_destroy().
-   * The #GObject::notify signal is emitted when the value of this property may
-   * have changed. It is normally emitted right after #FsStream::src-pad-added
+   * The "farsight-current-recv-codecs-changed" message is send on the #GstBus
+   * when the value of this property changes.
+   * It is normally emitted right after #FsStream::src-pad-added
    * only if that codec was not previously received in this stream, but it can
    * also be emitted if the pad already exists, but the source material that
    * will come to it is different.
diff --git a/gst/fsrtpconference/fs-rtp-stream.c b/gst/fsrtpconference/fs-rtp-stream.c
index 302b214..78d482c 100644
--- a/gst/fsrtpconference/fs-rtp-stream.c
+++ b/gst/fsrtpconference/fs-rtp-stream.c
@@ -790,6 +790,7 @@ _substream_codec_changed (FsRtpSubStream *substream,
 {
   GList *substream_item = NULL;
   FsCodec *codec = NULL;
+  GList *codeclist = NULL;
 
   g_object_get (substream, "codec", &codec, NULL);
 
@@ -810,13 +811,17 @@ _substream_codec_changed (FsRtpSubStream *substream,
 
       g_object_get (othersubstream, "codec", &othercodec, NULL);
 
-      if (othercodec && ! fs_codec_are_equal (codec, othercodec))
+      if (othercodec)
       {
-        fs_codec_destroy (othercodec);
-        break;
-      }
+        if (!fs_codec_are_equal (codec, othercodec))
+          break;
+
+        if (!_codec_list_has_codec (codeclist, othercodec))
+          codeclist = g_list_append (codeclist, othercodec);
+        else
+          fs_codec_destroy (othercodec);
 
-      fs_codec_destroy (othercodec);
+      }
     }
   }
 
@@ -834,11 +839,14 @@ _substream_codec_changed (FsRtpSubStream *substream,
         gst_message_new_element (GST_OBJECT (conf),
             gst_structure_new ("farsight-current-recv-codecs-changed",
                 "stream", FS_TYPE_STREAM, stream,
+                "codecs", FS_TYPE_CODEC_LIST, codeclist,
                 NULL)));
 
     gst_object_unref (conf);
   }
 
+  fs_codec_list_destroy (codeclist);
+
   fs_codec_destroy (codec);
 }
 
-- 
1.5.6.5




More information about the farsight-commits mailing list