[farsight2/master] Also pass the selected codec with the negotiated codecs everywhere

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


---
 gst/fsrtpconference/fs-rtp-dtmf-event-source.c |   13 ++++++--
 gst/fsrtpconference/fs-rtp-special-source.c    |   36 ++++++++++++++---------
 gst/fsrtpconference/fs-rtp-special-source.h    |    8 ++++-
 3 files changed, 37 insertions(+), 20 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-dtmf-event-source.c b/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
index 239f7f8..88544ff 100644
--- a/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
+++ b/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
@@ -60,12 +60,14 @@ static void fs_rtp_dtmf_event_source_dispose (GObject *object);
 static FsRtpSpecialSource *fs_rtp_dtmf_event_source_new (
     FsRtpSpecialSourceClass *klass,
     GList *negotiated_sources,
+    FsCodec *selected_codec,
     GstElement *bin,
     GstElement *rtpmuxer,
     GError **error);
 static gboolean fs_rtp_dtmf_event_source_class_want_source (
     FsRtpSpecialSourceClass *klass,
-    GList *negotiated_sources);
+    GList *negotiated_codecs,
+    FsCodec *selected_codec);
 static GList *fs_rtp_dtmf_event_source_class_add_blueprint (
     FsRtpSpecialSourceClass *klass,
     GList *blueprints);
@@ -115,15 +117,16 @@ fs_rtp_dtmf_event_source_class_add_blueprint (FsRtpSpecialSourceClass *klass,
 
 static gboolean
 fs_rtp_dtmf_event_source_class_want_source (FsRtpSpecialSourceClass *klass,
-    GList *negotiated_sources)
+    GList *negotiated_codecs,
+    FsCodec *selected_codec)
 {
   return FALSE;
 }
 
