cpw.maiku.media_refactor: 2325fa71: Add a way to set and get which media bac...

maiku at pidgin.im maiku at pidgin.im
Wed Oct 28 16:12:20 EDT 2009


-----------------------------------------------------------------
Revision: 2325fa71541af821ca10b88878b1d0e086af39d0
Ancestor: fd0aef2fed1b4d8e3e63f7524149d0345e50cfbe
Author: maiku at pidgin.im
Date: 2009-10-28T20:06:21
Branch: im.pidgin.cpw.maiku.media_refactor
URL: http://d.pidgin.im/viewmtn/revision/info/2325fa71541af821ca10b88878b1d0e086af39d0

Modified files:
        libpurple/media/media.c libpurple/mediamanager.c
        libpurple/mediamanager.h

ChangeLog: 

Add a way to set and get which media backend type to use.

-------------- next part --------------
============================================================
--- libpurple/media/media.c	3d6284acb5f2327e2f8231238b74b1ba537ff31b
+++ libpurple/media/media.c	69be7295b73345f6417f8eacb764951895db77cb
@@ -371,9 +371,9 @@ purple_media_set_property (GObject *obje
 		case PROP_CONFERENCE_TYPE:
 			media->priv->conference_type =
 					g_value_dup_string(value);
-			/* Will eventually get this type from the media manager */
 			media->priv->backend = g_object_new(
-					PURPLE_TYPE_MEDIA_BACKEND_FS2,
+					purple_media_manager_get_backend_type(
+					purple_media_manager_get()),
 					"conference-type",
 					media->priv->conference_type,
 					"media", media,
============================================================
--- libpurple/mediamanager.c	d6034723c9ed7f7a5b8c6c2b34d3c417c6fd3d3c
+++ libpurple/mediamanager.c	e56233d897986775857ad69339fdf09a5cadae93
@@ -37,6 +37,7 @@
 #endif
 
 #ifdef USE_VV
+#include <media/backend-fs2.h>
 
 #include <gst/farsight/fs-element-added-notifier.h>
 #include <gst/interfaces/xoverlay.h>
@@ -79,6 +80,7 @@ struct _PurpleMediaManagerPrivate
 	GList *elements;
 	GList *output_windows;
 	gulong next_output_window_id;
+	GType backend_type;
 
 	PurpleMediaElementInfo *video_src;
 	PurpleMediaElementInfo *video_sink;
@@ -166,6 +168,9 @@ purple_media_manager_init (PurpleMediaMa
 	media->priv = PURPLE_MEDIA_MANAGER_GET_PRIVATE(media);
 	media->priv->medias = NULL;
 	media->priv->next_output_window_id = 1;
+#ifdef USE_VV
+	media->priv->backend_type = PURPLE_TYPE_MEDIA_BACKEND_FS2;
+#endif
 
 	purple_prefs_add_none("/purple/media");
 	purple_prefs_add_none("/purple/media/audio");
@@ -910,6 +915,30 @@ purple_media_manager_get_ui_caps(PurpleM
 #endif
 }
 
+void
+purple_media_manager_set_backend_type(PurpleMediaManager *manager,
+		GType backend_type)
+{
+#ifdef USE_VV
+	g_return_if_fail(PURPLE_IS_MEDIA_MANAGER(manager));
+
+	manager->priv->backend_type = backend_type;
+#endif
+}
+
+GType
+purple_media_manager_get_backend_type(PurpleMediaManager *manager)
+{	
+#ifdef USE_VV
+	g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager),
+			PURPLE_MEDIA_CAPS_NONE);
+
+	return manager->priv->backend_type;
+#else
+	return G_TYPE_NONE;
+#endif
+}
+
 #ifdef USE_GSTREAMER
 
 /*
============================================================
--- libpurple/mediamanager.h	df11ffa73dc52beaac535443f4cf7577286fcff3
+++ libpurple/mediamanager.h	dbc11bf0e2a89793ecbecaa713acd3d4ffaea9e1
@@ -213,6 +213,28 @@ PurpleMediaCaps purple_media_manager_get
  */
 PurpleMediaCaps purple_media_manager_get_ui_caps(PurpleMediaManager *manager);
 
+/**
+ * Sets which media backend type media objects will use.
+ *
+ * @param manager The manager to set the caps on.
+ * @param backend_type The media backend type to use.
+ *
+ * @since 2.7.0
+ */
+void purple_media_manager_set_backend_type(PurpleMediaManager *manager,
+		GType backend_type);
+
+/**
+ * Gets which media backend type media objects will use.
+ *
+ * @param manager The manager to get the media backend type from.
+ *
+ * @return The type of media backend type media objects will use.
+ *
+ * @since 2.7.0
+ */
+GType purple_media_manager_get_backend_type(PurpleMediaManager *manager);
+
 /*}@*/
 
 #ifdef __cplusplus


More information about the Commits mailing list