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