/soc/2013/ankitkv/gobjectification: bdaa6ae19356: Merge default ...

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


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

Description:

Merge default branch (yet to add media_send_dtmf)

diffstat:

 configure.ac                                       |     23 +-
 finch/Makefile.am                                  |      1 +
 libpurple/Makefile.am                              |      2 +
 libpurple/data/purple-3.pc.in                      |      1 +
 libpurple/example/Makefile.am                      |      1 +
 libpurple/marshallers.list                         |      1 +
 libpurple/media-gst.h                              |      2 +
 libpurple/media.c                                  |     97 +
 libpurple/media.h                                  |     72 +-
 libpurple/media/backend-fs2.c                      |    283 +-
 libpurple/media/backend-iface.c                    |     42 +
 libpurple/media/backend-iface.h                    |     62 +
 libpurple/media/codec.c                            |      4 +-
 libpurple/media/enum-types.c                       |     18 +-
 libpurple/media/enum-types.h                       |     10 +-
 libpurple/mediamanager.c                           |    823 +-
 libpurple/mediamanager.h                           |    134 +
 libpurple/protocols/jabber/google/google_p2p.c     |      2 +-
 libpurple/protocols/jabber/google/google_session.c |      2 +-
 libpurple/protocols/mxit/profile.c                 |      2 +-
 pidgin/gtkdialogs.c                                |      7 +-
 pidgin/gtkmedia.c                                  |    138 +-
 po/br.po                                           |  20003 ++++++++++++++++++
 po/hy.po                                           |  20004 +++++++++++++++++++
 po/ms_MY.po                                        |  19975 ++++++++++++++++++
 share/ca-certs/Certum_Root_CA.pem                  |     19 +
 share/ca-certs/Certum_Trusted_Network_CA.pem       |     22 +
 share/ca-certs/Makefile.am                         |      2 +
 28 files changed, 61699 insertions(+), 53 deletions(-)

diffs (truncated from 62501 to 300 lines):

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -449,7 +449,7 @@ if test x$enable_i18n = xyes; then
 	GETTEXT_PACKAGE=pidgin
 	AC_SUBST(GETTEXT_PACKAGE)
 
-	ALL_LINGUAS="af am ar ast az be at latin bg bn bn_IN bs ca ca at valencia cs da de dz el en_AU en_CA en_GB eo es et eu fa fi fr ga gl gu he hi hr hu id it ja ka kk km kn ko ku ku_IQ lt lv mai mhr mk mn mr my_MM nb ne nl nn oc or pa pl pt_BR pt ps ro ru si sk sl sq sr sr at latin sv sw ta te th tr tt uk ur vi xh zh_CN zh_HK zh_TW"
+	ALL_LINGUAS="af am ar as ast az be at latin bg bn_IN bn br brx bs ca ca at valencia cs da de dz el en_AU en_CA en_GB eo es_AR es et eu fa fi fr ga gl gu he hi hr hu id it ja ka kk km kn ko ks ku_IQ ku lt lv mai mhr mk ml mn mr ms_MY my_MM nb ne nl nn oc or pa pl ps pt_BR pt ro ru sd si sk sl sq sr at latin sr sv sw ta te th tr tt uk ur uz vi xh zh_CN zh_HK zh_TW"
 	AM_GLIB_GNU_GETTEXT
 
 	dnl If we don't have msgfmt, then po/ is going to fail -- ensure that
@@ -1088,6 +1088,11 @@ elif test "x$with_gtk" == "x2" -a "x$wit
 	AC_MSG_ERROR([WebKitGTK+ 2.0 cannot be mixed with GStreamer 1.0.
 Please switch to WebKitGTK+ 3.0 or GStreamer 0.10.])
 fi
+if test "x$with_gstreamer" == "x0.10" -o "x$with_gstreamer" == "x1.0"; then
+	AC_SUBST(GSTREAMER_VER, [$with_gstreamer])
+else
+	AC_SUBST(GSTREAMER_VER, "")
+fi
 
 dnl #######################################################################
 dnl # Check for GStreamer Video
