[farsight2/master] Remove config parameters from FsCodec

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


---
 docs/libs/farsight2-libs-sections.txt  |    2 -
 gst-libs/gst/farsight/fs-codec.c       |  100 +-------------------------------
 gst-libs/gst/farsight/fs-codec.h       |   10 ---
 gst/fsrtpconference/fs-rtp-session.c   |    2 +-
 gst/fsrtpconference/fs-rtp-substream.c |    3 +-
 5 files changed, 3 insertions(+), 114 deletions(-)

diff --git a/docs/libs/farsight2-libs-sections.txt b/docs/libs/farsight2-libs-sections.txt
index 2473159..f1f54d4 100644
--- a/docs/libs/farsight2-libs-sections.txt
+++ b/docs/libs/farsight2-libs-sections.txt
@@ -114,7 +114,6 @@ fs_codec_new
 fs_codec_destroy
 fs_codec_copy
 fs_codec_are_equal
-fs_codec_are_equal_including_config
 fs_codec_list_from_keyfile
 fs_codec_list_destroy
 fs_codec_list_copy
@@ -123,7 +122,6 @@ fs_codec_to_string
 fs_codec_to_gst_caps
 fs_codec_add_optional_parameter
 fs_codec_remove_optional_parameter
-fs_codec_add_config_parameter
 <SUBSECTION Standard>
 FS_TYPE_CODEC
 FS_TYPE_CODEC_LIST
diff --git a/gst-libs/gst/farsight/fs-codec.c b/gst-libs/gst/farsight/fs-codec.c
index a52836e..7dfed6e 100644
--- a/gst-libs/gst/farsight/fs-codec.c
+++ b/gst-libs/gst/farsight/fs-codec.c
@@ -128,14 +128,6 @@ fs_codec_destroy (FsCodec * codec)
       g_slice_free (FsCodecParameter, param);
     }
     g_list_free (codec->optional_params);
-
-    for (lp = codec->config_params; lp; lp = g_list_next (lp)) {
-      param = (FsCodecParameter *) lp->data;
-      g_free (param->name);
-      g_free (param->value);
-      g_slice_free (FsCodecParameter, param);
-    }
-    g_list_free (codec->config_params);
   }
 
   g_slice_free (FsCodec, codec);
@@ -181,17 +173,6 @@ fs_codec_copy (const FsCodec * codec)
   }
   copy->optional_params = g_list_reverse (copy->optional_params);
 
-  for (lp = codec->config_params; lp; lp = g_list_next (lp))
-  {
-    param_copy = g_slice_new (FsCodecParameter);
-    param = (FsCodecParameter *) lp->data;
-    param_copy->name = g_strdup (param->name);
-    param_copy->value = g_strdup (param->value);
-    /* prepend then reverse the list for efficiency */
-    copy->config_params = g_list_prepend (copy->config_params, param_copy);
-  }
-  copy->config_params = g_list_reverse (copy->config_params);
-
   return copy;
 }
 
@@ -478,14 +459,6 @@ fs_codec_to_string (const FsCodec *codec)
     g_string_append_printf (string, " %s=%s", param->name, param->value);
   }
 
-  for (item = codec->config_params;
-       item;
-       item = g_list_next (item)) {
-    FsCodecParameter *param = item->data;
-    g_string_append_printf (string, " %s=%s", param->name, param->value);
-  }
-
-
   charstring = string->str;
   g_string_free (string, FALSE);
 
@@ -533,10 +506,7 @@ compare_lists (GList *list1, GList *list2)
  *
  * Compare two codecs, it will declare two codecs to be identical even
  * if their optional parameters are in a different order. %NULL encoding names
- * are ignored. Configuration parameters are ignored when comparing.
- *
- * fs_codec_are_equal_including_config() is the same as this function, but also
- * compares the configuration data
+ * are ignored.
  *
  * Return value: %TRUE of the codecs are identical, %FALSE otherwise
  */
