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