changeset 26393:462e5c27dbd7

Use purple_media_manager_get_pipeline instead.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Wed, 01 Apr 2009 01:05:03 +0000
parents 9c671fc1b351
children c3cf43b9402f
files libpurple/media-gst.h libpurple/media.c libpurple/media.h pidgin/gtkmedia.c
diffstat 4 files changed, 22 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media-gst.h	Tue Mar 31 23:53:03 2009 +0000
+++ b/libpurple/media-gst.h	Wed Apr 01 01:05:03 2009 +0000
@@ -84,15 +84,6 @@
 GstElement *purple_media_get_src(PurpleMedia *media, const gchar *sess_id);
 
 /**
- * Gets the pipeline from the media session.
- *
- * @param media The media session to retrieve the pipeline from.
- *
- * @return The pipeline retrieved.
- */
-GstElement *purple_media_get_pipeline(PurpleMedia *media);
-
-/**
  * Gets the tee from a given session/stream.
  *
  * @param media The instance to get the tee from.
--- a/libpurple/media.c	Tue Mar 31 23:53:03 2009 +0000
+++ b/libpurple/media.c	Wed Apr 01 01:05:03 2009 +0000
@@ -1325,18 +1325,6 @@
 }
 #endif
 
-GstElement *
-purple_media_get_pipeline(PurpleMedia *media)
-{
-#ifdef USE_VV
-	g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
-
-	return purple_media_manager_get_pipeline(media->priv->manager);
-#else
-	return NULL;
-#endif
-}
-
 PurpleConnection *
 purple_media_get_connection(PurpleMedia *media)
 {
@@ -1892,6 +1880,15 @@
 #endif  /* USE_VV */
 }
 
+PurpleMediaManager *
+purple_media_get_manager(PurpleMedia *media)
+{
+	PurpleMediaManager *ret;
+	g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
+	g_object_get(media, "manager", &ret, NULL);
+	return ret;
+}
+
 PurpleMediaSessionType
 purple_media_get_session_type(PurpleMedia *media, const gchar *sess_id)
 {
--- a/libpurple/media.h	Tue Mar 31 23:53:03 2009 +0000
+++ b/libpurple/media.h	Wed Apr 01 01:05:03 2009 +0000
@@ -405,6 +405,15 @@
 PurpleMediaSessionType purple_media_get_session_type(PurpleMedia *media, const gchar *sess_id);
 
 /**
+ * Gets the PurpleMediaManager this media session is a part of.
+ *
+ * @param media The media object to get the manager instance from.
+ *
+ * @return The PurpleMediaManager instance retrieved.
+ */
+struct _PurpleMediaManager *purple_media_get_manager(PurpleMedia *media);
+
+/**
  * Gets the codecs from a session.
  *
  * @param media The media object to find the session in.
--- a/pidgin/gtkmedia.c	Tue Mar 31 23:53:03 2009 +0000
+++ b/pidgin/gtkmedia.c	Wed Apr 01 01:05:03 2009 +0000
@@ -389,7 +389,8 @@
 static void
 pidgin_media_disconnect_levels(PurpleMedia *media, PidginMedia *gtkmedia)
 {
-	GstElement *element = purple_media_get_pipeline(media);
+	PurpleMediaManager *manager = purple_media_get_manager(media);
+	GstElement *element = purple_media_manager_get_pipeline(manager);
 	gulong handler_id = g_signal_handler_find(G_OBJECT(gst_pipeline_get_bus(GST_PIPELINE(element))),
 						  G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0, 
 						  NULL, G_CALLBACK(level_message_cb), gtkmedia);
@@ -584,7 +585,8 @@
 static void
 pidgin_media_ready_cb(PurpleMedia *media, PidginMedia *gtkmedia, const gchar *sid)
 {
-	GstElement *pipeline = purple_media_get_pipeline(media);
+	PurpleMediaManager *manager = purple_media_get_manager(media);
+	GstElement *pipeline = purple_media_manager_get_pipeline(manager);
 	GtkWidget *send_widget = NULL, *recv_widget = NULL;
 	PurpleMediaSessionType type =
 			purple_media_get_session_type(media, sid);