Mercurial > pidgin.yaz
annotate libpurple/mediamanager.c @ 29582:209fa20fc39f
Remove references to FsParticipant from PurpleMedia.
author | maiku@pidgin.im |
---|---|
date | Tue, 27 Oct 2009 19:10:57 +0000 |
parents | 41ae97b7e97e |
children | 2b2b930281a0 |
rev | line source |
---|---|
25546 | 1 /** |
25552 | 2 * @file mediamanager.c Media Manager API |
25546 | 3 * @ingroup core |
25715
b8a73b6dc0a4
* Added documentation to media.h and mediamanager.h
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
4 */ |
b8a73b6dc0a4
* Added documentation to media.h and mediamanager.h
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
5 |
b8a73b6dc0a4
* Added documentation to media.h and mediamanager.h
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25706
diff
changeset
|
6 /* purple |
25546 | 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 | |
28397
8c991e09efcb
Update various header copyrights thanks to licensecheck.
Paul Aurich <paul@darkrain42.org>
parents:
28230
diff
changeset
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
25546 | 25 */ |
26 | |
25552 | 27 #include "internal.h" |
28 | |
26606
df9042312063
Switch media to store accounts rather than connections.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26507
diff
changeset
|
29 #include "account.h" |
26006
0baeafee93be
Gracefully handle missing the fsrtpconference GStreamer plugin.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25727
diff
changeset
|
30 #include "debug.h" |
26431
1ae3af12095a
Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26389
diff
changeset
|
31 #include "media.h" |
26621
4f2f5659aa0d
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26608
diff
changeset
|
32 #include "mediamanager.h" |
4f2f5659aa0d
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26608
diff
changeset
|
33 |
4f2f5659aa0d
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26608
diff
changeset
|
34 #ifdef USE_GSTREAMER |
26645
75b473f216f2
Include the media API on win32 even though it isn't actually enabled.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
26621
diff
changeset
|
35 #include "marshallers.h" |
26431
1ae3af12095a
Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26389
diff
changeset
|
36 #include "media-gst.h" |
26621
4f2f5659aa0d
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26608
diff
changeset
|
37 #endif |
25546 | 38 |
25654
cbe97caec684
Use USE_VV instead of USE_FARSIGHT.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25651
diff
changeset
|
39 #ifdef USE_VV |
25546 | 40 |
28174
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
41 #include <gst/farsight/fs-element-added-notifier.h> |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
42 #include <gst/interfaces/xoverlay.h> |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
43 |
26482
84d09c6499f1
Hide the easy structs in mediamanager.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
44 /** @copydoc _PurpleMediaManagerPrivate */ |
84d09c6499f1
Hide the easy structs in mediamanager.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
45 typedef struct _PurpleMediaManagerPrivate PurpleMediaManagerPrivate; |
84d09c6499f1
Hide the easy structs in mediamanager.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
46 /** @copydoc _PurpleMediaOutputWindow */ |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
47 typedef struct _PurpleMediaOutputWindow PurpleMediaOutputWindow; |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
48 /** @copydoc _PurpleMediaManagerPrivate */ |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
49 typedef struct _PurpleMediaElementInfoPrivate PurpleMediaElementInfoPrivate; |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
50 |
26482
84d09c6499f1
Hide the easy structs in mediamanager.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
51 /** The media manager class. */ |
84d09c6499f1
Hide the easy structs in mediamanager.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
52 struct _PurpleMediaManagerClass |
84d09c6499f1
Hide the easy structs in mediamanager.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
53 { |
84d09c6499f1
Hide the easy structs in mediamanager.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
54 GObjectClass parent_class; /**< The parent class. */ |
84d09c6499f1
Hide the easy structs in mediamanager.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
55 }; |
84d09c6499f1
Hide the easy structs in mediamanager.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
56 |
84d09c6499f1
Hide the easy structs in mediamanager.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
57 /** The media manager's data. */ |
84d09c6499f1
Hide the easy structs in mediamanager.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
58 struct _PurpleMediaManager |
84d09c6499f1
Hide the easy structs in mediamanager.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
59 { |
84d09c6499f1
Hide the easy structs in mediamanager.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
60 GObject parent; /**< The parent of this manager. */ |
84d09c6499f1
Hide the easy structs in mediamanager.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
61 PurpleMediaManagerPrivate *priv; /**< Private data for the manager. */ |
84d09c6499f1
Hide the easy structs in mediamanager.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
62 }; |
84d09c6499f1
Hide the easy structs in mediamanager.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26474
diff
changeset
|
63 |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
64 struct _PurpleMediaOutputWindow |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
65 { |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
66 gulong id; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
67 PurpleMedia *media; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
68 gchar *session_id; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
69 gchar *participant; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
70 gulong window_id; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
71 GstElement *sink; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
72 }; |
25546 | 73 |
74 struct _PurpleMediaManagerPrivate | |
75 { | |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
76 GstElement *pipeline; |
26472
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
77 PurpleMediaCaps ui_caps; |
25546 | 78 GList *medias; |
26163
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
79 GList *elements; |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
80 GList *output_windows; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
81 gulong next_output_window_id; |
26165
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
82 |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
83 PurpleMediaElementInfo *video_src; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
84 PurpleMediaElementInfo *video_sink; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
85 PurpleMediaElementInfo *audio_src; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
86 PurpleMediaElementInfo *audio_sink; |
25546 | 87 }; |
88 | |
89 #define PURPLE_MEDIA_MANAGER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA_MANAGER, PurpleMediaManagerPrivate)) | |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
90 #define PURPLE_MEDIA_ELEMENT_INFO_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA_ELEMENT_INFO, PurpleMediaElementInfoPrivate)) |
25546 | 91 |
92 static void purple_media_manager_class_init (PurpleMediaManagerClass *klass); | |
93 static void purple_media_manager_init (PurpleMediaManager *media); | |
94 static void purple_media_manager_finalize (GObject *object); | |
95 | |
96 static GObjectClass *parent_class = NULL; | |
97 | |
98 | |
99 | |
100 enum { | |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25547
diff
changeset
|
101 INIT_MEDIA, |
29525
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
102 UI_CAPS_CHANGED, |
25546 | 103 LAST_SIGNAL |
104 }; | |
105 static guint purple_media_manager_signals[LAST_SIGNAL] = {0}; | |
26507
90c65a8575bf
Make it compile with --disable-vv... again!
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26494
diff
changeset
|
106 #endif |
25546 | 107 |
108 GType | |
109 purple_media_manager_get_type() | |
110 { | |
26507
90c65a8575bf
Make it compile with --disable-vv... again!
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26494
diff
changeset
|
111 #ifdef USE_VV |
25546 | 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, | |
25560
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25552
diff
changeset
|
124 (GInstanceInitFunc) purple_media_manager_init, |
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25552
diff
changeset
|
125 NULL |
25546 | 126 }; |
127 type = g_type_register_static(G_TYPE_OBJECT, "PurpleMediaManager", &info, 0); | |
128 } | |
129 return type; | |
26507
90c65a8575bf
Make it compile with --disable-vv... again!
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26494
diff
changeset
|
130 #else |
90c65a8575bf
Make it compile with --disable-vv... again!
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26494
diff
changeset
|
131 return G_TYPE_NONE; |
90c65a8575bf
Make it compile with --disable-vv... again!
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26494
diff
changeset
|
132 #endif |
25546 | 133 } |
134 | |
26507
90c65a8575bf
Make it compile with --disable-vv... again!
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26494
diff
changeset
|
135 #ifdef USE_VV |
25546 | 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 | |
25548
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
25547
diff
changeset
|
144 purple_media_manager_signals[INIT_MEDIA] = g_signal_new ("init-media", |
25546 | 145 G_TYPE_FROM_CLASS (klass), |
146 G_SIGNAL_RUN_LAST, | |
147 0, NULL, NULL, | |
26059
18b71033ea6e
Remove connection attribute from PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26026
diff
changeset
|
148 purple_smarshal_BOOLEAN__OBJECT_POINTER_STRING, |
18b71033ea6e
Remove connection attribute from PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26026
diff
changeset
|
149 G_TYPE_BOOLEAN, 3, PURPLE_TYPE_MEDIA, |
18b71033ea6e
Remove connection attribute from PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26026
diff
changeset
|
150 G_TYPE_POINTER, G_TYPE_STRING); |
29525
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
151 |
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
152 purple_media_manager_signals[UI_CAPS_CHANGED] = g_signal_new ("ui-caps-changed", |
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
153 G_TYPE_FROM_CLASS (klass), |
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
154 G_SIGNAL_RUN_LAST, |
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
155 0, NULL, NULL, |
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
156 purple_smarshal_VOID__FLAGS_FLAGS, |
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
157 G_TYPE_NONE, 2, PURPLE_MEDIA_TYPE_CAPS, |
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
158 PURPLE_MEDIA_TYPE_CAPS); |
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
159 |
25547 | 160 g_type_class_add_private(klass, sizeof(PurpleMediaManagerPrivate)); |
25546 | 161 } |
162 | |
163 static void | |
164 purple_media_manager_init (PurpleMediaManager *media) | |
165 { | |
166 media->priv = PURPLE_MEDIA_MANAGER_GET_PRIVATE(media); | |
25547 | 167 media->priv->medias = NULL; |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
168 media->priv->next_output_window_id = 1; |
28191
c8ff0a9cf8cc
Unlink the local audio volume and mute between sessions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28175
diff
changeset
|
169 |
c8ff0a9cf8cc
Unlink the local audio volume and mute between sessions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28175
diff
changeset
|
170 purple_prefs_add_none("/purple/media"); |
c8ff0a9cf8cc
Unlink the local audio volume and mute between sessions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28175
diff
changeset
|
171 purple_prefs_add_none("/purple/media/audio"); |
c8ff0a9cf8cc
Unlink the local audio volume and mute between sessions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28175
diff
changeset
|
172 purple_prefs_add_none("/purple/media/audio/volume"); |
c8ff0a9cf8cc
Unlink the local audio volume and mute between sessions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28175
diff
changeset
|
173 purple_prefs_add_int("/purple/media/audio/volume/input", 10); |
c8ff0a9cf8cc
Unlink the local audio volume and mute between sessions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28175
diff
changeset
|
174 purple_prefs_add_int("/purple/media/audio/volume/output", 10); |
25546 | 175 } |
176 | |
177 static void | |
178 purple_media_manager_finalize (GObject *media) | |
179 { | |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
180 PurpleMediaManagerPrivate *priv = PURPLE_MEDIA_MANAGER_GET_PRIVATE(media); |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
181 for (; priv->medias; priv->medias = |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
182 g_list_delete_link(priv->medias, priv->medias)) { |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
183 g_object_unref(priv->medias->data); |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
184 } |
26163
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
185 for (; priv->elements; priv->elements = |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
186 g_list_delete_link(priv->elements, priv->elements)) { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
187 g_object_unref(priv->elements->data); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
188 } |
25546 | 189 parent_class->finalize(media); |
190 } | |
26507
90c65a8575bf
Make it compile with --disable-vv... again!
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26494
diff
changeset
|
191 #endif |
25546 | 192 |
193 PurpleMediaManager * | |
194 purple_media_manager_get() | |
195 { | |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
196 #ifdef USE_VV |
25546 | 197 static PurpleMediaManager *manager = NULL; |
198 | |
199 if (manager == NULL) | |
200 manager = PURPLE_MEDIA_MANAGER(g_object_new(purple_media_manager_get_type(), NULL)); | |
201 return manager; | |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
202 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
203 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
204 #endif |
25546 | 205 } |
206 | |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
207 #ifdef USE_VV |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
208 static gboolean |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
209 pipeline_bus_call(GstBus *bus, GstMessage *msg, PurpleMediaManager *manager) |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
210 { |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
211 switch(GST_MESSAGE_TYPE(msg)) { |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
212 case GST_MESSAGE_EOS: |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
213 purple_debug_info("mediamanager", "End of Stream\n"); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
214 break; |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
215 case GST_MESSAGE_ERROR: { |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
216 gchar *debug = NULL; |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
217 GError *err = NULL; |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
218 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
219 gst_message_parse_error(msg, &err, &debug); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
220 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
221 purple_debug_error("mediamanager", |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
222 "gst pipeline error: %s\n", |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
223 err->message); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
224 g_error_free(err); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
225 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
226 if (debug) { |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
227 purple_debug_error("mediamanager", |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
228 "Debug details: %s\n", debug); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
229 g_free (debug); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
230 } |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
231 break; |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
232 } |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
233 default: |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
234 break; |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
235 } |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
236 return TRUE; |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
237 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
238 #endif |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
239 |
26621
4f2f5659aa0d
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26608
diff
changeset
|
240 #ifdef USE_GSTREAMER |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
241 GstElement * |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
242 purple_media_manager_get_pipeline(PurpleMediaManager *manager) |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
243 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
244 #ifdef USE_VV |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
245 g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), NULL); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
246 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
247 if (manager->priv->pipeline == NULL) { |
28175
fa2e83d7ba7f
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28174
diff
changeset
|
248 FsElementAddedNotifier *notifier; |
28174
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
249 gchar *filename; |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
250 GError *err = NULL; |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
251 GKeyFile *keyfile; |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
252 GstBus *bus; |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
253 manager->priv->pipeline = gst_pipeline_new(NULL); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
254 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
255 bus = gst_pipeline_get_bus( |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
256 GST_PIPELINE(manager->priv->pipeline)); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
257 gst_bus_add_signal_watch(GST_BUS(bus)); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
258 g_signal_connect(G_OBJECT(bus), "message", |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
259 G_CALLBACK(pipeline_bus_call), manager); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
260 gst_bus_set_sync_handler(bus, |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
261 gst_bus_sync_signal_handler, NULL); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
262 gst_object_unref(bus); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
263 |
28174
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
264 filename = g_build_filename(purple_user_dir(), |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
265 "fs-element.conf", NULL); |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
266 keyfile = g_key_file_new(); |
28175
fa2e83d7ba7f
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28174
diff
changeset
|
267 if (!g_key_file_load_from_file(keyfile, filename, |
28174
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
268 G_KEY_FILE_NONE, &err)) { |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
269 if (err->code == 4) |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
270 purple_debug_info("mediamanager", |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
271 "Couldn't read " |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
272 "fs-element.conf: %s\n", |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
273 err->message); |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
274 else |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
275 purple_debug_error("mediamanager", |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
276 "Error reading " |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
277 "fs-element.conf: %s\n", |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
278 err->message); |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
279 g_error_free(err); |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
280 } |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
281 g_free(filename); |
6ed9c1def7c8
Allow setting properties on GStreamer elements with fs-element.conf.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27990
diff
changeset
|
282 |
28175
fa2e83d7ba7f
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28174
diff
changeset
|
283 /* Hack to make alsasrc stop messing up audio timestamps */ |
fa2e83d7ba7f
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28174
diff
changeset
|
284 if (!g_key_file_has_key(keyfile, |
fa2e83d7ba7f
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28174
diff
changeset
|
285 "alsasrc", "slave-method", NULL)) { |
fa2e83d7ba7f
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28174
diff
changeset
|
286 g_key_file_set_integer(keyfile, |
fa2e83d7ba7f
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28174
diff
changeset
|
287 "alsasrc", "slave-method", 2); |
fa2e83d7ba7f
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28174
diff
changeset
|
288 } |
fa2e83d7ba7f
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28174
diff
changeset
|
289 |
fa2e83d7ba7f
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28174
diff
changeset
|
290 notifier = fs_element_added_notifier_new(); |
fa2e83d7ba7f
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28174
diff
changeset
|
291 fs_element_added_notifier_add(notifier, |
fa2e83d7ba7f
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28174
diff
changeset
|
292 GST_BIN(manager->priv->pipeline)); |
fa2e83d7ba7f
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28174
diff
changeset
|
293 fs_element_added_notifier_set_properties_from_keyfile( |
fa2e83d7ba7f
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28174
diff
changeset
|
294 notifier, keyfile); |
fa2e83d7ba7f
Set alsasrc's slave-method to 2. This stops the audio timestamps from
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28174
diff
changeset
|
295 |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
296 gst_element_set_state(manager->priv->pipeline, |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
297 GST_STATE_PLAYING); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
298 } |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
299 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
300 return manager->priv->pipeline; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
301 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
302 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
303 #endif |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
304 } |
26621
4f2f5659aa0d
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26608
diff
changeset
|
305 #endif /* USE_GSTREAMER */ |
26196
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26189
diff
changeset
|
306 |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25560
diff
changeset
|
307 PurpleMedia * |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25560
diff
changeset
|
308 purple_media_manager_create_media(PurpleMediaManager *manager, |
26606
df9042312063
Switch media to store accounts rather than connections.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26507
diff
changeset
|
309 PurpleAccount *account, |
25647
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25560
diff
changeset
|
310 const char *conference_type, |
26063
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
311 const char *remote_user, |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
312 gboolean initiator) |
25546 | 313 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
314 #ifdef USE_VV |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25647
diff
changeset
|
315 PurpleMedia *media; |
25723
1d9a2296d5d2
Stop additional media sessions within a single conversation for grouped contacts.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
316 gboolean signal_ret; |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25647
diff
changeset
|
317 |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25647
diff
changeset
|
318 media = PURPLE_MEDIA(g_object_new(purple_media_get_type(), |
26189
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26165
diff
changeset
|
319 "manager", manager, |
26606
df9042312063
Switch media to store accounts rather than connections.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26507
diff
changeset
|
320 "account", account, |
29549
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29525
diff
changeset
|
321 "conference-type", conference_type, |
26063
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
322 "initiator", initiator, |
25651
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25647
diff
changeset
|
323 NULL)); |
25706
1c68f78414b7
Set the media pipeline to PLAYING immediately after initialization
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25654
diff
changeset
|
324 |
25723
1d9a2296d5d2
Stop additional media sessions within a single conversation for grouped contacts.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
325 g_signal_emit(manager, purple_media_manager_signals[INIT_MEDIA], 0, |
26606
df9042312063
Switch media to store accounts rather than connections.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26507
diff
changeset
|
326 media, account, remote_user, &signal_ret); |
25723
1d9a2296d5d2
Stop additional media sessions within a single conversation for grouped contacts.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
327 |
1d9a2296d5d2
Stop additional media sessions within a single conversation for grouped contacts.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
328 if (signal_ret == FALSE) { |
1d9a2296d5d2
Stop additional media sessions within a single conversation for grouped contacts.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
329 g_object_unref(media); |
1d9a2296d5d2
Stop additional media sessions within a single conversation for grouped contacts.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
330 return NULL; |
1d9a2296d5d2
Stop additional media sessions within a single conversation for grouped contacts.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
331 } |
1d9a2296d5d2
Stop additional media sessions within a single conversation for grouped contacts.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25715
diff
changeset
|
332 |
25546 | 333 manager->priv->medias = g_list_append(manager->priv->medias, media); |
334 return media; | |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
335 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
336 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
337 #endif |
25546 | 338 } |
339 | |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
340 GList * |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
341 purple_media_manager_get_media(PurpleMediaManager *manager) |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
342 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
343 #ifdef USE_VV |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
344 return manager->priv->medias; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
345 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
346 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
347 #endif |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
348 } |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
349 |
26205
75a02ffb0139
Added purple_media_manager_get_media_by_connection.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
350 GList * |
26606
df9042312063
Switch media to store accounts rather than connections.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26507
diff
changeset
|
351 purple_media_manager_get_media_by_account(PurpleMediaManager *manager, |
df9042312063
Switch media to store accounts rather than connections.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26507
diff
changeset
|
352 PurpleAccount *account) |
26205
75a02ffb0139
Added purple_media_manager_get_media_by_connection.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
353 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
354 #ifdef USE_VV |
26205
75a02ffb0139
Added purple_media_manager_get_media_by_connection.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
355 GList *media = NULL; |
75a02ffb0139
Added purple_media_manager_get_media_by_connection.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
356 GList *iter; |
75a02ffb0139
Added purple_media_manager_get_media_by_connection.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
357 |
75a02ffb0139
Added purple_media_manager_get_media_by_connection.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
358 g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), NULL); |
75a02ffb0139
Added purple_media_manager_get_media_by_connection.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
359 |
75a02ffb0139
Added purple_media_manager_get_media_by_connection.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
360 iter = manager->priv->medias; |
75a02ffb0139
Added purple_media_manager_get_media_by_connection.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
361 for (; iter; iter = g_list_next(iter)) { |
26606
df9042312063
Switch media to store accounts rather than connections.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26507
diff
changeset
|
362 if (purple_media_get_account(iter->data) == account) { |
26205
75a02ffb0139
Added purple_media_manager_get_media_by_connection.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
363 media = g_list_prepend(media, iter->data); |
75a02ffb0139
Added purple_media_manager_get_media_by_connection.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
364 } |
75a02ffb0139
Added purple_media_manager_get_media_by_connection.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
365 } |
75a02ffb0139
Added purple_media_manager_get_media_by_connection.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
366 |
75a02ffb0139
Added purple_media_manager_get_media_by_connection.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
367 return media; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
368 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
369 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
370 #endif |
26205
75a02ffb0139
Added purple_media_manager_get_media_by_connection.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
371 } |
75a02ffb0139
Added purple_media_manager_get_media_by_connection.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26203
diff
changeset
|
372 |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
373 void |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
374 purple_media_manager_remove_media(PurpleMediaManager *manager, |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
375 PurpleMedia *media) |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
376 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
377 #ifdef USE_VV |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
378 GList *list = g_list_find(manager->priv->medias, media); |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
379 if (list) |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
380 manager->priv->medias = |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
381 g_list_delete_link(manager->priv->medias, list); |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
382 #endif |
25727
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
383 } |
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25723
diff
changeset
|
384 |
26463
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
385 #ifdef USE_VV |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
386 static void |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
387 request_pad_unlinked_cb(GstPad *pad, GstPad *peer, gpointer user_data) |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
388 { |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
389 GstElement *parent = GST_ELEMENT_PARENT(pad); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
390 GstIterator *iter; |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
391 GstPad *remaining_pad; |
28198
1c58b9d2429b
Unleak pad if more pads are linked.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28191
diff
changeset
|
392 GstIteratorResult result; |
26463
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
393 |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
394 gst_element_release_request_pad(GST_ELEMENT_PARENT(pad), pad); |
28198
1c58b9d2429b
Unleak pad if more pads are linked.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28191
diff
changeset
|
395 iter = gst_element_iterate_src_pads(parent); |
26463
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
396 |
28198
1c58b9d2429b
Unleak pad if more pads are linked.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28191
diff
changeset
|
397 result = gst_iterator_next(iter, (gpointer)&remaining_pad); |
1c58b9d2429b
Unleak pad if more pads are linked.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28191
diff
changeset
|
398 |
1c58b9d2429b
Unleak pad if more pads are linked.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28191
diff
changeset
|
399 if (result == GST_ITERATOR_DONE) { |
26463
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
400 gst_element_set_locked_state(parent, TRUE); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
401 gst_element_set_state(parent, GST_STATE_NULL); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
402 gst_bin_remove(GST_BIN(GST_ELEMENT_PARENT(parent)), parent); |
28198
1c58b9d2429b
Unleak pad if more pads are linked.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28191
diff
changeset
|
403 } else if (result == GST_ITERATOR_OK) { |
1c58b9d2429b
Unleak pad if more pads are linked.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
28191
diff
changeset
|
404 gst_object_unref(remaining_pad); |
26463
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
405 } |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
406 |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
407 gst_iterator_free(iter); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
408 } |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
409 #endif |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
410 |
26621
4f2f5659aa0d
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26608
diff
changeset
|
411 #ifdef USE_GSTREAMER |
26026
431c59a6959d
Add purple_media_manager_get_element.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26006
diff
changeset
|
412 GstElement * |
431c59a6959d
Add purple_media_manager_get_element.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26006
diff
changeset
|
413 purple_media_manager_get_element(PurpleMediaManager *manager, |
26474
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26472
diff
changeset
|
414 PurpleMediaSessionType type, PurpleMedia *media, |
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26472
diff
changeset
|
415 const gchar *session_id, const gchar *participant) |
26026
431c59a6959d
Add purple_media_manager_get_element.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26006
diff
changeset
|
416 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
417 #ifdef USE_VV |
26026
431c59a6959d
Add purple_media_manager_get_element.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26006
diff
changeset
|
418 GstElement *ret = NULL; |
26463
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
419 PurpleMediaElementInfo *info = NULL; |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
420 PurpleMediaElementType element_type; |
26026
431c59a6959d
Add purple_media_manager_get_element.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26006
diff
changeset
|
421 |
26463
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
422 if (type & PURPLE_MEDIA_SEND_AUDIO) |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
423 info = manager->priv->audio_src; |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
424 else if (type & PURPLE_MEDIA_RECV_AUDIO) |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
425 info = manager->priv->audio_sink; |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
426 else if (type & PURPLE_MEDIA_SEND_VIDEO) |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
427 info = manager->priv->video_src; |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
428 else if (type & PURPLE_MEDIA_RECV_VIDEO) |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
429 info = manager->priv->video_sink; |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
430 |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
431 if (info == NULL) |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
432 return NULL; |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
433 |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
434 element_type = purple_media_element_info_get_element_type(info); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
435 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
436 if (element_type & PURPLE_MEDIA_ELEMENT_UNIQUE && |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
437 element_type & PURPLE_MEDIA_ELEMENT_SRC) { |
26463
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
438 GstElement *tee; |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
439 GstPad *pad; |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
440 GstPad *ghost; |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
441 gchar *id = purple_media_element_info_get_id(info); |
26463
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
442 |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
443 ret = gst_bin_get_by_name(GST_BIN( |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
444 purple_media_manager_get_pipeline( |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
445 manager)), id); |
26026
431c59a6959d
Add purple_media_manager_get_element.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26006
diff
changeset
|
446 |
26463
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
447 if (ret == NULL) { |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
448 GstElement *bin, *fakesink; |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
449 ret = purple_media_element_info_call_create(info, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
450 media, session_id, participant); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
451 bin = gst_bin_new(id); |
26463
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
452 tee = gst_element_factory_make("tee", "tee"); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
453 gst_bin_add_many(GST_BIN(bin), ret, tee, NULL); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
454 gst_element_link(ret, tee); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
455 |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
456 /* |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
457 * This shouldn't be necessary, but it stops it from |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
458 * giving a not-linked error upon destruction |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
459 */ |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
460 fakesink = gst_element_factory_make("fakesink", NULL); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
461 g_object_set(fakesink, "sync", FALSE, NULL); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
462 gst_bin_add(GST_BIN(bin), fakesink); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
463 gst_element_link(tee, fakesink); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
464 |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
465 ret = bin; |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
466 gst_object_ref(ret); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
467 gst_bin_add(GST_BIN(purple_media_manager_get_pipeline( |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
468 manager)), ret); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
469 } |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
470 g_free(id); |
26463
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
471 |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
472 tee = gst_bin_get_by_name(GST_BIN(ret), "tee"); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
473 pad = gst_element_get_request_pad(tee, "src%d"); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
474 gst_object_unref(tee); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
475 ghost = gst_ghost_pad_new(NULL, pad); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
476 gst_object_unref(pad); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
477 g_signal_connect(GST_PAD(ghost), "unlinked", |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
478 G_CALLBACK(request_pad_unlinked_cb), NULL); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
479 gst_pad_set_active(ghost, TRUE); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
480 gst_element_add_pad(ret, ghost); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
481 } else { |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
482 ret = purple_media_element_info_call_create(info, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
483 media, session_id, participant); |
26463
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26432
diff
changeset
|
484 } |
26026
431c59a6959d
Add purple_media_manager_get_element.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26006
diff
changeset
|
485 |
431c59a6959d
Add purple_media_manager_get_element.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26006
diff
changeset
|
486 if (ret == NULL) |
431c59a6959d
Add purple_media_manager_get_element.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26006
diff
changeset
|
487 purple_debug_error("media", "Error creating source or sink\n"); |
431c59a6959d
Add purple_media_manager_get_element.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26006
diff
changeset
|
488 |
431c59a6959d
Add purple_media_manager_get_element.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26006
diff
changeset
|
489 return ret; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
490 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
491 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
492 #endif |
26026
431c59a6959d
Add purple_media_manager_get_element.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26006
diff
changeset
|
493 } |
431c59a6959d
Add purple_media_manager_get_element.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26006
diff
changeset
|
494 |
26163
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
495 PurpleMediaElementInfo * |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
496 purple_media_manager_get_element_info(PurpleMediaManager *manager, |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
497 const gchar *id) |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
498 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
499 #ifdef USE_VV |
26163
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
500 GList *iter; |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
501 |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
502 g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), NULL); |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
503 |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
504 iter = manager->priv->elements; |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
505 |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
506 for (; iter; iter = g_list_next(iter)) { |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
507 gchar *element_id = |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
508 purple_media_element_info_get_id(iter->data); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
509 if (!strcmp(element_id, id)) { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
510 g_free(element_id); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
511 g_object_ref(iter->data); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
512 return iter->data; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
513 } |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
514 g_free(element_id); |
26163
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
515 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
516 #endif |
26163
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
517 |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
518 return NULL; |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
519 } |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
520 |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
521 gboolean |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
522 purple_media_manager_register_element(PurpleMediaManager *manager, |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
523 PurpleMediaElementInfo *info) |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
524 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
525 #ifdef USE_VV |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
526 PurpleMediaElementInfo *info2; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
527 gchar *id; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
528 |
26163
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
529 g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), FALSE); |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
530 g_return_val_if_fail(info != NULL, FALSE); |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
531 |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
532 id = purple_media_element_info_get_id(info); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
533 info2 = purple_media_manager_get_element_info(manager, id); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
534 g_free(id); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
535 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
536 if (info2 != NULL) { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
537 g_object_unref(info2); |
26163
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
538 return FALSE; |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
539 } |
26163
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
540 |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
541 manager->priv->elements = |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
542 g_list_prepend(manager->priv->elements, info); |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
543 return TRUE; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
544 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
545 return FALSE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
546 #endif |
26163
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
547 } |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
548 |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
549 gboolean |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
550 purple_media_manager_unregister_element(PurpleMediaManager *manager, |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
551 const gchar *id) |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
552 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
553 #ifdef USE_VV |
26163
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
554 PurpleMediaElementInfo *info; |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
555 |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
556 g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), FALSE); |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
557 |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
558 info = purple_media_manager_get_element_info(manager, id); |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
559 |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
560 if (info == NULL) { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
561 g_object_unref(info); |
26163
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
562 return FALSE; |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
563 } |
26163
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
564 |
26165
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
565 if (manager->priv->audio_src == info) |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
566 manager->priv->audio_src = NULL; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
567 if (manager->priv->audio_sink == info) |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
568 manager->priv->audio_sink = NULL; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
569 if (manager->priv->video_src == info) |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
570 manager->priv->video_src = NULL; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
571 if (manager->priv->video_sink == info) |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
572 manager->priv->video_sink = NULL; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
573 |
26163
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
574 manager->priv->elements = g_list_remove( |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
575 manager->priv->elements, info); |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
576 g_object_unref(info); |
26163
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
577 return TRUE; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
578 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
579 return FALSE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
580 #endif |
26163
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
581 } |
521366dfd8db
Implement functions to register and unregister media elements for use in
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26152
diff
changeset
|
582 |
26165
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
583 gboolean |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
584 purple_media_manager_set_active_element(PurpleMediaManager *manager, |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
585 PurpleMediaElementInfo *info) |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
586 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
587 #ifdef USE_VV |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
588 PurpleMediaElementInfo *info2; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
589 PurpleMediaElementType type; |
26165
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
590 gboolean ret = FALSE; |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
591 gchar *id; |
26165
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
592 |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
593 g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), FALSE); |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
594 g_return_val_if_fail(info != NULL, FALSE); |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
595 |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
596 id = purple_media_element_info_get_id(info); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
597 info2 = purple_media_manager_get_element_info(manager, id); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
598 g_free(id); |
26165
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
599 |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
600 if (info2 == NULL) |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
601 purple_media_manager_register_element(manager, info); |
26608 | 602 else |
603 g_object_unref(info2); | |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
604 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
605 type = purple_media_element_info_get_element_type(info); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
606 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
607 if (type & PURPLE_MEDIA_ELEMENT_SRC) { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
608 if (type & PURPLE_MEDIA_ELEMENT_AUDIO) { |
26165
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
609 manager->priv->audio_src = info; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
610 ret = TRUE; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
611 } |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
612 if (type & PURPLE_MEDIA_ELEMENT_VIDEO) { |
26165
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
613 manager->priv->video_src = info; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
614 ret = TRUE; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
615 } |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
616 } |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
617 if (type & PURPLE_MEDIA_ELEMENT_SINK) { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
618 if (type & PURPLE_MEDIA_ELEMENT_AUDIO) { |
26165
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
619 manager->priv->audio_sink = info; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
620 ret = TRUE; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
621 } |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
622 if (type & PURPLE_MEDIA_ELEMENT_VIDEO) { |
26165
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
623 manager->priv->video_sink = info; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
624 ret = TRUE; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
625 } |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
626 } |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
627 |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
628 return ret; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
629 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
630 return FALSE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
631 #endif |
26165
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
632 } |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
633 |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
634 PurpleMediaElementInfo * |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
635 purple_media_manager_get_active_element(PurpleMediaManager *manager, |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
636 PurpleMediaElementType type) |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
637 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
638 #ifdef USE_VV |
26165
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
639 g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), NULL); |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
640 |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
641 if (type & PURPLE_MEDIA_ELEMENT_SRC) { |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
642 if (type & PURPLE_MEDIA_ELEMENT_AUDIO) |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
643 return manager->priv->audio_src; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
644 else if (type & PURPLE_MEDIA_ELEMENT_VIDEO) |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
645 return manager->priv->video_src; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
646 } else if (type & PURPLE_MEDIA_ELEMENT_SINK) { |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
647 if (type & PURPLE_MEDIA_ELEMENT_AUDIO) |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
648 return manager->priv->audio_sink; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
649 else if (type & PURPLE_MEDIA_ELEMENT_VIDEO) |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
650 return manager->priv->video_sink; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
651 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
652 #endif |
26165
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
653 |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
654 return NULL; |
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
655 } |
26621
4f2f5659aa0d
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26608
diff
changeset
|
656 #endif /* USE_GSTREAMER */ |
26165
0e8814c437b2
Add active elements to PurpleMediaManager. These are the elements that
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26163
diff
changeset
|
657 |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
658 #ifdef USE_VV |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
659 static void |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
660 window_id_cb(GstBus *bus, GstMessage *msg, PurpleMediaOutputWindow *ow) |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
661 { |
26494
86c5499f36e8
Fix embedding video when the sink is a gconfvideosrc pointing to an
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26484
diff
changeset
|
662 GstElement *sink; |
86c5499f36e8
Fix embedding video when the sink is a gconfvideosrc pointing to an
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26484
diff
changeset
|
663 |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
664 if (GST_MESSAGE_TYPE(msg) != GST_MESSAGE_ELEMENT || |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
665 !gst_structure_has_name(msg->structure, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
666 "prepare-xwindow-id")) |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
667 return; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
668 |
26494
86c5499f36e8
Fix embedding video when the sink is a gconfvideosrc pointing to an
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26484
diff
changeset
|
669 sink = GST_ELEMENT(GST_MESSAGE_SRC(msg)); |
86c5499f36e8
Fix embedding video when the sink is a gconfvideosrc pointing to an
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26484
diff
changeset
|
670 while (sink != ow->sink) { |
86c5499f36e8
Fix embedding video when the sink is a gconfvideosrc pointing to an
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26484
diff
changeset
|
671 if (sink == NULL) |
86c5499f36e8
Fix embedding video when the sink is a gconfvideosrc pointing to an
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26484
diff
changeset
|
672 return; |
86c5499f36e8
Fix embedding video when the sink is a gconfvideosrc pointing to an
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26484
diff
changeset
|
673 sink = GST_ELEMENT_PARENT(sink); |
86c5499f36e8
Fix embedding video when the sink is a gconfvideosrc pointing to an
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26484
diff
changeset
|
674 } |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
675 |
26494
86c5499f36e8
Fix embedding video when the sink is a gconfvideosrc pointing to an
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26484
diff
changeset
|
676 g_signal_handlers_disconnect_matched(bus, G_SIGNAL_MATCH_FUNC |
86c5499f36e8
Fix embedding video when the sink is a gconfvideosrc pointing to an
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26484
diff
changeset
|
677 | G_SIGNAL_MATCH_DATA, 0, 0, NULL, |
86c5499f36e8
Fix embedding video when the sink is a gconfvideosrc pointing to an
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26484
diff
changeset
|
678 window_id_cb, ow); |
86c5499f36e8
Fix embedding video when the sink is a gconfvideosrc pointing to an
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26484
diff
changeset
|
679 |
86c5499f36e8
Fix embedding video when the sink is a gconfvideosrc pointing to an
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26484
diff
changeset
|
680 gst_x_overlay_set_xwindow_id(GST_X_OVERLAY( |
86c5499f36e8
Fix embedding video when the sink is a gconfvideosrc pointing to an
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26484
diff
changeset
|
681 GST_MESSAGE_SRC(msg)), ow->window_id); |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
682 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
683 #endif |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
684 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
685 gboolean |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
686 purple_media_manager_create_output_window(PurpleMediaManager *manager, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
687 PurpleMedia *media, const gchar *session_id, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
688 const gchar *participant) |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
689 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
690 #ifdef USE_VV |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
691 GList *iter; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
692 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
693 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
694 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
695 iter = manager->priv->output_windows; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
696 for(; iter; iter = g_list_next(iter)) { |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
697 PurpleMediaOutputWindow *ow = iter->data; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
698 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
699 if (ow->sink == NULL && ow->media == media && |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
700 ((participant != NULL && |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
701 ow->participant != NULL && |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
702 !strcmp(participant, ow->participant)) || |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
703 (participant == ow->participant)) && |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
704 !strcmp(session_id, ow->session_id)) { |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
705 GstBus *bus; |
28229
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
706 GstElement *queue, *colorspace; |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
707 GstElement *tee = purple_media_get_tee(media, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
708 session_id, participant); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
709 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
710 if (tee == NULL) |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
711 continue; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
712 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
713 queue = gst_element_factory_make( |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
714 "queue", NULL); |
28229
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
715 colorspace = gst_element_factory_make( |
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
716 "ffmpegcolorspace", NULL); |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
717 ow->sink = purple_media_manager_get_element( |
26474
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26472
diff
changeset
|
718 manager, PURPLE_MEDIA_RECV_VIDEO, |
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26472
diff
changeset
|
719 ow->media, ow->session_id, |
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26472
diff
changeset
|
720 ow->participant); |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
721 |
26389
5ee7e8f209bb
Silence warning about videotestsrc not having two properties.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26205
diff
changeset
|
722 if (participant == NULL) { |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
723 /* aka this is a preview sink */ |
26389
5ee7e8f209bb
Silence warning about videotestsrc not having two properties.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26205
diff
changeset
|
724 GObjectClass *klass = |
5ee7e8f209bb
Silence warning about videotestsrc not having two properties.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26205
diff
changeset
|
725 G_OBJECT_GET_CLASS(ow->sink); |
5ee7e8f209bb
Silence warning about videotestsrc not having two properties.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26205
diff
changeset
|
726 if (g_object_class_find_property(klass, |
5ee7e8f209bb
Silence warning about videotestsrc not having two properties.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26205
diff
changeset
|
727 "sync")) |
5ee7e8f209bb
Silence warning about videotestsrc not having two properties.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26205
diff
changeset
|
728 g_object_set(G_OBJECT(ow->sink), |
5ee7e8f209bb
Silence warning about videotestsrc not having two properties.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26205
diff
changeset
|
729 "sync", "FALSE", NULL); |
5ee7e8f209bb
Silence warning about videotestsrc not having two properties.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26205
diff
changeset
|
730 if (g_object_class_find_property(klass, |
5ee7e8f209bb
Silence warning about videotestsrc not having two properties.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26205
diff
changeset
|
731 "async")) |
5ee7e8f209bb
Silence warning about videotestsrc not having two properties.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26205
diff
changeset
|
732 g_object_set(G_OBJECT(ow->sink), |
5ee7e8f209bb
Silence warning about videotestsrc not having two properties.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26205
diff
changeset
|
733 "async", FALSE, NULL); |
5ee7e8f209bb
Silence warning about videotestsrc not having two properties.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26205
diff
changeset
|
734 } |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
735 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
736 gst_bin_add_many(GST_BIN(GST_ELEMENT_PARENT(tee)), |
28229
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
737 queue, colorspace, ow->sink, NULL); |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
738 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
739 bus = gst_pipeline_get_bus(GST_PIPELINE( |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
740 manager->priv->pipeline)); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
741 g_signal_connect(bus, "sync-message::element", |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
742 G_CALLBACK(window_id_cb), ow); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
743 gst_object_unref(bus); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
744 |
28227
d865064a3104
Switch around some GStreamer linking and state setting.
maiku@pidgin.im
parents:
28198
diff
changeset
|
745 gst_element_set_state(ow->sink, GST_STATE_PLAYING); |
28229
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
746 gst_element_set_state(colorspace, GST_STATE_PLAYING); |
28227
d865064a3104
Switch around some GStreamer linking and state setting.
maiku@pidgin.im
parents:
28198
diff
changeset
|
747 gst_element_set_state(queue, GST_STATE_PLAYING); |
28229
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
748 gst_element_link(colorspace, ow->sink); |
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
749 gst_element_link(queue, colorspace); |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
750 gst_element_link(tee, queue); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
751 } |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
752 } |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
753 return TRUE; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
754 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
755 return FALSE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
756 #endif |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
757 } |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
758 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
759 gulong |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
760 purple_media_manager_set_output_window(PurpleMediaManager *manager, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
761 PurpleMedia *media, const gchar *session_id, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
762 const gchar *participant, gulong window_id) |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
763 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
764 #ifdef USE_VV |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
765 PurpleMediaOutputWindow *output_window; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
766 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
767 g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), FALSE); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
768 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
769 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
770 output_window = g_new0(PurpleMediaOutputWindow, 1); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
771 output_window->id = manager->priv->next_output_window_id++; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
772 output_window->media = media; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
773 output_window->session_id = g_strdup(session_id); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
774 output_window->participant = g_strdup(participant); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
775 output_window->window_id = window_id; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
776 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
777 manager->priv->output_windows = g_list_prepend( |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
778 manager->priv->output_windows, output_window); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
779 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
780 if (purple_media_get_tee(media, session_id, participant) != NULL) |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
781 purple_media_manager_create_output_window(manager, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
782 media, session_id, participant); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
783 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
784 return output_window->id; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
785 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
786 return 0; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
787 #endif |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
788 } |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
789 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
790 gboolean |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
791 purple_media_manager_remove_output_window(PurpleMediaManager *manager, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
792 gulong output_window_id) |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
793 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
794 #ifdef USE_VV |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
795 PurpleMediaOutputWindow *output_window = NULL; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
796 GList *iter; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
797 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
798 g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), FALSE); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
799 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
800 iter = manager->priv->output_windows; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
801 for (; iter; iter = g_list_next(iter)) { |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
802 PurpleMediaOutputWindow *ow = iter->data; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
803 if (ow->id == output_window_id) { |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
804 manager->priv->output_windows = g_list_delete_link( |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
805 manager->priv->output_windows, iter); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
806 output_window = ow; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
807 break; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
808 } |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
809 } |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
810 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
811 if (output_window == NULL) |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
812 return FALSE; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
813 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
814 if (output_window->sink != NULL) { |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
815 GstPad *pad = gst_element_get_static_pad( |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
816 output_window->sink, "sink"); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
817 GstPad *peer = gst_pad_get_peer(pad); |
28229
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
818 GstElement *colorspace = GST_ELEMENT_PARENT(peer), *queue; |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
819 gst_object_unref(pad); |
28229
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
820 gst_object_unref(peer); |
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
821 pad = gst_element_get_static_pad(colorspace, "sink"); |
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
822 peer = gst_pad_get_peer(pad); |
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
823 queue = GST_ELEMENT_PARENT(peer); |
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
824 gst_object_unref(pad); |
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
825 gst_object_unref(peer); |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
826 pad = gst_element_get_static_pad(queue, "sink"); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
827 peer = gst_pad_get_peer(pad); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
828 gst_object_unref(pad); |
27990
feb17f2b5b7a
Don't crash when there isn't a webcam connected.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26645
diff
changeset
|
829 if (peer != NULL) |
feb17f2b5b7a
Don't crash when there isn't a webcam connected.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26645
diff
changeset
|
830 gst_element_release_request_pad(GST_ELEMENT_PARENT(peer), peer); |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
831 gst_element_set_locked_state(queue, TRUE); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
832 gst_element_set_state(queue, GST_STATE_NULL); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
833 gst_bin_remove(GST_BIN(GST_ELEMENT_PARENT(queue)), queue); |
28229
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
834 gst_element_set_locked_state(colorspace, TRUE); |
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
835 gst_element_set_state(colorspace, GST_STATE_NULL); |
f5580e1ca4b1
Fix unidirectional media sessions and add a colorspace before the video sink.
maiku@pidgin.im
parents:
28227
diff
changeset
|
836 gst_bin_remove(GST_BIN(GST_ELEMENT_PARENT(colorspace)), colorspace); |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
837 gst_element_set_locked_state(output_window->sink, TRUE); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
838 gst_element_set_state(output_window->sink, GST_STATE_NULL); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
839 gst_bin_remove(GST_BIN(GST_ELEMENT_PARENT(output_window->sink)), |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
840 output_window->sink); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
841 } |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
842 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
843 g_free(output_window->session_id); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
844 g_free(output_window->participant); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
845 g_free(output_window); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
846 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
847 return TRUE; |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
848 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
849 return FALSE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
850 #endif |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
851 } |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
852 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
853 void |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
854 purple_media_manager_remove_output_windows(PurpleMediaManager *manager, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
855 PurpleMedia *media, const gchar *session_id, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
856 const gchar *participant) |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
857 { |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
858 #ifdef USE_VV |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
859 GList *iter; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
860 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
861 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
862 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
863 iter = manager->priv->output_windows; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
864 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
865 for (; iter;) { |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
866 PurpleMediaOutputWindow *ow = iter->data; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
867 iter = g_list_next(iter); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
868 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
869 if (media == ow->media && |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
870 ((session_id != NULL && ow->session_id != NULL && |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
871 !strcmp(session_id, ow->session_id)) || |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
872 (session_id == ow->session_id)) && |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
873 ((participant != NULL && ow->participant != NULL && |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
874 !strcmp(participant, ow->participant)) || |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
875 (participant == ow->participant))) |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
876 purple_media_manager_remove_output_window( |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
877 manager, ow->id); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
878 } |
26432
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26431
diff
changeset
|
879 #endif |
26199
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
880 } |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26196
diff
changeset
|
881 |
26472
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
882 void |
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
883 purple_media_manager_set_ui_caps(PurpleMediaManager *manager, |
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
884 PurpleMediaCaps caps) |
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
885 { |
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
886 #ifdef USE_VV |
29525
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
887 PurpleMediaCaps oldcaps; |
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
888 |
26472
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
889 g_return_if_fail(PURPLE_IS_MEDIA_MANAGER(manager)); |
29525
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
890 |
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
891 oldcaps = manager->priv->ui_caps; |
26472
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
892 manager->priv->ui_caps = caps; |
29525
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
893 |
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
894 if (caps != oldcaps) |
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
895 g_signal_emit(manager, |
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
896 purple_media_manager_signals[UI_CAPS_CHANGED], |
e144a461cf3c
Added the ui-caps-changed signal to the media manager.
maiku@pidgin.im
parents:
28397
diff
changeset
|
897 0, caps, oldcaps); |
26472
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
898 #endif |
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
899 } |
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
900 |
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
901 PurpleMediaCaps |
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
902 purple_media_manager_get_ui_caps(PurpleMediaManager *manager) |
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
903 { |
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
904 #ifdef USE_VV |
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
905 g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), |
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
906 PURPLE_MEDIA_CAPS_NONE); |
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
907 return manager->priv->ui_caps; |
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
908 #else |
26507
90c65a8575bf
Make it compile with --disable-vv... again!
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26494
diff
changeset
|
909 return PURPLE_MEDIA_CAPS_NONE; |
26472
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
910 #endif |
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
911 } |
507d2366d329
Add purple_media_manager_{get,set}_ui_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26463
diff
changeset
|
912 |
26621
4f2f5659aa0d
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26608
diff
changeset
|
913 #ifdef USE_GSTREAMER |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
914 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
915 /* |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
916 * PurpleMediaElementType |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
917 */ |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
918 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
919 GType |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
920 purple_media_element_type_get_type() |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
921 { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
922 static GType type = 0; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
923 if (type == 0) { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
924 static const GFlagsValue values[] = { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
925 { PURPLE_MEDIA_ELEMENT_NONE, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
926 "PURPLE_MEDIA_ELEMENT_NONE", "none" }, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
927 { PURPLE_MEDIA_ELEMENT_AUDIO, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
928 "PURPLE_MEDIA_ELEMENT_AUDIO", "audio" }, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
929 { PURPLE_MEDIA_ELEMENT_VIDEO, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
930 "PURPLE_MEDIA_ELEMENT_VIDEO", "video" }, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
931 { PURPLE_MEDIA_ELEMENT_AUDIO_VIDEO, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
932 "PURPLE_MEDIA_ELEMENT_AUDIO_VIDEO", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
933 "audio-video" }, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
934 { PURPLE_MEDIA_ELEMENT_NO_SRCS, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
935 "PURPLE_MEDIA_ELEMENT_NO_SRCS", "no-srcs" }, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
936 { PURPLE_MEDIA_ELEMENT_ONE_SRC, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
937 "PURPLE_MEDIA_ELEMENT_ONE_SRC", "one-src" }, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
938 { PURPLE_MEDIA_ELEMENT_MULTI_SRC, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
939 "PURPLE_MEDIA_ELEMENT_MULTI_SRC", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
940 "multi-src" }, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
941 { PURPLE_MEDIA_ELEMENT_REQUEST_SRC, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
942 "PURPLE_MEDIA_ELEMENT_REQUEST_SRC", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
943 "request-src" }, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
944 { PURPLE_MEDIA_ELEMENT_NO_SINKS, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
945 "PURPLE_MEDIA_ELEMENT_NO_SINKS", "no-sinks" }, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
946 { PURPLE_MEDIA_ELEMENT_ONE_SINK, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
947 "PURPLE_MEDIA_ELEMENT_ONE_SINK", "one-sink" }, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
948 { PURPLE_MEDIA_ELEMENT_MULTI_SINK, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
949 "PURPLE_MEDIA_ELEMENT_MULTI_SINK", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
950 "multi-sink" }, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
951 { PURPLE_MEDIA_ELEMENT_REQUEST_SINK, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
952 "PURPLE_MEDIA_ELEMENT_REQUEST_SINK", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
953 "request-sink" }, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
954 { PURPLE_MEDIA_ELEMENT_UNIQUE, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
955 "PURPLE_MEDIA_ELEMENT_UNIQUE", "unique" }, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
956 { PURPLE_MEDIA_ELEMENT_SRC, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
957 "PURPLE_MEDIA_ELEMENT_SRC", "src" }, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
958 { PURPLE_MEDIA_ELEMENT_SINK, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
959 "PURPLE_MEDIA_ELEMENT_SINK", "sink" }, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
960 { 0, NULL, NULL } |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
961 }; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
962 type = g_flags_register_static( |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
963 "PurpleMediaElementType", values); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
964 } |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
965 return type; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
966 } |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
967 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
968 /* |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
969 * PurpleMediaElementInfo |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
970 */ |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
971 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
972 struct _PurpleMediaElementInfoClass |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
973 { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
974 GObjectClass parent_class; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
975 }; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
976 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
977 struct _PurpleMediaElementInfo |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
978 { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
979 GObject parent; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
980 }; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
981 |
26507
90c65a8575bf
Make it compile with --disable-vv... again!
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26494
diff
changeset
|
982 #ifdef USE_VV |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
983 struct _PurpleMediaElementInfoPrivate |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
984 { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
985 gchar *id; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
986 gchar *name; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
987 PurpleMediaElementType type; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
988 PurpleMediaElementCreateCallback create; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
989 }; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
990 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
991 enum { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
992 PROP_0, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
993 PROP_ID, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
994 PROP_NAME, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
995 PROP_TYPE, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
996 PROP_CREATE_CB, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
997 }; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
998 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
999 static void |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1000 purple_media_element_info_init(PurpleMediaElementInfo *info) |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1001 { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1002 PurpleMediaElementInfoPrivate *priv = |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1003 PURPLE_MEDIA_ELEMENT_INFO_GET_PRIVATE(info); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1004 priv->id = NULL; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1005 priv->name = NULL; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1006 priv->type = PURPLE_MEDIA_ELEMENT_NONE; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1007 priv->create = NULL; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1008 } |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1009 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1010 static void |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1011 purple_media_element_info_finalize(GObject *info) |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1012 { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1013 PurpleMediaElementInfoPrivate *priv = |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1014 PURPLE_MEDIA_ELEMENT_INFO_GET_PRIVATE(info); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1015 g_free(priv->id); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1016 g_free(priv->name); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1017 } |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1018 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1019 static void |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1020 purple_media_element_info_set_property (GObject *object, guint prop_id, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1021 const GValue *value, GParamSpec *pspec) |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1022 { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1023 PurpleMediaElementInfoPrivate *priv; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1024 g_return_if_fail(PURPLE_IS_MEDIA_ELEMENT_INFO(object)); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1025 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1026 priv = PURPLE_MEDIA_ELEMENT_INFO_GET_PRIVATE(object); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1027 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1028 switch (prop_id) { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1029 case PROP_ID: |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1030 g_free(priv->id); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1031 priv->id = g_value_dup_string(value); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1032 break; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1033 case PROP_NAME: |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1034 g_free(priv->name); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1035 priv->name = g_value_dup_string(value); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1036 break; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1037 case PROP_TYPE: { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1038 priv->type = g_value_get_flags(value); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1039 break; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1040 } |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1041 case PROP_CREATE_CB: |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1042 priv->create = g_value_get_pointer(value); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1043 break; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1044 default: |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1045 G_OBJECT_WARN_INVALID_PROPERTY_ID( |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1046 object, prop_id, pspec); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1047 break; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1048 } |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1049 } |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1050 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1051 static void |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1052 purple_media_element_info_get_property (GObject *object, guint prop_id, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1053 GValue *value, GParamSpec *pspec) |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1054 { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1055 PurpleMediaElementInfoPrivate *priv; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1056 g_return_if_fail(PURPLE_IS_MEDIA_ELEMENT_INFO(object)); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1057 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1058 priv = PURPLE_MEDIA_ELEMENT_INFO_GET_PRIVATE(object); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1059 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1060 switch (prop_id) { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1061 case PROP_ID: |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1062 g_value_set_string(value, priv->id); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1063 break; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1064 case PROP_NAME: |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1065 g_value_set_string(value, priv->name); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1066 break; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1067 case PROP_TYPE: |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1068 g_value_set_flags(value, priv->type); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1069 break; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1070 case PROP_CREATE_CB: |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1071 g_value_set_pointer(value, priv->create); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1072 break; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1073 default: |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1074 G_OBJECT_WARN_INVALID_PROPERTY_ID( |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1075 object, prop_id, pspec); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1076 break; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1077 } |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1078 } |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1079 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1080 static void |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1081 purple_media_element_info_class_init(PurpleMediaElementInfoClass *klass) |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1082 { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1083 GObjectClass *gobject_class = (GObjectClass*)klass; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1084 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1085 gobject_class->finalize = purple_media_element_info_finalize; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1086 gobject_class->set_property = purple_media_element_info_set_property; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1087 gobject_class->get_property = purple_media_element_info_get_property; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1088 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1089 g_object_class_install_property(gobject_class, PROP_ID, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1090 g_param_spec_string("id", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1091 "ID", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1092 "The unique identifier of the element.", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1093 NULL, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1094 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1095 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1096 g_object_class_install_property(gobject_class, PROP_NAME, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1097 g_param_spec_string("name", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1098 "Name", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1099 "The friendly/display name of this element.", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1100 NULL, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1101 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1102 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1103 g_object_class_install_property(gobject_class, PROP_TYPE, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1104 g_param_spec_flags("type", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1105 "Element Type", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1106 "The type of element this is.", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1107 PURPLE_TYPE_MEDIA_ELEMENT_TYPE, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1108 PURPLE_MEDIA_ELEMENT_NONE, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1109 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1110 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1111 g_object_class_install_property(gobject_class, PROP_CREATE_CB, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1112 g_param_spec_pointer("create-cb", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1113 "Create Callback", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1114 "The function called to create this element.", |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1115 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1116 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1117 g_type_class_add_private(klass, sizeof(PurpleMediaElementInfoPrivate)); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1118 } |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1119 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1120 G_DEFINE_TYPE(PurpleMediaElementInfo, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1121 purple_media_element_info, G_TYPE_OBJECT); |
26507
90c65a8575bf
Make it compile with --disable-vv... again!
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26494
diff
changeset
|
1122 #else |
90c65a8575bf
Make it compile with --disable-vv... again!
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26494
diff
changeset
|
1123 GType |
90c65a8575bf
Make it compile with --disable-vv... again!
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26494
diff
changeset
|
1124 purple_media_element_info_get_type() |
90c65a8575bf
Make it compile with --disable-vv... again!
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26494
diff
changeset
|
1125 { |
90c65a8575bf
Make it compile with --disable-vv... again!
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26494
diff
changeset
|
1126 return G_TYPE_NONE; |
90c65a8575bf
Make it compile with --disable-vv... again!
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26494
diff
changeset
|
1127 } |
90c65a8575bf
Make it compile with --disable-vv... again!
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26494
diff
changeset
|
1128 #endif |
26484
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1129 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1130 gchar * |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1131 purple_media_element_info_get_id(PurpleMediaElementInfo *info) |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1132 { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1133 #ifdef USE_VV |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1134 gchar *id; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1135 g_return_val_if_fail(PURPLE_IS_MEDIA_ELEMENT_INFO(info), NULL); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1136 g_object_get(info, "id", &id, NULL); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1137 return id; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1138 #else |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1139 return NULL; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1140 #endif |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1141 } |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1142 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1143 gchar * |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1144 purple_media_element_info_get_name(PurpleMediaElementInfo *info) |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1145 { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1146 #ifdef USE_VV |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1147 gchar *name; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1148 g_return_val_if_fail(PURPLE_IS_MEDIA_ELEMENT_INFO(info), NULL); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1149 g_object_get(info, "name", &name, NULL); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1150 return name; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1151 #else |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1152 return NULL; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1153 #endif |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1154 } |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1155 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1156 PurpleMediaElementType |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1157 purple_media_element_info_get_element_type(PurpleMediaElementInfo *info) |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1158 { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1159 #ifdef USE_VV |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1160 PurpleMediaElementType type; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1161 g_return_val_if_fail(PURPLE_IS_MEDIA_ELEMENT_INFO(info), |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1162 PURPLE_MEDIA_ELEMENT_NONE); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1163 g_object_get(info, "type", &type, NULL); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1164 return type; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1165 #else |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1166 return PURPLE_MEDIA_ELEMENT_NONE; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1167 #endif |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1168 } |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1169 |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1170 GstElement * |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1171 purple_media_element_info_call_create(PurpleMediaElementInfo *info, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1172 PurpleMedia *media, const gchar *session_id, |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1173 const gchar *participant) |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1174 { |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1175 #ifdef USE_VV |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1176 PurpleMediaElementCreateCallback create; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1177 g_return_val_if_fail(PURPLE_IS_MEDIA_ELEMENT_INFO(info), NULL); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1178 g_object_get(info, "create-cb", &create, NULL); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1179 if (create) |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1180 return create(media, session_id, participant); |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1181 #endif |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1182 return NULL; |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1183 } |
081a819bc710
Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26482
diff
changeset
|
1184 |
26621
4f2f5659aa0d
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26608
diff
changeset
|
1185 #endif /* USE_GSTREAMER */ |
4f2f5659aa0d
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
26608
diff
changeset
|
1186 |