diff libpurple/protocols/jabber/jabber.c @ 26014:bd598b606ca4

Restructure Jingle code to more easily support multiple application types. Actually negotiate a rawudp transport rather than pretending to use iceudp.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Sun, 19 Oct 2008 04:37:23 +0000
parents e22bcca9f2b2
children 8bfa1f01f035
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Fri Sep 05 02:18:15 2008 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Sun Oct 19 04:37:23 2008 +0000
@@ -56,13 +56,13 @@
 #include "xdata.h"
 #include "pep.h"
 #include "adhoccommands.h"
-#include "jingle.h"
+
+#include "jingle/jingle.h"
+#include "jingle/rtp.h"
 
 #ifdef USE_VV
 #include <gst/farsight/fs-conference-iface.h>
 
-#define XEP_0167_AUDIO_CAP "urn:xmpp:tmp:jingle:apps:rtp#audio"
-#define XEP_0167_VIDEO_CAP "urn:xmpp:tmp:jingle:apps:rtp#video"
 #define GTALK_CAP "http://www.google.com/session/phone"
 
 #endif
@@ -1285,7 +1285,7 @@
 
 #ifdef USE_VV
 	/* Close all of the open Jingle sessions on this stream */
-	jabber_jingle_session_terminate_sessions(js);
+	jingle_terminate_sessions(js);
 #endif
 
 	/* Don't perform any actions on the ssl connection
@@ -1923,7 +1923,7 @@
 		return;
 
 #ifdef USE_VV
-	jabber_jingle_session_terminate_session_media(js, who);
+	jingle_rtp_terminate_session(js, who);
 #endif
 	if((jb = jabber_buddy_find(js, who, TRUE)) &&
 			(jbr = jabber_buddy_find_resource(jb, jid->resource))) {
@@ -2408,7 +2408,7 @@
 jabber_initiate_media(PurpleConnection *gc, const char *who, 
 		      PurpleMediaSessionType type)
 {
-	return jabber_jingle_session_initiate_media(gc->proto_data, who, type);
+	return jingle_rtp_initiate_media(gc->proto_data, who, type);
 }
 
 gboolean jabber_can_do_media(PurpleConnection *gc, const char *who, 
@@ -2432,18 +2432,18 @@
 	if (type == (PURPLE_MEDIA_AUDIO | PURPLE_MEDIA_VIDEO)) {
 		purple_debug_info("jabber", 
 				  "Checking audio/video XEP support for %s\n", who);
-		return (jabber_buddy_has_capability(jb, XEP_0167_AUDIO_CAP) ||
+		return (jabber_buddy_has_capability(jb, JINGLE_APP_RTP_SUPPORT_AUDIO) ||
 				jabber_buddy_has_capability(jb, GTALK_CAP)) && 
-				jabber_buddy_has_capability(jb, XEP_0167_VIDEO_CAP);
+				jabber_buddy_has_capability(jb, JINGLE_APP_RTP_SUPPORT_VIDEO);
 	} else if (type == (PURPLE_MEDIA_AUDIO)) {
 		purple_debug_info("jabber", 
 				  "Checking audio XEP support for %s\n", who);
-		return jabber_buddy_has_capability(jb, XEP_0167_AUDIO_CAP) ||
+		return jabber_buddy_has_capability(jb, JINGLE_APP_RTP_SUPPORT_AUDIO) ||
 				jabber_buddy_has_capability(jb, GTALK_CAP);
 	} else if (type == (PURPLE_MEDIA_VIDEO)) {
 		purple_debug_info("jabber", 
 				  "Checking video XEP support for %s\n", who);
-		return jabber_buddy_has_capability(jb, XEP_0167_VIDEO_CAP);
+		return jabber_buddy_has_capability(jb, JINGLE_APP_RTP_SUPPORT_VIDEO);
 	}
 
 	return FALSE;