Sun, 02 Sep 2012 04:09:38 -0400
Fix call to gst_bus_set_sync_handler.
| 19883 | 1 | /** |
| 19889 | 2 | * @file mediamanager.c Media Manager API |
| 19883 | 3 | * @ingroup core |
|
26105
7647c0dcf202
* Added documentation to media.h and mediamanager.h
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
4 | */ |
|
7647c0dcf202
* Added documentation to media.h and mediamanager.h
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
5 | |
|
7647c0dcf202
* Added documentation to media.h and mediamanager.h
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
6 | /* purple |
| 19883 | 7 | * |
| 8 | * Purple is the legal property of its developers, whose names are too numerous | |
| 9 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 10 | * source distribution. | |
| 11 | * | |
| 12 | * This program is free software; you can redistribute it and/or modify | |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * along with this program; if not, write to the Free Software | |
|
28321
c8d617c408ab
Update various header copyrights thanks to licensecheck.
Paul Aurich <darkrain42@pidgin.im>
parents:
28162
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 19883 | 25 | */ |
| 26 | ||
| 19889 | 27 | #include "internal.h" |
| 28 | ||
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
29 | #include "account.h" |
|
26130
b5e9f243cf89
Gracefully handle missing the fsrtpconference GStreamer plugin.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
30 | #include "debug.h" |
|
26479
47511dae9f81
Move GStreamer related media functions into its own header.
Michael Ruprecht <maiku@pidgin.im>
parents:
26427
diff
changeset
|
31 | #include "media.h" |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26748
diff
changeset
|
32 | #include "mediamanager.h" |
|
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26748
diff
changeset
|
33 | |
|
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26748
diff
changeset
|
34 | #ifdef USE_GSTREAMER |
|
26792
17140fe8c2f6
Include the media API on win32 even though it isn't actually enabled.
Daniel Atallah <datallah@pidgin.im>
parents:
26760
diff
changeset
|
35 | #include "marshallers.h" |
|
26479
47511dae9f81
Move GStreamer related media functions into its own header.
Michael Ruprecht <maiku@pidgin.im>
parents:
26427
diff
changeset
|
36 | #include "media-gst.h" |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26748
diff
changeset
|
37 | #endif |
| 19883 | 38 | |
|
23704
9b88c9b23aed
Use USE_VV instead of USE_FARSIGHT.
Michael Ruprecht <maiku@pidgin.im>
parents:
23701
diff
changeset
|
39 | #ifdef USE_VV |
|
29620
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
40 | #include <media/backend-fs2.h> |
| 19883 | 41 | |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
31565
diff
changeset
|
42 | #ifdef HAVE_FARSIGHT |
|
28109
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
43 | #include <gst/farsight/fs-element-added-notifier.h> |
|
32113
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
31565
diff
changeset
|
44 | #else |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
31565
diff
changeset
|
45 | #include <farstream/fs-element-added-notifier.h> |
|
2a75cce047d5
Port to Farstream
Olivier Crête <olivier.crete@collabora.com>
parents:
31565
diff
changeset
|
46 | #endif |
|
33482
b9d34920e752
Replace GstXOverlay with GstVideoOverlay.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33234
diff
changeset
|
47 | #if GST_CHECK_VERSION(0,11,0) |
|
b9d34920e752
Replace GstXOverlay with GstVideoOverlay.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33234
diff
changeset
|
48 | #include <gst/video/videooverlay.h> |
|
b9d34920e752
Replace GstXOverlay with GstVideoOverlay.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33234
diff
changeset
|
49 | #else |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
50 | #include <gst/interfaces/xoverlay.h> |
|
33482
b9d34920e752
Replace GstXOverlay with GstVideoOverlay.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33234
diff
changeset
|
51 | #endif |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
52 | |
|
26614
30eda41f2247
Hide the easy structs in mediamanager.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
53 | /** @copydoc _PurpleMediaManagerPrivate */ |
|
30eda41f2247
Hide the easy structs in mediamanager.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
54 | typedef struct _PurpleMediaManagerPrivate PurpleMediaManagerPrivate; |
|
30eda41f2247
Hide the easy structs in mediamanager.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
55 | /** @copydoc _PurpleMediaOutputWindow */ |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
56 | typedef struct _PurpleMediaOutputWindow PurpleMediaOutputWindow; |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
57 | /** @copydoc _PurpleMediaManagerPrivate */ |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
58 | typedef struct _PurpleMediaElementInfoPrivate PurpleMediaElementInfoPrivate; |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
59 | |
|
26614
30eda41f2247
Hide the easy structs in mediamanager.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
60 | /** The media manager class. */ |
|
30eda41f2247
Hide the easy structs in mediamanager.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
61 | struct _PurpleMediaManagerClass |
|
30eda41f2247
Hide the easy structs in mediamanager.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
62 | { |
|
30eda41f2247
Hide the easy structs in mediamanager.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
63 | GObjectClass parent_class; /**< The parent class. */ |
|
30eda41f2247
Hide the easy structs in mediamanager.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
64 | }; |
|
30eda41f2247
Hide the easy structs in mediamanager.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
65 | |
|
30eda41f2247
Hide the easy structs in mediamanager.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
66 | /** The media manager's data. */ |
|
30eda41f2247
Hide the easy structs in mediamanager.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
67 | struct _PurpleMediaManager |
|
30eda41f2247
Hide the easy structs in mediamanager.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
68 | { |
|
30eda41f2247
Hide the easy structs in mediamanager.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
69 | GObject parent; /**< The parent of this manager. */ |
|
30eda41f2247
Hide the easy structs in mediamanager.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
70 | PurpleMediaManagerPrivate *priv; /**< Private data for the manager. */ |
|
30eda41f2247
Hide the easy structs in mediamanager.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
71 | }; |
|
30eda41f2247
Hide the easy structs in mediamanager.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
72 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
73 | struct _PurpleMediaOutputWindow |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
74 | { |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
75 | gulong id; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
76 | PurpleMedia *media; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
77 | gchar *session_id; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
78 | gchar *participant; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
79 | gulong window_id; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
80 | GstElement *sink; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
81 | }; |
| 19883 | 82 | |
| 83 | struct _PurpleMediaManagerPrivate | |
| 84 | { | |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
85 | GstElement *pipeline; |
|
26520
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
86 | PurpleMediaCaps ui_caps; |
| 19883 | 87 | GList *medias; |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
88 | GList *elements; |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
89 | GList *output_windows; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
90 | gulong next_output_window_id; |
|
29620
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
91 | GType backend_type; |
|
31311
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
92 | GstCaps *video_caps; |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
93 | |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
94 | PurpleMediaElementInfo *video_src; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
95 | PurpleMediaElementInfo *video_sink; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
96 | PurpleMediaElementInfo *audio_src; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
97 | PurpleMediaElementInfo *audio_sink; |
| 19883 | 98 | }; |
| 99 | ||
| 100 | #define PURPLE_MEDIA_MANAGER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA_MANAGER, PurpleMediaManagerPrivate)) | |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
101 | #define PURPLE_MEDIA_ELEMENT_INFO_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA_ELEMENT_INFO, PurpleMediaElementInfoPrivate)) |
| 19883 | 102 | |
| 103 | static void purple_media_manager_class_init (PurpleMediaManagerClass *klass); | |
| 104 | static void purple_media_manager_init (PurpleMediaManager *media); | |
| 105 | static void purple_media_manager_finalize (GObject *object); | |
| 106 | ||
| 107 | static GObjectClass *parent_class = NULL; | |
| 108 | ||
| 109 | ||
| 110 | ||
| 111 | enum { | |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19884
diff
changeset
|
112 | INIT_MEDIA, |
|
29540
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
113 | UI_CAPS_CHANGED, |
| 19883 | 114 | LAST_SIGNAL |
| 115 | }; | |
| 116 | static guint purple_media_manager_signals[LAST_SIGNAL] = {0}; | |
|
26640
eba80d2f198f
Make it compile with --disable-vv... again!
Michael Ruprecht <maiku@pidgin.im>
parents:
26626
diff
changeset
|
117 | #endif |
| 19883 | 118 | |
| 119 | GType | |
| 120 | purple_media_manager_get_type() | |
| 121 | { | |
|
26640
eba80d2f198f
Make it compile with --disable-vv... again!
Michael Ruprecht <maiku@pidgin.im>
parents:
26626
diff
changeset
|
122 | #ifdef USE_VV |
| 19883 | 123 | static GType type = 0; |
| 124 | ||
| 125 | if (type == 0) { | |
| 126 | static const GTypeInfo info = { | |
| 127 | sizeof(PurpleMediaManagerClass), | |
| 128 | NULL, | |
| 129 | NULL, | |
| 130 | (GClassInitFunc) purple_media_manager_class_init, | |
| 131 | NULL, | |
| 132 | NULL, | |
| 133 | sizeof(PurpleMediaManager), | |
| 134 | 0, | |
|
22071
4c47e360e467
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19889
diff
changeset
|
135 | (GInstanceInitFunc) purple_media_manager_init, |
|
4c47e360e467
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19889
diff
changeset
|
136 | NULL |
| 19883 | 137 | }; |
| 138 | type = g_type_register_static(G_TYPE_OBJECT, "PurpleMediaManager", &info, 0); | |
| 139 | } | |
| 140 | return type; | |
|
26640
eba80d2f198f
Make it compile with --disable-vv... again!
Michael Ruprecht <maiku@pidgin.im>
parents:
26626
diff
changeset
|
141 | #else |
|
eba80d2f198f
Make it compile with --disable-vv... again!
Michael Ruprecht <maiku@pidgin.im>
parents:
26626
diff
changeset
|
142 | return G_TYPE_NONE; |
|
eba80d2f198f
Make it compile with --disable-vv... again!
Michael Ruprecht <maiku@pidgin.im>
parents:
26626
diff
changeset
|
143 | #endif |
| 19883 | 144 | } |
| 145 | ||
|
26640
eba80d2f198f
Make it compile with --disable-vv... again!
Michael Ruprecht <maiku@pidgin.im>
parents:
26626
diff
changeset
|
146 | #ifdef USE_VV |
| 19883 | 147 | static void |
| 148 | purple_media_manager_class_init (PurpleMediaManagerClass *klass) | |
| 149 | { | |
| 150 | GObjectClass *gobject_class = (GObjectClass*)klass; | |
| 151 | parent_class = g_type_class_peek_parent(klass); | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
29620
diff
changeset
|
152 | |
| 19883 | 153 | gobject_class->finalize = purple_media_manager_finalize; |
| 154 | ||
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19884
diff
changeset
|
155 | purple_media_manager_signals[INIT_MEDIA] = g_signal_new ("init-media", |
| 19883 | 156 | G_TYPE_FROM_CLASS (klass), |
| 157 | G_SIGNAL_RUN_LAST, | |
| 158 | 0, NULL, NULL, | |
|
26183
d78798f480da
Remove connection attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26150
diff
changeset
|
159 | purple_smarshal_BOOLEAN__OBJECT_POINTER_STRING, |
|
d78798f480da
Remove connection attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26150
diff
changeset
|
160 | G_TYPE_BOOLEAN, 3, PURPLE_TYPE_MEDIA, |
|
d78798f480da
Remove connection attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26150
diff
changeset
|
161 | G_TYPE_POINTER, G_TYPE_STRING); |
|
29540
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
162 | |
|
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
163 | purple_media_manager_signals[UI_CAPS_CHANGED] = g_signal_new ("ui-caps-changed", |
|
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
164 | G_TYPE_FROM_CLASS (klass), |
|
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
165 | G_SIGNAL_RUN_LAST, |
|
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
166 | 0, NULL, NULL, |
|
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
167 | purple_smarshal_VOID__FLAGS_FLAGS, |
|
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
168 | G_TYPE_NONE, 2, PURPLE_MEDIA_TYPE_CAPS, |
|
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
169 | PURPLE_MEDIA_TYPE_CAPS); |
|
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
170 | |
| 19884 | 171 | g_type_class_add_private(klass, sizeof(PurpleMediaManagerPrivate)); |
| 19883 | 172 | } |
| 173 | ||
| 174 | static void | |
| 175 | purple_media_manager_init (PurpleMediaManager *media) | |
| 176 | { | |
| 177 | media->priv = PURPLE_MEDIA_MANAGER_GET_PRIVATE(media); | |
| 19884 | 178 | media->priv->medias = NULL; |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
179 | media->priv->next_output_window_id = 1; |
|
29620
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
180 | #ifdef USE_VV |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
181 | media->priv->backend_type = PURPLE_TYPE_MEDIA_BACKEND_FS2; |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
182 | #endif |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28110
diff
changeset
|
183 | |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28110
diff
changeset
|
184 | purple_prefs_add_none("/purple/media"); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28110
diff
changeset
|
185 | purple_prefs_add_none("/purple/media/audio"); |
|
31557
02082aa1ba41
During a voice call, Pidgin now sends constant audio traffic, even when there
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31368
diff
changeset
|
186 | purple_prefs_add_int("/purple/media/audio/silence_threshold", 5); |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28110
diff
changeset
|
187 | purple_prefs_add_none("/purple/media/audio/volume"); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28110
diff
changeset
|
188 | purple_prefs_add_int("/purple/media/audio/volume/input", 10); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28110
diff
changeset
|
189 | purple_prefs_add_int("/purple/media/audio/volume/output", 10); |
| 19883 | 190 | } |
| 191 | ||
| 192 | static void | |
| 193 | purple_media_manager_finalize (GObject *media) | |
| 194 | { | |
|
26115
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
195 | PurpleMediaManagerPrivate *priv = PURPLE_MEDIA_MANAGER_GET_PRIVATE(media); |
|
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
196 | for (; priv->medias; priv->medias = |
|
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
197 | g_list_delete_link(priv->medias, priv->medias)) { |
|
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
198 | g_object_unref(priv->medias->data); |
|
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
199 | } |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
200 | for (; priv->elements; priv->elements = |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
201 | g_list_delete_link(priv->elements, priv->elements)) { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
202 | g_object_unref(priv->elements->data); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
203 | } |
|
31311
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
204 | if (priv->video_caps) |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
205 | gst_caps_unref(priv->video_caps); |
| 19883 | 206 | parent_class->finalize(media); |
| 207 | } | |
|
26640
eba80d2f198f
Make it compile with --disable-vv... again!
Michael Ruprecht <maiku@pidgin.im>
parents:
26626
diff
changeset
|
208 | #endif |
| 19883 | 209 | |
| 210 | PurpleMediaManager * | |
| 211 | purple_media_manager_get() | |
| 212 | { | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
213 | #ifdef USE_VV |
| 19883 | 214 | static PurpleMediaManager *manager = NULL; |
| 215 | ||
| 216 | if (manager == NULL) | |
| 217 | manager = PURPLE_MEDIA_MANAGER(g_object_new(purple_media_manager_get_type(), NULL)); | |
| 218 | return manager; | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
219 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
220 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
221 | #endif |
| 19883 | 222 | } |
| 223 | ||
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
224 | #ifdef USE_VV |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
225 | static gboolean |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
226 | pipeline_bus_call(GstBus *bus, GstMessage *msg, PurpleMediaManager *manager) |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
227 | { |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
228 | switch(GST_MESSAGE_TYPE(msg)) { |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
229 | case GST_MESSAGE_EOS: |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
230 | purple_debug_info("mediamanager", "End of Stream\n"); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
231 | break; |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
232 | case GST_MESSAGE_ERROR: { |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
233 | gchar *debug = NULL; |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
234 | GError *err = NULL; |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
235 | |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
236 | gst_message_parse_error(msg, &err, &debug); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
237 | |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
238 | purple_debug_error("mediamanager", |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
239 | "gst pipeline error: %s\n", |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
240 | err->message); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
241 | g_error_free(err); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
242 | |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
243 | if (debug) { |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
244 | purple_debug_error("mediamanager", |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
245 | "Debug details: %s\n", debug); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
246 | g_free (debug); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
247 | } |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
248 | break; |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
249 | } |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
250 | default: |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
251 | break; |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
252 | } |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
253 | return TRUE; |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
254 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
255 | #endif |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
256 | |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26748
diff
changeset
|
257 | #ifdef USE_GSTREAMER |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
258 | GstElement * |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
259 | purple_media_manager_get_pipeline(PurpleMediaManager *manager) |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
260 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
261 | #ifdef USE_VV |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
262 | g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), NULL); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
263 | |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
264 | if (manager->priv->pipeline == NULL) { |
|
28110
f0fd4a9d7c5a
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Michael Ruprecht <maiku@pidgin.im>
parents:
28109
diff
changeset
|
265 | FsElementAddedNotifier *notifier; |
|
28109
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
266 | gchar *filename; |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
267 | GError *err = NULL; |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
268 | GKeyFile *keyfile; |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
269 | GstBus *bus; |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
270 | manager->priv->pipeline = gst_pipeline_new(NULL); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
271 | |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
272 | bus = gst_pipeline_get_bus( |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
273 | GST_PIPELINE(manager->priv->pipeline)); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
274 | gst_bus_add_signal_watch(GST_BUS(bus)); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
275 | g_signal_connect(G_OBJECT(bus), "message", |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
276 | G_CALLBACK(pipeline_bus_call), manager); |
|
33485
8845db3de73a
Fix call to gst_bus_set_sync_handler.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33482
diff
changeset
|
277 | #if GST_CHECK_VERSION(0,11,0) |
|
8845db3de73a
Fix call to gst_bus_set_sync_handler.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33482
diff
changeset
|
278 | gst_bus_set_sync_handler(bus, gst_bus_sync_signal_handler, NULL, NULL); |
|
8845db3de73a
Fix call to gst_bus_set_sync_handler.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33482
diff
changeset
|
279 | #else |
|
8845db3de73a
Fix call to gst_bus_set_sync_handler.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33482
diff
changeset
|
280 | gst_bus_set_sync_handler(bus, gst_bus_sync_signal_handler, NULL); |
|
8845db3de73a
Fix call to gst_bus_set_sync_handler.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33482
diff
changeset
|
281 | #endif |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
282 | gst_object_unref(bus); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
283 | |
|
28109
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
284 | filename = g_build_filename(purple_user_dir(), |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
285 | "fs-element.conf", NULL); |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
286 | keyfile = g_key_file_new(); |
|
28110
f0fd4a9d7c5a
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Michael Ruprecht <maiku@pidgin.im>
parents:
28109
diff
changeset
|
287 | if (!g_key_file_load_from_file(keyfile, filename, |
|
28109
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
288 | G_KEY_FILE_NONE, &err)) { |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
289 | if (err->code == 4) |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
290 | purple_debug_info("mediamanager", |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
291 | "Couldn't read " |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
292 | "fs-element.conf: %s\n", |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
293 | err->message); |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
294 | else |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
295 | purple_debug_error("mediamanager", |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
296 | "Error reading " |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
297 | "fs-element.conf: %s\n", |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
298 | err->message); |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
299 | g_error_free(err); |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
300 | } |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
301 | g_free(filename); |
|
0c7d09754f78
Allow setting properties on GStreamer elements with fs-element.conf.
Michael Ruprecht <maiku@pidgin.im>
parents:
27926
diff
changeset
|
302 | |
|
28110
f0fd4a9d7c5a
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Michael Ruprecht <maiku@pidgin.im>
parents:
28109
diff
changeset
|
303 | /* Hack to make alsasrc stop messing up audio timestamps */ |
|
f0fd4a9d7c5a
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Michael Ruprecht <maiku@pidgin.im>
parents:
28109
diff
changeset
|
304 | if (!g_key_file_has_key(keyfile, |
|
f0fd4a9d7c5a
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Michael Ruprecht <maiku@pidgin.im>
parents:
28109
diff
changeset
|
305 | "alsasrc", "slave-method", NULL)) { |
|
f0fd4a9d7c5a
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Michael Ruprecht <maiku@pidgin.im>
parents:
28109
diff
changeset
|
306 | g_key_file_set_integer(keyfile, |
|
f0fd4a9d7c5a
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Michael Ruprecht <maiku@pidgin.im>
parents:
28109
diff
changeset
|
307 | "alsasrc", "slave-method", 2); |
|
f0fd4a9d7c5a
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Michael Ruprecht <maiku@pidgin.im>
parents:
28109
diff
changeset
|
308 | } |
|
f0fd4a9d7c5a
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Michael Ruprecht <maiku@pidgin.im>
parents:
28109
diff
changeset
|
309 | |
|
f0fd4a9d7c5a
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Michael Ruprecht <maiku@pidgin.im>
parents:
28109
diff
changeset
|
310 | notifier = fs_element_added_notifier_new(); |
|
f0fd4a9d7c5a
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Michael Ruprecht <maiku@pidgin.im>
parents:
28109
diff
changeset
|
311 | fs_element_added_notifier_add(notifier, |
|
f0fd4a9d7c5a
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Michael Ruprecht <maiku@pidgin.im>
parents:
28109
diff
changeset
|
312 | GST_BIN(manager->priv->pipeline)); |
|
f0fd4a9d7c5a
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Michael Ruprecht <maiku@pidgin.im>
parents:
28109
diff
changeset
|
313 | fs_element_added_notifier_set_properties_from_keyfile( |
|
f0fd4a9d7c5a
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Michael Ruprecht <maiku@pidgin.im>
parents:
28109
diff
changeset
|
314 | notifier, keyfile); |
|
f0fd4a9d7c5a
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Michael Ruprecht <maiku@pidgin.im>
parents:
28109
diff
changeset
|
315 | |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
316 | gst_element_set_state(manager->priv->pipeline, |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
317 | GST_STATE_PLAYING); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
318 | } |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
319 | |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
320 | return manager->priv->pipeline; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
321 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
322 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
323 | #endif |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
324 | } |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26748
diff
changeset
|
325 | #endif /* USE_GSTREAMER */ |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
326 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22071
diff
changeset
|
327 | PurpleMedia * |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22071
diff
changeset
|
328 | purple_media_manager_create_media(PurpleMediaManager *manager, |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
329 | PurpleAccount *account, |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22071
diff
changeset
|
330 | const char *conference_type, |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
331 | const char *remote_user, |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
332 | gboolean initiator) |
| 19883 | 333 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
334 | #ifdef USE_VV |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23697
diff
changeset
|
335 | PurpleMedia *media; |
|
26111
d25772351a75
Stop additional media sessions within a single conversation for grouped contacts.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
336 | gboolean signal_ret; |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23697
diff
changeset
|
337 | |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23697
diff
changeset
|
338 | media = PURPLE_MEDIA(g_object_new(purple_media_get_type(), |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
339 | "manager", manager, |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
340 | "account", account, |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29540
diff
changeset
|
341 | "conference-type", conference_type, |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
342 | "initiator", initiator, |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23697
diff
changeset
|
343 | NULL)); |
|
26096
7249fdfc2eab
Set the media pipeline to PLAYING immediately after initialization
Michael Ruprecht <maiku@pidgin.im>
parents:
23704
diff
changeset
|
344 | |
|
26111
d25772351a75
Stop additional media sessions within a single conversation for grouped contacts.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
345 | g_signal_emit(manager, purple_media_manager_signals[INIT_MEDIA], 0, |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
346 | media, account, remote_user, &signal_ret); |
|
26111
d25772351a75
Stop additional media sessions within a single conversation for grouped contacts.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
347 | |
|
d25772351a75
Stop additional media sessions within a single conversation for grouped contacts.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
348 | if (signal_ret == FALSE) { |
|
d25772351a75
Stop additional media sessions within a single conversation for grouped contacts.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
349 | g_object_unref(media); |
|
d25772351a75
Stop additional media sessions within a single conversation for grouped contacts.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
350 | return NULL; |
|
d25772351a75
Stop additional media sessions within a single conversation for grouped contacts.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
351 | } |
|
d25772351a75
Stop additional media sessions within a single conversation for grouped contacts.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
352 | |
| 19883 | 353 | manager->priv->medias = g_list_append(manager->priv->medias, media); |
| 354 | return media; | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
355 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
356 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
357 | #endif |
| 19883 | 358 | } |
| 359 | ||
|
26115
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
360 | GList * |
|
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
361 | purple_media_manager_get_media(PurpleMediaManager *manager) |
|
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
362 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
363 | #ifdef USE_VV |
|
26115
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
364 | return manager->priv->medias; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
365 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
366 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
367 | #endif |
|
26115
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
368 | } |
|
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
369 | |
|
26329
6e390d9ea49a
Added purple_media_manager_get_media_by_connection.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
370 | GList * |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
371 | purple_media_manager_get_media_by_account(PurpleMediaManager *manager, |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
372 | PurpleAccount *account) |
|
26329
6e390d9ea49a
Added purple_media_manager_get_media_by_connection.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
373 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
374 | #ifdef USE_VV |
|
26329
6e390d9ea49a
Added purple_media_manager_get_media_by_connection.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
375 | GList *media = NULL; |
|
6e390d9ea49a
Added purple_media_manager_get_media_by_connection.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
376 | GList *iter; |
|
6e390d9ea49a
Added purple_media_manager_get_media_by_connection.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
377 | |
|
6e390d9ea49a
Added purple_media_manager_get_media_by_connection.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
378 | g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), NULL); |
|
6e390d9ea49a
Added purple_media_manager_get_media_by_connection.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
379 | |
|
6e390d9ea49a
Added purple_media_manager_get_media_by_connection.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
380 | iter = manager->priv->medias; |
|
6e390d9ea49a
Added purple_media_manager_get_media_by_connection.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
381 | for (; iter; iter = g_list_next(iter)) { |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
382 | if (purple_media_get_account(iter->data) == account) { |
|
26329
6e390d9ea49a
Added purple_media_manager_get_media_by_connection.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
383 | media = g_list_prepend(media, iter->data); |
|
6e390d9ea49a
Added purple_media_manager_get_media_by_connection.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
384 | } |
|
6e390d9ea49a
Added purple_media_manager_get_media_by_connection.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
385 | } |
|
6e390d9ea49a
Added purple_media_manager_get_media_by_connection.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
386 | |
|
6e390d9ea49a
Added purple_media_manager_get_media_by_connection.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
387 | return media; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
388 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
389 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
390 | #endif |
|
26329
6e390d9ea49a
Added purple_media_manager_get_media_by_connection.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
391 | } |
|
6e390d9ea49a
Added purple_media_manager_get_media_by_connection.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
392 | |
|
26115
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
393 | void |
|
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
394 | purple_media_manager_remove_media(PurpleMediaManager *manager, |
|
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
395 | PurpleMedia *media) |
|
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
396 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
397 | #ifdef USE_VV |
|
26115
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
398 | GList *list = g_list_find(manager->priv->medias, media); |
|
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
399 | if (list) |
|
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
400 | manager->priv->medias = |
|
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
401 | g_list_delete_link(manager->priv->medias, list); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
402 | #endif |
|
26115
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
403 | } |
|
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26111
diff
changeset
|
404 | |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
405 | #ifdef USE_VV |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
406 | static void |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
407 | request_pad_unlinked_cb(GstPad *pad, GstPad *peer, gpointer user_data) |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
408 | { |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
409 | GstElement *parent = GST_ELEMENT_PARENT(pad); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
410 | GstIterator *iter; |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
411 | GstPad *remaining_pad; |
|
28132
5565fd8df570
Unleak pad if more pads are linked.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
412 | GstIteratorResult result; |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
413 | |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
414 | gst_element_release_request_pad(GST_ELEMENT_PARENT(pad), pad); |
|
31313
eca4138f416c
This patch fixes #12758.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31311
diff
changeset
|
415 | |
|
28132
5565fd8df570
Unleak pad if more pads are linked.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
416 | iter = gst_element_iterate_src_pads(parent); |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
417 | |
|
28132
5565fd8df570
Unleak pad if more pads are linked.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
418 | result = gst_iterator_next(iter, (gpointer)&remaining_pad); |
|
5565fd8df570
Unleak pad if more pads are linked.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
419 | |
|
5565fd8df570
Unleak pad if more pads are linked.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
420 | if (result == GST_ITERATOR_DONE) { |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
421 | gst_element_set_locked_state(parent, TRUE); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
422 | gst_element_set_state(parent, GST_STATE_NULL); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
423 | gst_bin_remove(GST_BIN(GST_ELEMENT_PARENT(parent)), parent); |
|
28132
5565fd8df570
Unleak pad if more pads are linked.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
424 | } else if (result == GST_ITERATOR_OK) { |
|
5565fd8df570
Unleak pad if more pads are linked.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
425 | gst_object_unref(remaining_pad); |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
426 | } |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
427 | |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
428 | gst_iterator_free(iter); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
429 | } |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
430 | #endif |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
431 | |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26748
diff
changeset
|
432 | #ifdef USE_GSTREAMER |
|
31311
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
433 | |
|
31319
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
434 | void |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
435 | purple_media_manager_set_video_caps(PurpleMediaManager *manager, GstCaps *caps) |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
436 | { |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
437 | #ifdef USE_VV |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
438 | if (manager->priv->video_caps) |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
439 | gst_caps_unref(manager->priv->video_caps); |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
440 | |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
441 | manager->priv->video_caps = caps; |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
442 | |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
443 | if (manager->priv->pipeline && manager->priv->video_src) { |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
444 | gchar *id = purple_media_element_info_get_id(manager->priv->video_src); |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
445 | GstElement *src = gst_bin_get_by_name(GST_BIN(manager->priv->pipeline), id); |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
446 | |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
447 | if (src) { |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
448 | GstElement *capsfilter = gst_bin_get_by_name(GST_BIN(src), "prpl_video_caps"); |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
449 | g_object_set(G_OBJECT(capsfilter), "caps", caps, NULL); |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
450 | } |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
451 | |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
452 | g_free(id); |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
453 | } |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
454 | #endif |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
455 | } |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
456 | |
|
b271e590aaf9
Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31313
diff
changeset
|
457 | GstCaps * |
|
31311
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
458 | purple_media_manager_get_video_caps(PurpleMediaManager *manager) |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
459 | { |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
460 | #ifdef USE_VV |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
461 | if (manager->priv->video_caps == NULL) |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
462 | manager->priv->video_caps = gst_caps_from_string("video/x-raw-yuv," |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
463 | "width=[250,352], height=[200,288], framerate=[1/1,20/1]"); |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
464 | return manager->priv->video_caps; |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
465 | #else |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
466 | return NULL; |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
467 | #endif |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
468 | } |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
469 | |
|
26150
951503fc5456
Add purple_media_manager_get_element.
Michael Ruprecht <maiku@pidgin.im>
parents:
26130
diff
changeset
|
470 | GstElement * |
|
951503fc5456
Add purple_media_manager_get_element.
Michael Ruprecht <maiku@pidgin.im>
parents:
26130
diff
changeset
|
471 | purple_media_manager_get_element(PurpleMediaManager *manager, |
|
26522
44401eba59a5
Give more information to element creation functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26520
diff
changeset
|
472 | PurpleMediaSessionType type, PurpleMedia *media, |
|
44401eba59a5
Give more information to element creation functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26520
diff
changeset
|
473 | const gchar *session_id, const gchar *participant) |
|
26150
951503fc5456
Add purple_media_manager_get_element.
Michael Ruprecht <maiku@pidgin.im>
parents:
26130
diff
changeset
|
474 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
475 | #ifdef USE_VV |
|
26150
951503fc5456
Add purple_media_manager_get_element.
Michael Ruprecht <maiku@pidgin.im>
parents:
26130
diff
changeset
|
476 | GstElement *ret = NULL; |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
477 | PurpleMediaElementInfo *info = NULL; |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
478 | PurpleMediaElementType element_type; |
|
26150
951503fc5456
Add purple_media_manager_get_element.
Michael Ruprecht <maiku@pidgin.im>
parents:
26130
diff
changeset
|
479 | |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
480 | if (type & PURPLE_MEDIA_SEND_AUDIO) |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
481 | info = manager->priv->audio_src; |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
482 | else if (type & PURPLE_MEDIA_RECV_AUDIO) |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
483 | info = manager->priv->audio_sink; |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
484 | else if (type & PURPLE_MEDIA_SEND_VIDEO) |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
485 | info = manager->priv->video_src; |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
486 | else if (type & PURPLE_MEDIA_RECV_VIDEO) |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
487 | info = manager->priv->video_sink; |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
488 | |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
489 | if (info == NULL) |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
490 | return NULL; |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
491 | |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
492 | element_type = purple_media_element_info_get_element_type(info); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
493 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
494 | if (element_type & PURPLE_MEDIA_ELEMENT_UNIQUE && |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
495 | element_type & PURPLE_MEDIA_ELEMENT_SRC) { |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
496 | GstElement *tee; |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
497 | GstPad *pad; |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
498 | GstPad *ghost; |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
499 | gchar *id = purple_media_element_info_get_id(info); |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
500 | |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
501 | ret = gst_bin_get_by_name(GST_BIN( |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
502 | purple_media_manager_get_pipeline( |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
503 | manager)), id); |
|
26150
951503fc5456
Add purple_media_manager_get_element.
Michael Ruprecht <maiku@pidgin.im>
parents:
26130
diff
changeset
|
504 | |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
505 | if (ret == NULL) { |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
506 | GstElement *bin, *fakesink; |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
507 | ret = purple_media_element_info_call_create(info, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
508 | media, session_id, participant); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
509 | bin = gst_bin_new(id); |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
510 | tee = gst_element_factory_make("tee", "tee"); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
511 | gst_bin_add_many(GST_BIN(bin), ret, tee, NULL); |
|
31311
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
512 | |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
513 | if (type & PURPLE_MEDIA_SEND_VIDEO) { |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
514 | GstElement *videoscale; |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
515 | GstElement *capsfilter; |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
516 | |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
517 | videoscale = gst_element_factory_make("videoscale", NULL); |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
518 | capsfilter = gst_element_factory_make("capsfilter", "prpl_video_caps"); |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
519 | |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
520 | g_object_set(G_OBJECT(capsfilter), |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
521 | "caps", purple_media_manager_get_video_caps(manager), NULL); |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
522 | |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
523 | gst_bin_add_many(GST_BIN(bin), videoscale, capsfilter, NULL); |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
524 | gst_element_link_many(ret, videoscale, capsfilter, tee, NULL); |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
525 | } else |
|
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
526 | gst_element_link(ret, tee); |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
527 | |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
528 | /* |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
529 | * This shouldn't be necessary, but it stops it from |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
530 | * giving a not-linked error upon destruction |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
531 | */ |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
532 | fakesink = gst_element_factory_make("fakesink", NULL); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
533 | g_object_set(fakesink, "sync", FALSE, NULL); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
534 | gst_bin_add(GST_BIN(bin), fakesink); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
535 | gst_element_link(tee, fakesink); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
536 | |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
537 | ret = bin; |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
538 | gst_object_ref(ret); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
539 | gst_bin_add(GST_BIN(purple_media_manager_get_pipeline( |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
540 | manager)), ret); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
541 | } |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
542 | g_free(id); |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
543 | |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
544 | tee = gst_bin_get_by_name(GST_BIN(ret), "tee"); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
545 | pad = gst_element_get_request_pad(tee, "src%d"); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
546 | gst_object_unref(tee); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
547 | ghost = gst_ghost_pad_new(NULL, pad); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
548 | gst_object_unref(pad); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
549 | g_signal_connect(GST_PAD(ghost), "unlinked", |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
550 | G_CALLBACK(request_pad_unlinked_cb), NULL); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
551 | gst_pad_set_active(ghost, TRUE); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
552 | gst_element_add_pad(ret, ghost); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
553 | } else { |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
554 | ret = purple_media_element_info_call_create(info, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
555 | media, session_id, participant); |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26480
diff
changeset
|
556 | } |
|
26150
951503fc5456
Add purple_media_manager_get_element.
Michael Ruprecht <maiku@pidgin.im>
parents:
26130
diff
changeset
|
557 | |
|
951503fc5456
Add purple_media_manager_get_element.
Michael Ruprecht <maiku@pidgin.im>
parents:
26130
diff
changeset
|
558 | if (ret == NULL) |
|
951503fc5456
Add purple_media_manager_get_element.
Michael Ruprecht <maiku@pidgin.im>
parents:
26130
diff
changeset
|
559 | purple_debug_error("media", "Error creating source or sink\n"); |
|
951503fc5456
Add purple_media_manager_get_element.
Michael Ruprecht <maiku@pidgin.im>
parents:
26130
diff
changeset
|
560 | |
|
951503fc5456
Add purple_media_manager_get_element.
Michael Ruprecht <maiku@pidgin.im>
parents:
26130
diff
changeset
|
561 | return ret; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
562 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
563 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
564 | #endif |
|
26150
951503fc5456
Add purple_media_manager_get_element.
Michael Ruprecht <maiku@pidgin.im>
parents:
26130
diff
changeset
|
565 | } |
|
951503fc5456
Add purple_media_manager_get_element.
Michael Ruprecht <maiku@pidgin.im>
parents:
26130
diff
changeset
|
566 | |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
567 | PurpleMediaElementInfo * |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
568 | purple_media_manager_get_element_info(PurpleMediaManager *manager, |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
569 | const gchar *id) |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
570 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
571 | #ifdef USE_VV |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
572 | GList *iter; |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
573 | |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
574 | g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), NULL); |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
575 | |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
576 | iter = manager->priv->elements; |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
577 | |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
578 | for (; iter; iter = g_list_next(iter)) { |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
579 | gchar *element_id = |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
580 | purple_media_element_info_get_id(iter->data); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
581 | if (!strcmp(element_id, id)) { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
582 | g_free(element_id); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
583 | g_object_ref(iter->data); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
584 | return iter->data; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
585 | } |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
586 | g_free(element_id); |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
587 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
588 | #endif |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
589 | |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
590 | return NULL; |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
591 | } |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
592 | |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
593 | gboolean |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
594 | purple_media_manager_register_element(PurpleMediaManager *manager, |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
595 | PurpleMediaElementInfo *info) |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
596 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
597 | #ifdef USE_VV |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
598 | PurpleMediaElementInfo *info2; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
599 | gchar *id; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
600 | |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
601 | g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), FALSE); |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
602 | g_return_val_if_fail(info != NULL, FALSE); |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
603 | |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
604 | id = purple_media_element_info_get_id(info); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
605 | info2 = purple_media_manager_get_element_info(manager, id); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
606 | g_free(id); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
607 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
608 | if (info2 != NULL) { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
609 | g_object_unref(info2); |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
610 | return FALSE; |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
611 | } |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
612 | |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
613 | manager->priv->elements = |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
614 | g_list_prepend(manager->priv->elements, info); |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
615 | return TRUE; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
616 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
617 | return FALSE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
618 | #endif |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
619 | } |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
620 | |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
621 | gboolean |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
622 | purple_media_manager_unregister_element(PurpleMediaManager *manager, |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
623 | const gchar *id) |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
624 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
625 | #ifdef USE_VV |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
626 | PurpleMediaElementInfo *info; |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
627 | |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
628 | g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), FALSE); |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
629 | |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
630 | info = purple_media_manager_get_element_info(manager, id); |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
631 | |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
632 | if (info == NULL) { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
633 | g_object_unref(info); |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
634 | return FALSE; |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
635 | } |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
636 | |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
637 | if (manager->priv->audio_src == info) |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
638 | manager->priv->audio_src = NULL; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
639 | if (manager->priv->audio_sink == info) |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
640 | manager->priv->audio_sink = NULL; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
641 | if (manager->priv->video_src == info) |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
642 | manager->priv->video_src = NULL; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
643 | if (manager->priv->video_sink == info) |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
644 | manager->priv->video_sink = NULL; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
645 | |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
646 | manager->priv->elements = g_list_remove( |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
647 | manager->priv->elements, info); |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
648 | g_object_unref(info); |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
649 | return TRUE; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
650 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
651 | return FALSE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
652 | #endif |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
653 | } |
|
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
654 | |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
655 | gboolean |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
656 | purple_media_manager_set_active_element(PurpleMediaManager *manager, |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
657 | PurpleMediaElementInfo *info) |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
658 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
659 | #ifdef USE_VV |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
660 | PurpleMediaElementInfo *info2; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
661 | PurpleMediaElementType type; |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
662 | gboolean ret = FALSE; |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
663 | gchar *id; |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
664 | |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
665 | g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), FALSE); |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
666 | g_return_val_if_fail(info != NULL, FALSE); |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
667 | |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
668 | id = purple_media_element_info_get_id(info); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
669 | info2 = purple_media_manager_get_element_info(manager, id); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
670 | g_free(id); |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
671 | |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
672 | if (info2 == NULL) |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
673 | purple_media_manager_register_element(manager, info); |
| 26748 | 674 | else |
| 675 | g_object_unref(info2); | |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
676 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
677 | type = purple_media_element_info_get_element_type(info); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
678 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
679 | if (type & PURPLE_MEDIA_ELEMENT_SRC) { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
680 | if (type & PURPLE_MEDIA_ELEMENT_AUDIO) { |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
681 | manager->priv->audio_src = info; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
682 | ret = TRUE; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
683 | } |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
684 | if (type & PURPLE_MEDIA_ELEMENT_VIDEO) { |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
685 | manager->priv->video_src = info; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
686 | ret = TRUE; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
687 | } |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
688 | } |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
689 | if (type & PURPLE_MEDIA_ELEMENT_SINK) { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
690 | if (type & PURPLE_MEDIA_ELEMENT_AUDIO) { |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
691 | manager->priv->audio_sink = info; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
692 | ret = TRUE; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
693 | } |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
694 | if (type & PURPLE_MEDIA_ELEMENT_VIDEO) { |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
695 | manager->priv->video_sink = info; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
696 | ret = TRUE; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
697 | } |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
698 | } |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
699 | |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
700 | return ret; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
701 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
702 | return FALSE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
703 | #endif |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
704 | } |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
705 | |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
706 | PurpleMediaElementInfo * |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
707 | purple_media_manager_get_active_element(PurpleMediaManager *manager, |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
708 | PurpleMediaElementType type) |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
709 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
710 | #ifdef USE_VV |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
711 | g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), NULL); |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
712 | |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
713 | if (type & PURPLE_MEDIA_ELEMENT_SRC) { |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
714 | if (type & PURPLE_MEDIA_ELEMENT_AUDIO) |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
715 | return manager->priv->audio_src; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
716 | else if (type & PURPLE_MEDIA_ELEMENT_VIDEO) |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
717 | return manager->priv->video_src; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
718 | } else if (type & PURPLE_MEDIA_ELEMENT_SINK) { |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
719 | if (type & PURPLE_MEDIA_ELEMENT_AUDIO) |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
720 | return manager->priv->audio_sink; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
721 | else if (type & PURPLE_MEDIA_ELEMENT_VIDEO) |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
722 | return manager->priv->video_sink; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
723 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
724 | #endif |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
725 | |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
726 | return NULL; |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
727 | } |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26748
diff
changeset
|
728 | #endif /* USE_GSTREAMER */ |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26287
diff
changeset
|
729 | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
730 | #ifdef USE_VV |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
731 | static void |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
732 | window_id_cb(GstBus *bus, GstMessage *msg, PurpleMediaOutputWindow *ow) |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
733 | { |
|
26626
afe9f06f73d0
Fix embedding video when the sink is a gconfvideosrc pointing to an
Michael Ruprecht <maiku@pidgin.im>
parents:
26616
diff
changeset
|
734 | GstElement *sink; |
|
afe9f06f73d0
Fix embedding video when the sink is a gconfvideosrc pointing to an
Michael Ruprecht <maiku@pidgin.im>
parents:
26616
diff
changeset
|
735 | |
|
33482
b9d34920e752
Replace GstXOverlay with GstVideoOverlay.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33234
diff
changeset
|
736 | if (GST_MESSAGE_TYPE(msg) != GST_MESSAGE_ELEMENT |
|
b9d34920e752
Replace GstXOverlay with GstVideoOverlay.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33234
diff
changeset
|
737 | #if GST_CHECK_VERSION(0,11,0) |
|
b9d34920e752
Replace GstXOverlay with GstVideoOverlay.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33234
diff
changeset
|
738 | || !gst_is_video_overlay_prepare_window_handle_message(msg)) |
|
b9d34920e752
Replace GstXOverlay with GstVideoOverlay.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33234
diff
changeset
|
739 | #else |
|
b9d34920e752
Replace GstXOverlay with GstVideoOverlay.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33234
diff
changeset
|
740 | || !gst_structure_has_name(msg->structure, "prepare-xwindow-id")) |
|
b9d34920e752
Replace GstXOverlay with GstVideoOverlay.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33234
diff
changeset
|
741 | #endif |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
742 | return; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
743 | |
|
26626
afe9f06f73d0
Fix embedding video when the sink is a gconfvideosrc pointing to an
Michael Ruprecht <maiku@pidgin.im>
parents:
26616
diff
changeset
|
744 | sink = GST_ELEMENT(GST_MESSAGE_SRC(msg)); |
|
afe9f06f73d0
Fix embedding video when the sink is a gconfvideosrc pointing to an
Michael Ruprecht <maiku@pidgin.im>
parents:
26616
diff
changeset
|
745 | while (sink != ow->sink) { |
|
afe9f06f73d0
Fix embedding video when the sink is a gconfvideosrc pointing to an
Michael Ruprecht <maiku@pidgin.im>
parents:
26616
diff
changeset
|
746 | if (sink == NULL) |
|
afe9f06f73d0
Fix embedding video when the sink is a gconfvideosrc pointing to an
Michael Ruprecht <maiku@pidgin.im>
parents:
26616
diff
changeset
|
747 | return; |
|
afe9f06f73d0
Fix embedding video when the sink is a gconfvideosrc pointing to an
Michael Ruprecht <maiku@pidgin.im>
parents:
26616
diff
changeset
|
748 | sink = GST_ELEMENT_PARENT(sink); |
|
afe9f06f73d0
Fix embedding video when the sink is a gconfvideosrc pointing to an
Michael Ruprecht <maiku@pidgin.im>
parents:
26616
diff
changeset
|
749 | } |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
750 | |
|
26626
afe9f06f73d0
Fix embedding video when the sink is a gconfvideosrc pointing to an
Michael Ruprecht <maiku@pidgin.im>
parents:
26616
diff
changeset
|
751 | g_signal_handlers_disconnect_matched(bus, G_SIGNAL_MATCH_FUNC |
|
afe9f06f73d0
Fix embedding video when the sink is a gconfvideosrc pointing to an
Michael Ruprecht <maiku@pidgin.im>
parents:
26616
diff
changeset
|
752 | | G_SIGNAL_MATCH_DATA, 0, 0, NULL, |
|
afe9f06f73d0
Fix embedding video when the sink is a gconfvideosrc pointing to an
Michael Ruprecht <maiku@pidgin.im>
parents:
26616
diff
changeset
|
753 | window_id_cb, ow); |
|
afe9f06f73d0
Fix embedding video when the sink is a gconfvideosrc pointing to an
Michael Ruprecht <maiku@pidgin.im>
parents:
26616
diff
changeset
|
754 | |
|
33482
b9d34920e752
Replace GstXOverlay with GstVideoOverlay.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33234
diff
changeset
|
755 | #if GST_CHECK_VERSION(0,11,0) |
|
b9d34920e752
Replace GstXOverlay with GstVideoOverlay.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33234
diff
changeset
|
756 | gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(GST_MESSAGE_SRC(msg)), |
|
b9d34920e752
Replace GstXOverlay with GstVideoOverlay.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33234
diff
changeset
|
757 | ow->window_id); |
|
b9d34920e752
Replace GstXOverlay with GstVideoOverlay.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33234
diff
changeset
|
758 | #elif GST_CHECK_VERSION(0,10,31) |
|
33234
5b70cdb613e9
Update deprecated GStreamer calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32113
diff
changeset
|
759 | gst_x_overlay_set_window_handle(GST_X_OVERLAY(GST_MESSAGE_SRC(msg)), |
|
5b70cdb613e9
Update deprecated GStreamer calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32113
diff
changeset
|
760 | ow->window_id); |
|
5b70cdb613e9
Update deprecated GStreamer calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32113
diff
changeset
|
761 | #else |
|
5b70cdb613e9
Update deprecated GStreamer calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32113
diff
changeset
|
762 | gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(GST_MESSAGE_SRC(msg)), |
|
5b70cdb613e9
Update deprecated GStreamer calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32113
diff
changeset
|
763 | ow->window_id); |
|
5b70cdb613e9
Update deprecated GStreamer calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32113
diff
changeset
|
764 | #endif |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
765 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
766 | #endif |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
767 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
768 | gboolean |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
769 | purple_media_manager_create_output_window(PurpleMediaManager *manager, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
770 | PurpleMedia *media, const gchar *session_id, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
771 | const gchar *participant) |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
772 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
773 | #ifdef USE_VV |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
774 | GList *iter; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
775 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
776 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
777 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
778 | iter = manager->priv->output_windows; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
779 | for(; iter; iter = g_list_next(iter)) { |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
780 | PurpleMediaOutputWindow *ow = iter->data; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
781 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
782 | if (ow->sink == NULL && ow->media == media && |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
783 | ((participant != NULL && |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
784 | ow->participant != NULL && |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
785 | !strcmp(participant, ow->participant)) || |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
786 | (participant == ow->participant)) && |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
787 | !strcmp(session_id, ow->session_id)) { |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
788 | GstBus *bus; |
|
28161
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
789 | GstElement *queue, *colorspace; |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
790 | GstElement *tee = purple_media_get_tee(media, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
791 | session_id, participant); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
792 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
793 | if (tee == NULL) |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
794 | continue; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
795 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
796 | queue = gst_element_factory_make( |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
797 | "queue", NULL); |
|
28161
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
798 | colorspace = gst_element_factory_make( |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
799 | "ffmpegcolorspace", NULL); |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
800 | ow->sink = purple_media_manager_get_element( |
|
26522
44401eba59a5
Give more information to element creation functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26520
diff
changeset
|
801 | manager, PURPLE_MEDIA_RECV_VIDEO, |
|
44401eba59a5
Give more information to element creation functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26520
diff
changeset
|
802 | ow->media, ow->session_id, |
|
44401eba59a5
Give more information to element creation functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26520
diff
changeset
|
803 | ow->participant); |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
804 | |
|
26427
cc660e80275f
Silence warning about videotestsrc not having two properties.
Michael Ruprecht <maiku@pidgin.im>
parents:
26329
diff
changeset
|
805 | if (participant == NULL) { |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
806 | /* aka this is a preview sink */ |
|
26427
cc660e80275f
Silence warning about videotestsrc not having two properties.
Michael Ruprecht <maiku@pidgin.im>
parents:
26329
diff
changeset
|
807 | GObjectClass *klass = |
|
cc660e80275f
Silence warning about videotestsrc not having two properties.
Michael Ruprecht <maiku@pidgin.im>
parents:
26329
diff
changeset
|
808 | G_OBJECT_GET_CLASS(ow->sink); |
|
cc660e80275f
Silence warning about videotestsrc not having two properties.
Michael Ruprecht <maiku@pidgin.im>
parents:
26329
diff
changeset
|
809 | if (g_object_class_find_property(klass, |
|
cc660e80275f
Silence warning about videotestsrc not having two properties.
Michael Ruprecht <maiku@pidgin.im>
parents:
26329
diff
changeset
|
810 | "sync")) |
|
cc660e80275f
Silence warning about videotestsrc not having two properties.
Michael Ruprecht <maiku@pidgin.im>
parents:
26329
diff
changeset
|
811 | g_object_set(G_OBJECT(ow->sink), |
|
cc660e80275f
Silence warning about videotestsrc not having two properties.
Michael Ruprecht <maiku@pidgin.im>
parents:
26329
diff
changeset
|
812 | "sync", "FALSE", NULL); |
|
cc660e80275f
Silence warning about videotestsrc not having two properties.
Michael Ruprecht <maiku@pidgin.im>
parents:
26329
diff
changeset
|
813 | if (g_object_class_find_property(klass, |
|
cc660e80275f
Silence warning about videotestsrc not having two properties.
Michael Ruprecht <maiku@pidgin.im>
parents:
26329
diff
changeset
|
814 | "async")) |
|
cc660e80275f
Silence warning about videotestsrc not having two properties.
Michael Ruprecht <maiku@pidgin.im>
parents:
26329
diff
changeset
|
815 | g_object_set(G_OBJECT(ow->sink), |
|
cc660e80275f
Silence warning about videotestsrc not having two properties.
Michael Ruprecht <maiku@pidgin.im>
parents:
26329
diff
changeset
|
816 | "async", FALSE, NULL); |
|
cc660e80275f
Silence warning about videotestsrc not having two properties.
Michael Ruprecht <maiku@pidgin.im>
parents:
26329
diff
changeset
|
817 | } |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
818 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
819 | gst_bin_add_many(GST_BIN(GST_ELEMENT_PARENT(tee)), |
|
28161
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
820 | queue, colorspace, ow->sink, NULL); |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
821 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
822 | bus = gst_pipeline_get_bus(GST_PIPELINE( |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
823 | manager->priv->pipeline)); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
824 | g_signal_connect(bus, "sync-message::element", |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
825 | G_CALLBACK(window_id_cb), ow); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
826 | gst_object_unref(bus); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
827 | |
|
28140
bbb3777dbe3e
Switch around some GStreamer linking and state setting.
Michael Ruprecht <maiku@pidgin.im>
parents:
28132
diff
changeset
|
828 | gst_element_set_state(ow->sink, GST_STATE_PLAYING); |
|
28161
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
829 | gst_element_set_state(colorspace, GST_STATE_PLAYING); |
|
28140
bbb3777dbe3e
Switch around some GStreamer linking and state setting.
Michael Ruprecht <maiku@pidgin.im>
parents:
28132
diff
changeset
|
830 | gst_element_set_state(queue, GST_STATE_PLAYING); |
|
28161
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
831 | gst_element_link(colorspace, ow->sink); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
832 | gst_element_link(queue, colorspace); |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
833 | gst_element_link(tee, queue); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
834 | } |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
835 | } |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
836 | return TRUE; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
837 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
838 | return FALSE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
839 | #endif |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
840 | } |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
841 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
842 | gulong |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
843 | purple_media_manager_set_output_window(PurpleMediaManager *manager, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
844 | PurpleMedia *media, const gchar *session_id, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
845 | const gchar *participant, gulong window_id) |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
846 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
847 | #ifdef USE_VV |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
848 | PurpleMediaOutputWindow *output_window; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
849 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
850 | g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), FALSE); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
851 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
852 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
853 | output_window = g_new0(PurpleMediaOutputWindow, 1); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
854 | output_window->id = manager->priv->next_output_window_id++; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
855 | output_window->media = media; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
856 | output_window->session_id = g_strdup(session_id); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
857 | output_window->participant = g_strdup(participant); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
858 | output_window->window_id = window_id; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
859 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
860 | manager->priv->output_windows = g_list_prepend( |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
861 | manager->priv->output_windows, output_window); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
862 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
863 | if (purple_media_get_tee(media, session_id, participant) != NULL) |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
864 | purple_media_manager_create_output_window(manager, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
865 | media, session_id, participant); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
866 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
867 | return output_window->id; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
868 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
869 | return 0; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
870 | #endif |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
871 | } |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
872 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
873 | gboolean |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
874 | purple_media_manager_remove_output_window(PurpleMediaManager *manager, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
875 | gulong output_window_id) |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
876 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
877 | #ifdef USE_VV |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
878 | PurpleMediaOutputWindow *output_window = NULL; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
879 | GList *iter; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
880 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
881 | g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), FALSE); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
882 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
883 | iter = manager->priv->output_windows; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
884 | for (; iter; iter = g_list_next(iter)) { |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
885 | PurpleMediaOutputWindow *ow = iter->data; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
886 | if (ow->id == output_window_id) { |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
887 | manager->priv->output_windows = g_list_delete_link( |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
888 | manager->priv->output_windows, iter); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
889 | output_window = ow; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
890 | break; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
891 | } |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
892 | } |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
893 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
894 | if (output_window == NULL) |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
895 | return FALSE; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
896 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
897 | if (output_window->sink != NULL) { |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
898 | GstPad *pad = gst_element_get_static_pad( |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
899 | output_window->sink, "sink"); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
900 | GstPad *peer = gst_pad_get_peer(pad); |
|
28161
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
901 | GstElement *colorspace = GST_ELEMENT_PARENT(peer), *queue; |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
902 | gst_object_unref(pad); |
|
28161
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
903 | gst_object_unref(peer); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
904 | pad = gst_element_get_static_pad(colorspace, "sink"); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
905 | peer = gst_pad_get_peer(pad); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
906 | queue = GST_ELEMENT_PARENT(peer); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
907 | gst_object_unref(pad); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
908 | gst_object_unref(peer); |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
909 | pad = gst_element_get_static_pad(queue, "sink"); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
910 | peer = gst_pad_get_peer(pad); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
911 | gst_object_unref(pad); |
|
27926
7ed64195754d
Don't crash when there isn't a webcam connected.
Michael Ruprecht <maiku@pidgin.im>
parents:
26792
diff
changeset
|
912 | if (peer != NULL) |
|
7ed64195754d
Don't crash when there isn't a webcam connected.
Michael Ruprecht <maiku@pidgin.im>
parents:
26792
diff
changeset
|
913 | gst_element_release_request_pad(GST_ELEMENT_PARENT(peer), peer); |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
914 | gst_element_set_locked_state(queue, TRUE); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
915 | gst_element_set_state(queue, GST_STATE_NULL); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
916 | gst_bin_remove(GST_BIN(GST_ELEMENT_PARENT(queue)), queue); |
|
28161
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
917 | gst_element_set_locked_state(colorspace, TRUE); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
918 | gst_element_set_state(colorspace, GST_STATE_NULL); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
919 | gst_bin_remove(GST_BIN(GST_ELEMENT_PARENT(colorspace)), colorspace); |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
920 | gst_element_set_locked_state(output_window->sink, TRUE); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
921 | gst_element_set_state(output_window->sink, GST_STATE_NULL); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
922 | gst_bin_remove(GST_BIN(GST_ELEMENT_PARENT(output_window->sink)), |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
923 | output_window->sink); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
924 | } |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
925 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
926 | g_free(output_window->session_id); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
927 | g_free(output_window->participant); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
928 | g_free(output_window); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
929 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
930 | return TRUE; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
931 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
932 | return FALSE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
933 | #endif |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
934 | } |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
935 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
936 | void |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
937 | purple_media_manager_remove_output_windows(PurpleMediaManager *manager, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
938 | PurpleMedia *media, const gchar *session_id, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
939 | const gchar *participant) |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
940 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
941 | #ifdef USE_VV |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
942 | GList *iter; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
943 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
944 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
945 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
946 | iter = manager->priv->output_windows; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
947 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
948 | for (; iter;) { |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
949 | PurpleMediaOutputWindow *ow = iter->data; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
950 | iter = g_list_next(iter); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
951 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
952 | if (media == ow->media && |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
953 | ((session_id != NULL && ow->session_id != NULL && |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
954 | !strcmp(session_id, ow->session_id)) || |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
955 | (session_id == ow->session_id)) && |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
956 | ((participant != NULL && ow->participant != NULL && |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
957 | !strcmp(participant, ow->participant)) || |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
958 | (participant == ow->participant))) |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
959 | purple_media_manager_remove_output_window( |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
960 | manager, ow->id); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
961 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
962 | #endif |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
963 | } |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
964 | |
|
26520
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
965 | void |
|
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
966 | purple_media_manager_set_ui_caps(PurpleMediaManager *manager, |
|
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
967 | PurpleMediaCaps caps) |
|
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
968 | { |
|
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
969 | #ifdef USE_VV |
|
29540
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
970 | PurpleMediaCaps oldcaps; |
|
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
971 | |
|
26520
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
972 | g_return_if_fail(PURPLE_IS_MEDIA_MANAGER(manager)); |
|
29540
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
973 | |
|
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
974 | oldcaps = manager->priv->ui_caps; |
|
26520
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
975 | manager->priv->ui_caps = caps; |
|
29540
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
976 | |
|
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
977 | if (caps != oldcaps) |
|
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
978 | g_signal_emit(manager, |
|
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
979 | purple_media_manager_signals[UI_CAPS_CHANGED], |
|
6d554484fbf7
Added the ui-caps-changed signal to the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
980 | 0, caps, oldcaps); |
|
26520
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
981 | #endif |
|
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
982 | } |
|
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
983 | |
|
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
984 | PurpleMediaCaps |
|
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
985 | purple_media_manager_get_ui_caps(PurpleMediaManager *manager) |
|
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
986 | { |
|
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
987 | #ifdef USE_VV |
|
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
988 | g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), |
|
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
989 | PURPLE_MEDIA_CAPS_NONE); |
|
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
990 | return manager->priv->ui_caps; |
|
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
991 | #else |
|
26640
eba80d2f198f
Make it compile with --disable-vv... again!
Michael Ruprecht <maiku@pidgin.im>
parents:
26626
diff
changeset
|
992 | return PURPLE_MEDIA_CAPS_NONE; |
|
26520
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
993 | #endif |
|
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
994 | } |
|
8cbe60f17f3b
Add purple_media_manager_{get,set}_ui_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26511
diff
changeset
|
995 | |
|
29620
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
996 | void |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
997 | purple_media_manager_set_backend_type(PurpleMediaManager *manager, |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
998 | GType backend_type) |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
999 | { |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1000 | #ifdef USE_VV |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1001 | g_return_if_fail(PURPLE_IS_MEDIA_MANAGER(manager)); |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1002 | |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1003 | manager->priv->backend_type = backend_type; |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1004 | #endif |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1005 | } |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1006 | |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1007 | GType |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1008 | purple_media_manager_get_backend_type(PurpleMediaManager *manager) |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
29620
diff
changeset
|
1009 | { |
|
29620
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1010 | #ifdef USE_VV |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1011 | g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1012 | PURPLE_MEDIA_CAPS_NONE); |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1013 | |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1014 | return manager->priv->backend_type; |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1015 | #else |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1016 | return G_TYPE_NONE; |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1017 | #endif |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1018 | } |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
1019 | |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26748
diff
changeset
|
1020 | #ifdef USE_GSTREAMER |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1021 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1022 | /* |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1023 | * PurpleMediaElementType |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1024 | */ |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1025 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1026 | GType |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1027 | purple_media_element_type_get_type() |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1028 | { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1029 | static GType type = 0; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1030 | if (type == 0) { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1031 | static const GFlagsValue values[] = { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1032 | { PURPLE_MEDIA_ELEMENT_NONE, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1033 | "PURPLE_MEDIA_ELEMENT_NONE", "none" }, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1034 | { PURPLE_MEDIA_ELEMENT_AUDIO, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1035 | "PURPLE_MEDIA_ELEMENT_AUDIO", "audio" }, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1036 | { PURPLE_MEDIA_ELEMENT_VIDEO, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1037 | "PURPLE_MEDIA_ELEMENT_VIDEO", "video" }, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1038 | { PURPLE_MEDIA_ELEMENT_AUDIO_VIDEO, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1039 | "PURPLE_MEDIA_ELEMENT_AUDIO_VIDEO", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1040 | "audio-video" }, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1041 | { PURPLE_MEDIA_ELEMENT_NO_SRCS, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1042 | "PURPLE_MEDIA_ELEMENT_NO_SRCS", "no-srcs" }, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1043 | { PURPLE_MEDIA_ELEMENT_ONE_SRC, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1044 | "PURPLE_MEDIA_ELEMENT_ONE_SRC", "one-src" }, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1045 | { PURPLE_MEDIA_ELEMENT_MULTI_SRC, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1046 | "PURPLE_MEDIA_ELEMENT_MULTI_SRC", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1047 | "multi-src" }, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1048 | { PURPLE_MEDIA_ELEMENT_REQUEST_SRC, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1049 | "PURPLE_MEDIA_ELEMENT_REQUEST_SRC", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1050 | "request-src" }, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1051 | { PURPLE_MEDIA_ELEMENT_NO_SINKS, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1052 | "PURPLE_MEDIA_ELEMENT_NO_SINKS", "no-sinks" }, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1053 | { PURPLE_MEDIA_ELEMENT_ONE_SINK, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1054 | "PURPLE_MEDIA_ELEMENT_ONE_SINK", "one-sink" }, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1055 | { PURPLE_MEDIA_ELEMENT_MULTI_SINK, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1056 | "PURPLE_MEDIA_ELEMENT_MULTI_SINK", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1057 | "multi-sink" }, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1058 | { PURPLE_MEDIA_ELEMENT_REQUEST_SINK, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1059 | "PURPLE_MEDIA_ELEMENT_REQUEST_SINK", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1060 | "request-sink" }, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1061 | { PURPLE_MEDIA_ELEMENT_UNIQUE, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1062 | "PURPLE_MEDIA_ELEMENT_UNIQUE", "unique" }, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1063 | { PURPLE_MEDIA_ELEMENT_SRC, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1064 | "PURPLE_MEDIA_ELEMENT_SRC", "src" }, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1065 | { PURPLE_MEDIA_ELEMENT_SINK, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1066 | "PURPLE_MEDIA_ELEMENT_SINK", "sink" }, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1067 | { 0, NULL, NULL } |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1068 | }; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1069 | type = g_flags_register_static( |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1070 | "PurpleMediaElementType", values); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1071 | } |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1072 | return type; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1073 | } |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1074 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1075 | /* |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1076 | * PurpleMediaElementInfo |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1077 | */ |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1078 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1079 | struct _PurpleMediaElementInfoClass |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1080 | { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1081 | GObjectClass parent_class; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1082 | }; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1083 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1084 | struct _PurpleMediaElementInfo |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1085 | { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1086 | GObject parent; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1087 | }; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1088 | |
|
26640
eba80d2f198f
Make it compile with --disable-vv... again!
Michael Ruprecht <maiku@pidgin.im>
parents:
26626
diff
changeset
|
1089 | #ifdef USE_VV |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1090 | struct _PurpleMediaElementInfoPrivate |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1091 | { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1092 | gchar *id; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1093 | gchar *name; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1094 | PurpleMediaElementType type; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1095 | PurpleMediaElementCreateCallback create; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1096 | }; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1097 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1098 | enum { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1099 | PROP_0, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1100 | PROP_ID, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1101 | PROP_NAME, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1102 | PROP_TYPE, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1103 | PROP_CREATE_CB, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1104 | }; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1105 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1106 | static void |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1107 | purple_media_element_info_init(PurpleMediaElementInfo *info) |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1108 | { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1109 | PurpleMediaElementInfoPrivate *priv = |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1110 | PURPLE_MEDIA_ELEMENT_INFO_GET_PRIVATE(info); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1111 | priv->id = NULL; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1112 | priv->name = NULL; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1113 | priv->type = PURPLE_MEDIA_ELEMENT_NONE; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1114 | priv->create = NULL; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1115 | } |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1116 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1117 | static void |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1118 | purple_media_element_info_finalize(GObject *info) |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1119 | { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1120 | PurpleMediaElementInfoPrivate *priv = |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1121 | PURPLE_MEDIA_ELEMENT_INFO_GET_PRIVATE(info); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1122 | g_free(priv->id); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1123 | g_free(priv->name); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1124 | } |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1125 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1126 | static void |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1127 | purple_media_element_info_set_property (GObject *object, guint prop_id, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1128 | const GValue *value, GParamSpec *pspec) |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1129 | { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1130 | PurpleMediaElementInfoPrivate *priv; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1131 | g_return_if_fail(PURPLE_IS_MEDIA_ELEMENT_INFO(object)); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1132 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1133 | priv = PURPLE_MEDIA_ELEMENT_INFO_GET_PRIVATE(object); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1134 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1135 | switch (prop_id) { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1136 | case PROP_ID: |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1137 | g_free(priv->id); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1138 | priv->id = g_value_dup_string(value); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1139 | break; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1140 | case PROP_NAME: |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1141 | g_free(priv->name); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1142 | priv->name = g_value_dup_string(value); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1143 | break; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1144 | case PROP_TYPE: { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1145 | priv->type = g_value_get_flags(value); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1146 | break; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1147 | } |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1148 | case PROP_CREATE_CB: |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1149 | priv->create = g_value_get_pointer(value); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1150 | break; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
29620
diff
changeset
|
1151 | default: |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1152 | G_OBJECT_WARN_INVALID_PROPERTY_ID( |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1153 | object, prop_id, pspec); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1154 | break; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1155 | } |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1156 | } |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1157 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1158 | static void |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1159 | purple_media_element_info_get_property (GObject *object, guint prop_id, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1160 | GValue *value, GParamSpec *pspec) |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1161 | { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1162 | PurpleMediaElementInfoPrivate *priv; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1163 | g_return_if_fail(PURPLE_IS_MEDIA_ELEMENT_INFO(object)); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
29620
diff
changeset
|
1164 | |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1165 | priv = PURPLE_MEDIA_ELEMENT_INFO_GET_PRIVATE(object); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1166 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1167 | switch (prop_id) { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1168 | case PROP_ID: |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1169 | g_value_set_string(value, priv->id); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1170 | break; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1171 | case PROP_NAME: |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1172 | g_value_set_string(value, priv->name); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1173 | break; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1174 | case PROP_TYPE: |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1175 | g_value_set_flags(value, priv->type); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1176 | break; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1177 | case PROP_CREATE_CB: |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1178 | g_value_set_pointer(value, priv->create); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1179 | break; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
29620
diff
changeset
|
1180 | default: |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1181 | G_OBJECT_WARN_INVALID_PROPERTY_ID( |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1182 | object, prop_id, pspec); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1183 | break; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1184 | } |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1185 | } |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1186 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1187 | static void |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1188 | purple_media_element_info_class_init(PurpleMediaElementInfoClass *klass) |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1189 | { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1190 | GObjectClass *gobject_class = (GObjectClass*)klass; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
29620
diff
changeset
|
1191 | |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1192 | gobject_class->finalize = purple_media_element_info_finalize; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1193 | gobject_class->set_property = purple_media_element_info_set_property; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1194 | gobject_class->get_property = purple_media_element_info_get_property; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1195 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1196 | g_object_class_install_property(gobject_class, PROP_ID, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1197 | g_param_spec_string("id", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1198 | "ID", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1199 | "The unique identifier of the element.", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1200 | NULL, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1201 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1202 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1203 | g_object_class_install_property(gobject_class, PROP_NAME, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1204 | g_param_spec_string("name", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1205 | "Name", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1206 | "The friendly/display name of this element.", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1207 | NULL, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1208 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1209 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1210 | g_object_class_install_property(gobject_class, PROP_TYPE, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1211 | g_param_spec_flags("type", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1212 | "Element Type", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1213 | "The type of element this is.", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1214 | PURPLE_TYPE_MEDIA_ELEMENT_TYPE, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1215 | PURPLE_MEDIA_ELEMENT_NONE, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1216 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1217 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1218 | g_object_class_install_property(gobject_class, PROP_CREATE_CB, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1219 | g_param_spec_pointer("create-cb", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1220 | "Create Callback", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1221 | "The function called to create this element.", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1222 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1223 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1224 | g_type_class_add_private(klass, sizeof(PurpleMediaElementInfoPrivate)); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1225 | } |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1226 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1227 | G_DEFINE_TYPE(PurpleMediaElementInfo, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1228 | purple_media_element_info, G_TYPE_OBJECT); |
|
26640
eba80d2f198f
Make it compile with --disable-vv... again!
Michael Ruprecht <maiku@pidgin.im>
parents:
26626
diff
changeset
|
1229 | #else |
|
eba80d2f198f
Make it compile with --disable-vv... again!
Michael Ruprecht <maiku@pidgin.im>
parents:
26626
diff
changeset
|
1230 | GType |
|
eba80d2f198f
Make it compile with --disable-vv... again!
Michael Ruprecht <maiku@pidgin.im>
parents:
26626
diff
changeset
|
1231 | purple_media_element_info_get_type() |
|
eba80d2f198f
Make it compile with --disable-vv... again!
Michael Ruprecht <maiku@pidgin.im>
parents:
26626
diff
changeset
|
1232 | { |
|
eba80d2f198f
Make it compile with --disable-vv... again!
Michael Ruprecht <maiku@pidgin.im>
parents:
26626
diff
changeset
|
1233 | return G_TYPE_NONE; |
|
eba80d2f198f
Make it compile with --disable-vv... again!
Michael Ruprecht <maiku@pidgin.im>
parents:
26626
diff
changeset
|
1234 | } |
|
eba80d2f198f
Make it compile with --disable-vv... again!
Michael Ruprecht <maiku@pidgin.im>
parents:
26626
diff
changeset
|
1235 | #endif |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1236 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1237 | gchar * |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1238 | purple_media_element_info_get_id(PurpleMediaElementInfo *info) |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1239 | { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1240 | #ifdef USE_VV |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1241 | gchar *id; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1242 | g_return_val_if_fail(PURPLE_IS_MEDIA_ELEMENT_INFO(info), NULL); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1243 | g_object_get(info, "id", &id, NULL); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1244 | return id; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1245 | #else |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1246 | return NULL; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1247 | #endif |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1248 | } |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1249 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1250 | gchar * |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1251 | purple_media_element_info_get_name(PurpleMediaElementInfo *info) |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1252 | { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1253 | #ifdef USE_VV |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1254 | gchar *name; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1255 | g_return_val_if_fail(PURPLE_IS_MEDIA_ELEMENT_INFO(info), NULL); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1256 | g_object_get(info, "name", &name, NULL); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1257 | return name; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1258 | #else |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1259 | return NULL; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1260 | #endif |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1261 | } |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1262 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1263 | PurpleMediaElementType |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1264 | purple_media_element_info_get_element_type(PurpleMediaElementInfo *info) |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1265 | { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1266 | #ifdef USE_VV |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1267 | PurpleMediaElementType type; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1268 | g_return_val_if_fail(PURPLE_IS_MEDIA_ELEMENT_INFO(info), |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1269 | PURPLE_MEDIA_ELEMENT_NONE); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1270 | g_object_get(info, "type", &type, NULL); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1271 | return type; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1272 | #else |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1273 | return PURPLE_MEDIA_ELEMENT_NONE; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1274 | #endif |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1275 | } |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1276 | |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1277 | GstElement * |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1278 | purple_media_element_info_call_create(PurpleMediaElementInfo *info, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1279 | PurpleMedia *media, const gchar *session_id, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1280 | const gchar *participant) |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1281 | { |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1282 | #ifdef USE_VV |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1283 | PurpleMediaElementCreateCallback create; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1284 | g_return_val_if_fail(PURPLE_IS_MEDIA_ELEMENT_INFO(info), NULL); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1285 | g_object_get(info, "create-cb", &create, NULL); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1286 | if (create) |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1287 | return create(media, session_id, participant); |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1288 | #endif |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1289 | return NULL; |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1290 | } |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26614
diff
changeset
|
1291 | |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26748
diff
changeset
|
1292 | #endif /* USE_GSTREAMER */ |
|
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26748
diff
changeset
|
1293 |