pidgin.vv: a1c2faac: Duplicate FsCandidate to remove it from ...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Sat Jan 10 06:16:14 EST 2009


-----------------------------------------------------------------
Revision: a1c2faac15efa6a1a39a2ee09000cf525535e094
Ancestor: befd3ff0e7dd20f612c653ad773327de142fa5e9
Author: maiku at soc.pidgin.im
Date: 2009-01-10T03:58:54
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/a1c2faac15efa6a1a39a2ee09000cf525535e094

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

ChangeLog: 

Duplicate FsCandidate to remove it from the public interface.

-------------- next part --------------
============================================================
--- libpurple/media.c	b78f90cfaf5eb4b27be466839288f47730918122
+++ libpurple/media.c	abb5168a43ab4d0e29851d755cdca7fac6e08df7
@@ -239,7 +239,7 @@ purple_media_class_init (PurpleMediaClas
 					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
 					 purple_smarshal_VOID__POINTER_POINTER_OBJECT,
 					 G_TYPE_NONE, 3, G_TYPE_POINTER,
-					 G_TYPE_POINTER, FS_TYPE_CANDIDATE);
+					 G_TYPE_POINTER, PURPLE_TYPE_MEDIA_CANDIDATE);
 	purple_media_signals[CANDIDATES_PREPARED] = g_signal_new("candidates-prepared", G_TYPE_FROM_CLASS(klass),
 					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
 					 purple_smarshal_VOID__STRING_STRING,
@@ -247,7 +247,8 @@ purple_media_class_init (PurpleMediaClas
 	purple_media_signals[CANDIDATE_PAIR] = g_signal_new("candidate-pair", G_TYPE_FROM_CLASS(klass),
 					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
 					 purple_smarshal_VOID__BOXED_BOXED,
-					 G_TYPE_NONE, 2, FS_TYPE_CANDIDATE, FS_TYPE_CANDIDATE);
+					 G_TYPE_NONE, 2, PURPLE_TYPE_MEDIA_CANDIDATE,
+					 PURPLE_TYPE_MEDIA_CANDIDATE);
 	purple_media_signals[CODECS_READY] = g_signal_new("codecs-ready", G_TYPE_FROM_CLASS(klass),
 					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
 					 g_cclosure_marshal_VOID__STRING,
@@ -413,6 +414,169 @@ purple_media_get_property (GObject *obje
 
 }
 
+PurpleMediaCandidate *
+purple_media_candidate_new(const gchar *foundation, guint component_id,
+		PurpleMediaCandidateType type,
+		PurpleMediaNetworkProtocol proto,
+		const gchar *ip, guint port)
+{
+	PurpleMediaCandidate *candidate = g_new0(PurpleMediaCandidate, 1);
+	candidate->foundation = g_strdup(foundation);
+	candidate->component_id = component_id;
+	candidate->type = type;
+	candidate->proto = proto;
+	candidate->ip = g_strdup(ip);
+	candidate->port = port;
+	return candidate;
+}
+
+static PurpleMediaCandidate *
+purple_media_candidate_copy(PurpleMediaCandidate *candidate)
+{
+	PurpleMediaCandidate *new_candidate;
+
+	if (candidate == NULL)
+		return NULL;
+
+	new_candidate = g_new0(PurpleMediaCandidate, 1);
+	new_candidate->foundation = g_strdup(candidate->foundation);
+	new_candidate->component_id = candidate->component_id;
+	new_candidate->ip = g_strdup(candidate->ip);
+	new_candidate->port = candidate->port;
+	new_candidate->base_ip = g_strdup(candidate->base_ip);
+	new_candidate->base_port = candidate->base_port;
+	new_candidate->proto = candidate->proto;
+	new_candidate->priority = candidate->priority;
+	new_candidate->type = candidate->type;
+	new_candidate->username = g_strdup(candidate->username);
+	new_candidate->password = g_strdup(candidate->password);
+	new_candidate->ttl = candidate->ttl;
+	return new_candidate;
+}
+
+static void
+purple_media_candidate_free(PurpleMediaCandidate *candidate)
+{
+	if (candidate == NULL)
+		return;
+
+	g_free((gchar*)candidate->foundation);
+	g_free((gchar*)candidate->ip);
+	g_free((gchar*)candidate->base_ip);
+	g_free((gchar*)candidate->username);
+	g_free((gchar*)candidate->password);
+	g_free(candidate);
+}
+
+static FsCandidate *
+purple_media_candidate_to_fs(PurpleMediaCandidate *candidate)
+{
+	FsCandidate *fscandidate;
+
+	if (candidate == NULL)
+		return NULL;
+
+	fscandidate = fs_candidate_new(candidate->foundation,
+		candidate->component_id, candidate->type,
+		candidate->proto, candidate->ip, candidate->port);
+
+	fscandidate->base_ip = g_strdup(candidate->base_ip);
+	fscandidate->base_port = candidate->base_port;
+	fscandidate->priority = candidate->priority;
+	fscandidate->username = g_strdup(candidate->username);
+	fscandidate->password = g_strdup(candidate->password);
+	fscandidate->ttl = candidate->ttl;
+	return fscandidate;
+}
+
+static PurpleMediaCandidate *
+purple_media_candidate_from_fs(FsCandidate *fscandidate)
+{
+	PurpleMediaCandidate *candidate;
+
+	if (fscandidate == NULL)
+		return NULL;
+
+	candidate = purple_media_candidate_new(fscandidate->foundation,
+		fscandidate->component_id, fscandidate->type,
+		fscandidate->proto, fscandidate->ip, fscandidate->port);
+	candidate->base_ip = g_strdup(fscandidate->base_ip);
+	candidate->base_port = fscandidate->base_port;
+	candidate->priority = fscandidate->priority;
+	candidate->username = g_strdup(fscandidate->username);
+	candidate->password = g_strdup(fscandidate->password);
+	candidate->ttl = fscandidate->ttl;
+	return candidate;
+}
+
+static GList *
+purple_media_candidate_list_from_fs(GList *candidates)
+{
+	GList *new_list = NULL;
+
+	for (; candidates; candidates = g_list_next(candidates)) {
+		new_list = g_list_prepend(new_list,
+				purple_media_candidate_from_fs(
+				candidates->data));
+	}
+
+	new_list = g_list_reverse(new_list);
+	return new_list;
+}
+
+static GList *
+purple_media_candidate_list_to_fs(GList *candidates)
+{
+	GList *new_list = NULL;
+
+	for (; candidates; candidates = g_list_next(candidates)) {
+		new_list = g_list_prepend(new_list,
+				purple_media_candidate_to_fs(
+				candidates->data));
+	}
+
+	new_list = g_list_reverse(new_list);
+	return new_list;
+}
+
+GList *
+purple_media_candidate_list_copy(GList *candidates)
+{
+	GList *new_list = NULL;
+
+	for (; candidates; candidates = g_list_next(candidates)) {
+		new_list = g_list_prepend(new_list, g_boxed_copy(
+				PURPLE_TYPE_MEDIA_CANDIDATE,
+				candidates->data));
+	}
+
+	new_list = g_list_reverse(new_list);
+	return new_list;
+}
+
+void
+purple_media_candidate_list_free(GList *candidates)
+{
+	for (; candidates; candidates =
+			g_list_delete_link(candidates, candidates)) {
+		g_boxed_free(PURPLE_TYPE_MEDIA_CANDIDATE,
+				candidates->data);
+	}
+}
+
+GType
+purple_media_candidate_get_type()
+{
+	static GType type = 0;
+
+	if (type == 0) {
+		type = g_boxed_type_register_static("PurpleMediaCandidate",
+				(GBoxedCopyFunc)purple_media_candidate_copy,
+				(GBoxedFreeFunc)purple_media_candidate_free);
+	}
+	return type;
+}
+
 static FsMediaType
 purple_media_to_fs_media_type(PurpleMediaSessionType type)
 {
@@ -1187,7 +1351,7 @@ purple_media_new_local_candidate_cb(FsSt
 {
 	gchar *name;
 	FsParticipant *participant;
-	FsCandidate *candidate;
+	PurpleMediaCandidate *candidate;
 	purple_debug_info("media", "got new local candidate: %s\n", local_candidate->foundation);
 	g_object_get(stream, "participant", &participant, NULL);
 	g_object_get(participant, "cname", &name, NULL);
@@ -1195,10 +1359,10 @@ purple_media_new_local_candidate_cb(FsSt
 
 	purple_media_insert_local_candidate(session, name, fs_candidate_copy(local_candidate));
 
-	candidate = fs_candidate_copy(local_candidate);
+	candidate = purple_media_candidate_from_fs(local_candidate);
 	g_signal_emit(session->media, purple_media_signals[NEW_CANDIDATE],
 		      0, session->id, name, candidate);
-	fs_candidate_destroy(candidate);
+	purple_media_candidate_free(candidate);
 
 	g_free(name);
 }
@@ -1234,8 +1398,10 @@ purple_media_candidate_pair_established_
 {
 	gchar *name;
 	FsParticipant *participant;
-	FsCandidate *local = fs_candidate_copy(native_candidate);
-	FsCandidate *remote = fs_candidate_copy(remote_candidate);
+	PurpleMediaCandidate *local =
+			purple_media_candidate_copy(native_candidate);
+	PurpleMediaCandidate *remote =
+			purple_media_candidate_copy(remote_candidate);
 	PurpleMediaStream *stream;
 
 	g_object_get(fsstream, "participant", &participant, NULL);
@@ -1251,8 +1417,8 @@ purple_media_candidate_pair_established_
 	g_signal_emit(session->media, purple_media_signals[CANDIDATE_PAIR], 0,
 		      local, remote);
 
-	fs_candidate_destroy(local);
-	fs_candidate_destroy(remote);
+	purple_media_candidate_free(local);
+	purple_media_candidate_free(remote);
 }
 
 static void
@@ -1486,7 +1652,7 @@ purple_media_get_local_candidates(Purple
 purple_media_get_local_candidates(PurpleMedia *media, const gchar *sess_id, const gchar *name)
 {
 	PurpleMediaStream *stream = purple_media_get_stream(media, sess_id, name);
-	return fs_candidate_list_copy(stream->local_candidates);
+	return purple_media_candidate_list_from_fs(stream->local_candidates);
 }
 
 void
@@ -1495,23 +1661,25 @@ purple_media_add_remote_candidates(Purpl
 {
 	PurpleMediaStream *stream = purple_media_get_stream(media, sess_id, name);
 	stream->remote_candidates = g_list_concat(stream->remote_candidates,
-			fs_candidate_list_copy(remote_candidates));
+			purple_media_candidate_list_to_fs(remote_candidates));
 
 	if (stream->session->accepted == TRUE) {
 		purple_media_set_remote_candidates(stream);
 	}
 }
 
-FsCandidate *
+PurpleMediaCandidate *
 purple_media_get_local_candidate(PurpleMedia *media, const gchar *sess_id, const gchar *name)
 {
-	return purple_media_get_stream(media, sess_id, name)->local_candidate;
+	return purple_media_candidate_from_fs(purple_media_get_stream(
+			media, sess_id, name)->local_candidate);
 }
 
-FsCandidate *
+PurpleMediaCandidate *
 purple_media_get_remote_candidate(PurpleMedia *media, const gchar *sess_id, const gchar *name)
 {
-	return purple_media_get_stream(media, sess_id, name)->remote_candidate;
+	return purple_media_candidate_from_fs(purple_media_get_stream(
+			media, sess_id, name)->remote_candidate);
 }
 
 gboolean
============================================================
--- libpurple/media.h	7ddd44c1985454931380ffd564f51304910803c4
+++ libpurple/media.h	e16398eb0560b17fe47ea78e2d65acf54c8019d3
@@ -37,6 +37,7 @@ G_BEGIN_DECLS
 G_BEGIN_DECLS
 
 #define PURPLE_TYPE_MEDIA            (purple_media_get_type())
+#define PURPLE_TYPE_MEDIA_CANDIDATE  (purple_media_candidate_get_type())
 #define PURPLE_MEDIA(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA, PurpleMedia))
 #define PURPLE_MEDIA_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA, PurpleMediaClass))
 #define PURPLE_IS_MEDIA(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA))
@@ -51,6 +52,8 @@ typedef struct _PurpleMediaPrivate Purpl
 typedef struct _PurpleMediaClass PurpleMediaClass;
 /** @copydoc _PurpleMediaPrivate */
 typedef struct _PurpleMediaPrivate PurpleMediaPrivate;
+/** @copydoc _PurpleMediaCandidate */
+typedef struct _PurpleMediaCandidate PurpleMediaCandidate;
 
 #else
 
@@ -76,6 +79,25 @@ typedef enum {
 	PURPLE_MEDIA_STATE_CHANGED_END,
 } PurpleMediaStateChangedType;
 
+typedef enum {
+	PURPLE_MEDIA_CANDIDATE_TYPE_HOST,
+	PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX,
+	PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX,
+	PURPLE_MEDIA_CANDIDATE_TYPE_RELAY,
+	PURPLE_MEDIA_CANDIDATE_TYPE_MULTICAST,
+} PurpleMediaCandidateType;
+
+typedef enum {
+	PURPLE_MEDIA_COMPONENT_NONE = 0,
+	PURPLE_MEDIA_COMPONENT_RTP = 1,
+	PURPLE_MEDIA_COMPONENT_RTCP = 2,
+} PurpleMediaComponentType;
+
+typedef enum {
+	PURPLE_MEDIA_NETWORK_PROTOCOL_UDP,
+	PURPLE_MEDIA_NETWORK_PROTOCOL_TCP,
+} PurpleMediaNetworkProtocol;
+
 #ifdef USE_VV
 
 /** The media class */
@@ -91,6 +113,22 @@ struct _PurpleMedia
 	PurpleMediaPrivate *priv;      /**< The private data of this object. */
 };
 
+struct _PurpleMediaCandidate
+{
+	const gchar *foundation;
+	guint component_id;
+	const gchar *ip;
+	guint16 port;
+	const gchar *base_ip;
+	guint16 base_port;
+	PurpleMediaNetworkProtocol proto;
+	guint32 priority;
+	PurpleMediaSessionType type;
+	const gchar *username;
+	const gchar *password;
+	guint ttl;
+};
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -110,6 +148,47 @@ GType purple_media_state_changed_get_typ
 GType purple_media_state_changed_get_type(void);
 
 /**
+ * Gets the type of the media candidate structure.
+ *
+ * @return The media canditate's GType
+ */
+GType purple_media_candidate_get_type(void);
+
+/**
+ * Creates a PurpleMediaCandidate instance.
+ *
+ * @param foundation The foundation of the candidate.
+ * @param component_id The component this candidate is for.
+ * @param type The type of candidate.
+ * @param proto The protocol this component is for.
+ * @param ip The IP address of this component.
+ * @param port The network port.
+ *
+ * @return The newly created PurpleMediaCandidate instance.
+ */
+PurpleMediaCandidate *purple_media_candidate_new(
+		const gchar *foundation, guint component_id,
+		PurpleMediaCandidateType type,
+		PurpleMediaNetworkProtocol proto,
+		const gchar *ip, guint port);
+
+/**
+ * Copies a GList of PurpleMediaCandidate and its contents.
+ *
+ * @param candidates The list of candidates to be copied.
+ *
+ * @return The copy of the GList.
+ */
+GList *purple_media_candidate_list_copy(GList *candidates);
+
+/**
+ * Frees a GList of PurpleMediaCandidate and its contents.
+ *
+ * @param candidates The list of candidates to be freed.
+ */
+void purple_media_candidate_list_free(GList *candidates);
+
+/**
  * Combines all the separate session types into a single PurpleMediaSessionType.
  *
  * @param media The media session to retrieve session types from.
@@ -388,7 +467,8 @@ GList *purple_media_get_local_candidates
  *
  * @return The active candidate retrieved.
  */
-FsCandidate *purple_media_get_local_candidate(PurpleMedia *media, const gchar *sess_id, const gchar *name);
+PurpleMediaCandidate *purple_media_get_local_candidate(PurpleMedia *media,
+		const gchar *sess_id, const gchar *name);
 
 /**
  * Gets the active remote candidate for the stream.
@@ -399,7 +479,8 @@ FsCandidate *purple_media_get_local_cand
  *
  * @return The remote candidate retrieved.
  */
-FsCandidate *purple_media_get_remote_candidate(PurpleMedia *media, const gchar *sess_id, const gchar *name);
+PurpleMediaCandidate *purple_media_get_remote_candidate(PurpleMedia *media,
+		const gchar *sess_id, const gchar *name);
 
 /**
  * Gets remote candidates from the stream.
============================================================
--- libpurple/protocols/jabber/google.c	f401cc6dd354b18eeba0d33f4b421d9fd02d9d54
+++ libpurple/protocols/jabber/google.c	9ea1e525c259330b9726eb45363cdc0fd78f9419
@@ -161,7 +161,7 @@ google_session_candidates_prepared (Purp
 	JabberIq *iq = jabber_iq_new(session->js, JABBER_IQ_SET);
 	GList *candidates = purple_media_get_local_candidates(session->media, "google-voice",
 							      session->remote_jid);
-	FsCandidate *transport;
+	PurpleMediaCandidate *transport;
 	xmlnode *sess;
 	xmlnode *candidate;
 	sess = google_session_create_xmlnode(session, "candidates");
@@ -171,7 +171,7 @@ google_session_candidates_prepared (Purp
 	for (;candidates;candidates = candidates->next) {
 		char port[8];
 		char pref[8];
-		transport = (FsCandidate*)(candidates->data);
+		transport = (PurpleMediaCandidate*)(candidates->data);
 
 		if (!strcmp(transport->ip, "127.0.0.1"))
 			continue;
@@ -194,10 +194,14 @@ google_session_candidates_prepared (Purp
 				transport->password != NULL ?
 				transport->password : "");
 		xmlnode_set_attrib(candidate, "preference", pref);
-		xmlnode_set_attrib(candidate, "protocol", transport->proto == FS_NETWORK_PROTOCOL_UDP ? "udp" : "tcp");
-		xmlnode_set_attrib(candidate, "type", transport->type == FS_CANDIDATE_TYPE_HOST ? "local" :
-						      transport->type == FS_CANDIDATE_TYPE_SRFLX ? "stun" :
-					       	      transport->type == FS_CANDIDATE_TYPE_RELAY ? "relay" : NULL);
+		xmlnode_set_attrib(candidate, "protocol", transport->proto ==
+				PURPLE_MEDIA_NETWORK_PROTOCOL_UDP ? "udp" : "tcp");
+		xmlnode_set_attrib(candidate, "type", transport->type ==
+				PURPLE_MEDIA_CANDIDATE_TYPE_HOST ? "local" :
+						      transport->type ==
+				PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX ? "stun" :
+					       	      transport->type ==
+				PURPLE_MEDIA_CANDIDATE_TYPE_RELAY ? "relay" : NULL);
 		xmlnode_set_attrib(candidate, "generation", "0");
 		xmlnode_set_attrib(candidate, "network", "0");
 		xmlnode_insert_child(sess, candidate);
@@ -399,17 +403,21 @@ google_session_handle_candidates(JabberS
 	char n[4];	
 		
 	for (cand = xmlnode_get_child(sess, "candidate"); cand; cand = xmlnode_get_next_twin(cand)) {
-		FsCandidate *info;
+		PurpleMediaCandidate *info;
 		g_snprintf(n, sizeof(n), "S%d", name++);
-		info = fs_candidate_new(n, FS_COMPONENT_RTP, !strcmp(xmlnode_get_attrib(cand, "type"), "local") ?
-					FS_CANDIDATE_TYPE_HOST :
+		info = purple_media_candidate_new(n, PURPLE_MEDIA_COMPONENT_RTP,
+				!strcmp(xmlnode_get_attrib(cand, "type"), "local") ?
+					PURPLE_MEDIA_CANDIDATE_TYPE_HOST :
 			     		!strcmp(xmlnode_get_attrib(cand, "type"), "stun") ?
-						FS_CANDIDATE_TYPE_PRFLX :
+						PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX :
 			     			!strcmp(xmlnode_get_attrib(cand, "type"), "relay") ?
-							FS_CANDIDATE_TYPE_RELAY : FS_CANDIDATE_TYPE_HOST,
+							PURPLE_MEDIA_CANDIDATE_TYPE_RELAY :
+							PURPLE_MEDIA_CANDIDATE_TYPE_HOST,
 						!strcmp(xmlnode_get_attrib(cand, "protocol"),"udp") ?
-							FS_NETWORK_PROTOCOL_UDP : FS_NETWORK_PROTOCOL_TCP,
-					xmlnode_get_attrib(cand, "address"), atoi(xmlnode_get_attrib(cand, "port")));
+							PURPLE_MEDIA_NETWORK_PROTOCOL_UDP :
+							PURPLE_MEDIA_NETWORK_PROTOCOL_TCP,
+					xmlnode_get_attrib(cand, "address"),
+					atoi(xmlnode_get_attrib(cand, "port")));
 
 		info->username = g_strdup(xmlnode_get_attrib(cand, "username"));
 		info->password = g_strdup(xmlnode_get_attrib(cand, "password"));
@@ -418,7 +426,7 @@ google_session_handle_candidates(JabberS
 	}
 
 	purple_media_add_remote_candidates(session->media, "google-voice", session->remote_jid, list);
-	fs_candidate_list_destroy(list);
+	purple_media_candidate_list_free(list);
 
 	result = jabber_iq_new(js, JABBER_IQ_RESULT);
 	jabber_iq_set_id(result, xmlnode_get_attrib(packet, "id"));
============================================================
--- libpurple/protocols/jabber/jingle/rtp.c	7b6ede10e55267142adb56c5f898221be57f3f8d
+++ libpurple/protocols/jabber/jingle/rtp.c	92348e55c7bbc07c8052b353c4c287dd68f2ac70
@@ -193,7 +193,7 @@ jingle_rtp_candidates_to_transport(Jingl
 		JingleTransport *transport = jingle_transport_create(JINGLE_TRANSPORT_RAWUDP);
 		JingleRawUdpCandidate *rawudp_candidate;
 		for (; candidates; candidates = g_list_next(candidates)) {
-			FsCandidate *candidate = candidates->data;
+			PurpleMediaCandidate *candidate = candidates->data;
 			id = jabber_get_next_id(jingle_session_get_js(session));
 			rawudp_candidate = jingle_rawudp_candidate_new(id,
 					generation, candidate->component_id,
@@ -206,14 +206,14 @@ jingle_rtp_candidates_to_transport(Jingl
 		JingleTransport *transport = jingle_transport_create(JINGLE_TRANSPORT_ICEUDP);
 		JingleIceUdpCandidate *iceudp_candidate;
 		for (; candidates; candidates = g_list_next(candidates)) {
-			FsCandidate *candidate = candidates->data;
+			PurpleMediaCandidate *candidate = candidates->data;
 			iceudp_candidate = jingle_iceudp_candidate_new(candidate->component_id,
 					candidate->foundation, generation, candidate->ip,
 					0, candidate->port, candidate->priority, "udp",
-					candidate->type == FS_CANDIDATE_TYPE_HOST ? "host" :
-					candidate->type == FS_CANDIDATE_TYPE_SRFLX ? "srflx" :
-					candidate->type == FS_CANDIDATE_TYPE_PRFLX ? "prflx" :
-					candidate->type == FS_CANDIDATE_TYPE_RELAY ? "relay" : "",
+					candidate->type == PURPLE_MEDIA_CANDIDATE_TYPE_HOST ? "host" :
+					candidate->type == PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX ? "srflx" :
+					candidate->type == PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX ? "prflx" :
+					candidate->type == PURPLE_MEDIA_CANDIDATE_TYPE_RELAY ? "relay" : "",
 					candidate->username, candidate->password);
 			jingle_iceudp_add_local_candidate(JINGLE_ICEUDP(transport), iceudp_candidate);
 		}
@@ -233,8 +233,10 @@ jingle_rtp_transport_to_candidates(Jingl
 
 		for (; candidates; candidates = g_list_delete_link(candidates, candidates)) {
 			JingleRawUdpCandidate *candidate = candidates->data;
-			ret = g_list_append(ret, fs_candidate_new("", candidate->component,
-					FS_CANDIDATE_TYPE_SRFLX, FS_NETWORK_PROTOCOL_UDP,
+			ret = g_list_append(ret, purple_media_candidate_new(
+					"", candidate->component,
+					PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX,
+					PURPLE_MEDIA_NETWORK_PROTOCOL_UDP,
 					candidate->ip, candidate->port));
 		}
 
@@ -244,17 +246,22 @@ jingle_rtp_transport_to_candidates(Jingl
 
 		for (; candidates; candidates = g_list_delete_link(candidates, candidates)) {
 			JingleIceUdpCandidate *candidate = candidates->data;
-			FsCandidate *fscandidate = fs_candidate_new(
+			PurpleMediaCandidate *new_candidate = purple_media_candidate_new(
 					candidate->foundation, candidate->component,
-					!strcmp(candidate->type, "host") ? FS_CANDIDATE_TYPE_HOST :
-					!strcmp(candidate->type, "srflx") ? FS_CANDIDATE_TYPE_SRFLX :
-					!strcmp(candidate->type, "prflx") ? FS_CANDIDATE_TYPE_PRFLX :
-					!strcmp(candidate->type, "relay") ? FS_CANDIDATE_TYPE_RELAY : 0,
-					FS_NETWORK_PROTOCOL_UDP, candidate->ip, candidate->port);
-			fscandidate->username = g_strdup(candidate->username);
-			fscandidate->password = g_strdup(candidate->password);
-			fscandidate->priority = candidate->priority;
-			ret = g_list_append(ret, fscandidate);
+					!strcmp(candidate->type, "host") ?
+					PURPLE_MEDIA_CANDIDATE_TYPE_HOST :
+					!strcmp(candidate->type, "srflx") ?
+					PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX :
+					!strcmp(candidate->type, "prflx") ?
+					PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX :
+					!strcmp(candidate->type, "relay") ?
+					PURPLE_MEDIA_CANDIDATE_TYPE_RELAY : 0,
+					PURPLE_MEDIA_NETWORK_PROTOCOL_UDP,
+					candidate->ip, candidate->port);
+			new_candidate->username = g_strdup(candidate->username);
+			new_candidate->password = g_strdup(candidate->password);
+			new_candidate->priority = candidate->priority;
+			ret = g_list_append(ret, new_candidate);
 		}
 
 		return ret;
@@ -264,7 +271,7 @@ static void
 }
 
 static void
-jingle_rtp_new_candidate_cb(PurpleMedia *media, gchar *sid, gchar *name, FsCandidate *candidate, JingleSession *session)
+jingle_rtp_new_candidate_cb(PurpleMedia *media, gchar *sid, gchar *name, PurpleMediaCandidate *candidate, JingleSession *session)
 {
 	purple_debug_info("jingle-rtp", "jingle_rtp_new_candidate_cb\n");
 }


More information about the Commits mailing list