/pidgin/main: a62fd4bd935f: media: Send a signal when a candidat...

Youness Alaoui kakaroto at kakaroto.homelinux.net
Fri Mar 13 08:59:51 EDT 2015


Changeset: a62fd4bd935f575341759dc677a9690dd8a21654
Author:	 Youness Alaoui <kakaroto at kakaroto.homelinux.net>
Date:	 2014-08-05 19:23 -0400
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/a62fd4bd935f

Description:

media: Send a signal when a candidate pair is established

This will be used for calling purple_media_set_send_rtcp_mux() where
appropriate.

diffstat:

 libpurple/marshallers.list |  1 +
 libpurple/media.c          |  8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diffs (40 lines):

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.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");
 }
 



More information about the Commits mailing list