Thu, 03 Jun 2021 19:33:07 -0500
Fix some null pointer deferences and dead stores that scanbuild found in Pidgin
Testing Done:
Verified scanbuild no long detected the errors.
Reviewed at https://reviews.imfreedom.org/r/719/
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
1 | /* |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
2 | * Configures microphones and webcams for voice and video |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
3 | * Copyright (C) 2009 Mike Ruprecht <cmaiku@gmail.com> |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
4 | * |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
5 | * This program is free software; you can redistribute it and/or |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
6 | * modify it under the terms of the GNU General Public License |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
7 | * as published by the Free Software Foundation; either version 2 |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
8 | * of the License, or (at your option) any later version. |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
9 | * |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
13 | * GNU General Public License for more details. |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
14 | * |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
16 | * along with this program; if not, write to the Free Software |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA. |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
18 | */ |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
19 | #include "internal.h" |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
20 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
21 | #include "debug.h" |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
22 | #include "mediamanager.h" |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
23 | #include "media-gst.h" |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
24 | #include "version.h" |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
25 | #include "gtkplugin.h" |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
26 | #include "gtkutils.h" |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
27 | #include "gtkprefs.h" |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
28 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
29 | #if GST_CHECK_VERSION(1,0,0) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
30 | #include <gst/video/videooverlay.h> |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
31 | #else |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
32 | #include <gst/interfaces/propertyprobe.h> |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
33 | #endif |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
34 | |
|
30745
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
35 | /* container window for showing a stand-alone configurator */ |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
36 | static GtkWidget *window = NULL; |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
37 | |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
38 | static PurpleMediaElementInfo *old_video_src = NULL, *old_video_sink = NULL, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
39 | *old_audio_src = NULL, *old_audio_sink = NULL; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
40 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
41 | static const gchar *AUDIO_SRC_PLUGINS[] = { |
|
40499
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
42 | "alsasrc", N_("ALSA"), |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
43 | /* "esdmon", "ESD", ? */ |
|
40499
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
44 | "osssrc", N_("OSS"), |
|
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
45 | "pulsesrc", N_("PulseAudio"), |
|
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
46 | "sndiosrc", N_("sndio"), |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
47 | /* "audiotestsrc wave=silence", "Silence", */ |
|
40499
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
48 | "audiotestsrc", N_("Test Sound"), |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
49 | NULL |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
50 | }; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
51 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
52 | static const gchar *AUDIO_SINK_PLUGINS[] = { |
|
40499
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
53 | "alsasink", N_("ALSA"), |
|
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
54 | "artsdsink", N_("aRts"), |
|
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
55 | "esdsink", N_("ESD"), |
|
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
56 | "osssink", N_("OSS"), |
|
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
57 | "pulsesink", N_("PulseAudio"), |
|
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
58 | "sndiosink", N_("sndio"), |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
59 | NULL |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
60 | }; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
61 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
62 | static const gchar *VIDEO_SRC_PLUGINS[] = { |
|
40499
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
63 | "videotestsrc", N_("Test Input"), |
|
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
64 | "dshowvideosrc", N_("DirectDraw"), |
|
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
65 | "ksvideosrc", N_("KS Video"), |
|
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
66 | "qcamsrc", N_("Quickcam"), |
|
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
67 | "v4lsrc", N_("Video4Linux"), |
|
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
68 | "v4l2src", N_("Video4Linux2"), |
|
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
69 | "v4lmjpegsrc", N_("Video4Linux MJPEG"), |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
70 | NULL |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
71 | }; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
72 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
73 | static const gchar *VIDEO_SINK_PLUGINS[] = { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
74 | /* "aasink", "AALib", Didn't work for me */ |
|
40499
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
75 | "directdrawsink", N_("DirectDraw"), |
|
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
76 | "glimagesink", N_("OpenGL"), |
|
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
77 | "ximagesink", N_("X Window System"), |
|
2320cf8d228a
A patch from Ambrose Li to mark additional voice and video strings for translation
Gary Kramlich <grim@reaperworld.com>
parents:
38948
diff
changeset
|
78 | "xvimagesink", N_("X Window System (Xv)"), |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
79 | NULL |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
80 | }; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
81 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
82 | static GList * |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
83 | get_element_devices(const gchar *element_name) |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
84 | { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
85 | GList *ret = NULL; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
86 | GstElement *element; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
87 | GObjectClass *klass; |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
88 | #if !GST_CHECK_VERSION(1,0,0) |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
89 | GstPropertyProbe *probe; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
90 | const GParamSpec *pspec; |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
91 | #endif |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
92 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
93 | ret = g_list_prepend(ret, (gpointer)_("Default")); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
94 | ret = g_list_prepend(ret, ""); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
95 | |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38257
diff
changeset
|
96 | if (purple_strequal(element_name, "<custom>") || (*element_name == '\0')) { |
|
31369
d7b8fe78c9d2
vvconfig: Don't crash when the stored device isn't found in the list of
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
97 | return g_list_reverse(ret); |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
98 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
99 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
100 | element = gst_element_factory_make(element_name, "test"); |
|
31681
0f60ba9bf9c7
Fix another vvconfig crash. Fixes #13290, #13774.
Pat Erley <pat@erley.org>
parents:
31623
diff
changeset
|
101 | if(!element) { |
|
0f60ba9bf9c7
Fix another vvconfig crash. Fixes #13290, #13774.
Pat Erley <pat@erley.org>
parents:
31623
diff
changeset
|
102 | purple_debug_info("vvconfig", "'%s' - unable to find element\n", element_name); |
|
0f60ba9bf9c7
Fix another vvconfig crash. Fixes #13290, #13774.
Pat Erley <pat@erley.org>
parents:
31623
diff
changeset
|
103 | return g_list_reverse(ret); |
|
0f60ba9bf9c7
Fix another vvconfig crash. Fixes #13290, #13774.
Pat Erley <pat@erley.org>
parents:
31623
diff
changeset
|
104 | } |
|
0f60ba9bf9c7
Fix another vvconfig crash. Fixes #13290, #13774.
Pat Erley <pat@erley.org>
parents:
31623
diff
changeset
|
105 | |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
106 | klass = G_OBJECT_GET_CLASS (element); |
|
31681
0f60ba9bf9c7
Fix another vvconfig crash. Fixes #13290, #13774.
Pat Erley <pat@erley.org>
parents:
31623
diff
changeset
|
107 | if(!klass) { |
|
0f60ba9bf9c7
Fix another vvconfig crash. Fixes #13290, #13774.
Pat Erley <pat@erley.org>
parents:
31623
diff
changeset
|
108 | purple_debug_info("vvconfig", "'%s' - unable to find G_Object Class\n", element_name); |
|
0f60ba9bf9c7
Fix another vvconfig crash. Fixes #13290, #13774.
Pat Erley <pat@erley.org>
parents:
31623
diff
changeset
|
109 | return g_list_reverse(ret); |
|
0f60ba9bf9c7
Fix another vvconfig crash. Fixes #13290, #13774.
Pat Erley <pat@erley.org>
parents:
31623
diff
changeset
|
110 | } |
|
0f60ba9bf9c7
Fix another vvconfig crash. Fixes #13290, #13774.
Pat Erley <pat@erley.org>
parents:
31623
diff
changeset
|
111 | |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
112 | #if GST_CHECK_VERSION(1,0,0) |
|
40718
5201d33e8999
Fix some spelling errors
Richard Laager <rlaager@pidgin.im>
parents:
40499
diff
changeset
|
113 | purple_debug_info("vvconfig", "'%s' - gstreamer-1.0 doesn't support " |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
114 | "property probing\n", element_name); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
115 | #else |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
116 | if (!g_object_class_find_property(klass, "device") || |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
117 | !GST_IS_PROPERTY_PROBE(element) || |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
118 | !(probe = GST_PROPERTY_PROBE(element)) || |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
119 | !(pspec = gst_property_probe_get_property(probe, "device"))) { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
120 | purple_debug_info("vvconfig", "'%s' - no device\n", element_name); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
121 | } else { |
|
36256
a437550a9308
Remove -Wno-sign-compare and backport fixes from default.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35980
diff
changeset
|
122 | gsize n; |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
123 | GValueArray *array; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
124 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
125 | /* Set autoprobe[-fps] to FALSE to avoid delays when probing. */ |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
126 | if (g_object_class_find_property (klass, "autoprobe")) { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
127 | g_object_set (G_OBJECT (element), "autoprobe", FALSE, NULL); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
128 | if (g_object_class_find_property (klass, "autoprobe-fps")) { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
129 | g_object_set (G_OBJECT (element), "autoprobe-fps", FALSE, NULL); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
130 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
131 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
132 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
133 | array = gst_property_probe_probe_and_get_values (probe, pspec); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
134 | if (array == NULL) { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
135 | purple_debug_info("vvconfig", "'%s' has no devices\n", element_name); |
|
31369
d7b8fe78c9d2
vvconfig: Don't crash when the stored device isn't found in the list of
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
136 | return g_list_reverse(ret); |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
137 | } |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31279
diff
changeset
|
138 | |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
139 | for (n=0; n < array->n_values; ++n) { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
140 | GValue *device; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
141 | const gchar *name; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
142 | const gchar *device_name; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
143 | |
|
35980
b44c08754471
Backport warning fixes for Pidgin from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33281
diff
changeset
|
144 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS |
|
b44c08754471
Backport warning fixes for Pidgin from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33281
diff
changeset
|
145 | /* GValueArray is in gstreamer-0.10 API */ |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
146 | device = g_value_array_get_nth(array, n); |
|
35980
b44c08754471
Backport warning fixes for Pidgin from default
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33281
diff
changeset
|
147 | G_GNUC_END_IGNORE_DEPRECATIONS |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
148 | g_object_set_property(G_OBJECT(element), "device", device); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
149 | if (gst_element_set_state(element, GST_STATE_READY) |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
150 | != GST_STATE_CHANGE_SUCCESS) { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
151 | purple_debug_warning("vvconfig", |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
152 | "Error changing state of %s\n", |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
153 | element_name); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
154 | continue; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
155 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
156 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
157 | g_object_get(G_OBJECT(element), "device-name", &name, NULL); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
158 | device_name = g_value_get_string(device); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
159 | if (name == NULL) |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
160 | name = _("Unknown"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
161 | purple_debug_info("vvconfig", "Found device %s : %s for %s\n", |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
162 | device_name, name, element_name); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
163 | ret = g_list_prepend(ret, (gpointer)name); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
164 | ret = g_list_prepend(ret, (gpointer)device_name); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
165 | gst_element_set_state(element, GST_STATE_NULL); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
166 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
167 | } |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
168 | #endif |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
169 | gst_object_unref(element); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31279
diff
changeset
|
170 | |
|
31369
d7b8fe78c9d2
vvconfig: Don't crash when the stored device isn't found in the list of
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
171 | return g_list_reverse(ret); |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
172 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
173 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
174 | static GList * |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
175 | get_element_plugins(const gchar **plugins) |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
176 | { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
177 | GList *ret = NULL; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
178 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
179 | ret = g_list_prepend(ret, "Default"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
180 | ret = g_list_prepend(ret, ""); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
181 | for (; plugins[0] && plugins[1]; plugins += 2) { |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
182 | #if GST_CHECK_VERSION(1,0,0) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
183 | if (gst_registry_check_feature_version(gst_registry_get(), |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
184 | plugins[0], 0, 0, 0)) { |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
185 | #else |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
186 | if (gst_default_registry_check_feature_version( |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
187 | plugins[0], 0, 0, 0)) { |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
188 | #endif |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
189 | ret = g_list_prepend(ret, (gpointer)plugins[1]); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
190 | ret = g_list_prepend(ret, (gpointer)plugins[0]); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
191 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
192 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
193 | ret = g_list_reverse(ret); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
194 | return ret; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
195 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
196 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
197 | static void |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
198 | device_changed_cb(const gchar *name, PurplePrefType type, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
199 | gconstpointer value, gpointer data) |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
200 | { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
201 | GtkSizeGroup *sg = data; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
202 | GtkWidget *parent, *widget; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
203 | GSList *widgets; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
204 | GList *devices; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
205 | GValue gvalue; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
206 | gint position; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
207 | gchar *label, *pref; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
208 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
209 | widgets = gtk_size_group_get_widgets(GTK_SIZE_GROUP(sg)); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
210 | for (; widgets; widgets = g_slist_next(widgets)) { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
211 | const gchar *widget_name = |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
212 | gtk_widget_get_name(GTK_WIDGET(widgets->data)); |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38257
diff
changeset
|
213 | if (purple_strequal(widget_name, name)) { |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
214 | gchar *temp_str; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
215 | gchar delimiters[3] = {0, 0, 0}; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
216 | const gchar *text; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
217 | gint keyval, pos; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
218 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
219 | widget = widgets->data; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
220 | /* Get label with _ from the GtkLabel */ |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
221 | text = gtk_label_get_text(GTK_LABEL(widget)); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
222 | keyval = gtk_label_get_mnemonic_keyval(GTK_LABEL(widget)); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
223 | delimiters[0] = g_ascii_tolower(keyval); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
224 | delimiters[1] = g_ascii_toupper(keyval); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
225 | pos = strcspn(text, delimiters); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
226 | if (pos != -1) { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
227 | temp_str = g_strndup(text, pos); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
228 | label = g_strconcat(temp_str, "_", |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
229 | text + pos, NULL); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
230 | g_free(temp_str); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
231 | } else { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
232 | label = g_strdup(text); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
233 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
234 | break; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
235 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
236 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
237 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
238 | if (widgets == NULL) |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
239 | return; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
240 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
241 | parent = gtk_widget_get_parent(widget); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
242 | widget = parent; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
243 | parent = gtk_widget_get_parent(GTK_WIDGET(widget)); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
244 | gvalue.g_type = 0; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
245 | g_value_init(&gvalue, G_TYPE_INT); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
246 | gtk_container_child_get_property(GTK_CONTAINER(parent), |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
247 | GTK_WIDGET(widget), "position", &gvalue); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
248 | position = g_value_get_int(&gvalue); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
249 | g_value_unset(&gvalue); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
250 | gtk_widget_destroy(widget); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
251 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
252 | pref = g_strdup(name); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
253 | strcpy(pref + strlen(pref) - strlen("plugin"), "device"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
254 | devices = get_element_devices(value); |
|
31369
d7b8fe78c9d2
vvconfig: Don't crash when the stored device isn't found in the list of
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
255 | if (g_list_find_custom(devices, purple_prefs_get_string(pref), |
|
d7b8fe78c9d2
vvconfig: Don't crash when the stored device isn't found in the list of
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
256 | (GCompareFunc)strcmp) == NULL) |
|
40926
d10bb378f560
Fix some null pointer deferences and dead stores that scanbuild found in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
40718
diff
changeset
|
257 | { |
|
d10bb378f560
Fix some null pointer deferences and dead stores that scanbuild found in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
40718
diff
changeset
|
258 | GList *next = g_list_next(devices); |
|
d10bb378f560
Fix some null pointer deferences and dead stores that scanbuild found in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
40718
diff
changeset
|
259 | |
|
d10bb378f560
Fix some null pointer deferences and dead stores that scanbuild found in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
40718
diff
changeset
|
260 | if(next != NULL) { |
|
d10bb378f560
Fix some null pointer deferences and dead stores that scanbuild found in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
40718
diff
changeset
|
261 | purple_prefs_set_string(pref, next->data); |
|
d10bb378f560
Fix some null pointer deferences and dead stores that scanbuild found in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
40718
diff
changeset
|
262 | } |
|
d10bb378f560
Fix some null pointer deferences and dead stores that scanbuild found in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
40718
diff
changeset
|
263 | } |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
264 | widget = pidgin_prefs_dropdown_from_list(parent, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
265 | label, PURPLE_PREF_STRING, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
266 | pref, devices); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
267 | g_list_free(devices); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
268 | g_signal_connect_swapped(widget, "destroy", |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
269 | G_CALLBACK(g_free), pref); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
270 | g_free(label); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
271 | gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
272 | gtk_widget_set_name(widget, name); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
273 | gtk_size_group_add_widget(sg, widget); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
274 | gtk_box_reorder_child(GTK_BOX(parent), |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
275 | gtk_widget_get_parent(GTK_WIDGET(widget)), position); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
276 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
277 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
278 | static void |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
279 | get_plugin_frame(GtkWidget *parent, GtkSizeGroup *sg, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
280 | const gchar *name, const gchar *plugin_label, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
281 | const gchar **plugin_strs, const gchar *plugin_pref, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
282 | const gchar *device_label, const gchar *device_pref) |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
283 | { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
284 | GtkWidget *vbox, *widget; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
285 | GList *plugins, *devices; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
286 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
287 | vbox = pidgin_make_frame(parent, name); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
288 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
289 | /* Setup plugin preference */ |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
290 | plugins = get_element_plugins(plugin_strs); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
291 | widget = pidgin_prefs_dropdown_from_list(vbox, plugin_label, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
292 | PURPLE_PREF_STRING, plugin_pref, plugins); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
293 | g_list_free(plugins); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
294 | gtk_size_group_add_widget(sg, widget); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
295 | gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
296 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
297 | /* Setup device preference */ |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
298 | devices = get_element_devices(purple_prefs_get_string(plugin_pref)); |
|
31279
c0104df45b93
vvconfig: Stop resetting device selections to defaults. Fixes #13044.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30752
diff
changeset
|
299 | if (g_list_find_custom(devices, purple_prefs_get_string(device_pref), |
|
c0104df45b93
vvconfig: Stop resetting device selections to defaults. Fixes #13044.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30752
diff
changeset
|
300 | (GCompareFunc) strcmp) == NULL) |
|
40926
d10bb378f560
Fix some null pointer deferences and dead stores that scanbuild found in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
40718
diff
changeset
|
301 | { |
|
d10bb378f560
Fix some null pointer deferences and dead stores that scanbuild found in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
40718
diff
changeset
|
302 | GList *next = g_list_next(devices); |
|
d10bb378f560
Fix some null pointer deferences and dead stores that scanbuild found in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
40718
diff
changeset
|
303 | if(next != NULL) { |
|
d10bb378f560
Fix some null pointer deferences and dead stores that scanbuild found in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
40718
diff
changeset
|
304 | purple_prefs_set_string(device_pref, next->data); |
|
d10bb378f560
Fix some null pointer deferences and dead stores that scanbuild found in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
40718
diff
changeset
|
305 | } |
|
d10bb378f560
Fix some null pointer deferences and dead stores that scanbuild found in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
40718
diff
changeset
|
306 | } |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
307 | widget = pidgin_prefs_dropdown_from_list(vbox, device_label, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
308 | PURPLE_PREF_STRING, device_pref, devices); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
309 | g_list_free(devices); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
310 | gtk_widget_set_name(widget, plugin_pref); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
311 | gtk_size_group_add_widget(sg, widget); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
312 | gtk_misc_set_alignment(GTK_MISC(widget), 0, 0.5); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
313 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
314 | purple_prefs_connect_callback(vbox, plugin_pref, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
315 | device_changed_cb, sg); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
316 | g_signal_connect_swapped(vbox, "destroy", |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
317 | G_CALLBACK(purple_prefs_disconnect_by_handle), vbox); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
318 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
319 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
320 | static GtkWidget * |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
321 | get_plugin_config_frame(PurplePlugin *plugin) { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
322 | GtkWidget *notebook, *vbox_audio, *vbox_video; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
323 | GtkSizeGroup *sg; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
324 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
325 | notebook = gtk_notebook_new(); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
326 | gtk_container_set_border_width(GTK_CONTAINER(notebook), |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
327 | PIDGIN_HIG_BORDER); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
328 | gtk_widget_show(notebook); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
329 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
330 | vbox_audio = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
331 | vbox_video = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
332 | gtk_notebook_append_page(GTK_NOTEBOOK(notebook), |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
333 | vbox_audio, gtk_label_new(_("Audio"))); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
334 | gtk_notebook_append_page(GTK_NOTEBOOK(notebook), |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
335 | vbox_video, gtk_label_new(_("Video"))); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
336 | gtk_container_set_border_width(GTK_CONTAINER (vbox_audio), |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
337 | PIDGIN_HIG_BORDER); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
338 | gtk_container_set_border_width(GTK_CONTAINER (vbox_video), |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
339 | PIDGIN_HIG_BORDER); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
340 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
341 | gtk_widget_show(vbox_audio); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
342 | gtk_widget_show(vbox_video); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
343 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
344 | sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
345 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
346 | get_plugin_frame(vbox_audio, sg, _("Output"), _("_Plugin"), AUDIO_SINK_PLUGINS, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
347 | "/plugins/core/vvconfig/audio/sink/plugin", _("_Device"), |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
348 | "/plugins/core/vvconfig/audio/sink/device"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
349 | get_plugin_frame(vbox_audio, sg, _("Input"), _("P_lugin"), AUDIO_SRC_PLUGINS, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
350 | "/plugins/core/vvconfig/audio/src/plugin", _("D_evice"), |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
351 | "/plugins/core/vvconfig/audio/src/device"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
352 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
353 | get_plugin_frame(vbox_video, sg, _("Output"), _("_Plugin"), VIDEO_SINK_PLUGINS, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
354 | "/plugins/gtk/vvconfig/video/sink/plugin", _("_Device"), |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
355 | "/plugins/gtk/vvconfig/video/sink/device"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
356 | get_plugin_frame(vbox_video, sg, _("Input"), _("P_lugin"), VIDEO_SRC_PLUGINS, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
357 | "/plugins/core/vvconfig/video/src/plugin", _("D_evice"), |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
358 | "/plugins/core/vvconfig/video/src/device"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
359 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
360 | return notebook; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
361 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
362 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
363 | static GstElement * |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
364 | create_video_src(PurpleMedia *media, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
365 | const gchar *session_id, const gchar *participant) |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
366 | { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
367 | const gchar *plugin = purple_prefs_get_string( |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
368 | "/plugins/core/vvconfig/video/src/plugin"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
369 | const gchar *device = purple_prefs_get_string( |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
370 | "/plugins/core/vvconfig/video/src/device"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
371 | GstElement *ret; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
372 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
373 | if (plugin[0] == '\0') |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
374 | return purple_media_element_info_call_create(old_video_src, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
375 | media, session_id, participant); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
376 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
377 | ret = gst_element_factory_make(plugin, "vvconfig-videosrc"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
378 | if (device[0] != '\0') |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
379 | g_object_set(G_OBJECT(ret), "device", device, NULL); |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38257
diff
changeset
|
380 | if (purple_strequal(plugin, "videotestsrc")) |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
381 | g_object_set(G_OBJECT(ret), "is-live", 1, NULL); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
382 | return ret; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
383 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
384 | |
|
37650
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
385 | static void |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
386 | videosink_disable_last_sample(GstElement *sink) |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
387 | { |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
388 | GObjectClass *klass = G_OBJECT_GET_CLASS(sink); |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
389 | |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
390 | if (g_object_class_find_property(klass, "enable-last-sample")) { |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
391 | g_object_set(sink, "enable-last-sample", FALSE, NULL); |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
392 | } |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
393 | } |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
394 | |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
395 | static void |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
396 | autovideosink_child_added_cb(GstChildProxy *child_proxy, GObject *object, |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
397 | #if GST_CHECK_VERSION(1,0,0) |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
398 | gchar *name, |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
399 | #endif |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
400 | gpointer user_data) |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
401 | { |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
402 | videosink_disable_last_sample(GST_ELEMENT(object)); |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
403 | } |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
404 | |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
405 | static GstElement * |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
406 | create_video_sink(PurpleMedia *media, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
407 | const gchar *session_id, const gchar *participant) |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
408 | { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
409 | const gchar *plugin = purple_prefs_get_string( |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
410 | "/plugins/gtk/vvconfig/video/sink/plugin"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
411 | const gchar *device = purple_prefs_get_string( |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
412 | "/plugins/gtk/vvconfig/video/sink/device"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
413 | GstElement *ret; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
414 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
415 | if (plugin[0] == '\0') |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
416 | return purple_media_element_info_call_create(old_video_sink, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
417 | media, session_id, participant); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
418 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
419 | ret = gst_element_factory_make(plugin, NULL); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
420 | if (device[0] != '\0') |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
421 | g_object_set(G_OBJECT(ret), "device", device, NULL); |
|
37650
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
422 | |
|
38257
1a294a6d2a57
Replace g_strcmp0() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37650
diff
changeset
|
423 | if (purple_strequal(plugin, "autovideosink")) { |
|
37650
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
424 | g_signal_connect(ret, "child-added", |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
425 | G_CALLBACK(autovideosink_child_added_cb), NULL); |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
426 | } else { |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
427 | videosink_disable_last_sample(ret); |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
428 | } |
|
f827e56eea34
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36316
diff
changeset
|
429 | |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
430 | return ret; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
431 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
432 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
433 | static GstElement * |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
434 | create_audio_src(PurpleMedia *media, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
435 | const gchar *session_id, const gchar *participant) |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
436 | { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
437 | const gchar *plugin = purple_prefs_get_string( |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
438 | "/plugins/core/vvconfig/audio/src/plugin"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
439 | const gchar *device = purple_prefs_get_string( |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
440 | "/plugins/core/vvconfig/audio/src/device"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
441 | GstElement *ret; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
442 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
443 | if (plugin[0] == '\0') |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
444 | return purple_media_element_info_call_create(old_audio_src, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
445 | media, session_id, participant); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
446 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
447 | ret = gst_element_factory_make(plugin, NULL); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
448 | if (device[0] != '\0') |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
449 | g_object_set(G_OBJECT(ret), "device", device, NULL); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
450 | return ret; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
451 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
452 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
453 | static GstElement * |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
454 | create_audio_sink(PurpleMedia *media, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
455 | const gchar *session_id, const gchar *participant) |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
456 | { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
457 | const gchar *plugin = purple_prefs_get_string( |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
458 | "/plugins/core/vvconfig/audio/sink/plugin"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
459 | const gchar *device = purple_prefs_get_string( |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
460 | "/plugins/core/vvconfig/audio/sink/device"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
461 | GstElement *ret; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
462 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
463 | if (plugin[0] == '\0') |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
464 | return purple_media_element_info_call_create(old_audio_sink, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
465 | media, session_id, participant); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
466 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
467 | ret = gst_element_factory_make(plugin, NULL); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
468 | if (device[0] != '\0') |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
469 | g_object_set(G_OBJECT(ret), "device", device, NULL); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
470 | return ret; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
471 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
472 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
473 | static void |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
474 | set_element_info_cond(PurpleMediaElementInfo *old_info, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
475 | PurpleMediaElementInfo *new_info, const gchar *id) |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
476 | { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
477 | gchar *element_id = purple_media_element_info_get_id(old_info); |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38257
diff
changeset
|
478 | if (purple_strequal(element_id, id)) |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
479 | purple_media_manager_set_active_element( |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
480 | purple_media_manager_get(), new_info); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
481 | g_free(element_id); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
482 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
483 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
484 | static gboolean |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
485 | plugin_load(PurplePlugin *plugin) |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
486 | { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
487 | PurpleMediaManager *manager; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
488 | PurpleMediaElementInfo *video_src, *video_sink, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
489 | *audio_src, *audio_sink; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
490 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
491 | /* Disable the plugin if the UI doesn't support VV */ |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
492 | if (purple_media_manager_get_ui_caps(purple_media_manager_get()) == |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
493 | PURPLE_MEDIA_CAPS_NONE) |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
494 | return FALSE; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
495 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
496 | purple_prefs_add_none("/plugins/core/vvconfig"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
497 | purple_prefs_add_none("/plugins/core/vvconfig/audio"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
498 | purple_prefs_add_none("/plugins/core/vvconfig/audio/src"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
499 | purple_prefs_add_string("/plugins/core/vvconfig/audio/src/plugin", ""); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
500 | purple_prefs_add_string("/plugins/core/vvconfig/audio/src/device", ""); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
501 | purple_prefs_add_none("/plugins/core/vvconfig/audio/sink"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
502 | purple_prefs_add_string("/plugins/core/vvconfig/audio/sink/plugin", ""); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
503 | purple_prefs_add_string("/plugins/core/vvconfig/audio/sink/device", ""); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
504 | purple_prefs_add_none("/plugins/core/vvconfig/video"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
505 | purple_prefs_add_none("/plugins/core/vvconfig/video/src"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
506 | purple_prefs_add_string("/plugins/core/vvconfig/video/src/plugin", ""); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
507 | purple_prefs_add_string("/plugins/core/vvconfig/video/src/device", ""); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
508 | purple_prefs_add_none("/plugins/gtk/vvconfig"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
509 | purple_prefs_add_none("/plugins/gtk/vvconfig/video"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
510 | purple_prefs_add_none("/plugins/gtk/vvconfig/video/sink"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
511 | purple_prefs_add_string("/plugins/gtk/vvconfig/video/sink/plugin", ""); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
512 | purple_prefs_add_string("/plugins/gtk/vvconfig/video/sink/device", ""); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
513 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
514 | video_src = g_object_new(PURPLE_TYPE_MEDIA_ELEMENT_INFO, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
515 | "id", "vvconfig-videosrc", |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
516 | "name", "VV Conf Plugin Video Source", |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
517 | "type", PURPLE_MEDIA_ELEMENT_VIDEO |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
518 | | PURPLE_MEDIA_ELEMENT_SRC |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
519 | | PURPLE_MEDIA_ELEMENT_ONE_SRC |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
520 | | PURPLE_MEDIA_ELEMENT_UNIQUE, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
521 | "create-cb", create_video_src, NULL); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
522 | video_sink = g_object_new(PURPLE_TYPE_MEDIA_ELEMENT_INFO, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
523 | "id", "vvconfig-videosink", |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
524 | "name", "VV Conf Plugin Video Sink", |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
525 | "type", PURPLE_MEDIA_ELEMENT_VIDEO |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
526 | | PURPLE_MEDIA_ELEMENT_SINK |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
527 | | PURPLE_MEDIA_ELEMENT_ONE_SINK, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
528 | "create-cb", create_video_sink, NULL); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
529 | audio_src = g_object_new(PURPLE_TYPE_MEDIA_ELEMENT_INFO, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
530 | "id", "vvconfig-audiosrc", |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
531 | "name", "VV Conf Plugin Audio Source", |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
532 | "type", PURPLE_MEDIA_ELEMENT_AUDIO |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
533 | | PURPLE_MEDIA_ELEMENT_SRC |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
534 | | PURPLE_MEDIA_ELEMENT_ONE_SRC |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
535 | | PURPLE_MEDIA_ELEMENT_UNIQUE, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
536 | "create-cb", create_audio_src, NULL); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
537 | audio_sink = g_object_new(PURPLE_TYPE_MEDIA_ELEMENT_INFO, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
538 | "id", "vvconfig-audiosink", |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
539 | "name", "VV Conf Plugin Audio Sink", |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
540 | "type", PURPLE_MEDIA_ELEMENT_AUDIO |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
541 | | PURPLE_MEDIA_ELEMENT_SINK |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
542 | | PURPLE_MEDIA_ELEMENT_ONE_SINK, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
543 | "create-cb", create_audio_sink, NULL); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
544 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
545 | purple_debug_info("gtkmedia", "Registering media element types\n"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
546 | manager = purple_media_manager_get(); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
547 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
548 | old_video_src = purple_media_manager_get_active_element(manager, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
549 | PURPLE_MEDIA_ELEMENT_VIDEO | PURPLE_MEDIA_ELEMENT_SRC); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
550 | old_video_sink = purple_media_manager_get_active_element(manager, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
551 | PURPLE_MEDIA_ELEMENT_VIDEO | PURPLE_MEDIA_ELEMENT_SINK); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
552 | old_audio_src = purple_media_manager_get_active_element(manager, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
553 | PURPLE_MEDIA_ELEMENT_AUDIO | PURPLE_MEDIA_ELEMENT_SRC); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
554 | old_audio_sink = purple_media_manager_get_active_element(manager, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
555 | PURPLE_MEDIA_ELEMENT_AUDIO | PURPLE_MEDIA_ELEMENT_SINK); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
556 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
557 | set_element_info_cond(old_video_src, video_src, "pidgindefaultvideosrc"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
558 | set_element_info_cond(old_video_sink, video_sink, "pidgindefaultvideosink"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
559 | set_element_info_cond(old_audio_src, audio_src, "pidgindefaultaudiosrc"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
560 | set_element_info_cond(old_audio_sink, audio_sink, "pidgindefaultaudiosink"); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
561 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
562 | return TRUE; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
563 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
564 | |
|
30745
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
565 | static void |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
566 | config_destroy(GtkObject *w, gpointer nul) |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
567 | { |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
568 | purple_debug_info("vvconfig", "closing vv configuration window\n"); |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
569 | window = NULL; |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
570 | } |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
571 | |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
572 | static void |
|
30746
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
573 | config_close(GtkObject *w, gpointer nul) |
|
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
574 | { |
|
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
575 | gtk_widget_destroy(GTK_WIDGET(window)); |
|
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
576 | } |
|
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
577 | |
|
31623
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
578 | typedef GtkWidget *(*FrameCreateCb)(PurplePlugin *plugin); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
579 | |
|
30746
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
580 | static void |
|
30745
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
581 | show_config(PurplePluginAction *action) |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
582 | { |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
583 | if (!window) { |
|
31623
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
584 | FrameCreateCb create_frame = action->user_data; |
|
30746
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
585 | GtkWidget *vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
|
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
586 | GtkWidget *hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BORDER); |
|
31623
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
587 | GtkWidget *config_frame = create_frame(NULL); |
|
30746
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
588 | GtkWidget *close = gtk_button_new_from_stock(GTK_STOCK_CLOSE); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31279
diff
changeset
|
589 | |
|
30746
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
590 | gtk_container_add(GTK_CONTAINER(vbox), config_frame); |
|
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
591 | gtk_container_add(GTK_CONTAINER(vbox), hbox); |
|
31623
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
592 | window = pidgin_create_window(action->label, |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
593 | PIDGIN_HIG_BORDER, NULL, FALSE); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31279
diff
changeset
|
594 | g_signal_connect(G_OBJECT(window), "destroy", |
|
30745
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
595 | G_CALLBACK(config_destroy), NULL); |
|
30746
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
596 | g_signal_connect(G_OBJECT(close), "clicked", |
|
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
597 | G_CALLBACK(config_close), NULL); |
|
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
598 | gtk_box_pack_end(GTK_BOX(hbox), close, FALSE, FALSE, PIDGIN_HIG_BORDER); |
|
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
599 | gtk_container_add(GTK_CONTAINER(window), vbox); |
|
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
600 | gtk_widget_show(GTK_WIDGET(close)); |
|
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
601 | gtk_widget_show(GTK_WIDGET(vbox)); |
|
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
602 | gtk_widget_show(GTK_WIDGET(hbox)); |
|
30745
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
603 | } |
|
30746
ed1f99ec4954
media: Add a close button to the stand-alone video configuration window. Adjusted title
Marcus Lundblad <malu@pidgin.im>
parents:
30745
diff
changeset
|
604 | gtk_window_present(GTK_WINDOW(window)); |
|
30745
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
605 | } |
|
30752
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
606 | |
|
31623
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
607 | static GstElement * |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
608 | create_pipeline() |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
609 | { |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
610 | GstElement *pipeline = gst_pipeline_new("voicetest"); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
611 | GstElement *src = create_audio_src(NULL, NULL, NULL); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
612 | GstElement *sink = create_audio_sink(NULL, NULL, NULL); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
613 | GstElement *volume = gst_element_factory_make("volume", "volume"); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
614 | GstElement *level = gst_element_factory_make("level", "level"); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
615 | GstElement *valve = gst_element_factory_make("valve", "valve"); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
616 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
617 | gst_bin_add_many(GST_BIN(pipeline), src, volume, level, valve, sink, NULL); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
618 | gst_element_link_many(src, volume, level, valve, sink, NULL); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
619 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
620 | gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PLAYING); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
621 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
622 | return pipeline; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
623 | } |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
624 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
625 | static void |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
626 | on_volume_change_cb(GtkRange *range, GstBin *pipeline) |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
627 | { |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
628 | GstElement *volume; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
629 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
630 | g_return_if_fail(pipeline != NULL); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
631 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
632 | volume = gst_bin_get_by_name(pipeline, "volume"); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
633 | g_object_set(volume, "volume", gtk_range_get_value(range) / 10.0, NULL); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
634 | } |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
635 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
636 | static gdouble |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
637 | gst_msg_db_to_percent(GstMessage *msg, gchar *value_name) |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
638 | { |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
639 | const GValue *list; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
640 | const GValue *value; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
641 | gdouble value_db; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
642 | gdouble percent; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
643 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
644 | list = gst_structure_get_value( |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
645 | gst_message_get_structure(msg), value_name); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
646 | #if GST_CHECK_VERSION(1,0,0) |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
647 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
648 | value = g_value_array_get_nth(g_value_get_boxed(list), 0); |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
649 | G_GNUC_END_IGNORE_DEPRECATIONS |
|
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
650 | #else |
|
31623
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
651 | value = gst_value_list_get_value(list, 0); |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
652 | #endif |
|
31623
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
653 | value_db = g_value_get_double(value); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
654 | percent = pow(10, value_db / 20); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
655 | return (percent > 1.0) ? 1.0 : percent; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
656 | } |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
657 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
658 | typedef struct |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
659 | { |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
660 | GtkProgressBar *level; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
661 | GtkRange *threshold; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
662 | } BusCbCtx; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
663 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
664 | static gboolean |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
665 | gst_bus_cb(GstBus *bus, GstMessage *msg, BusCbCtx *ctx) |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
666 | { |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
667 | if (GST_MESSAGE_TYPE(msg) == GST_MESSAGE_ELEMENT && |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36256
diff
changeset
|
668 | gst_structure_has_name(gst_message_get_structure(msg), "level")) { |
|
31623
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
669 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
670 | GstElement *src = GST_ELEMENT(GST_MESSAGE_SRC(msg)); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
671 | gchar *name = gst_element_get_name(src); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
672 | |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38257
diff
changeset
|
673 | if (purple_strequal(name, "level")) { |
|
31623
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
674 | gdouble percent; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
675 | gdouble threshold; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
676 | GstElement *valve; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
677 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
678 | percent = gst_msg_db_to_percent(msg, "rms"); |
|
38948
7804140b50b5
Clip audio level reporting
David Woodhouse <dwmw2@infradead.org>
parents:
38258
diff
changeset
|
679 | percent *= 5; |
|
7804140b50b5
Clip audio level reporting
David Woodhouse <dwmw2@infradead.org>
parents:
38258
diff
changeset
|
680 | if (percent > 1.0) |
|
7804140b50b5
Clip audio level reporting
David Woodhouse <dwmw2@infradead.org>
parents:
38258
diff
changeset
|
681 | percent = 1.0; |
|
7804140b50b5
Clip audio level reporting
David Woodhouse <dwmw2@infradead.org>
parents:
38258
diff
changeset
|
682 | gtk_progress_bar_set_fraction(ctx->level, percent); |
|
31623
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
683 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
684 | percent = gst_msg_db_to_percent(msg, "decay"); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
685 | threshold = gtk_range_get_value(ctx->threshold) / 100.0; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
686 | valve = gst_bin_get_by_name(GST_BIN(GST_ELEMENT_PARENT(src)), "valve"); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
687 | g_object_set(valve, "drop", (percent < threshold), NULL); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
688 | g_object_set(ctx->level, |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
689 | "text", (percent < threshold) ? _("DROP") : " ", NULL); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
690 | } |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
691 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
692 | g_free(name); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
693 | } |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
694 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
695 | return TRUE; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
696 | } |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
697 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
698 | static void |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
699 | voice_test_frame_destroy_cb(GtkObject *w, GstElement *pipeline) |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
700 | { |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
701 | g_return_if_fail(GST_IS_ELEMENT(pipeline)); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
702 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
703 | gst_element_set_state(pipeline, GST_STATE_NULL); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
704 | gst_object_unref(pipeline); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
705 | } |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
706 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
707 | static void |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
708 | volume_scale_destroy_cb(GtkRange *volume, gpointer nul) |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
709 | { |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
710 | purple_prefs_set_int("/purple/media/audio/volume/input", |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
711 | gtk_range_get_value(volume)); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
712 | } |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
713 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
714 | static gchar* |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
715 | threshold_value_format_cb(GtkScale *scale, gdouble value) |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
716 | { |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
717 | return g_strdup_printf ("%.*f%%", gtk_scale_get_digits(scale), value); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
718 | } |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
719 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
720 | static void |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
721 | threshold_scale_destroy_cb(GtkRange *threshold, gpointer nul) |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
722 | { |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
723 | purple_prefs_set_int("/purple/media/audio/silence_threshold", |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
724 | gtk_range_get_value(threshold)); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
725 | } |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
726 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
727 | static GtkWidget * |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
728 | get_voice_test_frame(PurplePlugin *plugin) |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
729 | { |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
730 | GtkWidget *vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
731 | GtkWidget *level = gtk_progress_bar_new(); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
732 | GtkWidget *volume = gtk_hscale_new_with_range(0, 100, 1); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
733 | GtkWidget *threshold = gtk_hscale_new_with_range(0, 100, 1); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
734 | GtkWidget *label; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
735 | GtkTable *table = GTK_TABLE(gtk_table_new(2, 2, FALSE)); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
736 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
737 | GstElement *pipeline; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
738 | GstBus *bus; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
739 | BusCbCtx *ctx; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
740 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
741 | g_object_set(vbox, "width-request", 500, NULL); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
742 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
743 | gtk_table_set_row_spacings(table, PIDGIN_HIG_BOX_SPACE); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
744 | gtk_table_set_col_spacings(table, PIDGIN_HIG_BOX_SPACE); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
745 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
746 | label = gtk_label_new(_("Volume:")); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
747 | g_object_set(label, "xalign", 0.0, NULL); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
748 | gtk_table_attach(table, label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
749 | gtk_table_attach_defaults(table, volume, 1, 2, 0, 1); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
750 | label = gtk_label_new(_("Silence threshold:")); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
751 | g_object_set(label, "xalign", 0.0, "yalign", 1.0, NULL); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
752 | gtk_table_attach(table, label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
753 | gtk_table_attach_defaults(table, threshold, 1, 2, 1, 2); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
754 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
755 | gtk_container_add(GTK_CONTAINER(vbox), level); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
756 | gtk_container_add(GTK_CONTAINER(vbox), GTK_WIDGET(table)); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
757 | gtk_widget_show_all(vbox); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
758 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
759 | pipeline = create_pipeline(); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
760 | bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
761 | gst_bus_add_signal_watch(bus); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
762 | ctx = g_new(BusCbCtx, 1); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
763 | ctx->level = GTK_PROGRESS_BAR(level); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
764 | ctx->threshold = GTK_RANGE(threshold); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
765 | g_signal_connect_data(bus, "message", G_CALLBACK(gst_bus_cb), |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
766 | ctx, (GClosureNotify)g_free, 0); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
767 | gst_object_unref(bus); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
768 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
769 | g_signal_connect(volume, "value-changed", |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
770 | (GCallback)on_volume_change_cb, pipeline); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
771 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
772 | gtk_range_set_value(GTK_RANGE(volume), |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
773 | purple_prefs_get_int("/purple/media/audio/volume/input")); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
774 | gtk_widget_set(volume, "draw-value", FALSE, NULL); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
775 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
776 | gtk_range_set_value(GTK_RANGE(threshold), |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
777 | purple_prefs_get_int("/purple/media/audio/silence_threshold")); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
778 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
779 | g_signal_connect(vbox, "destroy", |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
780 | G_CALLBACK(voice_test_frame_destroy_cb), pipeline); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
781 | g_signal_connect(volume, "destroy", |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
782 | G_CALLBACK(volume_scale_destroy_cb), NULL); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
783 | g_signal_connect(threshold, "format-value", |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
784 | G_CALLBACK(threshold_value_format_cb), NULL); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
785 | g_signal_connect(threshold, "destroy", |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
786 | G_CALLBACK(threshold_scale_destroy_cb), NULL); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
787 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
788 | return vbox; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
789 | } |
|
30752
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
790 | |
|
30745
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
791 | static GList * |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
792 | actions(PurplePlugin *plugin, gpointer context) |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
793 | { |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
794 | GList *l = NULL; |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
795 | PurplePluginAction *act = NULL; |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
796 | |
|
31623
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
797 | act = purple_plugin_action_new(_("Input and Output Settings"), |
|
30745
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
798 | show_config); |
|
31623
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
799 | act->user_data = get_plugin_config_frame; |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
800 | l = g_list_append(l, act); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
801 | |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
802 | act = purple_plugin_action_new(_("Microphone Test"), |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
803 | show_config); |
|
628b086c4167
This patch adds to Pidgin's vvconfig plugin a simple dialog, where user can test
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31369
diff
changeset
|
804 | act->user_data = get_voice_test_frame; |
|
30745
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
805 | l = g_list_append(l, act); |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
806 | |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
807 | return l; |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
808 | } |
|
8346d194d563
media: Added a plugin action menu for the voice and video settings plugin.
Marcus Lundblad <malu@pidgin.im>
parents:
28324
diff
changeset
|
809 | |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
810 | static gboolean |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
811 | plugin_unload(PurplePlugin *plugin) |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
812 | { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
813 | PurpleMediaManager *manager = purple_media_manager_get(); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
814 | purple_media_manager_set_active_element(manager, old_video_src); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
815 | purple_media_manager_set_active_element(manager, old_video_sink); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
816 | purple_media_manager_set_active_element(manager, old_audio_src); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
817 | purple_media_manager_set_active_element(manager, old_audio_sink); |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
818 | return TRUE; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
819 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
820 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
821 | static PidginPluginUiInfo ui_info = { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
822 | get_plugin_config_frame, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
823 | 0, /* page_num (Reserved) */ |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
824 | /* Padding */ |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
825 | NULL, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
826 | NULL, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
827 | NULL, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
828 | NULL |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
829 | }; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
830 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
831 | static PurplePluginInfo info = |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
832 | { |
|
30752
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
833 | PURPLE_PLUGIN_MAGIC, /**< magic */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
834 | PURPLE_MAJOR_VERSION, /**< major version */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
835 | PURPLE_MINOR_VERSION, /**< minor version */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
836 | PURPLE_PLUGIN_STANDARD, /**< type */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
837 | PIDGIN_PLUGIN_TYPE, /**< ui_requirement */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
838 | 0, /**< flags */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
839 | NULL, /**< dependencies */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
840 | PURPLE_PRIORITY_DEFAULT, /**< priority */ |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
841 | |
|
30752
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
842 | "gtk-maiku-vvconfig", /**< id */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
843 | N_("Voice/Video Settings"), /**< name */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
844 | DISPLAY_VERSION, /**< version */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
845 | N_("Configure your microphone and webcam."), /**< summary */ |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
846 | N_("Configure microphone and webcam " |
|
30752
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
847 | "settings for voice/video calls."), /**< description */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
848 | "Mike Ruprecht <cmaiku@gmail.com>", /**< author */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
849 | PURPLE_WEBSITE, /**< homepage */ |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
850 | |
|
30752
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
851 | plugin_load, /**< load */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
852 | plugin_unload, /**< unload */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
853 | NULL, /**< destroy */ |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
854 | |
|
30752
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
855 | &ui_info, /**< ui_info */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
856 | NULL, /**< extra_info */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
857 | NULL, /**< prefs_info */ |
|
86247e9da004
Spelling and spacing.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30746
diff
changeset
|
858 | actions, /**< actions */ |
|
28324
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
859 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
860 | /* padding */ |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
861 | NULL, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
862 | NULL, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
863 | NULL, |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
864 | NULL |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
865 | }; |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
866 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
867 | static void |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
868 | init_plugin(PurplePlugin *plugin) { |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
869 | } |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
870 | |
|
f9ef953c00bf
Add the vvconfig plugin. It allows you to choose different microphones,
Michael Ruprecht <maiku@pidgin.im>
parents:
diff
changeset
|
871 | PURPLE_INIT_PLUGIN(vvconfig, init_plugin, info) |