[farsight2/master] Add version of the codec_assoc custom lookup function that doesnt not ignore disabled codecs

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


---
 gst/fsrtpconference/fs-rtp-codec-negotiation.c |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-codec-negotiation.c b/gst/fsrtpconference/fs-rtp-codec-negotiation.c
index 01235ad..63e27ea 100644
--- a/gst/fsrtpconference/fs-rtp-codec-negotiation.c
+++ b/gst/fsrtpconference/fs-rtp-codec-negotiation.c
@@ -41,6 +41,10 @@ lookup_codec_association_by_pt_list (GList *codec_associations, gint pt,
 static CodecAssociation *
 codec_association_copy (CodecAssociation *ca);
 
+static CodecAssociation *
+lookup_codec_association_custom_intern (GList *codec_associations,
+    gboolean want_disabled, CAFindFunc func, gpointer user_data);
+
 /**
  * validate_codecs_configuration:
  * @media_type: The #FsMediaType these codecs should be for
@@ -695,9 +699,9 @@ codec_association_is_valid_for_sending (CodecAssociation *ca)
 }
 
 
-CodecAssociation *
-lookup_codec_association_custom (GList *codec_associations,
-    CAFindFunc func, gpointer user_data)
+static CodecAssociation *
+lookup_codec_association_custom_intern (GList *codec_associations,
+    gboolean want_disabled, CAFindFunc func, gpointer user_data)
 {
   GList *item;
 
@@ -708,7 +712,7 @@ lookup_codec_association_custom (GList *codec_associations,
        item = g_list_next (item))
   {
     CodecAssociation *ca = item->data;
-    if (ca->disable || ca->reserved)
+    if ((ca->disable && !want_disabled) || ca->reserved)
       continue;
 
     if (func (ca, user_data))
@@ -719,6 +723,16 @@ lookup_codec_association_custom (GList *codec_associations,
 }
 
 
+CodecAssociation *
+lookup_codec_association_custom (GList *codec_associations,
+    CAFindFunc func, gpointer user_data)
+{
+
+  return lookup_codec_association_custom_intern (codec_associations, FALSE,
+      func, user_data);
+}
+
+
 /**
  * codec_association_list_are_equal
  * @list1: a #GList of #FsCodec
-- 
1.5.6.5




More information about the farsight-commits mailing list