[farsight2/master] Remove useless gst caps in specific negotiation functions

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


---
 gst/fsrtpconference/fs-rtp-codec-negotiation.c |    6 +---
 gst/fsrtpconference/fs-rtp-specific-nego.c     |   34 ++++++++---------------
 gst/fsrtpconference/fs-rtp-specific-nego.h     |    3 +-
 3 files changed, 15 insertions(+), 28 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-codec-negotiation.c b/gst/fsrtpconference/fs-rtp-codec-negotiation.c
index 0ec88fa..01235ad 100644
--- a/gst/fsrtpconference/fs-rtp-codec-negotiation.c
+++ b/gst/fsrtpconference/fs-rtp-codec-negotiation.c
@@ -467,8 +467,7 @@ negotiate_codecs (const GList *remote_codecs,
 
     if (local_ca) {
       GST_DEBUG ("Have local codec in the same PT, lets try it first");
-      nego_codec = sdp_is_compat (local_ca->blueprint->rtp_caps,
-          local_ca->codec, remote_codec);
+      nego_codec = sdp_is_compat (local_ca->codec, remote_codec);
     }
 
     if (!nego_codec) {
@@ -480,8 +479,7 @@ negotiate_codecs (const GList *remote_codecs,
       {
         local_ca = item->data;
 
-        nego_codec = sdp_is_compat (local_ca->blueprint->rtp_caps,
-            local_ca->codec, remote_codec);
+        nego_codec = sdp_is_compat (local_ca->codec, remote_codec);
 
         if (nego_codec)
         {
diff --git a/gst/fsrtpconference/fs-rtp-specific-nego.c b/gst/fsrtpconference/fs-rtp-specific-nego.c
index 8febbf8..785d61c 100644
--- a/gst/fsrtpconference/fs-rtp-specific-nego.c
+++ b/gst/fsrtpconference/fs-rtp-specific-nego.c
@@ -40,17 +40,14 @@
 struct SdpCompatCheck {
   FsMediaType media_type;
   const gchar *encoding_name;
-  FsCodec * (* sdp_is_compat) (GstCaps *rtp_caps, FsCodec *local_codec,
-      FsCodec *remote_codec);
+  FsCodec * (* sdp_is_compat) (FsCodec *local_codec, FsCodec *remote_codec);
 };
 
 
 static FsCodec *
-sdp_is_compat_ilbc (GstCaps *rtp_caps, FsCodec *local_codec,
-    FsCodec *remote_codec);
+sdp_is_compat_ilbc (FsCodec *local_codec, FsCodec *remote_codec);
 static FsCodec *
-sdp_is_compat_h263_1998 (GstCaps *rtp_caps, FsCodec *local_codec,
-    FsCodec *remote_codec);
+sdp_is_compat_h263_1998 (FsCodec *local_codec, FsCodec *remote_codec);
 
 static struct SdpCompatCheck sdp_compat_checks[] = {
   {FS_MEDIA_TYPE_AUDIO, "iLBC", sdp_is_compat_ilbc},
@@ -60,18 +57,15 @@ static struct SdpCompatCheck sdp_compat_checks[] = {
 
 
 static FsCodec *
-sdp_is_compat_default (GstCaps *rtp_caps, FsCodec *local_codec,
-    FsCodec *remote_codec);
+sdp_is_compat_default (FsCodec *local_codec, FsCodec *remote_codec);
 
 FsCodec *
-sdp_is_compat (GstCaps *rtp_caps, FsCodec *local_codec,
-    FsCodec *remote_codec)
+sdp_is_compat (FsCodec *local_codec, FsCodec *remote_codec)
 {
   gint i;
 
-  g_assert (local_codec);
-  g_assert (remote_codec);
-  g_assert (rtp_caps);
+  g_return_val_if_fail (local_codec, NULL);
+  g_return_val_if_fail (remote_codec, NULL);
 
   if (local_codec->media_type != remote_codec->media_type) {
     GST_DEBUG ("Wrong media type, local: %s, remote: %s",
@@ -90,17 +84,15 @@ sdp_is_compat (GstCaps *rtp_caps, FsCodec *local_codec,
     if (sdp_compat_checks[i].media_type == remote_codec->media_type &&
         !g_ascii_strcasecmp (sdp_compat_checks[i].encoding_name,
             remote_codec->encoding_name)) {
-      return sdp_compat_checks[i].sdp_is_compat (rtp_caps, local_codec,
-          remote_codec);
+      return sdp_compat_checks[i].sdp_is_compat (local_codec, remote_codec);
     }
   }
 
-  return sdp_is_compat_default (rtp_caps, local_codec, remote_codec);
+  return sdp_is_compat_default (local_codec, remote_codec);
 }
 
 static FsCodec *
-sdp_is_compat_default (GstCaps *rtp_caps, FsCodec *local_codec,
-    FsCodec *remote_codec)
+sdp_is_compat_default (FsCodec *local_codec, FsCodec *remote_codec)
 {
   FsCodec *negotiated_codec = NULL;
   GList *local_param_list = NULL, *negotiated_param_list = NULL;
@@ -162,8 +154,7 @@ sdp_is_compat_default (GstCaps *rtp_caps, FsCodec *local_codec,
 }
 
 static FsCodec *
-sdp_is_compat_ilbc (GstCaps *rtp_caps, FsCodec *local_codec,
-    FsCodec *remote_codec)
+sdp_is_compat_ilbc (FsCodec *local_codec, FsCodec *remote_codec)
 {
   FsCodec *negotiated_codec = NULL;
   GList *mylistitem = NULL, *negotiated_param_list = NULL;
@@ -275,8 +266,7 @@ sdp_is_compat_ilbc (GstCaps *rtp_caps, FsCodec *local_codec,
 
 
 static FsCodec *
-sdp_is_compat_h263_1998 (GstCaps *rtp_caps, FsCodec *local_codec,
-    FsCodec *remote_codec)
+sdp_is_compat_h263_1998 (FsCodec *local_codec, FsCodec *remote_codec)
 {
   FsCodec *negotiated_codec = NULL;
   GList *mylistitem = NULL, *remote_param_list = NULL;
diff --git a/gst/fsrtpconference/fs-rtp-specific-nego.h b/gst/fsrtpconference/fs-rtp-specific-nego.h
index 38aa5ba..bd81a63 100644
--- a/gst/fsrtpconference/fs-rtp-specific-nego.h
+++ b/gst/fsrtpconference/fs-rtp-specific-nego.h
@@ -32,8 +32,7 @@
 G_BEGIN_DECLS
 
 FsCodec *
-sdp_is_compat (GstCaps *rtp_caps, FsCodec *local_codec,
-    FsCodec *remote_codec);
+sdp_is_compat (FsCodec *local_codec, FsCodec *remote_codec);
 
 G_END_DECLS
 
-- 
1.5.6.5




More information about the farsight-commits mailing list