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