/pidgin/main: 10251384e4db: Remove vvconfig plugin source.

Elliott Sales de Andrade qulogic at pidgin.im
Sun Jun 2 22:16:39 EDT 2013


Changeset: 10251384e4dbeefc4c533b20783732321f8d3233
Author:	 Elliott Sales de Andrade <qulogic at pidgin.im>
Date:	 2013-06-02 22:14 -0400
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/10251384e4db

Description:

Remove vvconfig plugin source.

Everything it does is now in the prefs or media setup.

diffstat:

 pidgin/plugins/vvconfig.c |  804 ----------------------------------------------
 1 files changed, 0 insertions(+), 804 deletions(-)

diffs (truncated from 809 to 300 lines):

diff --git a/pidgin/plugins/vvconfig.c b/pidgin/plugins/vvconfig.c
deleted file mode 100644
--- a/pidgin/plugins/vvconfig.c
+++ /dev/null
@@ -1,804 +0,0 @@
-/*
- * Configures microphones and webcams for voice and video
- * Copyright (C) 2009 Mike Ruprecht <cmaiku at gmail.com>
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA.
- */
-#include "internal.h"
-
-#include "debug.h"
-#include "mediamanager.h"
-#include "media-gst.h"
-#include "version.h"
-#include "gtkplugin.h"
-#include "gtkutils.h"
-#include "gtkprefs.h"
-
-#include <gst/interfaces/propertyprobe.h>
-
-/* container window for showing a stand-alone configurator */
-static GtkWidget *window = NULL;
-
-static PurpleMediaElementInfo *old_video_src = NULL, *old_video_sink = NULL,
-		*old_audio_src = NULL, *old_audio_sink = NULL;
-
-static const gchar *AUDIO_SRC_PLUGINS[] = {
-	"alsasrc",	"ALSA",
-	/* "esdmon",	"ESD", ? */
-	"osssrc",	"OSS",
-	"pulsesrc",	"PulseAudio",
-	"sndiosrc",	"sndio",
-	/* "audiotestsrc wave=silence", "Silence", */
-	"audiotestsrc",	"Test Sound",
-	NULL
-};
-
-static const gchar *AUDIO_SINK_PLUGINS[] = {
-	"alsasink",	"ALSA",
-	"artsdsink",	"aRts",
-	"esdsink",	"ESD",
-	"osssink",	"OSS",
-	"pulsesink",	"PulseAudio",
-	"sndiosink",	"sndio",
-	NULL
-};
-
-static const gchar *VIDEO_SRC_PLUGINS[] = {
-	"videotestsrc",	"Test Input",
-	"dshowvideosrc","DirectDraw",
-	"ksvideosrc",	"KS Video",
-	"qcamsrc",	"Quickcam",
-	"v4lsrc",	"Video4Linux",
-	"v4l2src",	"Video4Linux2",
-	"v4lmjpegsrc",	"Video4Linux MJPEG",
-	NULL
-};
-
-static const gchar *VIDEO_SINK_PLUGINS[] = {
-	/* "aasink",	"AALib", Didn't work for me */
-	"directdrawsink","DirectDraw",
-	"glimagesink",	"OpenGL",
-	"ximagesink",	"X Window System",
-	"xvimagesink",	"X Window System (Xv)",
-	NULL
-};
-
-static GList *
-get_element_devices(const gchar *element_name)
-{
-	GList *ret = NULL;
-	GstElement *element;
-	GObjectClass *klass;
-	GstPropertyProbe *probe;
-	const GParamSpec *pspec;
-
-	ret = g_list_prepend(ret, (gpointer)_("Default"));
-	ret = g_list_prepend(ret, "");
-
-	if (!strcmp(element_name, "<custom>") || (*element_name == '\0')) {
-		return g_list_reverse(ret);
-	}
-
-	element = gst_element_factory_make(element_name, "test");
-	if(!element) {
-		purple_debug_info("vvconfig", "'%s' - unable to find element\n", element_name);
-		return g_list_reverse(ret);
-	}
-
-	klass = G_OBJECT_GET_CLASS (element);
-	if(!klass) {
-		purple_debug_info("vvconfig", "'%s' - unable to find G_Object Class\n", element_name);
-		return g_list_reverse(ret);
-	}
-
-	if (!g_object_class_find_property(klass, "device") ||
-			!GST_IS_PROPERTY_PROBE(element) ||
-			!(probe = GST_PROPERTY_PROBE(element)) ||
-			!(pspec = gst_property_probe_get_property(probe, "device"))) {
-		purple_debug_info("vvconfig", "'%s' - no device\n", element_name);
-	} else {
-		gint n;
-		GValueArray *array;
-
-		/* Set autoprobe[-fps] to FALSE to avoid delays when probing. */
-		if (g_object_class_find_property (klass, "autoprobe")) {
-			g_object_set (G_OBJECT (element), "autoprobe", FALSE, NULL);
-			if (g_object_class_find_property (klass, "autoprobe-fps")) {
-				g_object_set (G_OBJECT (element), "autoprobe-fps", FALSE, NULL);
-			}
-		}
-
-		array = gst_property_probe_probe_and_get_values (probe, pspec);
-		if (array == NULL) {
-			purple_debug_info("vvconfig", "'%s' has no devices\n", element_name);
-			return g_list_reverse(ret);
-		}
-
-		for (n=0; n < array->n_values; ++n) {
-			GValue *device;
-			const gchar *name;
-			const gchar *device_name;
-
-			device = g_value_array_get_nth(array, n);
-			g_object_set_property(G_OBJECT(element), "device", device);
-			if (gst_element_set_state(element, GST_STATE_READY)
-					!= GST_STATE_CHANGE_SUCCESS) {
-				purple_debug_warning("vvconfig",
-						"Error changing state of %s\n",
-						element_name);
-				continue;
-			}
-
-			g_object_get(G_OBJECT(element), "device-name", &name, NULL);
-			device_name = g_value_get_string(device);
-			if (name == NULL)
-				name = _("Unknown");
-			purple_debug_info("vvconfig", "Found device %s : %s for %s\n",
-					device_name, name, element_name);
-			ret = g_list_prepend(ret, (gpointer)name);
-			ret = g_list_prepend(ret, (gpointer)device_name);
-			gst_element_set_state(element, GST_STATE_NULL);
-		}
-	}
-	gst_object_unref(element);
-
-	return g_list_reverse(ret);
-}
-
-static GList *
-get_element_plugins(const gchar **plugins)
-{
-	GList *ret = NULL;
-
-	ret = g_list_prepend(ret, "Default");
-	ret = g_list_prepend(ret, "");
-	for (; plugins[0] && plugins[1]; plugins += 2) {
-		if (gst_default_registry_check_feature_version(
-				plugins[0], 0, 0, 0)) {
-			ret = g_list_prepend(ret, (gpointer)plugins[1]);
-			ret = g_list_prepend(ret, (gpointer)plugins[0]);
-		}
-	}
-	ret = g_list_reverse(ret);
-	return ret;
-}
-
-static void
-device_changed_cb(const gchar *name, PurplePrefType type,
-		gconstpointer value, gpointer data)
-{
-	GtkSizeGroup *sg = data;
-	GtkWidget *parent, *widget;
-	GSList *widgets;
-	GList *devices;
-	GValue gvalue;
-	gint position;
-	gchar *label, *pref;
-
-	widgets = gtk_size_group_get_widgets(GTK_SIZE_GROUP(sg));
-	for (; widgets; widgets = g_slist_next(widgets)) {
-		const gchar *widget_name =
-				gtk_widget_get_name(GTK_WIDGET(widgets->data));
-		if (!strcmp(widget_name, name)) {
-			gchar *temp_str;
-			gchar delimiters[3] = {0, 0, 0};
-			const gchar *text;
-			gint keyval, pos;
-
-			widget = widgets->data;
-			/* Get label with _ from the GtkLabel */
-			text = gtk_label_get_text(GTK_LABEL(widget));
-			keyval = gtk_label_get_mnemonic_keyval(GTK_LABEL(widget));
-			delimiters[0] = g_ascii_tolower(keyval);
-			delimiters[1] = g_ascii_toupper(keyval);
-			pos = strcspn(text, delimiters);
-			if (pos != -1) {
-				temp_str = g_strndup(text, pos);
-				label = g_strconcat(temp_str, "_",
-						text + pos, NULL);
-				g_free(temp_str);
-			} else {
-				label = g_strdup(text);
-			}
-			break;
-		}
-	}
-
-	if (widgets == NULL)
-		return;
-
-	parent = gtk_widget_get_parent(widget);
-	widget = parent;
-	parent = gtk_widget_get_parent(GTK_WIDGET(widget));
-	gvalue.g_type = 0;
-	g_value_init(&gvalue, G_TYPE_INT);
-	gtk_container_child_get_property(GTK_CONTAINER(parent),
-			GTK_WIDGET(widget), "position", &gvalue);
-	position = g_value_get_int(&gvalue);
-	g_value_unset(&gvalue);
-	gtk_widget_destroy(widget);
-
-	pref = g_strdup(name);
-	strcpy(pref + strlen(pref) - strlen("plugin"), "device");
-	devices = get_element_devices(value);
-	if (g_list_find_custom(devices, purple_prefs_get_string(pref),
-			(GCompareFunc)strcmp) == NULL)
-		purple_prefs_set_string(pref, g_list_next(devices)->data);
-	widget = pidgin_prefs_dropdown_from_list(parent,
-			label, PURPLE_PREF_STRING,
-			pref, devices);
-	g_list_free(devices);
-	g_signal_connect_swapped(widget, "destroy",
-			G_CALLBACK(g_free), pref);
-	g_free(label);
-	gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5);
-	gtk_widget_set_name(widget, name);
-	gtk_size_group_add_widget(sg, widget);
-	gtk_box_reorder_child(GTK_BOX(parent),
-			gtk_widget_get_parent(GTK_WIDGET(widget)), position);
-}
-
-static void
-get_plugin_frame(GtkWidget *parent, GtkSizeGroup *sg,
-		const gchar *name, const gchar *plugin_label,
-		const gchar **plugin_strs, const gchar *plugin_pref,
-		const gchar *device_label, const gchar *device_pref)
-{
-	GtkWidget *vbox, *widget;
-	GList *plugins, *devices;
-
-	vbox = pidgin_make_frame(parent, name);
-
-	/* Setup plugin preference */
-	plugins = get_element_plugins(plugin_strs);
-	widget = pidgin_prefs_dropdown_from_list(vbox, plugin_label,
-			PURPLE_PREF_STRING, plugin_pref, plugins);
-	g_list_free(plugins);
-	gtk_size_group_add_widget(sg, widget);
-	gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5);
-
-	/* Setup device preference */
-	devices = get_element_devices(purple_prefs_get_string(plugin_pref));
-	if (g_list_find_custom(devices, purple_prefs_get_string(device_pref),
-			(GCompareFunc) strcmp) == NULL)
-		purple_prefs_set_string(device_pref, g_list_next(devices)->data);
-	widget = pidgin_prefs_dropdown_from_list(vbox, device_label,
-			PURPLE_PREF_STRING, device_pref, devices);
-	g_list_free(devices);
-	gtk_widget_set_name(widget, plugin_pref);
-	gtk_size_group_add_widget(sg, widget);
-	gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5);
-
-	purple_prefs_connect_callback(vbox, plugin_pref,
-			device_changed_cb, sg);
-	g_signal_connect_swapped(vbox, "destroy",
-			G_CALLBACK(purple_prefs_disconnect_by_handle), vbox);
-}
-
-static GtkWidget *
-get_plugin_config_frame(PurplePlugin *plugin) {
-	GtkWidget *notebook, *vbox_audio, *vbox_video;
-	GtkSizeGroup *sg;
-
-	notebook = gtk_notebook_new();



More information about the Commits mailing list