changeset 24964:0101d6e97f12

Very basic receive only GTalk audio sessions.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Sun, 16 Nov 2008 06:21:31 +0000
parents 33fa549f2399
children 70ae1029bb70
files libpurple/protocols/jabber/google.c
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/google.c	Sun Nov 16 05:22:17 2008 +0000
+++ b/libpurple/protocols/jabber/google.c	Sun Nov 16 06:21:31 2008 +0000
@@ -157,7 +157,8 @@
 
 
 static void 
-google_session_candidates_prepared (PurpleMedia *media, GoogleSession *session)
+google_session_candidates_prepared (PurpleMedia *media, gchar *session_id,
+		gchar *participant, GoogleSession *session)
 {
 	JabberIq *iq = jabber_iq_new(session->js, JABBER_IQ_SET);
 	GList *candidates = purple_media_get_local_candidates(session->media, "google-voice",
@@ -208,6 +209,7 @@
 	xmlnode *desc_element, *codec_element;
 	FsCodec *codec;
 	const char *id, *encoding_name,  *clock_rate;
+	GParameter param;
 		
 	if (session->state != UNINIT) {
 		purple_debug_error("jabber", "Received initiate for active session.\n");
@@ -217,10 +219,14 @@
 	session->media = purple_media_manager_create_media(purple_media_manager_get(), js->gc,
 							   "fsrtpconference", session->remote_jid);
 
-	/* "rawudp" will need to be changed to "nice" when libnice is finished */
-	/* GTalk will require the NICE_COMPATIBILITY_GOOGLE param */
+	/* GTalk requires the NICE_COMPATIBILITY_GOOGLE param */
+	param.name = "compatibility-mode";
+	memset(&param.value, 0, sizeof(GValue));
+	g_value_init(&param.value, G_TYPE_UINT);
+	g_value_set_uint(&param.value, 1); /* NICE_COMPATIBILITY_GOOGLE */
+
 	purple_media_add_stream(session->media, "google-voice", session->remote_jid, 
-				PURPLE_MEDIA_AUDIO, "rawudp", 0, NULL);
+				PURPLE_MEDIA_AUDIO, "nice", 1, &param);
 
 	desc_element = xmlnode_get_child(sess, "description");