pidgin.vv: 30a1a0d3: Use PurpleMediaKeyPair. Remove PurpleMed...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Thu Apr 2 00:25:38 EDT 2009


-----------------------------------------------------------------
Revision: 30a1a0d3c69aa9884971b299afb42ec7a9d46d96
Ancestor: 933da956e406f6d7baaaf338dcfa120fd64c4dc5
Author: maiku at soc.pidgin.im
Date: 2009-04-02T01:12:23
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/30a1a0d3c69aa9884971b299afb42ec7a9d46d96

Modified files:
        libpurple/media.c libpurple/media.h
        libpurple/protocols/jabber/jingle/rtp.c

ChangeLog: 

Use PurpleMediaKeyPair. Remove PurpleMediaCodecParameter.

-------------- next part --------------
============================================================
--- libpurple/media.c	29ed01c509ec85f3fbe080eeac3f594dbc5162fd
+++ libpurple/media.c	f722ca638d743538d6b1e4a1fe3cc92ae4474bab
@@ -753,13 +753,13 @@ purple_media_codec_add_optional_paramete
 purple_media_codec_add_optional_parameter(PurpleMediaCodec *codec,
 		const gchar *name, const gchar *value)
 {
-	PurpleMediaCodecParameter *new_param;
+	PurpleKeyValuePair *new_param;
 
 	g_return_if_fail(codec != NULL);
 	g_return_if_fail(name != NULL && value != NULL);
 
-	new_param = g_new0(PurpleMediaCodecParameter, 1);
-	new_param->name = g_strdup(name);
+	new_param = g_new0(PurpleKeyValuePair, 1);
+	new_param->key = g_strdup(name);
 	new_param->value = g_strdup(value);
 	codec->optional_params = g_list_append(
 			codec->optional_params, new_param);
@@ -767,11 +767,11 @@ purple_media_codec_remove_optional_param
 
 void
 purple_media_codec_remove_optional_parameter(PurpleMediaCodec *codec,
-		PurpleMediaCodecParameter *param)
+		PurpleKeyValuePair *param)
 {
 	g_return_if_fail(codec != NULL && param != NULL);
 
-	g_free(param->name);
+	g_free(param->key);
 	g_free(param->value);
 	g_free(param);
 
@@ -779,7 +779,7 @@ purple_media_codec_remove_optional_param
 			g_list_remove(codec->optional_params, param);
 }
 
-PurpleMediaCodecParameter *
+PurpleKeyValuePair *
 purple_media_codec_get_optional_parameter(PurpleMediaCodec *codec,
 		const gchar *name, const gchar *value)
 {
@@ -789,8 +789,8 @@ purple_media_codec_get_optional_paramete
 	g_return_val_if_fail(name != NULL, NULL);
 
 	for (iter = codec->optional_params; iter; iter = g_list_next(iter)) {
-		PurpleMediaCodecParameter *param = iter->data;
-		if (!g_ascii_strcasecmp(param->name, name) &&
+		PurpleKeyValuePair *param = iter->data;
+		if (!g_ascii_strcasecmp(param->key, name) &&
 				(value == NULL ||
 				!g_ascii_strcasecmp(param->value, value)))
 			return param;
@@ -826,10 +826,10 @@ purple_media_codec_copy(PurpleMediaCodec
 	new_codec->channels = codec->channels;
 
 	for (iter = codec->optional_params; iter; iter = g_list_next(iter)) {
-		PurpleMediaCodecParameter *param =
-				(PurpleMediaCodecParameter*)iter->data;
+		PurpleKeyValuePair *param =
+				(PurpleKeyValuePair*)iter->data;
 		purple_media_codec_add_optional_parameter(new_codec,
-				param->name, param->value);
+				param->key, param->value);
 	}
 
 	return new_codec;
@@ -869,10 +869,9 @@ purple_media_codec_to_fs(const PurpleMed
 	new_codec->channels = codec->channels;
 
 	for (iter = codec->optional_params; iter; iter = g_list_next(iter)) {
-		PurpleMediaCodecParameter *param =
-				(PurpleMediaCodecParameter*)iter->data;
+		PurpleKeyValuePair *param = (PurpleKeyValuePair*)iter->data;
 		fs_codec_add_optional_parameter(new_codec,
-				param->name, param->value);
+				param->key, param->value);
 	}
 
 	return new_codec;
============================================================
--- libpurple/media.h	e70c8b2f2497a60188742a42b1cb61e6f47ce239
+++ libpurple/media.h	250b0b2800fd854ccde4c6955e9051277757f0e6
@@ -27,6 +27,9 @@
 #ifndef __MEDIA_H_
 #define __MEDIA_H_
 
+#include "signals.h"
+#include "util.h"
+
 #include <glib.h>
 #include <glib-object.h>
 
@@ -54,8 +57,6 @@ typedef struct _PurpleMediaCodec PurpleM
 typedef struct _PurpleMediaCandidate PurpleMediaCandidate;
 /** @copydoc _PurpleMediaCodec */
 typedef struct _PurpleMediaCodec PurpleMediaCodec;
-/** @copydoc _PurpleMediaCodecParameter */
-typedef struct _PurpleMediaCodecParameter PurpleMediaCodecParameter;
 
 /** Media caps */
 typedef enum {
@@ -133,12 +134,6 @@ struct _PurpleMediaCandidate
 	guint ttl;
 };
 
-struct _PurpleMediaCodecParameter
-{
-	gchar *name;
-	gchar *value;
-};
-
 struct _PurpleMediaCodec
 {
 	gint id;
@@ -261,7 +256,7 @@ void purple_media_codec_remove_optional_
  * @param param A pointer to the parameter to remove.
  */
 void purple_media_codec_remove_optional_parameter(PurpleMediaCodec *codec,
-		PurpleMediaCodecParameter *param);
+		PurpleKeyValuePair *param);
 
 /**
  * Gets an optional parameter based on the values given.
@@ -272,7 +267,7 @@ void purple_media_codec_remove_optional_
  *
  * @return The value found or NULL.
  */
-PurpleMediaCodecParameter *purple_media_codec_get_optional_parameter(
+PurpleKeyValuePair *purple_media_codec_get_optional_parameter(
 		PurpleMediaCodec *codec, const gchar *name,
 		const gchar *value);
 
============================================================
--- libpurple/protocols/jabber/jingle/rtp.c	90042e19c6e5b25ae2f9132dd6e85cbc58f397f1
+++ libpurple/protocols/jabber/jingle/rtp.c	1287ef920d6839d889dd41dc4c12778f6676cd5e
@@ -681,9 +681,9 @@ jingle_rtp_add_payloads(xmlnode *descrip
 		xmlnode_set_attrib(payload, "channels", channels);
 
 		for (; iter; iter = g_list_next(iter)) {
-			PurpleMediaCodecParameter *mparam = iter->data;
+			PurpleKeyValuePair *mparam = iter->data;
 			xmlnode *param = xmlnode_new_child(payload, "parameter");
-			xmlnode_set_attrib(param, "name", mparam->name);
+			xmlnode_set_attrib(param, "name", mparam->key);
 			xmlnode_set_attrib(param, "value", mparam->value);
 		}
 


More information about the Commits mailing list