comparison 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
comparison
equal deleted inserted replaced
26013:5a774d0817d8 26014:bd598b606ca4
54 #include "ping.h" 54 #include "ping.h"
55 #include "si.h" 55 #include "si.h"
56 #include "xdata.h" 56 #include "xdata.h"
57 #include "pep.h" 57 #include "pep.h"
58 #include "adhoccommands.h" 58 #include "adhoccommands.h"
59 #include "jingle.h" 59
60 #include "jingle/jingle.h"
61 #include "jingle/rtp.h"
60 62
61 #ifdef USE_VV 63 #ifdef USE_VV
62 #include <gst/farsight/fs-conference-iface.h> 64 #include <gst/farsight/fs-conference-iface.h>
63 65
64 #define XEP_0167_AUDIO_CAP "urn:xmpp:tmp:jingle:apps:rtp#audio"
65 #define XEP_0167_VIDEO_CAP "urn:xmpp:tmp:jingle:apps:rtp#video"
66 #define GTALK_CAP "http://www.google.com/session/phone" 66 #define GTALK_CAP "http://www.google.com/session/phone"
67 67
68 #endif 68 #endif
69 69
70 #define JABBER_CONNECT_STEPS (js->gsc ? 9 : 5) 70 #define JABBER_CONNECT_STEPS (js->gsc ? 9 : 5)
1283 { 1283 {
1284 JabberStream *js = gc->proto_data; 1284 JabberStream *js = gc->proto_data;
1285 1285
1286 #ifdef USE_VV 1286 #ifdef USE_VV
1287 /* Close all of the open Jingle sessions on this stream */ 1287 /* Close all of the open Jingle sessions on this stream */
1288 jabber_jingle_session_terminate_sessions(js); 1288 jingle_terminate_sessions(js);
1289 #endif 1289 #endif
1290 1290
1291 /* Don't perform any actions on the ssl connection 1291 /* Don't perform any actions on the ssl connection
1292 * if we were forcibly disconnected because it will crash 1292 * if we were forcibly disconnected because it will crash
1293 * on some SSL backends. 1293 * on some SSL backends.
1921 1921
1922 if(!(jid = jabber_id_new(who))) 1922 if(!(jid = jabber_id_new(who)))
1923 return; 1923 return;
1924 1924
1925 #ifdef USE_VV 1925 #ifdef USE_VV
1926 jabber_jingle_session_terminate_session_media(js, who); 1926 jingle_rtp_terminate_session(js, who);
1927 #endif 1927 #endif
1928 if((jb = jabber_buddy_find(js, who, TRUE)) && 1928 if((jb = jabber_buddy_find(js, who, TRUE)) &&
1929 (jbr = jabber_buddy_find_resource(jb, jid->resource))) { 1929 (jbr = jabber_buddy_find_resource(jb, jid->resource))) {
1930 if(jbr->thread_id) { 1930 if(jbr->thread_id) {
1931 g_free(jbr->thread_id); 1931 g_free(jbr->thread_id);
2406 2406
2407 PurpleMedia * 2407 PurpleMedia *
2408 jabber_initiate_media(PurpleConnection *gc, const char *who, 2408 jabber_initiate_media(PurpleConnection *gc, const char *who,
2409 PurpleMediaSessionType type) 2409 PurpleMediaSessionType type)
2410 { 2410 {
2411 return jabber_jingle_session_initiate_media(gc->proto_data, who, type); 2411 return jingle_rtp_initiate_media(gc->proto_data, who, type);
2412 } 2412 }
2413 2413
2414 gboolean jabber_can_do_media(PurpleConnection *gc, const char *who, 2414 gboolean jabber_can_do_media(PurpleConnection *gc, const char *who,
2415 PurpleMediaSessionType type) 2415 PurpleMediaSessionType type)
2416 { 2416 {
2430 } 2430 }
2431 /* XMPP will only support two-way media, AFAIK... */ 2431 /* XMPP will only support two-way media, AFAIK... */
2432 if (type == (PURPLE_MEDIA_AUDIO | PURPLE_MEDIA_VIDEO)) { 2432 if (type == (PURPLE_MEDIA_AUDIO | PURPLE_MEDIA_VIDEO)) {
2433 purple_debug_info("jabber", 2433 purple_debug_info("jabber",
2434 "Checking audio/video XEP support for %s\n", who); 2434 "Checking audio/video XEP support for %s\n", who);
2435 return (jabber_buddy_has_capability(jb, XEP_0167_AUDIO_CAP) || 2435 return (jabber_buddy_has_capability(jb, JINGLE_APP_RTP_SUPPORT_AUDIO) ||
2436 jabber_buddy_has_capability(jb, GTALK_CAP)) && 2436 jabber_buddy_has_capability(jb, GTALK_CAP)) &&
2437 jabber_buddy_has_capability(jb, XEP_0167_VIDEO_CAP); 2437 jabber_buddy_has_capability(jb, JINGLE_APP_RTP_SUPPORT_VIDEO);
2438 } else if (type == (PURPLE_MEDIA_AUDIO)) { 2438 } else if (type == (PURPLE_MEDIA_AUDIO)) {
2439 purple_debug_info("jabber", 2439 purple_debug_info("jabber",
2440 "Checking audio XEP support for %s\n", who); 2440 "Checking audio XEP support for %s\n", who);
2441 return jabber_buddy_has_capability(jb, XEP_0167_AUDIO_CAP) || 2441 return jabber_buddy_has_capability(jb, JINGLE_APP_RTP_SUPPORT_AUDIO) ||
2442 jabber_buddy_has_capability(jb, GTALK_CAP); 2442 jabber_buddy_has_capability(jb, GTALK_CAP);
2443 } else if (type == (PURPLE_MEDIA_VIDEO)) { 2443 } else if (type == (PURPLE_MEDIA_VIDEO)) {
2444 purple_debug_info("jabber", 2444 purple_debug_info("jabber",
2445 "Checking video XEP support for %s\n", who); 2445 "Checking video XEP support for %s\n", who);
2446 return jabber_buddy_has_capability(jb, XEP_0167_VIDEO_CAP); 2446 return jabber_buddy_has_capability(jb, JINGLE_APP_RTP_SUPPORT_VIDEO);
2447 } 2447 }
2448 2448
2449 return FALSE; 2449 return FALSE;
2450 } 2450 }
2451 2451