@@ -1137,7 +1142,7 @@ AC_ARG_ENABLE(farstream,
 	enable_farstream="$enableval", enable_farstream="yes")
 if test "x$enable_farstream" != "xno"; then
 	if test "x$with_gstreamer" == "x1.0"; then
-		PKG_CHECK_MODULES(FARSTREAM, [farstream-0.2], [
+		PKG_CHECK_MODULES(FARSTREAM, [farstream-0.2 >= 0.2.7], [
 			AC_SUBST(FARSTREAM_CFLAGS)
 			AC_SUBST(FARSTREAM_LIBS)
 		], [
@@ -1185,6 +1190,20 @@ fi
 AM_CONDITIONAL(USE_VV, test "x$enable_vv" != "xno")
 
 dnl #######################################################################
+dnl # Check for Raw data streams support in Farstream 
+dnl #######################################################################
+if test "x$enable_vv" != "xno" -a "x$with_gstreamer" == "x1.0"; then
+	AC_MSG_CHECKING(for raw data support in Farstream)
+	PKG_CHECK_MODULES(GSTAPP, [gstreamer-app-1.0], [
+		AC_DEFINE(USE_GSTAPP, 1, [Use GStreamer Video Overlay support])
+		AC_SUBST(GSTAPP_CFLAGS)
+		AC_SUBST(GSTAPP_LIBS)
+		AC_DEFINE(HAVE_MEDIA_APPLICATION, 1, [Define if we have support for application media type.])
+		AC_MSG_RESULT(yes)
+		], [AC_MSG_RESULT(no)])
+fi
+
+dnl #######################################################################
 dnl # Check for Internationalized Domain Name support
 dnl #######################################################################
 
diff --git a/finch/Makefile.am b/finch/Makefile.am
--- a/finch/Makefile.am
+++ b/finch/Makefile.am
@@ -82,6 +82,7 @@ libfinch_la_LIBADD = \
 	$(LIBXML_LIBS) \
 	$(GNT_LIBS) \
 	$(GSTREAMER_LIBS) \
+	$(GSTVIDEO_LIBS) \
 	$(INTROSPECTION_LIBS) \
 	./libgnt/libgnt.la \
 	$(top_builddir)/libpurple/libpurple.la
diff --git a/libpurple/Makefile.am b/libpurple/Makefile.am
--- a/libpurple/Makefile.am
+++ b/libpurple/Makefile.am
@@ -425,6 +425,7 @@ libpurple_la_LIBADD = \
 	$(FARSTREAM_LIBS) \
 	$(GSTREAMER_LIBS) \
 	$(GSTVIDEO_LIBS) \
+	$(GSTAPP_LIBS) \
 	$(GSTINTERFACES_LIBS) \
 	$(IDN_LIBS) \
 	$(JSON_LIBS) \
@@ -443,6 +444,7 @@ AM_CPPFLAGS = \
 	$(FARSTREAM_CFLAGS) \
 	$(GSTREAMER_CFLAGS) \
 	$(GSTVIDEO_CFLAGS) \
+	$(GSTAPP_CFLAGS) \
 	$(GSTINTERFACES_CFLAGS) \
 	$(IDN_CFLAGS) \
 	$(NETWORKMANAGER_CFLAGS) \
diff --git a/libpurple/data/purple-3.pc.in b/libpurple/data/purple-3.pc.in
--- a/libpurple/data/purple-3.pc.in
+++ b/libpurple/data/purple-3.pc.in
@@ -5,6 +5,7 @@ includedir=@includedir@/libpurple
 datarootdir=@datarootdir@
 datadir=@datadir@
 sysconfdir=@sysconfdir@
+gstreamer=@GSTREAMER_VER@
 
 plugindir=${libdir}/purple- at PURPLE_MAJOR_VERSION@
 
diff --git a/libpurple/example/Makefile.am b/libpurple/example/Makefile.am
--- a/libpurple/example/Makefile.am
+++ b/libpurple/example/Makefile.am
@@ -9,6 +9,7 @@ nullclient_LDADD = \
 	$(GLIB_LIBS) \
 	$(GPLUGIN_LIBS) \
 	$(LIBXML_LIBS) \
+	$(GSTVIDEO_LIBS) \
 	$(top_builddir)/libpurple/libpurple.la
 
 AM_CPPFLAGS = \
diff --git a/libpurple/marshallers.list b/libpurple/marshallers.list
--- a/libpurple/marshallers.list
+++ b/libpurple/marshallers.list
@@ -7,3 +7,4 @@ VOID:ENUM,STRING,STRING,BOOLEAN
 VOID:FLAGS,FLAGS
 VOID:STRING,STRING,OBJECT,OBJECT
 BOOLEAN:OBJECT
+VOID:POINTER,POINTER,OBJECT,OBJECT
diff --git a/libpurple/media-gst.h b/libpurple/media-gst.h
--- a/libpurple/media-gst.h
+++ b/libpurple/media-gst.h
@@ -71,6 +71,7 @@ typedef GstElement *(*PurpleMediaElement
  *                                     time
  * @PURPLE_MEDIA_ELEMENT_SRC:          can be set as an active src
  * @PURPLE_MEDIA_ELEMENT_SINK:         can be set as an active sink
+ * @PURPLE_MEDIA_ELEMENT_APPLICATION:  supports application data
  */
 typedef enum {
 	PURPLE_MEDIA_ELEMENT_NONE = 0,
@@ -89,6 +90,7 @@ typedef enum {
 	PURPLE_MEDIA_ELEMENT_UNIQUE = 1 << 8,
 	PURPLE_MEDIA_ELEMENT_SRC = 1 << 9,
 	PURPLE_MEDIA_ELEMENT_SINK = 1 << 10,
+	PURPLE_MEDIA_ELEMENT_APPLICATION = 1 << 11,
 } PurpleMediaElementType;
 
 G_BEGIN_DECLS
diff --git a/libpurple/media.c b/libpurple/media.c
--- a/libpurple/media.c
+++ b/libpurple/media.c
@@ -119,6 +119,7 @@ enum {
 	NEW_CANDIDATE,
 	STATE_CHANGED,
 	STREAM_INFO,
+	CANDIDATE_PAIR_ESTABLISHED,
 	LAST_SIGNAL
 };
 static guint purple_media_signals[LAST_SIGNAL] = {0};
@@ -255,6 +256,11 @@ purple_media_class_init (PurpleMediaClas
 					 purple_smarshal_VOID__ENUM_STRING_STRING_BOOLEAN,
 					 G_TYPE_NONE, 4, PURPLE_MEDIA_TYPE_INFO_TYPE,
 					 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
+	purple_media_signals[CANDIDATE_PAIR_ESTABLISHED] = g_signal_new("candidate-pair-established", G_TYPE_FROM_CLASS(klass),
+					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+					 purple_smarshal_VOID__POINTER_POINTER_OBJECT_OBJECT,
+					 G_TYPE_NONE, 4, G_TYPE_POINTER, G_TYPE_POINTER,
+					 PURPLE_TYPE_MEDIA_CANDIDATE, PURPLE_TYPE_MEDIA_CANDIDATE);
 	g_type_class_add_private(klass, sizeof(PurpleMediaPrivate));
 }
 
@@ -1029,6 +1035,8 @@ purple_media_candidate_pair_established_
 				purple_media_candidate_copy(
 				remote_candidate));
 
+	g_signal_emit(media, purple_media_signals[CANDIDATE_PAIR_ESTABLISHED],
+		0, sess_id, name, local_candidate, remote_candidate);
 	purple_debug_info("media", "candidate pair established\n");
 }
 
@@ -1257,6 +1265,34 @@ purple_media_set_send_codec(PurpleMedia 
 }
 
 gboolean
+purple_media_set_encryption_parameters(PurpleMedia *media, const gchar *sess_id,
+		const gchar *cipher, const gchar *auth,
+		const gchar *key, gsize key_len)
+{
+#ifdef USE_VV
+	g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE);
+	return purple_media_backend_set_encryption_parameters(media->priv->backend,
+			sess_id, cipher, auth, key, key_len);
+#else
+	return FALSE;
+#endif
+}
+
+gboolean
+purple_media_set_decryption_parameters(PurpleMedia *media, const gchar *sess_id,
+		const gchar *participant, const gchar *cipher,
+		const gchar *auth, const gchar *key, gsize key_len)
+{
+#ifdef USE_VV
+	g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE);
+	return purple_media_backend_set_decryption_parameters(media->priv->backend,
+			sess_id, participant, cipher, auth, key, key_len);
+#else
+	return FALSE;
+#endif
+}
+
+gboolean
 purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id)
 {
 #ifdef USE_VV
@@ -1270,6 +1306,20 @@ purple_media_codecs_ready(PurpleMedia *m
 }
 
 gboolean
+purple_media_set_send_rtcp_mux(PurpleMedia *media, const gchar *sess_id,
+                               const gchar *participant, gboolean send_rtcp_mux)
+{
+#ifdef USE_VV
+	g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE);
+
+	return purple_media_backend_set_send_rtcp_mux(media->priv->backend,
+			sess_id, participant, send_rtcp_mux);
+#else
+	return FALSE;
+#endif
+}
+
+gboolean
 purple_media_is_initiator(PurpleMedia *media,
 		const gchar *sess_id, const gchar *participant)
 {
@@ -1420,3 +1470,50 @@ purple_media_get_tee(PurpleMedia *media,
 }
 #endif /* USE_GSTREAMER */
 
+gboolean
+purple_media_send_dtmf(PurpleMedia *media, const gchar *session_id,
+		gchar dtmf, guint8 volume, guint16 duration)
+{
+#ifdef USE_VV
+	PurpleAccount *account = NULL;
+	PurpleConnection *gc = NULL;
+	PurplePlugin *prpl = NULL;
+	PurplePluginProtocolInfo *prpl_info = NULL;
+	PurpleMediaBackendIface *backend_iface = NULL;
+
+	if (media)
+	{
+		account = purple_media_get_account(media);
+		backend_iface = PURPLE_MEDIA_BACKEND_GET_INTERFACE(media->priv->backend);
+	}
+	if (account)
+		gc = purple_account_get_connection(account);
+	if (gc)
+		prpl = purple_connection_get_prpl(gc);
+	if (prpl)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
+
+	if (dtmf == 'a')
+		dtmf = 'A';
+	else if (dtmf == 'b')
+		dtmf = 'B';
+	else if (dtmf == 'c')
+		dtmf = 'C';
+	else if (dtmf == 'd')
+		dtmf = 'D';
+
+	g_return_val_if_fail(strchr("0123456789ABCD#*", dtmf), FALSE);
+
+	if (prpl_info && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, media_send_dtmf)
+		&& prpl_info->media_send_dtmf(media, dtmf, volume, duration))
+	{
+		return TRUE;
+	} else if (backend_iface && backend_iface->send_dtmf
+		&& backend_iface->send_dtmf(media->priv->backend,
+				session_id, dtmf, volume, duration))
+	{
+		return TRUE;
+	}
+#endif
+	return FALSE;
+}
diff --git a/libpurple/media.h b/libpurple/media.h
--- a/libpurple/media.h
+++ b/libpurple/media.h
@@ -31,6 +31,8 @@
 #include <glib.h>
 #include <glib-object.h>
 
+typedef struct _PurpleMedia PurpleMedia;
+
 #include "media/candidate.h"
 #include "media/codec.h"
 #include "media/enum-types.h"
@@ -42,8 +44,6 @@
 #define PURPLE_IS_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA))
 #define PURPLE_MEDIA_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA, PurpleMediaClass))
 
-typedef struct _PurpleMedia PurpleMedia;
-
 #include "signals.h"
 #include "util.h"
 
@@ -324,10 +324,10 @@ GList *purple_media_get_active_remote_ca
  * purple_media_set_remote_codecs:
  * @media: The media object to find the session in.
  * @sess_id: The session id of the session find the stream in.
- * @participant: The name of the remote user to set the candidates from.
+ * @participant: The name of the remote user to set the codecs for.
  * @codecs: The list of remote codecs to set.



More information about the Commits mailing list