changeset 26164:fc100e71de5d

Added PurpleMediaElementType enum and added type to PurpleMediaElementInfo.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Tue, 03 Feb 2009 23:34:53 +0000
parents 521366dfd8db
children 0e8814c437b2
files libpurple/mediamanager.h pidgin/gtkmedia.c
diffstat 2 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/mediamanager.h	Tue Feb 03 22:37:24 2009 +0000
+++ b/libpurple/mediamanager.h	Tue Feb 03 23:34:53 2009 +0000
@@ -66,9 +66,31 @@
 	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 */
+} PurpleMediaElementType;
+
 struct _PurpleMediaElementInfo
 {
 	const gchar *id;
+	PurpleMediaElementType type;
 };
 
 #ifdef __cplusplus
--- a/pidgin/gtkmedia.c	Tue Feb 03 22:37:24 2009 +0000
+++ b/pidgin/gtkmedia.c	Tue Feb 03 23:34:53 2009 +0000
@@ -788,21 +788,31 @@
 static PurpleMediaElementInfo default_video_src =
 {
 	"pidgindefaultvideosrc",	/* id */
+	PURPLE_MEDIA_ELEMENT_VIDEO	/* type */
+			| PURPLE_MEDIA_ELEMENT_ONE_SRC
+			| PURPLE_MEDIA_ELEMENT_UNIQUE,
 };
 
 static PurpleMediaElementInfo default_video_sink =
 {
 	"pidgindefaultvideosink",	/* id */
+	PURPLE_MEDIA_ELEMENT_VIDEO	/* type */
+			| PURPLE_MEDIA_ELEMENT_ONE_SINK,
 };
 
 static PurpleMediaElementInfo default_audio_src =
 {
 	"pidgindefaultaudiosrc",	/* id */
+	PURPLE_MEDIA_ELEMENT_AUDIO	/* type */
+			| PURPLE_MEDIA_ELEMENT_ONE_SRC
+			| PURPLE_MEDIA_ELEMENT_UNIQUE,
 };
 
 static PurpleMediaElementInfo default_audio_sink =
 {
 	"pidgindefaultaudiosink",	/* id */
+	PURPLE_MEDIA_ELEMENT_AUDIO	/* type */
+			| PURPLE_MEDIA_ELEMENT_ONE_SINK,
 };
 
 void