changeset 26462:b0a9c48b5f69

merge of '2d0e977ba883c0b9d24d52360839cfed7cf1f2a6' and 'e9514d92cd62759a80a75f93b308e4fd05afe673'
author Mike Ruprecht <maiku@soc.pidgin.im>
date Mon, 30 Mar 2009 04:15:53 +0000
parents aa85cf759b98 (current diff) cdce3db4e09f (diff)
children 6bcf5ad967ea
files pidgin/gtkmedia.c
diffstat 4 files changed, 36 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntmedia.c	Mon Mar 30 03:58:18 2009 +0000
+++ b/finch/gntmedia.c	Mon Mar 30 04:15:53 2009 +0000
@@ -45,6 +45,29 @@
 
 #undef hangup
 
+#define FINCH_TYPE_MEDIA            (finch_media_get_type())
+#define FINCH_MEDIA(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), FINCH_TYPE_MEDIA, FinchMedia))
+#define FINCH_MEDIA_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), FINCH_TYPE_MEDIA, FinchMediaClass))
+#define FINCH_IS_MEDIA(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), FINCH_TYPE_MEDIA))
+#define FINCH_IS_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), FINCH_TYPE_MEDIA))
+#define FINCH_MEDIA_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), FINCH_TYPE_MEDIA, FinchMediaClass))
+
+typedef struct _FinchMedia FinchMedia;
+typedef struct _FinchMediaClass FinchMediaClass;
+typedef struct _FinchMediaPrivate FinchMediaPrivate;
+typedef enum _FinchMediaState FinchMediaState;
+
+struct _FinchMediaClass
+{
+	GntBoxClass parent_class;
+};
+
+struct _FinchMedia
+{
+	GntBox parent;
+	FinchMediaPrivate *priv;
+};
+
 struct _FinchMediaPrivate
 {
 	PurpleMedia *media;
@@ -78,7 +101,7 @@
 	PROP_MEDIA,
 };
 
-GType
+static GType
 finch_media_get_type(void)
 {
 	static GType type = 0;
@@ -319,7 +342,7 @@
 	}
 }
 
