pidgin.vv: 54fd6939: Properly wrap media functions so the API...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Mon Mar 23 02:21:32 EDT 2009


-----------------------------------------------------------------
Revision: 54fd69399f341b0b069451f9f87d498931b1b6f6
Ancestor: f33da3b932877b99e0bb92fee5d7938563d6a589
Author: maiku at soc.pidgin.im
Date: 2009-03-23T04:00:11
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/54fd69399f341b0b069451f9f87d498931b1b6f6

Modified files:
        Doxyfile.in libpurple/media-gst.h libpurple/media.c
        libpurple/media.h libpurple/mediamanager.c
        libpurple/mediamanager.h

ChangeLog: 

Properly wrap media functions so the API doesn't disappear when USE_VV 
is not defined.

-------------- next part --------------
============================================================
--- Doxyfile.in	b42968d9a4b3e488ebc6728a94f79b56ce6d9673
+++ Doxyfile.in	8477c5c4ca55496d672aa6e414e975e32eabef1d
@@ -1070,7 +1070,7 @@ INCLUDE_FILE_PATTERNS  = 
 # undefined via #undef or recursively expanded use the := operator 
 # instead of the = operator.
 
-PREDEFINED             = USE_VV
+PREDEFINED             = 
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
 # this tag can be used to specify a list of macro names that should be expanded. 
============================================================
--- libpurple/media-gst.h	08418d9fd656d185a1aa06489359e210926889d2
+++ libpurple/media-gst.h	f7cad35a02b69c7502c77584f076bb9a879d9a92
@@ -27,8 +27,6 @@
 #ifndef __MEDIA_GST_H_
 #define __MEDIA_GST_H_
 
-#ifdef USE_VV
-
 #include "media.h"
 #include "mediamanager.h"
 
@@ -141,6 +139,4 @@ G_END_DECLS
 
 G_END_DECLS
 
-#endif  /* USE_VV */
-
 #endif  /* __MEDIA_GST_H_ */
============================================================
--- libpurple/media.c	7f1627dd45bb076aa73d8e42a4bfb4ba07c60d31
+++ libpurple/media.c	9fe1275054e3004a21437d9dd85a958fff9b2bcd
@@ -79,9 +79,11 @@ struct _PurpleMediaStream
 	gulong window_id;
 	guint connected_cb_id;
 };
+#endif
 
 struct _PurpleMediaPrivate
 {
+#ifdef USE_VV
 	PurpleMediaManager *manager;
 	PurpleConnection *pc;
 	FsConference *conference;
@@ -94,8 +96,12 @@ struct _PurpleMediaPrivate
 	GList *streams;		/* PurpleMediaStream table */
 
 	GstElement *confbin;
+#else
+	gpointer dummy;
+#endif
 };
 
+#ifdef USE_VV
 #define PURPLE_MEDIA_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA, PurpleMediaPrivate))
 
 static void purple_media_class_init (PurpleMediaClass *klass);
@@ -139,10 +145,12 @@ enum {
 	PROP_INITIATOR,
 	PROP_PRPL_DATA,
 };
+#endif
 
 GType
 purple_media_get_type()
 {
+#ifdef USE_VV
 	static GType type = 0;
 
 	if (type == 0) {
@@ -161,6 +169,9 @@ purple_media_get_type()
 		type = g_type_register_static(G_TYPE_OBJECT, "PurpleMedia", &info, 0);
 	}
 	return type;
+#else
+	return G_TYPE_NONE;
+#endif
 }
 
 GType
@@ -203,6 +214,7 @@ purple_media_info_type_get_type()
 	return type;
 }
 
+#ifdef USE_VV
 static void
 purple_media_class_init (PurpleMediaClass *klass)
 {
@@ -505,6 +517,7 @@ purple_media_get_property (GObject *obje
 	}
 
 }
