[farsight2/master] Add a way to tell if the source should be before of after other sources, to be able to differentiate between sournd and event dtmf

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


---
 gst/fsrtpconference/fs-rtp-dtmf-event-source.c |    1 +
 gst/fsrtpconference/fs-rtp-special-source.c    |   23 ++++++++++++++++++-----
 gst/fsrtpconference/fs-rtp-special-source.h    |    1 +
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-dtmf-event-source.c b/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
index 2ce404e..3e6f6fa 100644
--- a/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
+++ b/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
@@ -507,6 +507,7 @@ fs_rtp_dtmf_event_source_new (FsRtpSpecialSourceClass *klass,
     FsCodec *selected_codec,
     GstElement *bin,
     GstElement *rtpmuxer,
+    gboolean *last,
     GError **error)
 {
   FsRtpDtmfEventSource *self = NULL;
diff --git a/gst/fsrtpconference/fs-rtp-special-source.c b/gst/fsrtpconference/fs-rtp-special-source.c
index a2eee95..730d1f6 100644
--- a/gst/fsrtpconference/fs-rtp-special-source.c
+++ b/gst/fsrtpconference/fs-rtp-special-source.c
@@ -66,6 +66,7 @@ fs_rtp_special_source_new (FsRtpSpecialSourceClass *klass,
     FsCodec *selected_codec,
     GstElement *bin,
     GstElement *rtpmuxer,
+    gboolean *last,
     GError **error);
 static gboolean
 fs_rtp_special_source_update (FsRtpSpecialSource *source,
@@ -195,13 +196,19 @@ fs_rtp_special_sources_update (
       {
         if (!fs_rtp_special_source_update (obj, negotiated_codecs, send_codec))
         {
+          gboolean last;
+
           current_extra_sources = g_list_remove (current_extra_sources, obj);
           g_object_unref (obj);
           obj = fs_rtp_special_source_new (klass, negotiated_codecs, send_codec,
-              bin, rtpmuxer, error);
+              bin, rtpmuxer, &last, error);
           if (!obj)
             goto error;
-          current_extra_sources = g_list_prepend (current_extra_sources, obj);
+
+          if (last)
+            current_extra_sources = g_list_append (current_extra_sources, obj);
+          else
+            current_extra_sources = g_list_prepend (current_extra_sources, obj);
         }
       }
       else
@@ -215,11 +222,16 @@ fs_rtp_special_sources_update (
       if (fs_rtp_special_source_class_want_source (klass, negotiated_codecs,
               send_codec))
       {
+        gboolean last;
+
         obj = fs_rtp_special_source_new (klass, negotiated_codecs, send_codec,
-            bin, rtpmuxer, error);
+            bin, rtpmuxer, &last, error);
         if (!obj)
           goto error;
-        current_extra_sources = g_list_prepend (current_extra_sources, obj);
+        if (last)
+          current_extra_sources = g_list_append (current_extra_sources, obj);
+        else
+          current_extra_sources = g_list_prepend (current_extra_sources, obj);
       }
     }
   }
@@ -236,11 +248,12 @@ fs_rtp_special_source_new (FsRtpSpecialSourceClass *klass,
     FsCodec *selected_codec,
     GstElement *bin,
     GstElement *rtpmuxer,
+    gboolean *last,
     GError **error)
 {
   if (klass->new)
     return klass->new (klass, negotiated_sources, selected_codec, bin, rtpmuxer,
-        error);
+        last, error);
 
   g_set_error (error, FS_ERROR, FS_ERROR_NOT_IMPLEMENTED,
       "new not defined for %s", G_OBJECT_CLASS_NAME (klass));
diff --git a/gst/fsrtpconference/fs-rtp-special-source.h b/gst/fsrtpconference/fs-rtp-special-source.h
index 3dcbdd6..27d9f45 100644
--- a/gst/fsrtpconference/fs-rtp-special-source.h
+++ b/gst/fsrtpconference/fs-rtp-special-source.h
@@ -84,6 +84,7 @@ struct _FsRtpSpecialSourceClass
       FsCodec *selected_codec,
       GstElement *bin,
       GstElement *rtpmuxer,
+      gboolean *last,
       GError **error);
 };
 
-- 
1.5.6.5




More information about the farsight-commits mailing list