pidgin.vv: f33da3b9: Move GStreamer related media functions i...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Sun Mar 22 23:01:40 EDT 2009


-----------------------------------------------------------------
Revision: f33da3b932877b99e0bb92fee5d7938563d6a589
Ancestor: a4047299427f6e08240e4ed64ac33a7f28ec5846
Author: maiku at soc.pidgin.im
Date: 2009-03-23T02:59:18
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/f33da3b932877b99e0bb92fee5d7938563d6a589

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

ChangeLog: 

Move GStreamer related media functions into its own header.

-------------- next part --------------
============================================================
--- libpurple/media-gst.h	08418d9fd656d185a1aa06489359e210926889d2
+++ libpurple/media-gst.h	08418d9fd656d185a1aa06489359e210926889d2
@@ -0,0 +1,146 @@
+/**
+ * @file media-gst.h Media API
+ * @ingroup core
+ */
+
+/* purple
+ *
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __MEDIA_GST_H_
+#define __MEDIA_GST_H_
+
+#ifdef USE_VV
+
+#include "media.h"
+#include "mediamanager.h"
+
+#include <gst/gst.h>
+
+G_BEGIN_DECLS
+
+/** @copydoc _PurpleMediaElementInfo */
+typedef struct _PurpleMediaElementInfo PurpleMediaElementInfo;
+
+typedef enum {
+	PURPLE_MEDIA_ELEMENT_AUDIO = 1,			/** supports audio */
+	PURPLE_MEDIA_ELEMENT_VIDEO = 1 << 1,		/** supports video */
+	PURPLE_MEDIA_ELEMENT_AUDIO_VIDEO = PURPLE_MEDIA_ELEMENT_AUDIO
+			| PURPLE_MEDIA_ELEMENT_VIDEO, 	/** supports audio and video */
+
+	PURPLE_MEDIA_ELEMENT_NO_SRCS = 0,		/** has no src pads */
+	PURPLE_MEDIA_ELEMENT_ONE_SRC = 1 << 2,		/** has one src pad */
+	PURPLE_MEDIA_ELEMENT_MULTI_SRC = 1 << 3, 	/** has multiple src pads */
+	PURPLE_MEDIA_ELEMENT_REQUEST_SRC = 1 << 4, 	/** src pads must be requested */
+
+	PURPLE_MEDIA_ELEMENT_NO_SINKS = 0,		/** has no sink pads */
+	PURPLE_MEDIA_ELEMENT_ONE_SINK = 1 << 5, 	/** has one sink pad */
+	PURPLE_MEDIA_ELEMENT_MULTI_SINK = 1 << 6, 	/** has multiple sink pads */
+	PURPLE_MEDIA_ELEMENT_REQUEST_SINK = 1 << 7, 	/** sink pads must be requested */
+
+	PURPLE_MEDIA_ELEMENT_UNIQUE = 1 << 8,		/** This element is unique and
+							 only one instance of it should
+							 be created at a time */
+
+	PURPLE_MEDIA_ELEMENT_SRC = 1 << 9,		/** can be set as an active src */
+	PURPLE_MEDIA_ELEMENT_SINK = 1 << 10,		/** can be set as an active sink */
+} PurpleMediaElementType;
+
+struct _PurpleMediaElementInfo
+{
+	const gchar *id;
+	PurpleMediaElementType type;
+	GstElement *(*create)(void);
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Gets the source from a session
+ *
+ * @param media The media object the session is in.
+ * @param sess_id The session id of the session to get the source from.
+ *
+ * @return The source retrieved.
+ */
+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.
+ * @param session_id The id of the session to get the tee from.
+ * @param participant Optionally, the participant of the stream to get the tee from.
+ *
+ * @return The GstTee element from the chosen session/stream.
+ */
+GstElement *purple_media_get_tee(PurpleMedia *media,
+		const gchar *session_id, const gchar *participant);
+
+
+/**
+ * Gets the pipeline from the media manager.
+ *
+ * @param manager The media manager to get the pipeline from.
+ *
+ * @return The pipeline.
+ */
+GstElement *purple_media_manager_get_pipeline(PurpleMediaManager *manager);
+
+/**
+ * Returns a GStreamer source or sink for audio or video.
+ *
+ * @param manager The media manager to use to obtain the source/sink.
+ * @param type The type of source/sink to get.
+ */
+GstElement *purple_media_manager_get_element(PurpleMediaManager *manager,
+		PurpleMediaSessionType type);
+
+PurpleMediaElementInfo *purple_media_manager_get_element_info(
+		PurpleMediaManager *manager, const gchar *name);
+gboolean purple_media_manager_register_element(PurpleMediaManager *manager,
+		PurpleMediaElementInfo *info);
+gboolean purple_media_manager_unregister_element(PurpleMediaManager *manager,
+		const gchar *name);
+gboolean purple_media_manager_set_active_element(PurpleMediaManager *manager,
+		PurpleMediaElementInfo *info);
+PurpleMediaElementInfo *purple_media_manager_get_active_element(
+		PurpleMediaManager *manager, PurpleMediaElementType type);
+
+#ifdef __cplusplus
+}
+#endif
+
+G_END_DECLS
+
+#endif  /* USE_VV */
+
+#endif  /* __MEDIA_GST_H_ */
============================================================
--- finch/gntmedia.c	df9bfeed38fc49e961f97574fde95e0a6094d365
+++ finch/gntmedia.c	8b10521f430791c8d259b4c52e4fea752e395ab4
@@ -25,7 +25,6 @@
  */
 
 #include "finch.h"
