changeset 26298:b892b3cb9dbc

Add candidates-prepared signal to PurpleMedia.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Thu, 19 Mar 2009 09:30:16 +0000
parents 55c77c8e75cf
children d784e9ea7f50
files libpurple/media.c libpurple/protocols/jabber/jingle/rtp.c
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media.c	Thu Mar 19 09:06:54 2009 +0000
+++ b/libpurple/media.c	Thu Mar 19 09:30:16 2009 +0000
@@ -126,6 +126,7 @@
 enum {
 	ERROR,
 	ACCEPTED,
+	CANDIDATES_PREPARED,
 	CODECS_CHANGED,
 	NEW_CANDIDATE,
 	READY_NEW,
@@ -234,6 +235,11 @@
 					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
 					 purple_smarshal_VOID__STRING_STRING,
 					 G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING);
+	purple_media_signals[CANDIDATES_PREPARED] = g_signal_new("candidates-prepared", G_TYPE_FROM_CLASS(klass),
+					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+					 purple_smarshal_VOID__STRING_STRING,
+					 G_TYPE_NONE, 2, G_TYPE_STRING,
+					 G_TYPE_STRING);
 	purple_media_signals[CODECS_CHANGED] = g_signal_new("codecs-changed", G_TYPE_FROM_CLASS(klass),
 					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
 					 g_cclosure_marshal_VOID__STRING,
@@ -1724,6 +1730,10 @@
 	stream_data = purple_media_get_stream(session->media, session->id, name);
 	stream_data->candidates_prepared = TRUE;
 
+	g_signal_emit(session->media,
+			purple_media_signals[CANDIDATES_PREPARED],
+			0, session->id, name);
+
 	purple_media_emit_ready(session->media, session, name);
 	g_free(name);
 }
--- a/libpurple/protocols/jabber/jingle/rtp.c	Thu Mar 19 09:06:54 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/rtp.c	Thu Mar 19 09:30:16 2009 +0000
@@ -343,6 +343,12 @@
 }
 
 static void
+jingle_rtp_candidates_prepared_cb(PurpleMedia *media, gchar *sid, gchar *name)
+{
+	purple_debug_info("jingle-rtp", "jingle_rtp_candidates_prepared_cb\n");
+}
+
+static void
 jingle_rtp_codecs_changed_cb(PurpleMedia *media, gchar *sid,
 		JingleSession *session)
 {
@@ -473,6 +479,8 @@
 	/* connect callbacks */
 	g_signal_connect(G_OBJECT(media), "accepted",
 				 G_CALLBACK(jingle_rtp_accepted_cb), session);
+	g_signal_connect(G_OBJECT(media), "candidates-prepared",
+				 G_CALLBACK(jingle_rtp_candidates_prepared_cb), session);
 	g_signal_connect(G_OBJECT(media), "codecs-changed",
 				 G_CALLBACK(jingle_rtp_codecs_changed_cb), session);
 	g_signal_connect(G_OBJECT(media), "ready-new",