diff libpurple/media/backend-fs2.c @ 29162:74e75fc3481e

Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
author maiku@pidgin.im
date Mon, 26 Oct 2009 17:39:38 +0000
parents cc978a1a4bd1
children 1fdc75c94c22
line wrap: on
line diff
--- a/libpurple/media/backend-fs2.c	Fri Oct 23 23:12:57 2009 +0000
+++ b/libpurple/media/backend-fs2.c	Mon Oct 26 17:39:38 2009 +0000
@@ -574,9 +574,10 @@
 		FsStream *stream;
 		FsCandidate *local_candidate;
 		FsCandidate *remote_candidate;
-#if 0
-		PurpleMediaSession *session;
-#endif
+		FsParticipant *participant;
+		PurpleMediaBackendFs2Session *session;
+		PurpleMediaCandidate *lcandidate, *rcandidate;
+		gchar *name;
 
 		value = gst_structure_get_value(msg->structure, "stream");
 		stream = g_value_get_object(value);
@@ -586,11 +587,21 @@
 		value = gst_structure_get_value(msg->structure,
 				"remote-candidate");
 		remote_candidate = g_value_get_boxed(value);
-#if 0
-		session = purple_media_session_from_fs_stream(media, stream);
-		_candidate_pair_established_cb(stream, local_candidate,
-				remote_candidate, session);
-#endif
+
+		g_object_get(stream, "participant", &participant, NULL);
+		g_object_get(participant, "cname", &name, NULL);
+		g_object_unref(participant);
+
+		session = _get_session_from_fs_stream(self, stream);
+
+		lcandidate = purple_media_candidate_from_fs(local_candidate);
+		rcandidate = purple_media_candidate_from_fs(remote_candidate);
+
+		g_signal_emit_by_name(self, "active-candidate-pair",
+				session->id, name, lcandidate, rcandidate);
+
+		g_object_unref(lcandidate);
+		g_object_unref(rcandidate);
 	} else if (gst_structure_has_name(msg->structure,
 			"farsight-recv-codecs-changed")) {
 		const GValue *value;