/soc/2013/ankitkv/gobjectification: aea7e3b20138: Added send_dtm...

Ankit Vani a at nevitus.org
Fri Apr 10 04:01:37 EDT 2015


Changeset: aea7e3b20138e9daa75e1f30dc1629eafafac994
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2015-04-10 13:30 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/aea7e3b20138

Description:

Added send_dtmf to protocol media interface

diffstat:

 libpurple/media/enum-types.c        |  6 +++---
 libpurple/protocol.c                |  7 +++++++
 libpurple/protocol.h                |  9 +++++++++
 libpurple/protocols/jabber/jabber.c |  4 ++++
 4 files changed, 23 insertions(+), 3 deletions(-)

diffs (95 lines):

diff --git a/libpurple/media/enum-types.c b/libpurple/media/enum-types.c
--- a/libpurple/media/enum-types.c
+++ b/libpurple/media/enum-types.c
@@ -142,13 +142,13 @@ purple_media_network_protocol_get_type()
 					"udp" },
 			{ PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_PASSIVE,
 					"PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_PASSIVE",
-					"tcp passive" },
+					"tcp-passive" },
 			{ PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_ACTIVE,
 					"PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_ACTIVE",
-					"tcp active" },
+					"tcp-active" },
 			{ PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_SO,
 					"PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_SO",
-					"tcp so" },
+					"tcp-so" },
 			{ 0, NULL, NULL }
 		};
 		type = g_enum_register_static("PurpleMediaNetworkProtocol",
diff --git a/libpurple/protocol.c b/libpurple/protocol.c
--- a/libpurple/protocol.c
+++ b/libpurple/protocol.c
@@ -1018,6 +1018,13 @@ purple_protocol_media_iface_get_caps(Pur
 	DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, 0, get_caps, account, who);
 }
 
+gboolean purple_protocol_media_iface_send_dtmf(PurpleProtocol *protocol,
+		PurpleMedia *media, gchar dtmf, guint8 volume, guint8 duration)
+{
+	DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, FALSE, send_dtmf, media,
+			dtmf, volume, duration);
+}
+
 #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN
 #undef DEFINE_PROTOCOL_FUNC
 
diff --git a/libpurple/protocol.h b/libpurple/protocol.h
--- a/libpurple/protocol.h
+++ b/libpurple/protocol.h
@@ -659,6 +659,9 @@ typedef struct _PurpleProtocolMediaIface
  *            <sbr/>@account: The account the contact is on.
  *            <sbr/>@who: The remote user to check for media capability with.
  *            <sbr/>Returns: The media caps the contact supports.
+ * @send_dtmf: Sends DTMF codes out-of-band in a protocol-specific way if the
+ *             protocol supports it, or failing that in-band if the media backend
+ *             can do so. See purple_media_send_dtmf().
  *
  * The protocol media interface.
  *
@@ -675,6 +678,9 @@ struct _PurpleProtocolMediaIface
 
 	PurpleMediaCaps (*get_caps)(PurpleAccount *account,
 					  const char *who);
+
+	gboolean (*send_dtmf)(PurpleMedia *media, gchar dtmf,
+				    guint8 volume, guint8 duration);
 };
 
 #define PURPLE_PROTOCOL_HAS_MEDIA_IFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_PROTOCOL_MEDIA_IFACE))
@@ -1149,6 +1155,9 @@ gboolean purple_protocol_media_iface_ini
 PurpleMediaCaps purple_protocol_media_iface_get_caps(PurpleProtocol *,
 		PurpleAccount *account, const char *who);
 
+gboolean purple_protocol_media_iface_send_dtmf(PurpleProtocol *,
+		PurpleMedia *media, gchar dtmf, guint8 volume, guint8 duration);
+
 /**************************************************************************/
 /* Protocol Factory Interface API                                         */
 /**************************************************************************/
diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -73,9 +73,11 @@
 #include "facebook.h"
 
 #include "jingle/jingle.h"
+#include "jingle/content.h"
 #include "jingle/iceudp.h"
 #include "jingle/rawudp.h"
 #include "jingle/rtp.h"
+#include "jingle/session.h"
 
 #define PING_TIMEOUT 60
 /* Send a whitespace keepalive to the server if we haven't sent
@@ -4315,7 +4317,9 @@ plugin_load(PurplePlugin *plugin, GError
 	jingle_google_p2p_register_type(plugin);
 
 	jingle_content_register_type(plugin);
+#ifdef USE_VV
 	jingle_rtp_register_type(plugin);
+#endif
 
 	jabber_protocol_register_type(plugin);
 



More information about the Commits mailing list