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