@@ -571,36 +541,6 @@ fs_codec_are_equal (const FsCodec *codec1, const FsCodec *codec2)
 }
 
 /**
- * fs_codec_are_equal:
- * @codec1: First codec
- * @codec2: Second codec
- *
- * Compare two codecs, it will declare two codecs to be identical even
- * if their optional parameters are in a different order. %NULL encoding names
- * are ignored.
- *
- * This is the same as fs_codec_are_equal(), but also makes sure that the
- * codec configurations are the same.
- *
- * Return value: %TRUE of the codecs are identical, %FALSE otherwise
- */
-gboolean
-fs_codec_are_equal_including_config (
-    const FsCodec *codec1,
-    const FsCodec *codec2)
-{
-  if (!fs_codec_are_equal (codec1, codec2))
-    return FALSE;
-
-  if (!compare_lists (codec1->config_params, codec2->config_params) ||
-      !compare_lists (codec2->config_params, codec1->config_params))
-    return FALSE;
-
-  return TRUE;
-}
-
-
-/**
  * fs_codec_to_gst_caps
  * @codec: A #FsCodec to be converted
  *
@@ -662,17 +602,6 @@ fs_codec_to_gst_caps (const FsCodec *codec)
     g_free (lower_name);
   }
 
-  for (item = codec->config_params;
-       item;
-       item = g_list_next (item)) {
-    FsCodecParameter *param = item->data;
-    gchar *lower_name = g_ascii_strdown (param->name, -1);
-    gst_structure_set (structure, lower_name, G_TYPE_STRING, param->value,
-      NULL);
-    g_free (lower_name);
-  }
-
-
   caps = gst_caps_new_full (structure, NULL);
 
   return caps;
@@ -733,33 +662,6 @@ fs_codec_add_optional_parameter (FsCodec *codec,
   codec->optional_params = g_list_append (codec->optional_params, param);
 }
 
-
-/**
- * fs_codec_add_config_parameter:
- * @codec: The #FsCodec to add the parameter to
- * @name: The name of the config parameter
- * @value: The value of the config parameter
- *
- * This function adds an new config parameter to a #FsCodec
- */
-
-void
-fs_codec_add_config_parameter (FsCodec *codec,
-    const gchar *name,
-    const gchar *value)
-{
-  FsCodecParameter *param;
-
-  g_return_if_fail (name != NULL && value != NULL);
-
-  param = g_slice_new (FsCodecParameter);
-
-  param->name = g_strdup (name);
-  param->value = g_strdup (value);
-
-  codec->config_params = g_list_append (codec->config_params, param);
-}
-
 /**
  * fs_codec_remove_optional_parameter:
  * @codec: a #FsCodec
diff --git a/gst-libs/gst/farsight/fs-codec.h b/gst-libs/gst/farsight/fs-codec.h
index 884888d..f254c9b 100644
--- a/gst-libs/gst/farsight/fs-codec.h
+++ b/gst-libs/gst/farsight/fs-codec.h
@@ -83,7 +83,6 @@ typedef enum
  * @clock_rate: clock rate of this stream
  * @channels: Number of channels codec should decode
  * @optional_params: key pairs of param name to param data for neutral and receive side params
- * @config_params: key pairs of param name to params data for send-side params
  *
  * This structure reprensents one codec that can be offered or received
  */
@@ -96,7 +95,6 @@ struct _FsCodec
   guint clock_rate;
   guint channels;
   GList *optional_params;
-  GList *config_params;
   /*< private >*/
   gpointer _padding[4];         /* padding for binary-compatible
                                    expansion*/
@@ -135,11 +133,6 @@ GstCaps *fs_codec_to_gst_caps (const FsCodec *codec);
 
 gboolean fs_codec_list_are_equal (GList *list1, GList *list2);
 
-gboolean fs_codec_are_equal_including_config (
-    const FsCodec *codec1,
-    const FsCodec *codec2);
-
-
 const gchar *fs_media_type_to_string (FsMediaType media_type);
 
 void fs_codec_add_optional_parameter (FsCodec *codec, const gchar *name,
@@ -148,9 +141,6 @@ void fs_codec_add_optional_parameter (FsCodec *codec, const gchar *name,
 void fs_codec_remove_optional_parameter (FsCodec *codec,
     FsCodecParameter *param);
 
-void fs_codec_add_config_parameter (FsCodec *codec, const gchar *name,
-    const gchar *value);
-
 G_END_DECLS
 
 #endif /* __FS_CODEC_H__ */
diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index 37bf7ca..a561599 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -2327,7 +2327,7 @@ fs_rtp_session_substream_add_codec_bin (FsRtpSession *session,
   if (!new_codec)
     goto out;
 
-  if (fs_codec_are_equal_including_config (new_codec, current_codec))
+  if (fs_codec_are_equal (new_codec, current_codec))
   {
     ret = TRUE;
     goto out;
diff --git a/gst/fsrtpconference/fs-rtp-substream.c b/gst/fsrtpconference/fs-rtp-substream.c
index f99dc9d..90e748f 100644
--- a/gst/fsrtpconference/fs-rtp-substream.c
+++ b/gst/fsrtpconference/fs-rtp-substream.c
@@ -1078,8 +1078,7 @@ fs_rtp_sub_stream_invalidate_codec_locked (FsRtpSubStream *substream, gint pt,
   if (substream->priv->pt == pt &&
       substream->priv->codec &&
       !substream->priv->blocking_id &&
-      (!codec ||
-          !fs_codec_are_equal_including_config (substream->priv->codec, codec)))
+      (!codec || !fs_codec_are_equal (substream->priv->codec, codec)))
     substream->priv->blocking_id = gst_pad_add_data_probe (
         substream->priv->rtpbin_pad,
         G_CALLBACK (_rtpbin_pad_have_data_callback), substream);
-- 
1.5.6.5




More information about the farsight-commits mailing list