[farsight2/master] Add function to search a codec association by codec

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


---
 gst/fsrtpconference/fs-rtp-codec-negotiation.c |   17 +++++++++++++++++
 gst/fsrtpconference/fs-rtp-codec-negotiation.h |    3 +++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-codec-negotiation.c b/gst/fsrtpconference/fs-rtp-codec-negotiation.c
index b7416b9..b78a69d 100644
--- a/gst/fsrtpconference/fs-rtp-codec-negotiation.c
+++ b/gst/fsrtpconference/fs-rtp-codec-negotiation.c
@@ -601,6 +601,22 @@ lookup_codec_association_by_pt (GList *codec_associations, gint pt)
   return lookup_codec_association_by_pt_list (codec_associations, pt, FALSE);
 }
 
+CodecAssociation *
+lookup_codec_association_by_codec (GList *codec_associations, FsCodec *codec)
+{
+  while (codec_associations)
+  {
+    if (codec_associations->data)
+    {
+      CodecAssociation *ca = codec_associations->data;
+      if (fs_codec_are_equal (ca->codec, codec))
+        return ca;
+    }
+    codec_associations = g_list_next (codec_associations);
+  }
+
+  return NULL;
+}
 
 
 void
@@ -621,3 +637,4 @@ codec_association_copy (CodecAssociation *ca)
 
   return newca;
 }
+
diff --git a/gst/fsrtpconference/fs-rtp-codec-negotiation.h b/gst/fsrtpconference/fs-rtp-codec-negotiation.h
index d013e33..9a8b173 100644
--- a/gst/fsrtpconference/fs-rtp-codec-negotiation.h
+++ b/gst/fsrtpconference/fs-rtp-codec-negotiation.h
@@ -66,6 +66,9 @@ negotiate_codecs (const GList *remote_codecs,
 CodecAssociation *
 lookup_codec_association_by_pt (GList *codec_associations, gint pt);
 
+CodecAssociation *
+lookup_codec_association_by_codec (GList *codec_associations, FsCodec *codec);
+
 void
 codec_association_list_destroy (GList *list);
 
-- 
1.5.6.5




More information about the farsight-commits mailing list