-#include "mediamanager.h"
 
 #include "gntconv.h"
 #include "gntmedia.h"
@@ -38,6 +37,8 @@
 #include "cmds.h"
 #include "conversation.h"
 #include "debug.h"
+#include "media-gst.h"
+#include "mediamanager.h"
 
 /* An incredibly large part of the following is from gtkmedia.c */
 #ifdef USE_VV
============================================================
--- libpurple/Makefile.am	3d0ca98f1c940a5a0f432433466c70c0f70ceb7a
+++ libpurple/Makefile.am	37e379e7755ec5c05ad37207a1146d0f27853f28
@@ -115,6 +115,7 @@ purple_coreheaders = \
 	log.h \
 	marshallers.h \
 	media.h \
+	media-gst.h \
 	mediamanager.h \
 	mime.h \
 	nat-pmp.h \
============================================================
--- libpurple/media.c	4137ba023f6890162aa455531a54be892ccfb482
+++ libpurple/media.c	7f1627dd45bb076aa73d8e42a4bfb4ba07c60d31
@@ -29,8 +29,9 @@
 #include "internal.h"
 
 #include "connection.h"
+#include "marshallers.h"
 #include "media.h"
-#include "marshallers.h"
+#include "media-gst.h"
 #include "mediamanager.h"
 #include "network.h"
 
============================================================
--- libpurple/media.h	425f0977ff83d0ca5c5f5b2c241998f580bfeab0
+++ libpurple/media.h	aef7942bf12e38dc6b190f3917039c1410a2b19a
@@ -29,7 +29,6 @@
 
 #ifdef USE_VV
 
-#include <gst/gst.h>
 #include <glib.h>
 #include <glib-object.h>
 
@@ -323,25 +322,6 @@ GList *purple_media_get_session_names(Pu
 GList *purple_media_get_session_names(PurpleMedia *media);
 
 /**
- * Gets the source from a session
- *
- * @param media The media object the session is in.
- * @param sess_id The session id of the session to get the source from.
- *
- * @return The source retrieved.
- */
-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 PurpleConnection this media session is on.
  *
  * @param media The media session to retrieve the connection from.
@@ -610,18 +590,6 @@ void purple_media_remove_output_windows(
  */
 void purple_media_remove_output_windows(PurpleMedia *media);
 
-/**
- * Gets the tee from a given session/stream.
- *
- * @param media The instance to get the tee from.
- * @param session_id The id of the session to get the tee from.
- * @param participant Optionally, the participant of the stream to get the tee from.
- *
- * @return The GstTee element from the chosen session/stream.
- */
-GstElement *purple_media_get_tee(PurpleMedia *media,
-		const gchar *session_id, const gchar *participant);
-
 #ifdef __cplusplus
 }
 #endif
============================================================
--- libpurple/mediamanager.c	6bf9ae1ede7268dc6a797ef8f2370a22bf18c52e
+++ libpurple/mediamanager.c	e7b270f88eee0d1fb2f359f800182f37e698bc67
@@ -29,8 +29,9 @@
 #include "connection.h"
 #include "debug.h"
 #include "marshallers.h"
-#include "mediamanager.h"
 #include "media.h"
+#include "media-gst.h"
+#include "mediamanager.h"
 
 #ifdef USE_VV
 
============================================================
--- libpurple/mediamanager.h	a436c4485740b10b87c076bd0d69a1d2b62cbc40
+++ libpurple/mediamanager.h	53e1c4aaad9294586d35331477d78b87be8d19b6
@@ -50,8 +50,6 @@ typedef struct _PurpleMediaManagerPrivat
 typedef struct _PurpleMediaManagerClass PurpleMediaManagerClass;
 /** @copydoc _PurpleMediaManagerPrivate */
 typedef struct _PurpleMediaManagerPrivate PurpleMediaManagerPrivate;
-/** @copydoc _PurpleMediaElementInfo */
-typedef struct _PurpleMediaElementInfo PurpleMediaElementInfo;
 
 /** The media manager class. */
 struct _PurpleMediaManagerClass
@@ -66,37 +64,6 @@ struct _PurpleMediaManager
 	PurpleMediaManagerPrivate *priv; /**< Private data for the manager. */
 };
 
