pidgin.vv: bf07e625: Implement jingle_rtp_candidates_prepared...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Thu Mar 19 08:50:46 EDT 2009


-----------------------------------------------------------------
Revision: bf07e6251df10e4c8c39545c4ff401db5b447c37
Ancestor: cfe931468e3dd34ffe4c1d9368d4da9b8dbc2413
Author: maiku at soc.pidgin.im
Date: 2009-03-19T09:46:37
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/bf07e6251df10e4c8c39545c4ff401db5b447c37

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

ChangeLog: 

Implement jingle_rtp_candidates_prepared_cb.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/rtp.c	3cb148ddc4b12ca143e58d171a73259186bfe5a9
+++ libpurple/protocols/jabber/jingle/rtp.c	be3d1719ba9e5f45c9210b254e0fc1762f570a47
@@ -343,9 +343,38 @@ static void
 }
 
 static void
-jingle_rtp_candidates_prepared_cb(PurpleMedia *media, gchar *sid, gchar *name)
+jingle_rtp_candidates_prepared_cb(PurpleMedia *media,
+		gchar *sid, gchar *name, JingleSession *session)
 {
+	JingleContent *content = jingle_session_find_content(
+			session, sid, "initiator");
+	JingleTransport *oldtransport, *transport;
+	GList *candidates;
+
 	purple_debug_info("jingle-rtp", "jingle_rtp_candidates_prepared_cb\n");
+
+	if (content == NULL)
+		jingle_session_find_content(session, sid, "responder");
+
+	if (content == NULL) {
+		purple_debug_error("jingle-rtp",
+				"jingle_rtp_candidates_prepared_cb: "
+				"Can't find session %s\n", sid);
+		return;
+	}
+
+	oldtransport = jingle_content_get_transport(content);
+	candidates = purple_media_get_local_candidates(media, sid, name);
+	transport = JINGLE_TRANSPORT(jingle_rtp_candidates_to_transport(
+			session, JINGLE_IS_RAWUDP(oldtransport) ?
+				JINGLE_TYPE_RAWUDP : JINGLE_TYPE_ICEUDP,
+			0, candidates));
+
+	g_list_free(candidates);
+	g_object_unref(oldtransport);
+
+	jingle_content_set_pending_transport(content, transport);
+	jingle_content_accept_transport(content);
 }
 
 static void
@@ -425,20 +454,6 @@ jingle_rtp_ready_cb(PurpleMedia *media, 
 			g_signal_connect(G_OBJECT(media), "new-candidate",
 					 G_CALLBACK(jingle_rtp_new_candidate_cb), session);
 		}
-	} else if (sid != NULL && name != NULL) {
-		JingleContent *content = jingle_session_find_content(session, sid, "initiator");
-		JingleTransport *oldtransport = jingle_content_get_transport(content);
-		GList *candidates = purple_media_get_local_candidates(media, sid, name);
-		JingleTransport *transport =
-				JINGLE_TRANSPORT(jingle_rtp_candidates_to_transport(
-				session, JINGLE_IS_RAWUDP(oldtransport) ?
-					JINGLE_TYPE_RAWUDP : JINGLE_TYPE_ICEUDP,
-				0, candidates));
-		g_list_free(candidates);
-		g_object_unref(oldtransport);
-
-		jingle_content_set_pending_transport(content, transport);
-		jingle_content_accept_transport(content);
 	}
 }
 


More information about the Commits mailing list