comparison libpurple/media/media.c @ 29167:7713312c4ab0

Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
author maiku@pidgin.im
date Mon, 26 Oct 2009 19:01:30 +0000
parents 18571ea6e44a
children 1156bf88b4d3
comparison
equal deleted inserted replaced
29166:18571ea6e44a 29167:7713312c4ab0
326 purple_media_candidate_list_free(stream->local_candidates); 326 purple_media_candidate_list_free(stream->local_candidates);
327 if (stream->remote_candidates) 327 if (stream->remote_candidates)
328 purple_media_candidate_list_free(stream->remote_candidates); 328 purple_media_candidate_list_free(stream->remote_candidates);
329 329
330 if (stream->active_local_candidates) 330 if (stream->active_local_candidates)
331 fs_candidate_list_destroy(stream->active_local_candidates); 331 purple_media_candidate_list_free(
332 stream->active_local_candidates);
332 if (stream->active_remote_candidates) 333 if (stream->active_remote_candidates)
333 fs_candidate_list_destroy(stream->active_remote_candidates); 334 fs_candidate_list_destroy(stream->active_remote_candidates);
334 335
335 g_free(stream); 336 g_free(stream);
336 } 337 }
1239 stream = purple_media_get_stream(media, sess_id, name); 1240 stream = purple_media_get_stream(media, sess_id, name);
1240 id = purple_media_candidate_get_component_id(local_candidate); 1241 id = purple_media_candidate_get_component_id(local_candidate);
1241 1242
1242 iter = stream->active_local_candidates; 1243 iter = stream->active_local_candidates;
1243 for(; iter; iter = g_list_next(iter)) { 1244 for(; iter; iter = g_list_next(iter)) {
1244 FsCandidate *c = iter->data; 1245 PurpleMediaCandidate *c = iter->data;
1245 if (id == c->component_id) { 1246 if (id == purple_media_candidate_get_component_id(c)) {
1246 fs_candidate_destroy(c); 1247 g_object_unref(c);
1247 stream->active_local_candidates = 1248 stream->active_local_candidates =
1248 g_list_delete_link(iter, iter); 1249 g_list_delete_link(iter, iter);
1249 stream->active_local_candidates = g_list_prepend( 1250 stream->active_local_candidates = g_list_prepend(
1250 stream->active_local_candidates, 1251 stream->active_local_candidates,
1251 purple_media_candidate_to_fs( 1252 purple_media_candidate_copy(
1252 local_candidate)); 1253 local_candidate));
1253 break; 1254 break;
1254 } 1255 }
1255 } 1256 }
1256 if (iter == NULL) 1257 if (iter == NULL)
1257 stream->active_local_candidates = g_list_prepend( 1258 stream->active_local_candidates = g_list_prepend(
1258 stream->active_local_candidates, 1259 stream->active_local_candidates,
1259 purple_media_candidate_to_fs( 1260 purple_media_candidate_copy(
1260 local_candidate)); 1261 local_candidate));
1261 1262
1262 id = purple_media_candidate_get_component_id(local_candidate); 1263 id = purple_media_candidate_get_component_id(local_candidate);
1263 1264
1264 iter = stream->active_remote_candidates; 1265 iter = stream->active_remote_candidates;
1715 { 1716 {
1716 #ifdef USE_VV 1717 #ifdef USE_VV
1717 PurpleMediaStream *stream; 1718 PurpleMediaStream *stream;
1718 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); 1719 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
1719 stream = purple_media_get_stream(media, sess_id, participant); 1720 stream = purple_media_get_stream(media, sess_id, participant);
1720 return purple_media_candidate_list_from_fs( 1721 return purple_media_candidate_list_copy(
1721 stream->active_local_candidates); 1722 stream->active_local_candidates);
1722 #else 1723 #else
1723 return NULL; 1724 return NULL;
1724 #endif 1725 #endif
1725 } 1726 }