-GntWidget *
+static GntWidget *
 finch_media_new(PurpleMedia *media)
 {
 	return GNT_WIDGET(g_object_new(finch_media_get_type(),
@@ -378,7 +401,7 @@
 	double input_volume = purple_prefs_get_int(
 			"/purple/media/audio/volume/input")/10.0;
 
-	bin = gst_bin_new("purplesendaudiobin");
+	bin = gst_bin_new("finchdefaultaudiosrc");
 	src = gst_element_factory_make("alsasrc", "asrc");
 	volume = gst_element_factory_make("volume", "purpleaudioinputvolume");
 	g_object_set(volume, "volume", input_volume, NULL);
@@ -435,9 +458,11 @@
 			| PURPLE_MEDIA_ELEMENT_ONE_SINK,
 	create_default_audio_sink,	/* create */
 };
+#endif  /* USE_VV */
 
 void finch_media_manager_init(void)
 {
+#ifdef USE_VV
 	PurpleMediaManager *manager = purple_media_manager_get();
 	g_signal_connect(G_OBJECT(manager), "init-media", G_CALLBACK(finch_new_media), NULL);
 	purple_cmd_register("call", "", PURPLE_CMD_P_DEFAULT,
@@ -447,14 +472,16 @@
 	purple_debug_info("gntmedia", "Registering media element types\n");
 	purple_media_manager_set_active_element(manager, &default_audio_src);
 	purple_media_manager_set_active_element(manager, &default_audio_sink);
+#endif
 }
 
 void finch_media_manager_uninit(void)
 {
+#ifdef USE_VV
 	PurpleMediaManager *manager = purple_media_manager_get();
 	g_signal_handlers_disconnect_by_func(G_OBJECT(manager),
 			G_CALLBACK(finch_new_media), NULL);
+#endif
 }
 
-#endif  /* USE_VV */
 
--- a/finch/gntmedia.h	Mon Mar 30 03:58:18 2009 +0000
+++ b/finch/gntmedia.h	Mon Mar 30 04:15:53 2009 +0000
@@ -31,47 +31,12 @@
 #include "config.h"
 #endif
 
-#ifdef USE_VV
-
-#include <glib-object.h>
-#include "gntbox.h"
-
 G_BEGIN_DECLS
 
-#define FINCH_TYPE_MEDIA            (finch_media_get_type())
-#define FINCH_MEDIA(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), FINCH_TYPE_MEDIA, FinchMedia))
-#define FINCH_MEDIA_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), FINCH_TYPE_MEDIA, FinchMediaClass))
-#define FINCH_IS_MEDIA(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), FINCH_TYPE_MEDIA))
-#define FINCH_IS_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), FINCH_TYPE_MEDIA))
-#define FINCH_MEDIA_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), FINCH_TYPE_MEDIA, FinchMediaClass))
-
-typedef struct _FinchMedia FinchMedia;
-typedef struct _FinchMediaClass FinchMediaClass;
-typedef struct _FinchMediaPrivate FinchMediaPrivate;
-typedef enum _FinchMediaState FinchMediaState;
-
-struct _FinchMediaClass
-{
-	GntBoxClass parent_class;
-};
-
-struct _FinchMedia
-{
-	GntBox parent;
-	FinchMediaPrivate *priv;
-};
-
-GType finch_media_get_type(void);
-
-GntWidget *finch_media_new(PurpleMedia *media);
-
 void finch_media_manager_init(void);
-
 void finch_media_manager_uninit(void);
 
 G_END_DECLS
 
-#endif /* USE_VV */
-
 #endif /* GNT_MEDIA_H */
 
--- a/finch/gntui.c	Mon Mar 30 03:58:18 2009 +0000
+++ b/finch/gntui.c	Mon Mar 30 04:15:53 2009 +0000
@@ -92,10 +92,8 @@
 	finch_roomlist_init();
 	purple_roomlist_set_ui_ops(finch_roomlist_get_ui_ops());
 
-#ifdef USE_VV
 	/* Media */
 	finch_media_manager_init();
-#endif
 
 	gnt_register_action(_("Accounts"), finch_accounts_show_all);
 	gnt_register_action(_("Buddy List"), finch_blist_show);
--- a/pidgin/gtkmedia.c	Mon Mar 30 03:58:18 2009 +0000
+++ b/pidgin/gtkmedia.c	Mon Mar 30 04:15:53 2009 +0000
@@ -892,7 +892,7 @@
 	const gchar *video_device = purple_prefs_get_string(
 			"/purple/media/video/device");
 
-	sendbin = gst_bin_new("purplesendvideobin");
+	sendbin = gst_bin_new("pidgindefaultvideosrc");
 	src = gst_element_factory_make(video_plugin, "purplevideosource");
 	videoscale = gst_element_factory_make("videoscale", NULL);
 	capsfilter = gst_element_factory_make("capsfilter", NULL);
@@ -938,7 +938,7 @@
 	double input_volume = purple_prefs_get_int(
 			"/purple/media/audio/volume/input")/10.0;
 
-	bin = gst_bin_new("purplesendaudiobin");
+	bin = gst_bin_new("pidgindefaultaudiosrc");
 	src = gst_element_factory_make("alsasrc", "asrc");
 	volume = gst_element_factory_make("volume", "purpleaudioinputvolume");
 	g_object_set(volume, "volume", input_volume, NULL);
@@ -1020,10 +1020,12 @@
 			| PURPLE_MEDIA_ELEMENT_ONE_SINK,
 	create_default_audio_sink,	/* create */
 };
+#endif  /* USE_VV */
 
 void
 pidgin_medias_init(void)
 {
+#ifdef USE_VV
 	PurpleMediaManager *manager = purple_media_manager_get();
 	g_signal_connect(G_OBJECT(manager), "init-media",
 			 G_CALLBACK(pidgin_media_new_cb), NULL);
@@ -1033,6 +1035,6 @@
 	purple_media_manager_set_active_element(manager, &default_video_sink);
 	purple_media_manager_set_active_element(manager, &default_audio_src);
 	purple_media_manager_set_active_element(manager, &default_audio_sink);
+#endif
 }
 
-#endif  /* USE_VV */