-typedef enum {
-	PURPLE_MEDIA_ELEMENT_AUDIO = 1,			/** supports audio */
-	PURPLE_MEDIA_ELEMENT_VIDEO = 1 << 1,		/** supports video */
-	PURPLE_MEDIA_ELEMENT_AUDIO_VIDEO = PURPLE_MEDIA_ELEMENT_AUDIO
-			| PURPLE_MEDIA_ELEMENT_VIDEO, 	/** supports audio and video */
-
-	PURPLE_MEDIA_ELEMENT_NO_SRCS = 0,		/** has no src pads */
-	PURPLE_MEDIA_ELEMENT_ONE_SRC = 1 << 2,		/** has one src pad */
-	PURPLE_MEDIA_ELEMENT_MULTI_SRC = 1 << 3, 	/** has multiple src pads */
-	PURPLE_MEDIA_ELEMENT_REQUEST_SRC = 1 << 4, 	/** src pads must be requested */
-
-	PURPLE_MEDIA_ELEMENT_NO_SINKS = 0,		/** has no sink pads */
-	PURPLE_MEDIA_ELEMENT_ONE_SINK = 1 << 5, 	/** has one sink pad */
-	PURPLE_MEDIA_ELEMENT_MULTI_SINK = 1 << 6, 	/** has multiple sink pads */
-	PURPLE_MEDIA_ELEMENT_REQUEST_SINK = 1 << 7, 	/** sink pads must be requested */
-
-	PURPLE_MEDIA_ELEMENT_UNIQUE = 1 << 8,		/** This element is unique and
-							 only one instance of it should
-							 be created at a time */
-
-	PURPLE_MEDIA_ELEMENT_SRC = 1 << 9,		/** can be set as an active src */
-	PURPLE_MEDIA_ELEMENT_SINK = 1 << 10,		/** can be set as an active sink */
-} PurpleMediaElementType;
-
-struct _PurpleMediaElementInfo
-{
-	const gchar *id;
-	PurpleMediaElementType type;
-	GstElement *(*create)(void);
-};
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -121,16 +88,6 @@ PurpleMediaManager *purple_media_manager
 PurpleMediaManager *purple_media_manager_get(void);
 
 /**
- * Gets the pipeline from the media manager.
- *
- * @param manager The media manager to get the pipeline from.
- *
- * @return The pipeline.
- */
-GstElement *
-purple_media_manager_get_pipeline(PurpleMediaManager *manager);
-
-/**
  * Creates a media session.
  *
  * @param manager The media manager to create the session under.
@@ -177,25 +134,6 @@ purple_media_manager_remove_media(Purple
 				  PurpleMedia *media);
 
 /**
- * Returns a GStreamer source or sink for audio or video.
- *
- * @param manager The media manager to use to obtain the source/sink.
- * @param type The type of source/sink to get.
- */
-GstElement *purple_media_manager_get_element(PurpleMediaManager *manager,
-		PurpleMediaSessionType type);
-
-PurpleMediaElementInfo *purple_media_manager_get_element_info(
-		PurpleMediaManager *manager, const gchar *name);
-gboolean purple_media_manager_register_element(PurpleMediaManager *manager,
-		PurpleMediaElementInfo *info);
-gboolean purple_media_manager_unregister_element(PurpleMediaManager *manager,
-		const gchar *name);
-gboolean purple_media_manager_set_active_element(PurpleMediaManager *manager,
-		PurpleMediaElementInfo *info);
-PurpleMediaElementInfo *purple_media_manager_get_active_element(
-		PurpleMediaManager *manager, PurpleMediaElementType type);
-/**
  * This shouldn't be called outside of mediamanager.c and media.c
  */
 gboolean purple_media_manager_create_output_window(
============================================================
--- pidgin/gtkmedia.c	4c3b0876efebbdd21142ae15bdf11d56aa372f63
+++ pidgin/gtkmedia.c	db8613da127b3e45ac6a6befd96898cff5b4a2e0
@@ -28,6 +28,7 @@
 #include "internal.h"
 #include "connection.h"
 #include "media.h"
+#include "media-gst.h"
 #include "mediamanager.h"
 #include "pidgin.h"
 #include "request.h"


More information about the Commits mailing list