pidgin.vv: aa2db844: Added codecs-changed signal.

maiku at soc.pidgin.im maiku at soc.pidgin.im
Tue Jan 27 18:05:30 EST 2009


-----------------------------------------------------------------
Revision: aa2db844f3c9c26644fda280af06a0476d013cde
Ancestor: a29031d131de981b21aa9a1fa838dfdcf5d534db
Author: maiku at soc.pidgin.im
Date: 2009-01-27T08:46:53
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/aa2db844f3c9c26644fda280af06a0476d013cde

Modified files:
        libpurple/media.c libpurple/protocols/jabber/jingle/rtp.c

ChangeLog: 

Added codecs-changed signal.

-------------- next part --------------
============================================================
--- libpurple/media.c	e9af9d77425050e69fa13bdb9f2eac485384ebab
+++ libpurple/media.c	78b4d2918345185ac3e5bb14946204a86d9ba139
@@ -118,6 +118,7 @@ enum {
 
 enum {
 	ERROR,
+	CODECS_CHANGED,
 	NEW_CANDIDATE,
 	READY_NEW,
 	STATE_CHANGED,
@@ -199,6 +200,10 @@ purple_media_class_init (PurpleMediaClas
 					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
 					 g_cclosure_marshal_VOID__STRING,
 					 G_TYPE_NONE, 1, 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,
+					 G_TYPE_NONE, 1, G_TYPE_STRING);
 	purple_media_signals[NEW_CANDIDATE] = g_signal_new("new-candidate", G_TYPE_FROM_CLASS(klass),
 					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
 					 purple_smarshal_VOID__POINTER_POINTER_OBJECT,
@@ -1151,12 +1156,17 @@ media_bus_call(GstBus *bus, GstMessage *
 					PurpleMediaSession *session = sessions->data;
 					if (session->session == fssession) {
 						gboolean ready;
+						gchar *session_id;
+
 						g_object_get(session->session, "codecs-ready", &ready, NULL);
 						if (session->codecs_ready == FALSE && ready == TRUE) {
 							session->codecs_ready = ready;
 							purple_media_emit_ready(media, session, NULL);
 						}
 
+						session_id = g_strdup(session->id);
+						g_signal_emit(media, purple_media_signals[CODECS_CHANGED], 0, session_id);
+						g_free(session_id);
 						g_list_free(sessions);
 						break;
 					}
============================================================
--- libpurple/protocols/jabber/jingle/rtp.c	cd14bd1a633b423bdfd4bef60a5edc2c6f5a3bf6
+++ libpurple/protocols/jabber/jingle/rtp.c	cd41dec9fdaaf7c3bc00a2ad78fdb1cc77910fb4
@@ -271,6 +271,14 @@ static void
 }
 
 static void
+jingle_rtp_codecs_changed_cb(PurpleMedia *media, gchar *sid,
+		JingleSession *session)
+{
+	purple_debug_info("jingle-rtp", "jingle_rtp_codecs_changed_cb: "
+			"session_id: %s jingle_session: %p\n", sid, session);
+}
+
+static void
 jingle_rtp_new_candidate_cb(PurpleMedia *media, gchar *sid, gchar *name, PurpleMediaCandidate *candidate, JingleSession *session)
 {
 	purple_debug_info("jingle-rtp", "jingle_rtp_new_candidate_cb\n");
@@ -359,6 +367,8 @@ jingle_rtp_create_media(JingleContent *c
 	g_hash_table_insert(js->medias, sid, media);
 
 	/* connect callbacks */
+	g_signal_connect(G_OBJECT(media), "codecs-changed",
+				 G_CALLBACK(jingle_rtp_codecs_changed_cb), session);
 	g_signal_connect(G_OBJECT(media), "new-candidate",
 				 G_CALLBACK(jingle_rtp_new_candidate_cb), session);
 	g_signal_connect(G_OBJECT(media), "ready-new",


More information about the Commits mailing list