pidgin.vv: af786a7f: Create purple_media_stream_info. Add loc...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Sun Mar 29 21:25:42 EDT 2009


-----------------------------------------------------------------
Revision: af786a7f61576b2cb57b61df5bf78d69b7ec3c8d
Ancestor: 79d15afc25b78fa264fb19724f9b2621cdf5891a
Author: maiku at soc.pidgin.im
Date: 2009-03-29T23:00:33
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/af786a7f61576b2cb57b61df5bf78d69b7ec3c8d

Modified files:
        finch/gntmedia.c libpurple/marshallers.list
        libpurple/media.c libpurple/media.h
        libpurple/protocols/jabber/google.c
        libpurple/protocols/jabber/jingle/rtp.c pidgin/gtkmedia.c

ChangeLog: 

Create purple_media_stream_info. Add local parameter to stream-info signal.

-------------- next part --------------
============================================================
--- finch/gntmedia.c	7437097016f62a4f83f7448645105a9b7831bf30
+++ finch/gntmedia.c	a2f5d56975a864fc1528d1af2d1c23378f7ed31f
@@ -233,7 +233,7 @@ finch_media_stream_info_cb(PurpleMedia *
 
 static void
 finch_media_stream_info_cb(PurpleMedia *media, PurpleMediaInfoType type,
-		gchar *sid, gchar *name, FinchMedia *gntmedia)
+		gchar *sid, gchar *name, gboolean local, FinchMedia *gntmedia)
 {
 	if (type == PURPLE_MEDIA_INFO_REJECT) {
 		finch_media_emit_message(gntmedia,
============================================================
--- libpurple/marshallers.list	4e7fb780529f606c1837dfcff8de04aab53426d2
+++ libpurple/marshallers.list	da9d485880a6ef73b891ceb2595d04fa6c5cd4b3
@@ -3,3 +3,4 @@ VOID:ENUM,STRING,STRING
 BOOLEAN:OBJECT,POINTER,STRING
 VOID:STRING,STRING
 VOID:ENUM,STRING,STRING
+VOID:ENUM,STRING,STRING,BOOLEAN
============================================================
--- libpurple/media.c	b129e699c74c6ac46f1c22c122ebc697bbef1b2a
+++ libpurple/media.c	0374767b86c3f5e1300094ba2f5bf0a9865b59c8
@@ -288,9 +288,9 @@ purple_media_class_init (PurpleMediaClas
 					 G_TYPE_STRING, G_TYPE_STRING);
 	purple_media_signals[STREAM_INFO] = g_signal_new("stream-info", G_TYPE_FROM_CLASS(klass),
 					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
-					 purple_smarshal_VOID__ENUM_STRING_STRING,
-					 G_TYPE_NONE, 3, PURPLE_MEDIA_TYPE_INFO_TYPE,
-					 G_TYPE_STRING, G_TYPE_STRING);
+					 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);
 	g_type_class_add_private(klass, sizeof(PurpleMediaPrivate));
 }
 
@@ -1406,7 +1406,7 @@ purple_media_hangup(PurpleMedia *media)
 	g_return_if_fail(PURPLE_IS_MEDIA(media));
 	g_signal_emit(media, purple_media_signals[STREAM_INFO],
 			0, PURPLE_MEDIA_INFO_HANGUP,
-			NULL, NULL);
+			NULL, NULL, TRUE);
 	purple_media_end(media, NULL, NULL);
 #endif
 }
@@ -1418,7 +1418,7 @@ purple_media_reject(PurpleMedia *media)
 	g_return_if_fail(PURPLE_IS_MEDIA(media));
 	g_signal_emit(media, purple_media_signals[STREAM_INFO],
 			0, PURPLE_MEDIA_INFO_REJECT,
-			NULL, NULL);
+			NULL, NULL, TRUE);
 	purple_media_end(media, NULL, NULL);
 #endif
 }
@@ -1438,7 +1438,29 @@ purple_media_end(PurpleMedia *media,
 #endif
 }
 
