pidgin.vv: 2def59e7: Give more information to element creatio...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Wed Apr 1 00:31:15 EDT 2009


-----------------------------------------------------------------
Revision: 2def59e70dc735b2a5a83535098066135cbe323a
Ancestor: b9590dd3baa0a323803bb14ec968c433bfb6d1ee
Author: maiku at soc.pidgin.im
Date: 2009-03-31T23:53:03
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/2def59e70dc735b2a5a83535098066135cbe323a

Modified files:
        finch/gntmedia.c libpurple/media-gst.h libpurple/media.c
        libpurple/mediamanager.c pidgin/gtkmedia.c

ChangeLog: 

Give more information to element creation functions.
This should allow for Picture in Picture support.

-------------- next part --------------
============================================================
--- finch/gntmedia.c	9f7f797b404d86cb1c05ad378dbfd5c8dc191a7c
+++ finch/gntmedia.c	a9cf2574bcd4a832a37fcf77f408b12111374cff
@@ -390,7 +390,8 @@ static GstElement *
 }
 
 static GstElement *
-create_default_audio_src(void)
+create_default_audio_src(PurpleMedia *media,
+		const gchar *session_id, const gchar *participant)
 {
 	GstElement *bin, *src, *volume;
 	GstPad *pad, *ghost;
@@ -416,7 +417,8 @@ static GstElement *
 }
 
 static GstElement *
-create_default_audio_sink(void)
+create_default_audio_sink(PurpleMedia *media,
+		const gchar *session_id, const gchar *participant)
 {
 	GstElement *bin, *sink, *volume, *queue;
 	GstPad *pad, *ghost;
============================================================
--- libpurple/media-gst.h	f7cad35a02b69c7502c77584f076bb9a879d9a92
+++ libpurple/media-gst.h	a922978b8ffb607e3984c6d7db83a08704aed0e2
@@ -65,7 +65,8 @@ struct _PurpleMediaElementInfo
 {
 	const gchar *id;
 	PurpleMediaElementType type;
-	GstElement *(*create)(void);
+	GstElement *(*create)(PurpleMedia *media,
+			const gchar *session_id, const gchar *participant);
 };
 
 #ifdef __cplusplus
@@ -120,7 +121,8 @@ GstElement *purple_media_manager_get_ele
  * @param type The type of source/sink to get.
  */
 GstElement *purple_media_manager_get_element(PurpleMediaManager *manager,
-		PurpleMediaSessionType type);
+		PurpleMediaSessionType type, PurpleMedia *media,
+		const gchar *session_id, const gchar *participant);
 
 PurpleMediaElementInfo *purple_media_manager_get_element_info(
 		PurpleMediaManager *manager, const gchar *name);
============================================================
--- libpurple/media.c	7cf77a9403f513db88a0f6b41becd4aa734c4f59
+++ libpurple/media.c	6e6b5a021d52176776e972fbd7eec16b38e7719e
@@ -1630,7 +1630,10 @@ purple_media_src_pad_added_cb(FsStream *
 			stream->src = gst_element_factory_make(
 					"liveadder", NULL);
 			sink = purple_media_manager_get_element(priv->manager,
-					PURPLE_MEDIA_RECV_AUDIO);
+					PURPLE_MEDIA_RECV_AUDIO,
+					stream->session->media,
+					stream->session->id,
+					stream->participant);
 		} else if (codec->media_type == FS_MEDIA_TYPE_VIDEO) {
 			stream->src = gst_element_factory_make(
 					"fsfunnel", NULL);
@@ -1745,7 +1748,8 @@ purple_media_add_stream(PurpleMedia *med
 		session_type = purple_media_from_fs(media_type,
 				FS_DIRECTION_SEND);
 		src = purple_media_manager_get_element(
-				media->priv->manager, session_type);
+				media->priv->manager, session_type,
+				media, session->id, who);
 		if (!GST_IS_ELEMENT(src)) {
 			purple_debug_error("media",
 					"Error creating src for session %s\n",
============================================================
--- libpurple/mediamanager.c	ea9f32cb5b71d55d3edc3b031dcd88a8009e2daa
+++ libpurple/mediamanager.c	a82e42ccd09a7bbf88a0c25d6a871aaaff1ad8dc
@@ -353,7 +353,8 @@ purple_media_manager_get_element(PurpleM
 
 GstElement *
 purple_media_manager_get_element(PurpleMediaManager *manager,
-		PurpleMediaSessionType type)
+		PurpleMediaSessionType type, PurpleMedia *media,
+		const gchar *session_id, const gchar *participant)
 {
 #ifdef USE_VV
 	GstElement *ret = NULL;
@@ -383,7 +384,7 @@ purple_media_manager_get_element(PurpleM
 
 		if (ret == NULL) {
 			GstElement *bin, *fakesink;
-			ret = info->create();
+			ret = info->create(media, session_id, participant);
 			bin = gst_bin_new(info->id);
 			tee = gst_element_factory_make("tee", "tee");
 			gst_bin_add_many(GST_BIN(bin), ret, tee, NULL);
@@ -415,7 +416,7 @@ purple_media_manager_get_element(PurpleM
 		gst_pad_set_active(ghost, TRUE);
 		gst_element_add_pad(ret, ghost);
 	} else {
-		ret = info->create();
+		ret = info->create(media, session_id, participant);
 	}
 
 	if (ret == NULL)
@@ -612,7 +613,9 @@ purple_media_manager_create_output_windo
 			queue = gst_element_factory_make(
 					"queue", NULL);
 			ow->sink = purple_media_manager_get_element(
-					manager, PURPLE_MEDIA_RECV_VIDEO);
+					manager, PURPLE_MEDIA_RECV_VIDEO,
+					ow->media, ow->session_id,
+					ow->participant);
 
 			if (participant == NULL) {
 				/* aka this is a preview sink */
============================================================
--- pidgin/gtkmedia.c	772cf1ec72d84df1002f54f060383d7799f44404
+++ pidgin/gtkmedia.c	77255dd99d409a2e9058516b886dbfca26787e0a
@@ -902,7 +902,8 @@ static GstElement *
 }
 
 static GstElement *
-create_default_video_src(void)
+create_default_video_src(PurpleMedia *media,
+		const gchar *session_id, const gchar *participant)
 {
 	GstElement *sendbin, *src, *videoscale, *capsfilter;
 	GstPad *pad;
@@ -944,13 +945,15 @@ static GstElement *
 }
 
 static GstElement *
-create_default_video_sink(void)
+create_default_video_sink(PurpleMedia *media,
+		const gchar *session_id, const gchar *participant)
 {
 	return gst_element_factory_make("autovideosink", NULL);
 }
 
 static GstElement *
-create_default_audio_src(void)
+create_default_audio_src(PurpleMedia *media,
+		const gchar *session_id, const gchar *participant)
 {
 	GstElement *bin, *src, *volume, *level;
 	GstPad *pad, *ghost;
@@ -979,7 +982,8 @@ static GstElement *
 }
 
 static GstElement *
-create_default_audio_sink(void)
+create_default_audio_sink(PurpleMedia *media,
+		const gchar *session_id, const gchar *participant)
 {
 	GstElement *bin, *sink, *volume, *level, *queue;
 	GstPad *pad, *ghost;


More information about the Commits mailing list