+#endif
 
 PurpleMediaCandidate *
 purple_media_candidate_new(const gchar *foundation, guint component_id,
@@ -560,6 +573,7 @@ purple_media_candidate_free(PurpleMediaC
 	g_free(candidate);
 }
 
+#ifdef USE_VV
 static FsCandidate *
 purple_media_candidate_to_fs(PurpleMediaCandidate *candidate)
 {
@@ -630,6 +644,7 @@ purple_media_candidate_list_to_fs(GList 
 	new_list = g_list_reverse(new_list);
 	return new_list;
 }
+#endif
 
 GList *
 purple_media_candidate_list_copy(GList *candidates)
@@ -669,6 +684,7 @@ purple_media_candidate_get_type()
 	return type;
 }
 
+#ifdef USE_VV
 static FsMediaType
 purple_media_to_fs_media_type(PurpleMediaSessionType type)
 {
@@ -713,6 +729,7 @@ purple_media_from_fs(FsMediaType type, F
 	}
 	return result;
 }
+#endif
 
 void
 purple_media_codec_add_optional_parameter(PurpleMediaCodec *codec,
@@ -818,6 +835,7 @@ purple_media_codec_free(PurpleMediaCodec
 	g_free(codec);
 }
 
+#ifdef USE_VV
 static FsCodec *
 purple_media_codec_to_fs(const PurpleMediaCodec *codec)
 {
@@ -864,16 +882,22 @@ purple_media_codec_from_fs(const FsCodec
 
 	return new_codec;
 }
+#endif
 
 gchar *
 purple_media_codec_to_string(const PurpleMediaCodec *codec)
 {
+#ifdef USE_VV
 	FsCodec *fscodec = purple_media_codec_to_fs(codec);
 	gchar *str = fs_codec_to_string(fscodec);
 	fs_codec_destroy(fscodec);
 	return str;
+#else
+	return g_strdup("");
+#endif
 }
 
+#ifdef USE_VV
 static GList *
 purple_media_codec_list_from_fs(GList *codecs)
 {
@@ -903,6 +927,7 @@ purple_media_codec_list_to_fs(GList *cod
 	new_list = g_list_reverse(new_list);
 	return new_list;
 }
+#endif
 
 GList *
 purple_media_codec_list_copy(GList *codecs)
@@ -942,6 +967,7 @@ purple_media_codec_get_type()
 	return type;
 }
 
+#ifdef USE_VV
 static PurpleMediaSession*
 purple_media_get_session(PurpleMedia *media, const gchar *sess_id)
 {
@@ -1083,15 +1109,21 @@ purple_media_insert_local_candidate(Purp
 	stream = purple_media_get_stream(session->media, session->id, name);
 	stream->local_candidates = g_list_append(stream->local_candidates, candidate);
 }
+#endif
 
 GList *
 purple_media_get_session_names(PurpleMedia *media)
 {
+#ifdef USE_VV
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
 	return media->priv->sessions != NULL ?
 			g_hash_table_get_keys(media->priv->sessions) : NULL;
+#else
+	return NULL;
+#endif
 }
 
+#ifdef USE_VV
 static void 
 purple_media_set_src(PurpleMedia *media, const gchar *sess_id, GstElement *src)
 {
@@ -1128,6 +1160,7 @@ purple_media_set_src(PurpleMedia *media,
 			  ? "success" : "failure");
 	gst_element_set_locked_state(session->src, FALSE);
 }
+#endif
 
 #if 0
 static void 
@@ -1157,12 +1190,17 @@ purple_media_get_src(PurpleMedia *media,
 GstElement *
 purple_media_get_src(PurpleMedia *media, const gchar *sess_id)
 {
+#ifdef USE_VV
 	PurpleMediaSession *session;
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
 	session = purple_media_get_session(media, sess_id);
 	return (session != NULL) ? session->src : NULL;
+#else
+	return NULL;
+#endif
 }
 
+#ifdef USE_VV
 static PurpleMediaSession *
 purple_media_session_from_fs_stream(PurpleMedia *media, FsStream *stream)
 {
@@ -1294,43 +1332,59 @@ media_bus_call(GstBus *bus, GstMessage *
 
 	return TRUE;
 }
+#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)
 {
+#ifdef USE_VV
 	PurpleConnection *pc;
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
 	g_object_get(G_OBJECT(media), "connection", &pc, NULL);
 	return pc;
+#else
+	return NULL;
+#endif
 }
 
 gpointer
 purple_media_get_prpl_data(PurpleMedia *media)
 {
+#ifdef USE_VV
 	gpointer prpl_data;
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
 	g_object_get(G_OBJECT(media), "prpl-data", &prpl_data, NULL);
 	return prpl_data;
+#else
+	return NULL;
+#endif
 }
 
 void
 purple_media_set_prpl_data(PurpleMedia *media, gpointer prpl_data)
 {
+#ifdef USE_VV
 	g_return_if_fail(PURPLE_IS_MEDIA(media));
 	g_object_set(G_OBJECT(media), "prpl-data", prpl_data, NULL);
+#endif
 }
 
 void
 purple_media_error(PurpleMedia *media, const gchar *error, ...)
 {
+#ifdef USE_VV
 	va_list args;
 	gchar *message;
 
@@ -1344,11 +1398,13 @@ purple_media_error(PurpleMedia *media, c
 	g_signal_emit(media, purple_media_signals[ERROR], 0, message);
 
 	g_free(message);
+#endif
 }
 
 void
 purple_media_accept(PurpleMedia *media)
 {
+#ifdef USE_VV
 	GList *streams;
 
 	g_return_if_fail(PURPLE_IS_MEDIA(media));
@@ -1365,32 +1421,38 @@ purple_media_accept(PurpleMedia *media)
 
 	g_signal_emit(media, purple_media_signals[ACCEPTED],
 			0, NULL, NULL);
+#endif
 }
 
 void
 purple_media_hangup(PurpleMedia *media)
 {
+#ifdef USE_VV
 	g_return_if_fail(PURPLE_IS_MEDIA(media));
 	g_signal_emit(media, purple_media_signals[STREAM_INFO],
 			0, PURPLE_MEDIA_INFO_HANGUP,
 			NULL, NULL);
 	purple_media_end(media, NULL, NULL);
+#endif
 }
 
 void
 purple_media_reject(PurpleMedia *media)
 {
+#ifdef USE_VV
 	g_return_if_fail(PURPLE_IS_MEDIA(media));
 	g_signal_emit(media, purple_media_signals[STREAM_INFO],
 			0, PURPLE_MEDIA_INFO_REJECT,
 			NULL, NULL);
 	purple_media_end(media, NULL, NULL);
+#endif
 }
 
 void
 purple_media_end(PurpleMedia *media,
 		const gchar *session_id, const gchar *participant)
 {
+#ifdef USE_VV
 	g_return_if_fail(PURPLE_IS_MEDIA(media));
 	if (session_id == NULL && participant == NULL) {
 		g_signal_emit(media, purple_media_signals[STATE_CHANGED],
@@ -1398,8 +1460,10 @@ purple_media_end(PurpleMedia *media,
 				NULL, NULL);
 		g_object_unref(media);
 	}
+#endif
 }
 
+#ifdef USE_VV
 static void
 purple_media_new_local_candidate_cb(FsStream *stream,
 				    FsCandidate *local_candidate,
@@ -1789,6 +1853,7 @@ purple_media_add_stream_internal(PurpleM
 
 	return TRUE;
 }
+#endif
 
 gboolean
 purple_media_add_stream(PurpleMedia *media, const gchar *sess_id, const gchar *who,
@@ -1796,6 +1861,7 @@ purple_media_add_stream(PurpleMedia *med
 			const gchar *transmitter,
 			guint num_params, GParameter *params)
 {
+#ifdef USE_VV
 	FsStreamDirection type_direction;
 
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE);
@@ -1819,6 +1885,9 @@ purple_media_add_stream(PurpleMedia *med
 		}
 	}
 	return TRUE;
+#else
+	return FALSE;
+#endif
 }
 
 void
@@ -1830,15 +1899,20 @@ purple_media_get_session_type(PurpleMedi
 PurpleMediaSessionType
 purple_media_get_session_type(PurpleMedia *media, const gchar *sess_id)
 {
+#ifdef USE_VV
 	PurpleMediaSession *session;
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), PURPLE_MEDIA_NONE);
 	session = purple_media_get_session(media, sess_id);
 	return session->type;
+#else
+	return PURPLE_MEDIA_NONE;
+#endif
 }
 /* XXX: Should wait until codecs-ready is TRUE before using this function */
 GList *
 purple_media_get_codecs(PurpleMedia *media, const gchar *sess_id)
 {
+#ifdef USE_VV
 	GList *fscodecs;
 	GList *codecs;
 	PurpleMediaSession *session;
@@ -1855,21 +1929,29 @@ purple_media_get_codecs(PurpleMedia *med
 	codecs = purple_media_codec_list_from_fs(fscodecs);
 	fs_codec_list_destroy(fscodecs);
 	return codecs;
+#else
+	return NULL;
+#endif
 }
 
 GList *
 purple_media_get_local_candidates(PurpleMedia *media, const gchar *sess_id, const gchar *name)
 {
+#ifdef USE_VV
 	PurpleMediaStream *stream;
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
 	stream = purple_media_get_stream(media, sess_id, name);
 	return purple_media_candidate_list_from_fs(stream->local_candidates);
+#else
+	return NULL;
+#endif
 }
 
 void
 purple_media_add_remote_candidates(PurpleMedia *media, const gchar *sess_id,
 				   const gchar *name, GList *remote_candidates)
 {
+#ifdef USE_VV
 	PurpleMediaStream *stream;
 	GError *err = NULL;
 
@@ -1887,33 +1969,43 @@ purple_media_add_remote_candidates(Purpl
 				" candidates: %s\n", err->message);
 		g_error_free(err);
 	}
+#endif
 }
 
 GList *
 purple_media_get_active_local_candidates(PurpleMedia *media,
 		const gchar *sess_id, const gchar *name)
 {
+#ifdef USE_VV
 	PurpleMediaStream *stream;
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
 	stream = purple_media_get_stream(media, sess_id, name);
 	return purple_media_candidate_list_from_fs(
 			stream->active_local_candidates);
+#else
+	return NULL;
+#endif
 }
 
 GList *
 purple_media_get_active_remote_candidates(PurpleMedia *media,
 		const gchar *sess_id, const gchar *name)
 {
+#ifdef USE_VV
 	PurpleMediaStream *stream;
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
 	stream = purple_media_get_stream(media, sess_id, name);
 	return purple_media_candidate_list_from_fs(
 			stream->active_remote_candidates);
+#else
+	return NULL;
+#endif
 }
 
 gboolean
 purple_media_set_remote_codecs(PurpleMedia *media, const gchar *sess_id, const gchar *name, GList *codecs)
 {
+#ifdef USE_VV
 	PurpleMediaStream *stream;
 	FsStream *fsstream;
 	GList *fscodecs;
@@ -1937,12 +2029,16 @@ purple_media_set_remote_codecs(PurpleMed
 		return FALSE;
 	}
 	return TRUE;
+#else
+	return FALSE;
+#endif
 }
 
 gboolean
 purple_media_candidates_prepared(PurpleMedia *media,
 		const gchar *session_id, const gchar *participant)
 {
+#ifdef USE_VV
 	GList *streams;
 	gboolean prepared = TRUE;
 
@@ -1960,11 +2056,15 @@ purple_media_candidates_prepared(PurpleM
 	}
 
 	return prepared;
+#else
+	return FALSE;
+#endif
 }
 
 gboolean
 purple_media_set_send_codec(PurpleMedia *media, const gchar *sess_id, PurpleMediaCodec *codec)
 {
+#ifdef USE_VV
 	PurpleMediaSession *session;
 	FsCodec *fscodec;
 	GError *err = NULL;
@@ -1986,11 +2086,15 @@ purple_media_set_send_codec(PurpleMedia 
 		return FALSE;
 	}
 	return TRUE;
+#else
+	return FALSE;
+#endif
 }
 
 gboolean
 purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id)
 {
+#ifdef USE_VV
 	gboolean ret;
 
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE);
@@ -2016,12 +2120,16 @@ purple_media_codecs_ready(PurpleMedia *m
 			g_list_free(values);
 	}
 	return ret;
+#else
+	return FALSE;
+#endif
 }
 
 gboolean
 purple_media_accepted(PurpleMedia *media, const gchar *sess_id,
 		const gchar *participant)
 {
+#ifdef USE_VV
 	gboolean accepted = TRUE;
 
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE);
@@ -2056,10 +2164,14 @@ purple_media_accepted(PurpleMedia *media
 	}
 
 	return accepted;
+#else
+	return FALSE;
+#endif
 }
 
 void purple_media_mute(PurpleMedia *media, gboolean active)
 {
+#ifdef USE_VV
 	GList *sessions;
 
 	g_return_if_fail(PURPLE_IS_MEDIA(media));
@@ -2076,11 +2188,13 @@ void purple_media_mute(PurpleMedia *medi
 			g_object_set(volume, "mute", active, NULL);
 		}
 	}
+#endif
 }
 
 void purple_media_set_input_volume(PurpleMedia *media,
 		const gchar *session_id, double level)
 {
+#ifdef USE_VV
 	GList *sessions;
 
 	g_return_if_fail(PURPLE_IS_MEDIA(media));
@@ -2101,12 +2215,14 @@ void purple_media_set_input_volume(Purpl
 			g_object_set(volume, "volume", level, NULL);
 		}
 	}
+#endif
 }
 
 void purple_media_set_output_volume(PurpleMedia *media,
 		const gchar *session_id, const gchar *participant,
 		double level)
 {
+#ifdef USE_VV
 	GList *streams;
 
 	g_return_if_fail(PURPLE_IS_MEDIA(media));
@@ -2141,21 +2257,27 @@ void purple_media_set_output_volume(Purp
 			gst_iterator_free(iter);
 		}
 	}
+#endif
 }
 
 gulong
 purple_media_set_output_window(PurpleMedia *media, const gchar *session_id,
 		const gchar *participant, gulong window_id)
 {
+#ifdef USE_VV
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE);
 
 	return purple_media_manager_set_output_window(media->priv->manager,
 			media, session_id, participant, window_id);
+#else
+	return 0;
+#endif
 }
 
 void
 purple_media_remove_output_windows(PurpleMedia *media)
 {
+#ifdef USE_VV
 	GList *iter = media->priv->streams;
 	for (; iter; iter = g_list_next(iter)) {
 		PurpleMediaStream *stream = iter->data;
@@ -2171,12 +2293,14 @@ purple_media_remove_output_windows(Purpl
 				media->priv->manager, media,
 				session_name, NULL);
 	}
+#endif
 }
 
 GstElement *
 purple_media_get_tee(PurpleMedia *media,
 		const gchar *session_id, const gchar *participant)
 {
+#ifdef USE_VV
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
 
 	if (session_id != NULL && participant == NULL) {
@@ -2190,6 +2314,8 @@ purple_media_get_tee(PurpleMedia *media,
 		return (stream != NULL) ? stream->tee : NULL;
 	}
 	g_return_val_if_reached(NULL);
+#else
+	return NULL;
+#endif
 }
 
-#endif  /* USE_VV */
============================================================
--- libpurple/media.h	aef7942bf12e38dc6b190f3917039c1410a2b19a
+++ libpurple/media.h	a6527a8931ee7dfdbbcd7a296016996a9397a8cf
@@ -27,8 +27,6 @@
 #ifndef __MEDIA_H_
 #define __MEDIA_H_
 
-#ifdef USE_VV
-
 #include <glib.h>
 #include <glib-object.h>
 
@@ -59,12 +57,6 @@ typedef struct _PurpleMediaCodecParamete
 /** @copydoc _PurpleMediaCodecParameter */
 typedef struct _PurpleMediaCodecParameter PurpleMediaCodecParameter;
 
-#else
-
-typedef void PurpleMedia;
-
-#endif /* USE_VV */
-
 /** Media caps */
 typedef enum {
 	PURPLE_MEDIA_CAPS_NONE = 0,
@@ -122,8 +114,6 @@ typedef enum {
 	PURPLE_MEDIA_NETWORK_PROTOCOL_TCP,
 } PurpleMediaNetworkProtocol;
 
-#ifdef USE_VV
-
 /** The media class */
 struct _PurpleMediaClass
 {
@@ -596,7 +586,4 @@ G_END_DECLS
 
 G_END_DECLS
 
-#endif  /* USE_VV */
-
-
 #endif  /* __MEDIA_H_ */
============================================================
--- libpurple/mediamanager.c	e7b270f88eee0d1fb2f359f800182f37e698bc67
+++ libpurple/mediamanager.c	09bdedc4750b6440f17c0accabf67ba26c7efc4a
@@ -49,6 +49,7 @@ struct _PurpleMediaOutputWindow
 	gulong window_id;
 	GstElement *sink;
 };
+#endif
 
 struct _PurpleMediaManagerPrivate
 {
@@ -155,13 +156,18 @@ purple_media_manager_get()
 PurpleMediaManager *
 purple_media_manager_get()
 {
+#ifdef USE_VV
 	static PurpleMediaManager *manager = NULL;
 
 	if (manager == NULL)
 		manager = PURPLE_MEDIA_MANAGER(g_object_new(purple_media_manager_get_type(), NULL));
 	return manager;
+#else
+	return NULL;
+#endif
 }
 
+#ifdef USE_VV
 static gboolean
 pipeline_bus_call(GstBus *bus, GstMessage *msg, PurpleMediaManager *manager)
 {
@@ -192,10 +198,12 @@ pipeline_bus_call(GstBus *bus, GstMessag
 	}
 	return TRUE;
 }
+#endif
 
 GstElement *
 purple_media_manager_get_pipeline(PurpleMediaManager *manager)
 {
+#ifdef USE_VV
 	g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), NULL);
 
 	if (manager->priv->pipeline == NULL) {
@@ -216,6 +224,9 @@ purple_media_manager_get_pipeline(Purple
 	}
 
 	return manager->priv->pipeline;
+#else
+	return NULL;
+#endif
 }
 
 PurpleMedia *
@@ -225,6 +236,7 @@ purple_media_manager_create_media(Purple
 				  const char *remote_user,
 				  gboolean initiator)
 {
+#ifdef USE_VV
 	PurpleMedia *media;
 	FsConference *conference = FS_CONFERENCE(gst_element_factory_make(conference_type, NULL));
 	GstStateChangeReturn ret;
@@ -266,18 +278,26 @@ purple_media_manager_create_media(Purple
 
 	manager->priv->medias = g_list_append(manager->priv->medias, media);
 	return media;
+#else
+	return NULL;
+#endif
 }
 
 GList *
 purple_media_manager_get_media(PurpleMediaManager *manager)
 {
+#ifdef USE_VV
 	return manager->priv->medias;
+#else
+	return NULL;
+#endif
 }
 
 GList *
 purple_media_manager_get_media_by_connection(PurpleMediaManager *manager,
 		PurpleConnection *pc)
 {
+#ifdef USE_VV
 	GList *media = NULL;
 	GList *iter;
 
@@ -291,22 +311,28 @@ purple_media_manager_get_media_by_connec
 	}
 
 	return media;
+#else
+	return NULL;
+#endif
 }
 
 void
 purple_media_manager_remove_media(PurpleMediaManager *manager,
 				  PurpleMedia *media)
 {
+#ifdef USE_VV
 	GList *list = g_list_find(manager->priv->medias, media);
 	if (list)
 		manager->priv->medias =
 			g_list_delete_link(manager->priv->medias, list);
+#endif
 }
 
 GstElement *
 purple_media_manager_get_element(PurpleMediaManager *manager,
 		PurpleMediaSessionType type)
 {
+#ifdef USE_VV
 	GstElement *ret = NULL;
 
 	/* TODO: If src, retrieve current src */
@@ -329,12 +355,16 @@ purple_media_manager_get_element(PurpleM
 		purple_debug_error("media", "Error creating source or sink\n");
 
 	return ret;
+#else
+	return NULL;
+#endif
 }
 
 PurpleMediaElementInfo *
 purple_media_manager_get_element_info(PurpleMediaManager *manager,
 		const gchar *id)
 {
+#ifdef USE_VV
 	GList *iter;
 
 	g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), NULL);
@@ -346,6 +376,7 @@ purple_media_manager_get_element_info(Pu
 		if (!strcmp(info->id, id))
 			return info;
 	}
+#endif
 
 	return NULL;
 }
@@ -354,6 +385,7 @@ purple_media_manager_register_element(Pu
 purple_media_manager_register_element(PurpleMediaManager *manager,
 		PurpleMediaElementInfo *info)
 {
+#ifdef USE_VV
 	g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), FALSE);
 	g_return_val_if_fail(info != NULL, FALSE);
 
@@ -363,12 +395,16 @@ purple_media_manager_register_element(Pu
 	manager->priv->elements =
 			g_list_prepend(manager->priv->elements, info);
 	return TRUE;
+#else
+	return FALSE;
+#endif
 }
 
 gboolean
 purple_media_manager_unregister_element(PurpleMediaManager *manager,
 		const gchar *id)
 {
+#ifdef USE_VV
 	PurpleMediaElementInfo *info;
 
 	g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), FALSE);