-
 static gboolean
 fs_rtp_dtmf_event_source_build (FsRtpDtmfEventSource *source,
     GList *negotiated_sources,
+    FsCodec *selected_codec,
     GError **error)
 {
   return FALSE;
@@ -132,6 +135,7 @@ fs_rtp_dtmf_event_source_build (FsRtpDtmfEventSource *source,
 static FsRtpSpecialSource *
 fs_rtp_dtmf_event_source_new (FsRtpSpecialSourceClass *klass,
     GList *negotiated_sources,
+    FsCodec *selected_codec,
     GstElement *bin,
     GstElement *rtpmuxer,
     GError **error)
@@ -144,7 +148,8 @@ fs_rtp_dtmf_event_source_new (FsRtpSpecialSourceClass *klass,
       NULL);
   g_assert (source);
 
-  if (!fs_rtp_dtmf_event_source_build (source, negotiated_sources, error))
+  if (!fs_rtp_dtmf_event_source_build (source, negotiated_sources,
+          selected_codec, error))
   {
     g_object_unref (source);
     return NULL;
diff --git a/gst/fsrtpconference/fs-rtp-special-source.c b/gst/fsrtpconference/fs-rtp-special-source.c
index 3a4e7ed..e1d1e85 100644
--- a/gst/fsrtpconference/fs-rtp-special-source.c
+++ b/gst/fsrtpconference/fs-rtp-special-source.c
@@ -62,13 +62,15 @@ static void fs_rtp_special_source_dispose (GObject *object);
 
 static FsRtpSpecialSource *
 fs_rtp_special_source_new (FsRtpSpecialSourceClass *klass,
-    GList *negotiated_sources,
+    GList *negotiated_codecs,
+    FsCodec *selected_codec,
     GstElement *bin,
     GstElement *rtpmuxer,
     GError **error);
 static gboolean
 fs_rtp_special_source_update (FsRtpSpecialSource *source,
-    GList *negotiated_sources);
+    GList *negotiated_codecs,
+    FsCodec *selected_codec);
 
 static void
 fs_rtp_special_source_class_init (FsRtpSpecialSourceClass *klass)
@@ -119,10 +121,11 @@ fs_rtp_special_source_class_add_blueprint (FsRtpSpecialSourceClass *klass,
 
 static gboolean
 fs_rtp_special_source_class_want_source (FsRtpSpecialSourceClass *klass,
-    GList *negotiated_sources)
+    GList *negotiated_codecs,
+    FsCodec *selected_codec)
 {
   if (klass->want_source)
-    return klass->want_source (klass, negotiated_sources);
+    return klass->want_source (klass, negotiated_codecs, selected_codec);
 
   return FALSE;
 }
@@ -160,6 +163,7 @@ GList *
 fs_rtp_special_sources_update (
     GList *current_extra_sources,
     GList *negotiated_codecs,
+    FsCodec *send_codec,
     GstElement *bin,
     GstElement *rtpmuxer,
     GError **error)
@@ -186,14 +190,15 @@ fs_rtp_special_sources_update (
 
     if (obj_item)
     {
-      if (fs_rtp_special_source_class_want_source (klass, negotiated_codecs))
+      if (fs_rtp_special_source_class_want_source (klass, negotiated_codecs,
+              send_codec))
       {
-        if (!fs_rtp_special_source_update (obj, negotiated_codecs))
+        if (!fs_rtp_special_source_update (obj, negotiated_codecs, send_codec))
         {
           current_extra_sources = g_list_remove (current_extra_sources, obj);
           g_object_unref (obj);
-          obj = fs_rtp_special_source_new (klass, negotiated_codecs, bin,
-              rtpmuxer, error);
+          obj = fs_rtp_special_source_new (klass, negotiated_codecs, send_codec,
+              bin, rtpmuxer, error);
           if (!obj)
             goto error;
           current_extra_sources = g_list_prepend (current_extra_sources, obj);
@@ -207,10 +212,11 @@ fs_rtp_special_sources_update (
     }
     else
     {
-      if (fs_rtp_special_source_class_want_source (klass, negotiated_codecs))
+      if (fs_rtp_special_source_class_want_source (klass, negotiated_codecs,
+              send_codec))
       {
-        obj = fs_rtp_special_source_new (klass, negotiated_codecs, bin,
-            rtpmuxer, error);
+        obj = fs_rtp_special_source_new (klass, negotiated_codecs, send_codec,
+            bin, rtpmuxer, error);
         if (!obj)
           goto error;
         current_extra_sources = g_list_prepend (current_extra_sources, obj);
@@ -227,12 +233,14 @@ fs_rtp_special_sources_update (
 static FsRtpSpecialSource *
 fs_rtp_special_source_new (FsRtpSpecialSourceClass *klass,
     GList *negotiated_sources,
+    FsCodec *selected_codec,
     GstElement *bin,
     GstElement *rtpmuxer,
     GError **error)
 {
   if (klass->new)
-    return klass->new (klass, negotiated_sources, bin, rtpmuxer, error);
+    return klass->new (klass, negotiated_sources, selected_codec, bin, rtpmuxer,
+        error);
 
   g_set_error (error, FS_ERROR, FS_ERROR_NOT_IMPLEMENTED,
       "new not defined for %s", G_OBJECT_CLASS_NAME (klass));
@@ -242,12 +250,12 @@ fs_rtp_special_source_new (FsRtpSpecialSourceClass *klass,
 
 static gboolean
 fs_rtp_special_source_update (FsRtpSpecialSource *source,
-    GList *negotiated_sources)
+    GList *negotiated_sources, FsCodec *selected_codec)
 {
   FsRtpSpecialSourceClass *klass = FS_RTP_SPECIAL_SOURCE_GET_CLASS (source);
 
   if (klass->update)
-    return klass->update (source, negotiated_sources);
+    return klass->update (source, negotiated_sources, selected_codec);
 
   return FALSE;
 }
diff --git a/gst/fsrtpconference/fs-rtp-special-source.h b/gst/fsrtpconference/fs-rtp-special-source.h
index 07d058d..3814c31 100644
--- a/gst/fsrtpconference/fs-rtp-special-source.h
+++ b/gst/fsrtpconference/fs-rtp-special-source.h
@@ -59,17 +59,20 @@ struct _FsRtpSpecialSourceClass
   /* Object methods */
 
   gboolean (*update) (FsRtpSpecialSource *source,
-      GList *negotiated_codecs);
+      GList *negotiated_codecs,
+      FsCodec *selected_codec);
 
   /* Class methods */
   gboolean (*want_source) (FsRtpSpecialSourceClass *klass,
-      GList *negotiated_codecs);
+      GList *negotiated_codecs,
+      FsCodec *selected_codec);
 
   GList* (*add_blueprint) (FsRtpSpecialSourceClass *klass,
       GList *blueprints);
 
   FsRtpSpecialSource* (*new) (FsRtpSpecialSourceClass *klass,
       GList *negotiated_sources,
+      FsCodec *selected_codec,
       GstElement *bin,
       GstElement *rtpmuxer,
       GError **error);
@@ -91,6 +94,7 @@ GList *
 fs_rtp_special_sources_update (
     GList *current_extra_sources,
     GList *negotiated_codecs,
+    FsCodec *send_codec,
     GstElement *bin,
     GstElement *rtpmuxer,
     GError **error);
-- 
1.5.6.5




More information about the farsight-commits mailing list