Mercurial > pidgin
comparison libpurple/media.c @ 28400:2c4a3703324b
Actually emit the PURPLE_MEDIA_INFO_{,UN}HOLD signals.
author | maiku@pidgin.im |
---|---|
date | Mon, 19 Oct 2009 22:03:19 +0000 |
parents | e0519a0c9f46 |
children | 867438a30bdd 7819d3819f4c 093c79fa01c7 |
comparison
equal
deleted
inserted
replaced
28399:e0519a0c9f46 | 28400:2c4a3703324b |
---|---|
101 GList *remote_candidates; | 101 GList *remote_candidates; |
102 | 102 |
103 gboolean initiator; | 103 gboolean initiator; |
104 gboolean accepted; | 104 gboolean accepted; |
105 gboolean candidates_prepared; | 105 gboolean candidates_prepared; |
106 gboolean held; | |
107 gboolean paused; | |
106 | 108 |
107 GList *active_local_candidates; | 109 GList *active_local_candidates; |
108 GList *active_remote_candidates; | 110 GList *active_remote_candidates; |
109 | 111 |
110 guint connected_cb_id; | 112 guint connected_cb_id; |
2328 GList *streams = purple_media_get_streams(media, | 2330 GList *streams = purple_media_get_streams(media, |
2329 session_id, participant); | 2331 session_id, participant); |
2330 for (; streams; streams = g_list_delete_link(streams, streams)) { | 2332 for (; streams; streams = g_list_delete_link(streams, streams)) { |
2331 PurpleMediaStream *stream = streams->data; | 2333 PurpleMediaStream *stream = streams->data; |
2332 if (stream->session->type & PURPLE_MEDIA_SEND_VIDEO) { | 2334 if (stream->session->type & PURPLE_MEDIA_SEND_VIDEO) { |
2335 stream->paused = active; | |
2336 | |
2337 if (!stream->held) | |
2338 g_object_set(stream->stream, "direction", | |
2339 purple_media_to_fs_stream_direction( | |
2340 stream->session->type & ((active) ? | |
2341 ~PURPLE_MEDIA_SEND_VIDEO : | |
2342 PURPLE_MEDIA_VIDEO)), NULL); | |
2343 } | |
2344 } | |
2345 } else if (local == TRUE && (type == PURPLE_MEDIA_INFO_HOLD || | |
2346 type == PURPLE_MEDIA_INFO_UNHOLD)) { | |
2347 GList *streams; | |
2348 gboolean active = (type == PURPLE_MEDIA_INFO_HOLD); | |
2349 | |
2350 g_return_if_fail(PURPLE_IS_MEDIA(media)); | |
2351 | |
2352 streams = purple_media_get_streams(media, | |
2353 session_id, participant); | |
2354 for (; streams; streams = g_list_delete_link(streams, streams)) { | |
2355 PurpleMediaStream *stream = streams->data; | |
2356 stream->held = active; | |
2357 if (stream->session->type & PURPLE_MEDIA_VIDEO) { | |
2358 FsStreamDirection direction; | |
2359 | |
2360 direction = ((active) ? | |
2361 ~PURPLE_MEDIA_VIDEO : | |
2362 PURPLE_MEDIA_VIDEO); | |
2363 if (!active && stream->paused) | |
2364 direction &= ~PURPLE_MEDIA_SEND_VIDEO; | |
2365 | |
2366 g_object_set(stream->stream, "direction", | |
2367 purple_media_to_fs_stream_direction( | |
2368 stream->session->type & direction), NULL); | |
2369 } else if (stream->session->type & PURPLE_MEDIA_AUDIO) { | |
2333 g_object_set(stream->stream, "direction", | 2370 g_object_set(stream->stream, "direction", |
2334 purple_media_to_fs_stream_direction( | 2371 purple_media_to_fs_stream_direction( |
2335 stream->session->type & ((active) ? | 2372 stream->session->type & ((active) ? |
2336 ~PURPLE_MEDIA_SEND_VIDEO : | 2373 ~PURPLE_MEDIA_AUDIO : |
2337 PURPLE_MEDIA_VIDEO)), NULL); | 2374 PURPLE_MEDIA_AUDIO)), NULL); |
2338 } | 2375 } |
2339 } | 2376 } |
2340 } | 2377 } |
2341 | 2378 |
2342 g_signal_emit(media, purple_media_signals[STREAM_INFO], | 2379 g_signal_emit(media, purple_media_signals[STREAM_INFO], |