Mercurial > pidgin.yaz
annotate libpurple/media/media.c @ 29592:0b54934f2742
Remove a couple more unnecessary headers from media.c
author | maiku@pidgin.im |
---|---|
date | Tue, 27 Oct 2009 21:50:19 +0000 |
parents | a71400a86933 |
children | 8b04812396b9 |
rev | line source |
---|---|
29534 | 1 /** |
2 * @file media.c Media API | |
3 * @ingroup core | |
4 */ | |
5 | |
6 /* purple | |
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | |
25 */ | |
26 | |
27 #include "internal.h" | |
28 | |
29 #include "account.h" | |
30 #include "media.h" | |
29549
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
31 #include "media/backend-fs2.h" |
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
32 #include "media/backend-iface.h" |
29534 | 33 #include "mediamanager.h" |
34 | |
35 #include "debug.h" | |
36 | |
37 #ifdef USE_GSTREAMER | |
38 #include "marshallers.h" | |
39 #include "media-gst.h" | |
40 #endif | |
41 | |
42 #ifdef USE_VV | |
43 | |
44 /** @copydoc _PurpleMediaSession */ | |
45 typedef struct _PurpleMediaSession PurpleMediaSession; | |
46 /** @copydoc _PurpleMediaStream */ | |
47 typedef struct _PurpleMediaStream PurpleMediaStream; | |
48 /** @copydoc _PurpleMediaClass */ | |
49 typedef struct _PurpleMediaClass PurpleMediaClass; | |
50 /** @copydoc _PurpleMediaPrivate */ | |
51 typedef struct _PurpleMediaPrivate PurpleMediaPrivate; | |
52 | |
53 /** The media class */ | |
54 struct _PurpleMediaClass | |
55 { | |
56 GObjectClass parent_class; /**< The parent class. */ | |
57 }; | |
58 | |
59 /** The media class's private data */ | |
60 struct _PurpleMedia | |
61 { | |
62 GObject parent; /**< The parent of this object. */ | |
63 PurpleMediaPrivate *priv; /**< The private data of this object. */ | |
64 }; | |
65 | |
66 struct _PurpleMediaSession | |
67 { | |
68 gchar *id; | |
69 PurpleMedia *media; | |
70 PurpleMediaSessionType type; | |
71 gboolean initiator; | |
72 }; | |
73 | |
74 struct _PurpleMediaStream | |
75 { | |
76 PurpleMediaSession *session; | |
77 gchar *participant; | |
78 | |
79 GList *local_candidates; | |
80 GList *remote_candidates; | |
81 | |
82 gboolean initiator; | |
83 gboolean accepted; | |
84 gboolean candidates_prepared; | |
85 | |
86 GList *active_local_candidates; | |
87 GList *active_remote_candidates; | |
88 | |
89 guint connected_cb_id; | |
90 }; | |
91 #endif | |
92 | |
93 struct _PurpleMediaPrivate | |
94 { | |
95 #ifdef USE_VV | |
96 PurpleMediaManager *manager; | |
97 PurpleAccount *account; | |
29549
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
98 PurpleMediaBackend *backend; |
29545
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
99 gchar *conference_type; |
29551
e85df0170905
Decouple the media_bus_call from the backend. It will still be needed even
maiku@pidgin.im
parents:
29550
diff
changeset
|
100 gulong gst_bus_handler_id; |
29534 | 101 gboolean initiator; |
102 gpointer prpl_data; | |
103 | |
104 GHashTable *sessions; /* PurpleMediaSession table */ | |
105 | |
106 GList *streams; /* PurpleMediaStream table */ | |
107 #else | |
108 gpointer dummy; | |
109 #endif | |
110 }; | |
111 | |
112 #ifdef USE_VV | |
113 #define PURPLE_MEDIA_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA, PurpleMediaPrivate)) | |
114 | |
115 static void purple_media_class_init (PurpleMediaClass *klass); | |
116 static void purple_media_init (PurpleMedia *media); | |
117 static void purple_media_dispose (GObject *object); | |
118 static void purple_media_finalize (GObject *object); | |
119 static void purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); | |
120 static void purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); | |
121 | |
29554
2460e6774e08
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
maiku@pidgin.im
parents:
29553
diff
changeset
|
122 static void purple_media_new_local_candidate_cb(PurpleMediaBackend *backend, |
2460e6774e08
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
maiku@pidgin.im
parents:
29553
diff
changeset
|
123 const gchar *sess_id, const gchar *participant, |
2460e6774e08
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
maiku@pidgin.im
parents:
29553
diff
changeset
|
124 PurpleMediaCandidate *candidate, PurpleMedia *media); |
29557
1fdc75c94c22
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
maiku@pidgin.im
parents:
29556
diff
changeset
|
125 static void purple_media_candidates_prepared_cb(PurpleMediaBackend *backend, |
1fdc75c94c22
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
maiku@pidgin.im
parents:
29556
diff
changeset
|
126 const gchar *sess_id, const gchar *name, PurpleMedia *media); |
29556
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
127 static void purple_media_candidate_pair_established_cb( |
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
128 PurpleMediaBackend *backend, |
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
129 const gchar *sess_id, const gchar *name, |
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
130 PurpleMediaCandidate *local_candidate, |
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
131 PurpleMediaCandidate *remote_candidate, |
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
132 PurpleMedia *media); |
29555
cc978a1a4bd1
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
maiku@pidgin.im
parents:
29554
diff
changeset
|
133 static void purple_media_codecs_changed_cb(PurpleMediaBackend *backend, |
cc978a1a4bd1
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
maiku@pidgin.im
parents:
29554
diff
changeset
|
134 const gchar *sess_id, PurpleMedia *media); |
29534 | 135 |
136 static GObjectClass *parent_class = NULL; | |
137 | |
138 | |
139 | |
140 enum { | |
141 S_ERROR, | |
142 CANDIDATES_PREPARED, | |
143 CODECS_CHANGED, | |
144 LEVEL, | |
145 NEW_CANDIDATE, | |
146 STATE_CHANGED, | |
147 STREAM_INFO, | |
148 LAST_SIGNAL | |
149 }; | |
150 static guint purple_media_signals[LAST_SIGNAL] = {0}; | |
151 | |
152 enum { | |
153 PROP_0, | |
154 PROP_MANAGER, | |
155 PROP_ACCOUNT, | |
29545
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
156 PROP_CONFERENCE_TYPE, |
29534 | 157 PROP_INITIATOR, |
158 PROP_PRPL_DATA, | |
159 }; | |
160 #endif | |
161 | |
162 | |
163 GType | |
164 purple_media_get_type() | |
165 { | |
166 #ifdef USE_VV | |
167 static GType type = 0; | |
168 | |
169 if (type == 0) { | |
170 static const GTypeInfo info = { | |
171 sizeof(PurpleMediaClass), | |
172 NULL, | |
173 NULL, | |
174 (GClassInitFunc) purple_media_class_init, | |
175 NULL, | |
176 NULL, | |
177 sizeof(PurpleMedia), | |
178 0, | |
179 (GInstanceInitFunc) purple_media_init, | |
180 NULL | |
181 }; | |
182 type = g_type_register_static(G_TYPE_OBJECT, "PurpleMedia", &info, 0); | |
183 } | |
184 return type; | |
185 #else | |
186 return G_TYPE_NONE; | |
187 #endif | |
188 } | |
189 | |
190 #ifdef USE_VV | |
191 static void | |
192 purple_media_class_init (PurpleMediaClass *klass) | |
193 { | |
194 GObjectClass *gobject_class = (GObjectClass*)klass; | |
195 parent_class = g_type_class_peek_parent(klass); | |
196 | |
197 gobject_class->dispose = purple_media_dispose; | |
198 gobject_class->finalize = purple_media_finalize; | |
199 gobject_class->set_property = purple_media_set_property; | |
200 gobject_class->get_property = purple_media_get_property; | |
201 | |
202 g_object_class_install_property(gobject_class, PROP_MANAGER, | |
203 g_param_spec_object("manager", | |
204 "Purple Media Manager", | |
205 "The media manager that contains this media session.", | |
206 PURPLE_TYPE_MEDIA_MANAGER, | |
207 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); | |
208 | |
209 g_object_class_install_property(gobject_class, PROP_ACCOUNT, | |
210 g_param_spec_pointer("account", | |
211 "PurpleAccount", | |
212 "The account this media session is on.", | |
213 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); | |
214 | |
29545
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
215 g_object_class_install_property(gobject_class, PROP_CONFERENCE_TYPE, |
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
216 g_param_spec_string("conference-type", |
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
217 "Conference Type", |
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
218 "The type of conference that this media object " |
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
219 "has been created to provide.", |
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
220 NULL, |
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
221 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
222 |
29534 | 223 g_object_class_install_property(gobject_class, PROP_INITIATOR, |
224 g_param_spec_boolean("initiator", | |
225 "initiator", | |
226 "If the local user initiated the conference.", | |
227 FALSE, | |
228 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); | |
229 | |
230 g_object_class_install_property(gobject_class, PROP_PRPL_DATA, | |
231 g_param_spec_pointer("prpl-data", | |
232 "gpointer", | |
233 "Data the prpl plugin set on the media session.", | |
234 G_PARAM_READWRITE)); | |
235 | |
236 purple_media_signals[S_ERROR] = g_signal_new("error", G_TYPE_FROM_CLASS(klass), | |
237 G_SIGNAL_RUN_LAST, 0, NULL, NULL, | |
238 g_cclosure_marshal_VOID__STRING, | |
239 G_TYPE_NONE, 1, G_TYPE_STRING); | |
240 purple_media_signals[CANDIDATES_PREPARED] = g_signal_new("candidates-prepared", G_TYPE_FROM_CLASS(klass), | |
241 G_SIGNAL_RUN_LAST, 0, NULL, NULL, | |
242 purple_smarshal_VOID__STRING_STRING, | |
243 G_TYPE_NONE, 2, G_TYPE_STRING, | |
244 G_TYPE_STRING); | |
245 purple_media_signals[CODECS_CHANGED] = g_signal_new("codecs-changed", G_TYPE_FROM_CLASS(klass), | |
246 G_SIGNAL_RUN_LAST, 0, NULL, NULL, | |
247 g_cclosure_marshal_VOID__STRING, | |
248 G_TYPE_NONE, 1, G_TYPE_STRING); | |
249 purple_media_signals[LEVEL] = g_signal_new("level", G_TYPE_FROM_CLASS(klass), | |
250 G_SIGNAL_RUN_LAST, 0, NULL, NULL, | |
251 purple_smarshal_VOID__STRING_STRING_DOUBLE, | |
252 G_TYPE_NONE, 3, G_TYPE_STRING, | |
253 G_TYPE_STRING, G_TYPE_DOUBLE); | |
254 purple_media_signals[NEW_CANDIDATE] = g_signal_new("new-candidate", G_TYPE_FROM_CLASS(klass), | |
255 G_SIGNAL_RUN_LAST, 0, NULL, NULL, | |
256 purple_smarshal_VOID__POINTER_POINTER_OBJECT, | |
257 G_TYPE_NONE, 3, G_TYPE_POINTER, | |
258 G_TYPE_POINTER, PURPLE_TYPE_MEDIA_CANDIDATE); | |
259 purple_media_signals[STATE_CHANGED] = g_signal_new("state-changed", G_TYPE_FROM_CLASS(klass), | |
260 G_SIGNAL_RUN_LAST, 0, NULL, NULL, | |
261 purple_smarshal_VOID__ENUM_STRING_STRING, | |
262 G_TYPE_NONE, 3, PURPLE_MEDIA_TYPE_STATE, | |
263 G_TYPE_STRING, G_TYPE_STRING); | |
264 purple_media_signals[STREAM_INFO] = g_signal_new("stream-info", G_TYPE_FROM_CLASS(klass), | |
265 G_SIGNAL_RUN_LAST, 0, NULL, NULL, | |
266 purple_smarshal_VOID__ENUM_STRING_STRING_BOOLEAN, | |
267 G_TYPE_NONE, 4, PURPLE_MEDIA_TYPE_INFO_TYPE, | |
268 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN); | |
269 g_type_class_add_private(klass, sizeof(PurpleMediaPrivate)); | |
270 } | |
271 | |
272 | |
273 static void | |
274 purple_media_init (PurpleMedia *media) | |
275 { | |
276 media->priv = PURPLE_MEDIA_GET_PRIVATE(media); | |
277 memset(media->priv, 0, sizeof(*media->priv)); | |
278 } | |
279 | |
280 static void | |
281 purple_media_stream_free(PurpleMediaStream *stream) | |
282 { | |
283 if (stream == NULL) | |
284 return; | |
285 | |
286 /* Remove the connected_cb timeout */ | |
287 if (stream->connected_cb_id != 0) | |
288 purple_timeout_remove(stream->connected_cb_id); | |
289 | |
290 g_free(stream->participant); | |
291 | |
292 if (stream->local_candidates) | |
29559
cb843608e183
Store local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29557
diff
changeset
|
293 purple_media_candidate_list_free(stream->local_candidates); |
29534 | 294 if (stream->remote_candidates) |
29560
18571ea6e44a
Store remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29559
diff
changeset
|
295 purple_media_candidate_list_free(stream->remote_candidates); |
29534 | 296 |
297 if (stream->active_local_candidates) | |
29561
7713312c4ab0
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29560
diff
changeset
|
298 purple_media_candidate_list_free( |
7713312c4ab0
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29560
diff
changeset
|
299 stream->active_local_candidates); |
29534 | 300 if (stream->active_remote_candidates) |
29562
1156bf88b4d3
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29561
diff
changeset
|
301 purple_media_candidate_list_free( |
1156bf88b4d3
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29561
diff
changeset
|
302 stream->active_remote_candidates); |
29534 | 303 |
304 g_free(stream); | |
305 } | |
306 | |
307 static void | |
308 purple_media_session_free(PurpleMediaSession *session) | |
309 { | |
310 if (session == NULL) | |
311 return; | |
312 | |
313 g_free(session->id); | |
314 g_free(session); | |
315 } | |
316 | |
317 static void | |
318 purple_media_dispose(GObject *media) | |
319 { | |
320 PurpleMediaPrivate *priv = PURPLE_MEDIA_GET_PRIVATE(media); | |
321 | |
322 purple_debug_info("media","purple_media_dispose\n"); | |
323 | |
324 purple_media_manager_remove_media(priv->manager, PURPLE_MEDIA(media)); | |
325 | |
29549
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
326 if (priv->backend) { |
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
327 g_object_unref(priv->backend); |
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
328 priv->backend = NULL; |
29534 | 329 } |
330 | |
29551
e85df0170905
Decouple the media_bus_call from the backend. It will still be needed even
maiku@pidgin.im
parents:
29550
diff
changeset
|
331 if (priv->gst_bus_handler_id != 0) { |
29534 | 332 GstElement *pipeline = purple_media_manager_get_pipeline( |
333 priv->manager); | |
334 GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); | |
29551
e85df0170905
Decouple the media_bus_call from the backend. It will still be needed even
maiku@pidgin.im
parents:
29550
diff
changeset
|
335 g_signal_handler_disconnect(bus, priv->gst_bus_handler_id); |
29534 | 336 gst_object_unref(bus); |
29551
e85df0170905
Decouple the media_bus_call from the backend. It will still be needed even
maiku@pidgin.im
parents:
29550
diff
changeset
|
337 priv->gst_bus_handler_id = 0; |
e85df0170905
Decouple the media_bus_call from the backend. It will still be needed even
maiku@pidgin.im
parents:
29550
diff
changeset
|
338 } |
29534 | 339 |
29551
e85df0170905
Decouple the media_bus_call from the backend. It will still be needed even
maiku@pidgin.im
parents:
29550
diff
changeset
|
340 if (priv->manager) { |
29534 | 341 g_object_unref(priv->manager); |
342 priv->manager = NULL; | |
343 } | |
344 | |
345 G_OBJECT_CLASS(parent_class)->dispose(media); | |
346 } | |
347 | |
348 static void | |
349 purple_media_finalize(GObject *media) | |
350 { | |
351 PurpleMediaPrivate *priv = PURPLE_MEDIA_GET_PRIVATE(media); | |
352 purple_debug_info("media","purple_media_finalize\n"); | |
353 | |
354 for (; priv->streams; priv->streams = g_list_delete_link(priv->streams, priv->streams)) | |
355 purple_media_stream_free(priv->streams->data); | |
356 | |
357 if (priv->sessions) { | |
358 GList *sessions = g_hash_table_get_values(priv->sessions); | |
359 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { | |
360 purple_media_session_free(sessions->data); | |
361 } | |
362 g_hash_table_destroy(priv->sessions); | |
363 } | |
364 | |
365 G_OBJECT_CLASS(parent_class)->finalize(media); | |
366 } | |
367 | |
368 static void | |
369 purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) | |
370 { | |
371 PurpleMedia *media; | |
372 g_return_if_fail(PURPLE_IS_MEDIA(object)); | |
373 | |
374 media = PURPLE_MEDIA(object); | |
375 | |
376 switch (prop_id) { | |
377 case PROP_MANAGER: | |
29549
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
378 media->priv->manager = g_value_dup_object(value); |
29534 | 379 break; |
380 case PROP_ACCOUNT: | |
381 media->priv->account = g_value_get_pointer(value); | |
382 break; | |
29545
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
383 case PROP_CONFERENCE_TYPE: |
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
384 media->priv->conference_type = |
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
385 g_value_dup_string(value); |
29549
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
386 /* Will eventually get this type from the media manager */ |
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
387 media->priv->backend = g_object_new( |
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
388 PURPLE_TYPE_MEDIA_BACKEND_FS2, |
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
389 "conference-type", |
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
390 media->priv->conference_type, |
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
391 "media", media, |
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
392 NULL); |
29554
2460e6774e08
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
maiku@pidgin.im
parents:
29553
diff
changeset
|
393 g_signal_connect(media->priv->backend, |
29556
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
394 "active-candidate-pair", |
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
395 G_CALLBACK( |
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
396 purple_media_candidate_pair_established_cb), |
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
397 media); |
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
398 g_signal_connect(media->priv->backend, |
29557
1fdc75c94c22
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
maiku@pidgin.im
parents:
29556
diff
changeset
|
399 "candidates-prepared", |
1fdc75c94c22
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
maiku@pidgin.im
parents:
29556
diff
changeset
|
400 G_CALLBACK( |
1fdc75c94c22
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
maiku@pidgin.im
parents:
29556
diff
changeset
|
401 purple_media_candidates_prepared_cb), |
1fdc75c94c22
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
maiku@pidgin.im
parents:
29556
diff
changeset
|
402 media); |
1fdc75c94c22
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
maiku@pidgin.im
parents:
29556
diff
changeset
|
403 g_signal_connect(media->priv->backend, |
29555
cc978a1a4bd1
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
maiku@pidgin.im
parents:
29554
diff
changeset
|
404 "codecs-changed", |
cc978a1a4bd1
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
maiku@pidgin.im
parents:
29554
diff
changeset
|
405 G_CALLBACK( |
cc978a1a4bd1
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
maiku@pidgin.im
parents:
29554
diff
changeset
|
406 purple_media_codecs_changed_cb), |
cc978a1a4bd1
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
maiku@pidgin.im
parents:
29554
diff
changeset
|
407 media); |
cc978a1a4bd1
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
maiku@pidgin.im
parents:
29554
diff
changeset
|
408 g_signal_connect(media->priv->backend, |
29554
2460e6774e08
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
maiku@pidgin.im
parents:
29553
diff
changeset
|
409 "new-candidate", |
2460e6774e08
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
maiku@pidgin.im
parents:
29553
diff
changeset
|
410 G_CALLBACK( |
2460e6774e08
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
maiku@pidgin.im
parents:
29553
diff
changeset
|
411 purple_media_new_local_candidate_cb), |
2460e6774e08
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
maiku@pidgin.im
parents:
29553
diff
changeset
|
412 media); |
29545
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
413 break; |
29534 | 414 case PROP_INITIATOR: |
415 media->priv->initiator = g_value_get_boolean(value); | |
416 break; | |
417 case PROP_PRPL_DATA: | |
418 media->priv->prpl_data = g_value_get_pointer(value); | |
419 break; | |
420 default: | |
421 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
422 break; | |
423 } | |
424 } | |
425 | |
426 static void | |
427 purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) | |
428 { | |
429 PurpleMedia *media; | |
430 g_return_if_fail(PURPLE_IS_MEDIA(object)); | |
431 | |
432 media = PURPLE_MEDIA(object); | |
433 | |
434 switch (prop_id) { | |
435 case PROP_MANAGER: | |
436 g_value_set_object(value, media->priv->manager); | |
437 break; | |
438 case PROP_ACCOUNT: | |
439 g_value_set_pointer(value, media->priv->account); | |
440 break; | |
29545
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
441 case PROP_CONFERENCE_TYPE: |
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
442 g_value_set_string(value, |
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
443 media->priv->conference_type); |
30e8ab2a4bc2
Add a conference-type parameter to PurpleMedia.
maiku@pidgin.im
parents:
29538
diff
changeset
|
444 break; |
29534 | 445 case PROP_INITIATOR: |
446 g_value_set_boolean(value, media->priv->initiator); | |
447 break; | |
448 case PROP_PRPL_DATA: | |
449 g_value_set_pointer(value, media->priv->prpl_data); | |
450 break; | |
451 default: | |
452 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
453 break; | |
454 } | |
455 | |
456 } | |
457 | |
458 static PurpleMediaSession* | |
459 purple_media_get_session(PurpleMedia *media, const gchar *sess_id) | |
460 { | |
461 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); | |
462 return (PurpleMediaSession*) (media->priv->sessions) ? | |
463 g_hash_table_lookup(media->priv->sessions, sess_id) : NULL; | |
464 } | |
465 | |
466 static PurpleMediaStream* | |
467 purple_media_get_stream(PurpleMedia *media, const gchar *session, const gchar *participant) | |
468 { | |
469 GList *streams; | |
470 | |
471 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); | |
472 | |
473 streams = media->priv->streams; | |
474 | |
475 for (; streams; streams = g_list_next(streams)) { | |
476 PurpleMediaStream *stream = streams->data; | |
477 if (!strcmp(stream->session->id, session) && | |
478 !strcmp(stream->participant, participant)) | |
479 return stream; | |
480 } | |
481 | |
482 return NULL; | |
483 } | |
484 | |
485 static GList * | |
486 purple_media_get_streams(PurpleMedia *media, const gchar *session, | |
487 const gchar *participant) | |
488 { | |
489 GList *streams; | |
490 GList *ret = NULL; | |
491 | |
492 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); | |
493 | |
494 streams = media->priv->streams; | |
495 | |
496 for (; streams; streams = g_list_next(streams)) { | |
497 PurpleMediaStream *stream = streams->data; | |
498 if ((session == NULL || | |
499 !strcmp(stream->session->id, session)) && | |
500 (participant == NULL || | |
501 !strcmp(stream->participant, participant))) | |
502 ret = g_list_append(ret, stream); | |
503 } | |
504 | |
505 return ret; | |
506 } | |
507 | |
508 static void | |
509 purple_media_add_session(PurpleMedia *media, PurpleMediaSession *session) | |
510 { | |
511 g_return_if_fail(PURPLE_IS_MEDIA(media)); | |
512 g_return_if_fail(session != NULL); | |
513 | |
514 if (!media->priv->sessions) { | |
515 purple_debug_info("media", "Creating hash table for sessions\n"); | |
516 media->priv->sessions = g_hash_table_new(g_str_hash, g_str_equal); | |
517 } | |
518 g_hash_table_insert(media->priv->sessions, g_strdup(session->id), session); | |
519 } | |
520 | |
29568 | 521 #if 0 |
29534 | 522 static gboolean |
523 purple_media_remove_session(PurpleMedia *media, PurpleMediaSession *session) | |
524 { | |
525 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); | |
526 return g_hash_table_remove(media->priv->sessions, session->id); | |
527 } | |
29568 | 528 #endif |
29534 | 529 |
530 static PurpleMediaStream * | |
29580 | 531 purple_media_insert_stream(PurpleMediaSession *session, |
532 const gchar *name, gboolean initiator) | |
29534 | 533 { |
534 PurpleMediaStream *media_stream; | |
535 | |
536 g_return_val_if_fail(session != NULL, NULL); | |
537 | |
538 media_stream = g_new0(PurpleMediaStream, 1); | |
539 media_stream->participant = g_strdup(name); | |
540 media_stream->session = session; | |
29580 | 541 media_stream->initiator = initiator; |
29534 | 542 |
543 session->media->priv->streams = | |
544 g_list_append(session->media->priv->streams, media_stream); | |
545 | |
546 return media_stream; | |
547 } | |
548 | |
549 static void | |
550 purple_media_insert_local_candidate(PurpleMediaSession *session, const gchar *name, | |
29559
cb843608e183
Store local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29557
diff
changeset
|
551 PurpleMediaCandidate *candidate) |
29534 | 552 { |
553 PurpleMediaStream *stream; | |
554 | |
555 g_return_if_fail(session != NULL); | |
556 | |
557 stream = purple_media_get_stream(session->media, session->id, name); | |
558 stream->local_candidates = g_list_append(stream->local_candidates, candidate); | |
559 } | |
560 #endif | |
561 | |
562 GList * | |
563 purple_media_get_session_ids(PurpleMedia *media) | |
564 { | |
565 #ifdef USE_VV | |
566 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); | |
567 return media->priv->sessions != NULL ? | |
568 g_hash_table_get_keys(media->priv->sessions) : NULL; | |
569 #else | |
570 return NULL; | |
571 #endif | |
572 } | |
573 | |
574 #ifdef USE_GSTREAMER | |
575 GstElement * | |
576 purple_media_get_src(PurpleMedia *media, const gchar *sess_id) | |
577 { | |
578 #ifdef USE_VV | |
579 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); | |
29583
eadb9e309b87
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
maiku@pidgin.im
parents:
29582
diff
changeset
|
580 |
eadb9e309b87
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
maiku@pidgin.im
parents:
29582
diff
changeset
|
581 if (PURPLE_IS_MEDIA_BACKEND_FS2(media->priv->backend)) |
eadb9e309b87
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
maiku@pidgin.im
parents:
29582
diff
changeset
|
582 return purple_media_backend_fs2_get_src( |
eadb9e309b87
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
maiku@pidgin.im
parents:
29582
diff
changeset
|
583 PURPLE_MEDIA_BACKEND_FS2( |
eadb9e309b87
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
maiku@pidgin.im
parents:
29582
diff
changeset
|
584 media->priv->backend), sess_id); |
eadb9e309b87
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
maiku@pidgin.im
parents:
29582
diff
changeset
|
585 |
eadb9e309b87
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
maiku@pidgin.im
parents:
29582
diff
changeset
|
586 g_return_val_if_reached(NULL); |
29534 | 587 #else |
588 return NULL; | |
589 #endif | |
590 } | |
591 #endif /* USE_GSTREAMER */ | |
592 | |
593 PurpleAccount * | |
594 purple_media_get_account(PurpleMedia *media) | |
595 { | |
596 #ifdef USE_VV | |
597 PurpleAccount *account; | |
598 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); | |
599 g_object_get(G_OBJECT(media), "account", &account, NULL); | |
600 return account; | |
601 #else | |
602 return NULL; | |
603 #endif | |
604 } | |
605 | |
606 gpointer | |
607 purple_media_get_prpl_data(PurpleMedia *media) | |
608 { | |
609 #ifdef USE_VV | |
610 gpointer prpl_data; | |
611 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); | |
612 g_object_get(G_OBJECT(media), "prpl-data", &prpl_data, NULL); | |
613 return prpl_data; | |
614 #else | |
615 return NULL; | |
616 #endif | |
617 } | |
618 | |
619 void | |
620 purple_media_set_prpl_data(PurpleMedia *media, gpointer prpl_data) | |
621 { | |
622 #ifdef USE_VV | |
623 g_return_if_fail(PURPLE_IS_MEDIA(media)); | |
624 g_object_set(G_OBJECT(media), "prpl-data", prpl_data, NULL); | |
625 #endif | |
626 } | |
627 | |
628 void | |
629 purple_media_error(PurpleMedia *media, const gchar *error, ...) | |
630 { | |
631 #ifdef USE_VV | |
632 va_list args; | |
633 gchar *message; | |
634 | |
635 g_return_if_fail(PURPLE_IS_MEDIA(media)); | |
636 | |
637 va_start(args, error); | |
638 message = g_strdup_vprintf(error, args); | |
639 va_end(args); | |
640 | |
641 purple_debug_error("media", "%s\n", message); | |
642 g_signal_emit(media, purple_media_signals[S_ERROR], 0, message); | |
643 | |
644 g_free(message); | |
645 #endif | |
646 } | |
647 | |
648 void | |
649 purple_media_end(PurpleMedia *media, | |
650 const gchar *session_id, const gchar *participant) | |
651 { | |
652 #ifdef USE_VV | |
653 g_return_if_fail(PURPLE_IS_MEDIA(media)); | |
654 if (session_id == NULL && participant == NULL) { | |
655 g_signal_emit(media, purple_media_signals[STATE_CHANGED], | |
656 0, PURPLE_MEDIA_STATE_END, | |
657 NULL, NULL); | |
658 g_object_unref(media); | |
659 } | |
660 #endif | |
661 } | |
662 | |
663 void | |
664 purple_media_stream_info(PurpleMedia *media, PurpleMediaInfoType type, | |
665 const gchar *session_id, const gchar *participant, | |
666 gboolean local) | |
667 { | |
668 #ifdef USE_VV | |
669 g_return_if_fail(PURPLE_IS_MEDIA(media)); | |
670 | |
671 if (type == PURPLE_MEDIA_INFO_ACCEPT) { | |
672 GList *streams; | |
673 | |
674 g_return_if_fail(PURPLE_IS_MEDIA(media)); | |
675 | |
676 streams = purple_media_get_streams(media, | |
677 session_id, participant); | |
678 | |
679 for (; streams; streams = | |
680 g_list_delete_link(streams, streams)) { | |
681 PurpleMediaStream *stream = streams->data; | |
29576
a27e41f373db
Handle part of accepting a stream in the Fs2 media backend.
maiku@pidgin.im
parents:
29575
diff
changeset
|
682 |
29534 | 683 stream->accepted = TRUE; |
684 } | |
685 } | |
686 | |
687 g_signal_emit(media, purple_media_signals[STREAM_INFO], | |
688 0, type, session_id, participant, local); | |
689 | |
690 if (type == PURPLE_MEDIA_INFO_HANGUP || | |
691 type == PURPLE_MEDIA_INFO_REJECT) { | |
692 purple_media_end(media, session_id, participant); | |
693 } | |
694 #endif | |
695 } | |
696 | |
697 #ifdef USE_VV | |
698 static void | |
29554
2460e6774e08
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
maiku@pidgin.im
parents:
29553
diff
changeset
|
699 purple_media_new_local_candidate_cb(PurpleMediaBackend *backend, |
2460e6774e08
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
maiku@pidgin.im
parents:
29553
diff
changeset
|
700 const gchar *sess_id, const gchar *participant, |
2460e6774e08
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
maiku@pidgin.im
parents:
29553
diff
changeset
|
701 PurpleMediaCandidate *candidate, PurpleMedia *media) |
29534 | 702 { |
29554
2460e6774e08
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
maiku@pidgin.im
parents:
29553
diff
changeset
|
703 PurpleMediaSession *session = |
2460e6774e08
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
maiku@pidgin.im
parents:
29553
diff
changeset
|
704 purple_media_get_session(media, sess_id); |
29534 | 705 |
29554
2460e6774e08
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
maiku@pidgin.im
parents:
29553
diff
changeset
|
706 purple_media_insert_local_candidate(session, participant, |
29559
cb843608e183
Store local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29557
diff
changeset
|
707 purple_media_candidate_copy(candidate)); |
29534 | 708 |
709 g_signal_emit(session->media, purple_media_signals[NEW_CANDIDATE], | |
29554
2460e6774e08
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
maiku@pidgin.im
parents:
29553
diff
changeset
|
710 0, session->id, participant, candidate); |
29534 | 711 } |
712 | |
713 static void | |
29557
1fdc75c94c22
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
maiku@pidgin.im
parents:
29556
diff
changeset
|
714 purple_media_candidates_prepared_cb(PurpleMediaBackend *backend, |
1fdc75c94c22
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
maiku@pidgin.im
parents:
29556
diff
changeset
|
715 const gchar *sess_id, const gchar *name, PurpleMedia *media) |
29534 | 716 { |
717 PurpleMediaStream *stream_data; | |
718 | |
29557
1fdc75c94c22
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
maiku@pidgin.im
parents:
29556
diff
changeset
|
719 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
29534 | 720 |
29557
1fdc75c94c22
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
maiku@pidgin.im
parents:
29556
diff
changeset
|
721 stream_data = purple_media_get_stream(media, sess_id, name); |
29534 | 722 stream_data->candidates_prepared = TRUE; |
723 | |
29557
1fdc75c94c22
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
maiku@pidgin.im
parents:
29556
diff
changeset
|
724 g_signal_emit(media, purple_media_signals[CANDIDATES_PREPARED], |
1fdc75c94c22
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
maiku@pidgin.im
parents:
29556
diff
changeset
|
725 0, sess_id, name); |
29534 | 726 } |
727 | |
728 /* callback called when a pair of transport candidates (local and remote) | |
729 * has been established */ | |
730 static void | |
29556
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
731 purple_media_candidate_pair_established_cb(PurpleMediaBackend *backend, |
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
732 const gchar *sess_id, const gchar *name, |
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
733 PurpleMediaCandidate *local_candidate, |
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
734 PurpleMediaCandidate *remote_candidate, |
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
735 PurpleMedia *media) |
29534 | 736 { |
737 PurpleMediaStream *stream; | |
738 GList *iter; | |
29556
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
739 guint id; |
29534 | 740 |
29556
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
741 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
29534 | 742 |
29556
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
743 stream = purple_media_get_stream(media, sess_id, name); |
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
744 id = purple_media_candidate_get_component_id(local_candidate); |
29534 | 745 |
746 iter = stream->active_local_candidates; | |
747 for(; iter; iter = g_list_next(iter)) { | |
29561
7713312c4ab0
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29560
diff
changeset
|
748 PurpleMediaCandidate *c = iter->data; |
7713312c4ab0
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29560
diff
changeset
|
749 if (id == purple_media_candidate_get_component_id(c)) { |
7713312c4ab0
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29560
diff
changeset
|
750 g_object_unref(c); |
29534 | 751 stream->active_local_candidates = |
752 g_list_delete_link(iter, iter); | |
753 stream->active_local_candidates = g_list_prepend( | |
754 stream->active_local_candidates, | |
29561
7713312c4ab0
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29560
diff
changeset
|
755 purple_media_candidate_copy( |
29556
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
756 local_candidate)); |
29534 | 757 break; |
758 } | |
759 } | |
760 if (iter == NULL) | |
761 stream->active_local_candidates = g_list_prepend( | |
762 stream->active_local_candidates, | |
29561
7713312c4ab0
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29560
diff
changeset
|
763 purple_media_candidate_copy( |
29556
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
764 local_candidate)); |
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
765 |
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
766 id = purple_media_candidate_get_component_id(local_candidate); |
29534 | 767 |
768 iter = stream->active_remote_candidates; | |
769 for(; iter; iter = g_list_next(iter)) { | |
29562
1156bf88b4d3
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29561
diff
changeset
|
770 PurpleMediaCandidate *c = iter->data; |
1156bf88b4d3
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29561
diff
changeset
|
771 if (id == purple_media_candidate_get_component_id(c)) { |
1156bf88b4d3
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29561
diff
changeset
|
772 g_object_unref(c); |
29534 | 773 stream->active_remote_candidates = |
774 g_list_delete_link(iter, iter); | |
775 stream->active_remote_candidates = g_list_prepend( | |
776 stream->active_remote_candidates, | |
29562
1156bf88b4d3
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29561
diff
changeset
|
777 purple_media_candidate_copy( |
29556
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
778 remote_candidate)); |
29534 | 779 break; |
780 } | |
781 } | |
782 if (iter == NULL) | |
783 stream->active_remote_candidates = g_list_prepend( | |
784 stream->active_remote_candidates, | |
29562
1156bf88b4d3
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29561
diff
changeset
|
785 purple_media_candidate_copy( |
29556
74e75fc3481e
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
maiku@pidgin.im
parents:
29555
diff
changeset
|
786 remote_candidate)); |
29534 | 787 |
788 purple_debug_info("media", "candidate pair established\n"); | |
789 } | |
790 | |
29555
cc978a1a4bd1
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
maiku@pidgin.im
parents:
29554
diff
changeset
|
791 static void |
cc978a1a4bd1
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
maiku@pidgin.im
parents:
29554
diff
changeset
|
792 purple_media_codecs_changed_cb(PurpleMediaBackend *backend, |
cc978a1a4bd1
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
maiku@pidgin.im
parents:
29554
diff
changeset
|
793 const gchar *sess_id, PurpleMedia *media) |
cc978a1a4bd1
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
maiku@pidgin.im
parents:
29554
diff
changeset
|
794 { |
cc978a1a4bd1
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
maiku@pidgin.im
parents:
29554
diff
changeset
|
795 g_signal_emit(media, purple_media_signals[CODECS_CHANGED], 0, sess_id); |
cc978a1a4bd1
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
maiku@pidgin.im
parents:
29554
diff
changeset
|
796 } |
29534 | 797 #endif /* USE_VV */ |
798 | |
799 gboolean | |
800 purple_media_add_stream(PurpleMedia *media, const gchar *sess_id, | |
801 const gchar *who, PurpleMediaSessionType type, | |
802 gboolean initiator, const gchar *transmitter, | |
803 guint num_params, GParameter *params) | |
804 { | |
805 #ifdef USE_VV | |
806 PurpleMediaSession *session; | |
807 PurpleMediaStream *stream = NULL; | |
808 | |
809 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); | |
810 | |
29549
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
811 if (!purple_media_backend_add_stream(media->priv->backend, |
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
812 sess_id, who, type, initiator, transmitter, |
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
813 num_params, params)) { |
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
814 purple_debug_error("media", "Error adding stream.\n"); |
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
815 return FALSE; |
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
816 } |
41ae97b7e97e
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
maiku@pidgin.im
parents:
29545
diff
changeset
|
817 |
29534 | 818 session = purple_media_get_session(media, sess_id); |
819 | |
820 if (!session) { | |
821 session = g_new0(PurpleMediaSession, 1); | |
822 session->id = g_strdup(sess_id); | |
823 session->media = media; | |
824 session->type = type; | |
825 session->initiator = initiator; | |
826 | |
827 purple_media_add_session(media, session); | |
828 g_signal_emit(media, purple_media_signals[STATE_CHANGED], | |
829 0, PURPLE_MEDIA_STATE_NEW, | |
830 session->id, NULL); | |
831 } | |
832 | |
29579
f65689100cfe
Move odd direction changing functionality to the Fs2 media backend.
maiku@pidgin.im
parents:
29578
diff
changeset
|
833 if (purple_media_get_stream(media, sess_id, who) == NULL) { |
29580 | 834 stream = purple_media_insert_stream(session, who, initiator); |
29534 | 835 |
836 g_signal_emit(media, purple_media_signals[STATE_CHANGED], | |
837 0, PURPLE_MEDIA_STATE_NEW, | |
838 session->id, who); | |
839 } | |
840 | |
841 return TRUE; | |
842 #else | |
843 return FALSE; | |
844 #endif /* USE_VV */ | |
845 } | |
846 | |
847 PurpleMediaManager * | |
848 purple_media_get_manager(PurpleMedia *media) | |
849 { | |
850 PurpleMediaManager *ret; | |
851 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); | |
852 g_object_get(media, "manager", &ret, NULL); | |
853 return ret; | |
854 } | |
855 | |
856 PurpleMediaSessionType | |
857 purple_media_get_session_type(PurpleMedia *media, const gchar *sess_id) | |
858 { | |
859 #ifdef USE_VV | |
860 PurpleMediaSession *session; | |
861 g_return_val_if_fail(PURPLE_IS_MEDIA(media), PURPLE_MEDIA_NONE); | |
862 session = purple_media_get_session(media, sess_id); | |
863 return session->type; | |
864 #else | |
865 return PURPLE_MEDIA_NONE; | |
866 #endif | |
867 } | |
868 /* XXX: Should wait until codecs-ready is TRUE before using this function */ | |
869 GList * | |
870 purple_media_get_codecs(PurpleMedia *media, const gchar *sess_id) | |
871 { | |
872 #ifdef USE_VV | |
873 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); | |
874 | |
29569
9c1810122f21
Transfer get_codecs functionality to the Fs2 media backend.
maiku@pidgin.im
parents:
29568
diff
changeset
|
875 return purple_media_backend_get_codecs(media->priv->backend, sess_id); |
29534 | 876 #else |
877 return NULL; | |
878 #endif | |
879 } | |
880 | |
881 GList * | |
882 purple_media_get_local_candidates(PurpleMedia *media, const gchar *sess_id, | |
883 const gchar *participant) | |
884 { | |
885 #ifdef USE_VV | |
886 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); | |
29571
f0966e90ec44
Move get_local_candidates functionality over to the Fs2 media backend.
maiku@pidgin.im
parents:
29569
diff
changeset
|
887 |
f0966e90ec44
Move get_local_candidates functionality over to the Fs2 media backend.
maiku@pidgin.im
parents:
29569
diff
changeset
|
888 return purple_media_backend_get_local_candidates(media->priv->backend, |
f0966e90ec44
Move get_local_candidates functionality over to the Fs2 media backend.
maiku@pidgin.im
parents:
29569
diff
changeset
|
889 sess_id, participant); |
29534 | 890 #else |
891 return NULL; | |
892 #endif | |
893 } | |
894 | |
895 void | |
896 purple_media_add_remote_candidates(PurpleMedia *media, const gchar *sess_id, | |
897 const gchar *participant, | |
898 GList *remote_candidates) | |
899 { | |
900 #ifdef USE_VV | |
901 PurpleMediaStream *stream; | |
902 | |
903 g_return_if_fail(PURPLE_IS_MEDIA(media)); | |
904 stream = purple_media_get_stream(media, sess_id, participant); | |
905 | |
906 if (stream == NULL) { | |
907 purple_debug_error("media", | |
908 "purple_media_add_remote_candidates: " | |
909 "couldn't find stream %s %s.\n", | |
910 sess_id ? sess_id : "(null)", | |
911 participant ? participant : "(null)"); | |
912 return; | |
913 } | |
914 | |
915 stream->remote_candidates = g_list_concat(stream->remote_candidates, | |
29560
18571ea6e44a
Store remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29559
diff
changeset
|
916 purple_media_candidate_list_copy(remote_candidates)); |
29534 | 917 |
29576
a27e41f373db
Handle part of accepting a stream in the Fs2 media backend.
maiku@pidgin.im
parents:
29575
diff
changeset
|
918 purple_media_backend_add_remote_candidates(media->priv->backend, |
a27e41f373db
Handle part of accepting a stream in the Fs2 media backend.
maiku@pidgin.im
parents:
29575
diff
changeset
|
919 sess_id, participant, remote_candidates); |
29534 | 920 #endif |
921 } | |
922 | |
923 #if 0 | |
924 /* | |
925 * These two functions aren't being used and I'd rather not lock in the API | |
926 * until they are needed. If they ever are. | |
927 */ | |
928 | |
929 GList * | |
930 purple_media_get_active_local_candidates(PurpleMedia *media, | |
931 const gchar *sess_id, const gchar *participant) | |
932 { | |
933 #ifdef USE_VV | |
934 PurpleMediaStream *stream; | |
935 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); | |
936 stream = purple_media_get_stream(media, sess_id, participant); | |
29561
7713312c4ab0
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29560
diff
changeset
|
937 return purple_media_candidate_list_copy( |
29534 | 938 stream->active_local_candidates); |
939 #else | |
940 return NULL; | |
941 #endif | |
942 } | |
943 | |
944 GList * | |
945 purple_media_get_active_remote_candidates(PurpleMedia *media, | |
946 const gchar *sess_id, const gchar *participant) | |
947 { | |
948 #ifdef USE_VV | |
949 PurpleMediaStream *stream; | |
950 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); | |
951 stream = purple_media_get_stream(media, sess_id, participant); | |
29562
1156bf88b4d3
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
maiku@pidgin.im
parents:
29561
diff
changeset
|
952 return purple_media_candidate_list_copy( |
29534 | 953 stream->active_remote_candidates); |
954 #else | |
955 return NULL; | |
956 #endif | |
957 } | |
958 #endif | |
959 | |
960 gboolean | |
961 purple_media_set_remote_codecs(PurpleMedia *media, const gchar *sess_id, | |
962 const gchar *participant, GList *codecs) | |
963 { | |
964 #ifdef USE_VV | |
965 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); | |
966 | |
29573
a39696686dd6
Move set_remote_codecs functionality to the Fs2 media backend.
maiku@pidgin.im
parents:
29571
diff
changeset
|
967 return purple_media_backend_set_remote_codecs(media->priv->backend, |
a39696686dd6
Move set_remote_codecs functionality to the Fs2 media backend.
maiku@pidgin.im
parents:
29571
diff
changeset
|
968 sess_id, participant, codecs); |
29534 | 969 #else |
970 return FALSE; | |
971 #endif | |
972 } | |
973 | |
974 gboolean | |
975 purple_media_candidates_prepared(PurpleMedia *media, | |
976 const gchar *session_id, const gchar *participant) | |
977 { | |
978 #ifdef USE_VV | |
979 GList *streams; | |
980 gboolean prepared = TRUE; | |
981 | |
982 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); | |
983 | |
984 streams = purple_media_get_streams(media, session_id, participant); | |
985 | |
986 for (; streams; streams = g_list_delete_link(streams, streams)) { | |
987 PurpleMediaStream *stream = streams->data; | |
988 if (stream->candidates_prepared == FALSE) { | |
989 g_list_free(streams); | |
990 prepared = FALSE; | |
991 break; | |
992 } | |
993 } | |
994 | |
995 return prepared; | |
996 #else | |
997 return FALSE; | |
998 #endif | |
999 } | |
1000 | |
1001 gboolean | |
1002 purple_media_set_send_codec(PurpleMedia *media, const gchar *sess_id, PurpleMediaCodec *codec) | |
1003 { | |
1004 #ifdef USE_VV | |
1005 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); | |
1006 | |
29575
ec5ed142f551
Move set_remote_codec functionality to the Fs2 media backend.
maiku@pidgin.im
parents:
29573
diff
changeset
|
1007 return purple_media_backend_set_send_codec( |
ec5ed142f551
Move set_remote_codec functionality to the Fs2 media backend.
maiku@pidgin.im
parents:
29573
diff
changeset
|
1008 media->priv->backend, sess_id, codec); |
29534 | 1009 #else |
1010 return FALSE; | |
1011 #endif | |
1012 } | |
1013 | |
1014 gboolean | |
1015 purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id) | |
1016 { | |
1017 #ifdef USE_VV | |
1018 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); | |
1019 | |
29581
f351e87b7af0
Add codecs_ready to the media backend interface.
maiku@pidgin.im
parents:
29580
diff
changeset
|
1020 return purple_media_backend_codecs_ready( |
f351e87b7af0
Add codecs_ready to the media backend interface.
maiku@pidgin.im
parents:
29580
diff
changeset
|
1021 media->priv->backend, sess_id); |
29534 | 1022 #else |
1023 return FALSE; | |
1024 #endif | |
1025 } | |
1026 | |
1027 gboolean | |
1028 purple_media_is_initiator(PurpleMedia *media, | |
1029 const gchar *sess_id, const gchar *participant) | |
1030 { | |
1031 #ifdef USE_VV | |
1032 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); | |
1033 | |
1034 if (sess_id == NULL && participant == NULL) | |
1035 return media->priv->initiator; | |
1036 else if (sess_id != NULL && participant == NULL) { | |
1037 PurpleMediaSession *session = | |
1038 purple_media_get_session(media, sess_id); | |
1039 return session != NULL ? session->initiator : FALSE; | |
1040 } else if (sess_id != NULL && participant != NULL) { | |
1041 PurpleMediaStream *stream = purple_media_get_stream( | |
1042 media, sess_id, participant); | |
1043 return stream != NULL ? stream->initiator : FALSE; | |
1044 } | |
1045 #endif | |
1046 return FALSE; | |
1047 } | |
1048 | |
1049 gboolean | |
1050 purple_media_accepted(PurpleMedia *media, const gchar *sess_id, | |
1051 const gchar *participant) | |
1052 { | |
1053 #ifdef USE_VV | |
1054 gboolean accepted = TRUE; | |
1055 | |
1056 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); | |
1057 | |
1058 if (sess_id == NULL && participant == NULL) { | |
1059 GList *streams = media->priv->streams; | |
1060 | |
1061 for (; streams; streams = g_list_next(streams)) { | |
1062 PurpleMediaStream *stream = streams->data; | |
1063 if (stream->accepted == FALSE) { | |
1064 accepted = FALSE; | |
1065 break; | |
1066 } | |
1067 } | |
1068 } else if (sess_id != NULL && participant == NULL) { | |
1069 GList *streams = purple_media_get_streams( | |
1070 media, sess_id, NULL); | |
1071 for (; streams; streams = | |
1072 g_list_delete_link(streams, streams)) { | |
1073 PurpleMediaStream *stream = streams->data; | |
1074 if (stream->accepted == FALSE) { | |
1075 g_list_free(streams); | |
1076 accepted = FALSE; | |
1077 break; | |
1078 } | |
1079 } | |
1080 } else if (sess_id != NULL && participant != NULL) { | |
1081 PurpleMediaStream *stream = purple_media_get_stream( | |
1082 media, sess_id, participant); | |
1083 if (stream == NULL || stream->accepted == FALSE) | |
1084 accepted = FALSE; | |
1085 } | |
1086 | |
1087 return accepted; | |
1088 #else | |
1089 return FALSE; | |
1090 #endif | |
1091 } | |
1092 | |
1093 void purple_media_set_input_volume(PurpleMedia *media, | |
1094 const gchar *session_id, double level) | |
1095 { | |
1096 #ifdef USE_VV | |
1097 g_return_if_fail(PURPLE_IS_MEDIA(media)); | |
29585
95f918df7f09
Move volume setting functionality to the Fs2 media backend.
maiku@pidgin.im
parents:
29584
diff
changeset
|
1098 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(media->priv->backend)); |
29534 | 1099 |
29585
95f918df7f09
Move volume setting functionality to the Fs2 media backend.
maiku@pidgin.im
parents:
29584
diff
changeset
|
1100 purple_media_backend_fs2_set_input_volume( |
95f918df7f09
Move volume setting functionality to the Fs2 media backend.
maiku@pidgin.im
parents:
29584
diff
changeset
|
1101 PURPLE_MEDIA_BACKEND_FS2( |
95f918df7f09
Move volume setting functionality to the Fs2 media backend.
maiku@pidgin.im
parents:
29584
diff
changeset
|
1102 media->priv->backend), |
95f918df7f09
Move volume setting functionality to the Fs2 media backend.
maiku@pidgin.im
parents:
29584
diff
changeset
|
1103 session_id, level); |
29534 | 1104 #endif |
1105 } | |
1106 | |
1107 void purple_media_set_output_volume(PurpleMedia *media, | |
1108 const gchar *session_id, const gchar *participant, | |
1109 double level) | |
1110 { | |
1111 #ifdef USE_VV | |
1112 g_return_if_fail(PURPLE_IS_MEDIA(media)); | |
29585
95f918df7f09
Move volume setting functionality to the Fs2 media backend.
maiku@pidgin.im
parents:
29584
diff
changeset
|
1113 g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(media->priv->backend)); |
29534 | 1114 |
29585
95f918df7f09
Move volume setting functionality to the Fs2 media backend.
maiku@pidgin.im
parents:
29584
diff
changeset
|
1115 purple_media_backend_fs2_set_output_volume( |
95f918df7f09
Move volume setting functionality to the Fs2 media backend.
maiku@pidgin.im
parents:
29584
diff
changeset
|
1116 PURPLE_MEDIA_BACKEND_FS2( |
95f918df7f09
Move volume setting functionality to the Fs2 media backend.
maiku@pidgin.im
parents:
29584
diff
changeset
|
1117 media->priv->backend), |
95f918df7f09
Move volume setting functionality to the Fs2 media backend.
maiku@pidgin.im
parents:
29584
diff
changeset
|
1118 session_id, participant, level); |
29534 | 1119 #endif |
1120 } | |
1121 | |
1122 gulong | |
1123 purple_media_set_output_window(PurpleMedia *media, const gchar *session_id, | |
1124 const gchar *participant, gulong window_id) | |
1125 { | |
1126 #ifdef USE_VV | |
1127 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); | |
1128 | |
1129 return purple_media_manager_set_output_window(media->priv->manager, | |
1130 media, session_id, participant, window_id); | |
1131 #else | |
1132 return 0; | |
1133 #endif | |
1134 } | |
1135 | |
1136 void | |
1137 purple_media_remove_output_windows(PurpleMedia *media) | |
1138 { | |
1139 #ifdef USE_VV | |
1140 GList *iter = media->priv->streams; | |
1141 for (; iter; iter = g_list_next(iter)) { | |
1142 PurpleMediaStream *stream = iter->data; | |
1143 purple_media_manager_remove_output_windows( | |
1144 media->priv->manager, media, | |
1145 stream->session->id, stream->participant); | |
1146 } | |
1147 | |
1148 iter = purple_media_get_session_ids(media); | |
1149 for (; iter; iter = g_list_delete_link(iter, iter)) { | |
1150 gchar *session_name = iter->data; | |
1151 purple_media_manager_remove_output_windows( | |
1152 media->priv->manager, media, | |
1153 session_name, NULL); | |
1154 } | |
1155 #endif | |
1156 } | |
1157 | |
1158 #ifdef USE_GSTREAMER | |
1159 GstElement * | |
1160 purple_media_get_tee(PurpleMedia *media, | |
1161 const gchar *session_id, const gchar *participant) | |
1162 { | |
1163 #ifdef USE_VV | |
1164 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); | |
1165 | |
29583
eadb9e309b87
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
maiku@pidgin.im
parents:
29582
diff
changeset
|
1166 if (PURPLE_IS_MEDIA_BACKEND_FS2(media->priv->backend)) |
eadb9e309b87
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
maiku@pidgin.im
parents:
29582
diff
changeset
|
1167 return purple_media_backend_fs2_get_tee( |
eadb9e309b87
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
maiku@pidgin.im
parents:
29582
diff
changeset
|
1168 PURPLE_MEDIA_BACKEND_FS2( |
eadb9e309b87
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
maiku@pidgin.im
parents:
29582
diff
changeset
|
1169 media->priv->backend), |
29534 | 1170 session_id, participant); |
1171 g_return_val_if_reached(NULL); | |
1172 #else | |
1173 return NULL; | |
1174 #endif | |
1175 } | |
1176 #endif /* USE_GSTREAMER */ | |
1177 |