cpw.darkrain42.xmpp.bosh: 536d6ae9: Advertise ICEUDP only when libnice is av...

paul at darkrain42.org paul at darkrain42.org
Sat Apr 4 02:21:02 EDT 2009


-----------------------------------------------------------------
Revision: 536d6ae921253bbffab25aa51ce9bdcb1f0e20ec
Ancestor: 594f6978ee0c7e63362aacb42ad4468135eef80c
Author: paul at darkrain42.org
Date: 2009-04-04T06:15:58
Branch: im.pidgin.cpw.darkrain42.xmpp.bosh
URL: http://d.pidgin.im/viewmtn/revision/info/536d6ae921253bbffab25aa51ce9bdcb1f0e20ec

Modified files:
        libpurple/media.c libpurple/media.h
        libpurple/protocols/jabber/jabber.c

ChangeLog: 

Advertise ICEUDP only when libnice is available

-------------- next part --------------
============================================================
--- libpurple/media.c	a524e919d4dac7fad86ab5a802547bb495c50afc
+++ libpurple/media.c	fdc339bd8077e41be932bd2346f68d26f8414448
@@ -40,6 +40,7 @@
 #ifdef USE_VV
 
 #include <gst/farsight/fs-conference-iface.h>
+#include <gst/farsight/fs-transmitter.h>
 
 /** @copydoc _PurpleMediaSession */
 typedef struct _PurpleMediaSession PurpleMediaSession;
@@ -3057,3 +3058,26 @@ purple_media_get_tee(PurpleMedia *media,
 #endif
 }
 
+gboolean
+purple_media_transmitter_exists(const gchar *transmitter)
+{
+#ifdef USE_VV
+	char **transmitters;
+	int i;
+
+	g_return_val_if_fail(transmitter != NULL, FALSE);
+
+	transmitters = fs_transmitter_list_available();
+	for (i = 0; transmitters[i]; ++i) {
+		if (g_str_equal(transmitter, transmitters[i])) {
+			g_strfreev(transmitters);
+			return TRUE;
+		}
+	}
+
+	g_strfreev(transmitters);
+	return FALSE;
+#else
+	return FALSE;
+#endif
+}
============================================================
--- libpurple/media.h	88c150dedb77fef28614b9eeb7102e17ee92d402
+++ libpurple/media.h	8abf48fd8ebdc48a04e425f4fcc5c0ca9f204c81
@@ -597,6 +597,15 @@ void purple_media_remove_output_windows(
  */
 void purple_media_remove_output_windows(PurpleMedia *media);
 
+/**
+ * Returns whether or not a specific transmitter type is present.
+ *
+ * @param transmitter The name of the transmitter.
+ *
+ * @return TRUE if it is present, FALSE otherwise.
+ */
+gboolean purple_media_transmitter_exists(const gchar *transmitter);
+
 #ifdef __cplusplus
 }
 #endif
============================================================
--- libpurple/protocols/jabber/jabber.c	4f96c10e8c4fb4cbb55198e8d06b1a01260939b5
+++ libpurple/protocols/jabber/jabber.c	c857e68a013293f28535b7577b775faab6ab715e
@@ -2748,6 +2748,12 @@ feature_video_enabled(JabberStream *js, 
 	return (caps & (PURPLE_MEDIA_CAPS_VIDEO | PURPLE_MEDIA_CAPS_VIDEO_SINGLE_DIRECTION));
 }
 
+static gboolean
+feature_ice_transmitter_present(JabberStream *js, const char *namespace)
+{
+	return purple_media_transmitter_exists("nice");
+}
+
 typedef struct {
 	PurpleConnection *pc;
 	gchar *who;
@@ -3181,12 +3187,13 @@ jabber_init_plugin(PurplePlugin *plugin)
 	/* Jingle features! */
 	jabber_add_feature(JINGLE, 0);
 	jabber_add_feature(JINGLE_TRANSPORT_RAWUDP, 0);
-	jabber_add_feature(JINGLE_TRANSPORT_ICEUDP, 0);
+
 #ifdef USE_VV
 	jabber_add_feature("http://www.google.com/xmpp/protocol/session", feature_audio_enabled);
 	jabber_add_feature("http://www.google.com/xmpp/protocol/voice/v1", feature_audio_enabled);
 	jabber_add_feature(JINGLE_APP_RTP_SUPPORT_AUDIO, feature_audio_enabled);
 	jabber_add_feature(JINGLE_APP_RTP_SUPPORT_VIDEO, feature_video_enabled);
+	jabber_add_feature(JINGLE_TRANSPORT_ICEUDP, feature_ice_transmitter_present);
 #endif
 
 	/* IPC functions */


More information about the Commits mailing list