comparison libpurple/media/media.c @ 29562:1156bf88b4d3

Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
author maiku@pidgin.im
date Mon, 26 Oct 2009 19:11:29 +0000
parents 7713312c4ab0
children eef5ec04a5bf
comparison
equal deleted inserted replaced
29561:7713312c4ab0 29562:1156bf88b4d3
329 329
330 if (stream->active_local_candidates) 330 if (stream->active_local_candidates)
331 purple_media_candidate_list_free( 331 purple_media_candidate_list_free(
332 stream->active_local_candidates); 332 stream->active_local_candidates);
333 if (stream->active_remote_candidates) 333 if (stream->active_remote_candidates)
334 fs_candidate_list_destroy(stream->active_remote_candidates); 334 purple_media_candidate_list_free(
335 stream->active_remote_candidates);
335 336
336 g_free(stream); 337 g_free(stream);
337 } 338 }
338 339
339 static void 340 static void
1262 1263
1263 id = purple_media_candidate_get_component_id(local_candidate); 1264 id = purple_media_candidate_get_component_id(local_candidate);
1264 1265
1265 iter = stream->active_remote_candidates; 1266 iter = stream->active_remote_candidates;
1266 for(; iter; iter = g_list_next(iter)) { 1267 for(; iter; iter = g_list_next(iter)) {
1267 FsCandidate *c = iter->data; 1268 PurpleMediaCandidate *c = iter->data;
1268 if (id == c->component_id) { 1269 if (id == purple_media_candidate_get_component_id(c)) {
1269 fs_candidate_destroy(c); 1270 g_object_unref(c);
1270 stream->active_remote_candidates = 1271 stream->active_remote_candidates =
1271 g_list_delete_link(iter, iter); 1272 g_list_delete_link(iter, iter);
1272 stream->active_remote_candidates = g_list_prepend( 1273 stream->active_remote_candidates = g_list_prepend(
1273 stream->active_remote_candidates, 1274 stream->active_remote_candidates,
1274 purple_media_candidate_to_fs( 1275 purple_media_candidate_copy(
1275 remote_candidate)); 1276 remote_candidate));
1276 break; 1277 break;
1277 } 1278 }
1278 } 1279 }
1279 if (iter == NULL) 1280 if (iter == NULL)
1280 stream->active_remote_candidates = g_list_prepend( 1281 stream->active_remote_candidates = g_list_prepend(
1281 stream->active_remote_candidates, 1282 stream->active_remote_candidates,
1282 purple_media_candidate_to_fs( 1283 purple_media_candidate_copy(
1283 remote_candidate)); 1284 remote_candidate));
1284 1285
1285 purple_debug_info("media", "candidate pair established\n"); 1286 purple_debug_info("media", "candidate pair established\n");
1286 } 1287 }
1287 1288
1731 { 1732 {
1732 #ifdef USE_VV 1733 #ifdef USE_VV
1733 PurpleMediaStream *stream; 1734 PurpleMediaStream *stream;
1734 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); 1735 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
1735 stream = purple_media_get_stream(media, sess_id, participant); 1736 stream = purple_media_get_stream(media, sess_id, participant);
1736 return purple_media_candidate_list_from_fs( 1737 return purple_media_candidate_list_copy(
1737 stream->active_remote_candidates); 1738 stream->active_remote_candidates);
1738 #else 1739 #else
1739 return NULL; 1740 return NULL;
1740 #endif 1741 #endif
1741 } 1742 }