@@ -390,12 +426,16 @@ purple_media_manager_unregister_element(
 	manager->priv->elements = g_list_remove(
 			manager->priv->elements, info);
 	return TRUE;
+#else
+	return FALSE;
+#endif
 }
 
 gboolean
 purple_media_manager_set_active_element(PurpleMediaManager *manager,
 		PurpleMediaElementInfo *info)
 {
+#ifdef USE_VV
 	gboolean ret = FALSE;
 
 	g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), FALSE);
@@ -426,12 +466,16 @@ purple_media_manager_set_active_element(
 	}
 
 	return ret;
+#else
+	return FALSE;
+#endif
 }
 
 PurpleMediaElementInfo *
 purple_media_manager_get_active_element(PurpleMediaManager *manager,
 		PurpleMediaElementType type)
 {
+#ifdef USE_VV
 	g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), NULL);
 
 	if (type & PURPLE_MEDIA_ELEMENT_SRC) {
@@ -445,10 +489,12 @@ purple_media_manager_get_active_element(
 		else if (type & PURPLE_MEDIA_ELEMENT_VIDEO)
 			return manager->priv->video_sink;
 	}
+#endif
 
 	return NULL;
 }
 
+#ifdef USE_VV
 static void
 window_id_cb(GstBus *bus, GstMessage *msg, PurpleMediaOutputWindow *ow)
 {
@@ -466,12 +512,14 @@ window_id_cb(GstBus *bus, GstMessage *ms
 				GST_MESSAGE_SRC(msg)), ow->window_id);
 	}
 }