+void
+purple_media_stream_info(PurpleMedia *media, PurpleMediaInfoType type,
+		const gchar *session_id, const gchar *participant,
+		gboolean local)
+{
 #ifdef USE_VV
+	GList *streams;
+
+	g_return_if_fail(PURPLE_IS_MEDIA(media));
+
+	streams = purple_media_get_streams(media, session_id, participant);
+
+	for (; streams; streams = g_list_delete_link(streams, streams)) {
+		PurpleMediaStream *stream = streams->data;
+
+		g_signal_emit(media, purple_media_signals[STREAM_INFO],
+				0, type, stream->session->id,
+				stream->participant, local);
+	}
+#endif
+}
+
+#ifdef USE_VV
 static void
 purple_media_new_local_candidate_cb(FsStream *stream,
 				    FsCandidate *local_candidate,
============================================================
--- libpurple/media.h	a6527a8931ee7dfdbbcd7a296016996a9397a8cf
+++ libpurple/media.h	0344addc0718d738420338d3d8bbe83138a4d4c8
@@ -378,6 +378,19 @@ void purple_media_end(PurpleMedia *media
 		const gchar *participant);
 
 /**
+ * Signals different information about the given stream.
+ *
+ * @param media The media instance to containing the stream to signal.
+ * @param type The type of info being signaled.
+ * @param session_id The id of the session of the stream being signaled.
+ * @param participant The participant of the stream being signaled.
+ * @param local TRUE if the info originated locally, FALSE if on the remote end.
+ */
+void purple_media_stream_info(PurpleMedia *media, PurpleMediaInfoType type,
+		const gchar *session_id, const gchar *participant,
+		gboolean local);
+
+/**
  * Adds a stream to a session.
  *
  * It only adds a stream to one audio session or video session as
============================================================
--- libpurple/protocols/jabber/google.c	74635706b2c916b51a6fd93eccf98940b659d07f
+++ libpurple/protocols/jabber/google.c	819a4823e23e14927c4fe12603680a42dd3975b2
@@ -238,7 +238,8 @@ google_session_stream_info_cb(PurpleMedi
 
 static void
 google_session_stream_info_cb(PurpleMedia *media, PurpleMediaInfoType type,
-		gchar *sid, gchar *name, GoogleSession *session)
+		gchar *sid, gchar *name, gboolean local,
+		GoogleSession *session)
 {
 	if (type == PURPLE_MEDIA_INFO_HANGUP) {
 		xmlnode *sess;
============================================================
--- libpurple/protocols/jabber/jingle/rtp.c	c0708258a4b4a0c3fd140cb6bcc0ac2d62cfff83
+++ libpurple/protocols/jabber/jingle/rtp.c	88f3ba922a1ca4a3c822c204817232e0cc1c717d
@@ -444,7 +444,8 @@ jingle_rtp_stream_info_cb(PurpleMedia *m
 
 static void
 jingle_rtp_stream_info_cb(PurpleMedia *media, PurpleMediaInfoType type,
-		gchar *sid, gchar *name, JingleSession *session)
+		gchar *sid, gchar *name, gboolean local,
+		JingleSession *session)
 {
 	purple_debug_info("jingle-rtp", "stream-info: type %d "
 			"id: %s name: %s\n", type, sid, name);
============================================================
--- pidgin/gtkmedia.c	f52c2c2e79e7e1e26ad1c9beb0537e00915555ca
+++ pidgin/gtkmedia.c	bbe906d1c6a8e3ce2c87793f13f0ef4e68c8b28d
@@ -703,7 +703,8 @@ pidgin_media_stream_info_cb(PurpleMedia 
 
 static void
 pidgin_media_stream_info_cb(PurpleMedia *media, PurpleMediaInfoType type,
-		gchar *sid, gchar *name, PidginMedia *gtkmedia)
+		gchar *sid, gchar *name, gboolean local,
+		PidginMedia *gtkmedia)
 {
 	if (type == PURPLE_MEDIA_INFO_REJECT) {
 		pidgin_media_emit_message(gtkmedia,


More information about the Commits mailing list