+#endif
 
 gboolean
 purple_media_manager_create_output_window(PurpleMediaManager *manager,
 		PurpleMedia *media, const gchar *session_id,
 		const gchar *participant)
 {
+#ifdef USE_VV
 	GList *iter;
 
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE);
@@ -529,6 +577,9 @@ purple_media_manager_create_output_windo
 		}
 	}
 	return TRUE;
+#else
+	return FALSE;
+#endif
 }
 
 gulong
@@ -536,6 +587,7 @@ purple_media_manager_set_output_window(P
 		PurpleMedia *media, const gchar *session_id,
 		const gchar *participant, gulong window_id)
 {
+#ifdef USE_VV
 	PurpleMediaOutputWindow *output_window;
 
 	g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), FALSE);
@@ -556,12 +608,16 @@ purple_media_manager_set_output_window(P
 				media, session_id, participant);
 
 	return output_window->id;
+#else
+	return 0;
+#endif
 }
 
 gboolean
 purple_media_manager_remove_output_window(PurpleMediaManager *manager,
 		gulong output_window_id)
 {
+#ifdef USE_VV
 	PurpleMediaOutputWindow *output_window = NULL;
 	GList *iter;
 
@@ -605,6 +661,9 @@ purple_media_manager_remove_output_windo
 	g_free(output_window);
 
 	return TRUE;
+#else
+	return FALSE;
+#endif
 }
 
 void
@@ -612,6 +671,7 @@ purple_media_manager_remove_output_windo
 		PurpleMedia *media, const gchar *session_id,
 		const gchar *participant)
 {
+#ifdef USE_VV
 	GList *iter;
 
 	g_return_if_fail(PURPLE_IS_MEDIA(media));
@@ -632,6 +692,6 @@ purple_media_manager_remove_output_windo
 		purple_media_manager_remove_output_window(
 				manager, ow->id);
 	}
+#endif
 }
 
-#endif  /* USE_VV */
============================================================
--- libpurple/mediamanager.h	53e1c4aaad9294586d35331477d78b87be8d19b6
+++ libpurple/mediamanager.h	63756666632dbd801d8be931908c8ea20eff4e25
@@ -27,8 +27,6 @@
 #ifndef __MEDIA_MANAGER_H_
 #define __MEDIA_MANAGER_H_
 
-#ifdef USE_VV
-
 #include <glib.h>
 #include <glib-object.h>
 
@@ -155,7 +153,4 @@ G_END_DECLS
 
 G_END_DECLS
 
-#endif  /* USE_VV */
-
-
 #endif  /* __MEDIA_MANAGER_H_ */


More information about the Commits mailing list