comparison libpurple/media.c @ 32578:978dd52814c7

propagate from branch 'im.pidgin.pidgin' (head b64b40b3762950d0b8b4bff4f4bb8bddeefc24ac) to branch 'im.pidgin.cpw.qulogic.gtk3' (head 907442ea1932404e6753dbf649de9a5ea2406766)
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 09 May 2009 20:10:22 +0000
parents 8b7d1aed6d59
children 72bcdcb0629f
comparison
equal deleted inserted replaced
32577:a70f05468fb4 32578:978dd52814c7
1848 stream->local_candidates = g_list_append(stream->local_candidates, candidate); 1848 stream->local_candidates = g_list_append(stream->local_candidates, candidate);
1849 } 1849 }
1850 #endif 1850 #endif
1851 1851
1852 GList * 1852 GList *
1853 purple_media_get_session_names(PurpleMedia *media) 1853 purple_media_get_session_ids(PurpleMedia *media)
1854 { 1854 {
1855 #ifdef USE_VV 1855 #ifdef USE_VV
1856 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); 1856 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
1857 return media->priv->sessions != NULL ? 1857 return media->priv->sessions != NULL ?
1858 g_hash_table_get_keys(media->priv->sessions) : NULL; 1858 g_hash_table_get_keys(media->priv->sessions) : NULL;
2661 return NULL; 2661 return NULL;
2662 #endif 2662 #endif
2663 } 2663 }
2664 2664
2665 GList * 2665 GList *
2666 purple_media_get_local_candidates(PurpleMedia *media, const gchar *sess_id, const gchar *name) 2666 purple_media_get_local_candidates(PurpleMedia *media, const gchar *sess_id,
2667 const gchar *participant)
2667 { 2668 {
2668 #ifdef USE_VV 2669 #ifdef USE_VV
2669 PurpleMediaStream *stream; 2670 PurpleMediaStream *stream;
2670 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); 2671 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
2671 stream = purple_media_get_stream(media, sess_id, name); 2672 stream = purple_media_get_stream(media, sess_id, participant);
2672 return purple_media_candidate_list_from_fs(stream->local_candidates); 2673 return purple_media_candidate_list_from_fs(stream->local_candidates);
2673 #else 2674 #else
2674 return NULL; 2675 return NULL;
2675 #endif 2676 #endif
2676 } 2677 }
2677 2678
2678 void 2679 void
2679 purple_media_add_remote_candidates(PurpleMedia *media, const gchar *sess_id, 2680 purple_media_add_remote_candidates(PurpleMedia *media, const gchar *sess_id,
2680 const gchar *name, GList *remote_candidates) 2681 const gchar *participant,
2682 GList *remote_candidates)
2681 { 2683 {
2682 #ifdef USE_VV 2684 #ifdef USE_VV
2683 PurpleMediaStream *stream; 2685 PurpleMediaStream *stream;
2684 GError *err = NULL; 2686 GError *err = NULL;
2685 2687
2686 g_return_if_fail(PURPLE_IS_MEDIA(media)); 2688 g_return_if_fail(PURPLE_IS_MEDIA(media));
2687 stream = purple_media_get_stream(media, sess_id, name); 2689 stream = purple_media_get_stream(media, sess_id, participant);
2688 2690
2689 if (stream == NULL) { 2691 if (stream == NULL) {
2690 purple_debug_error("media", 2692 purple_debug_error("media",
2691 "purple_media_add_remote_candidates: " 2693 "purple_media_add_remote_candidates: "
2692 "couldn't find stream %s %s.\n", 2694 "couldn't find stream %s %s.\n",
2693 sess_id, name); 2695 sess_id, participant);
2694 return; 2696 return;
2695 } 2697 }
2696 2698
2697 stream->remote_candidates = g_list_concat(stream->remote_candidates, 2699 stream->remote_candidates = g_list_concat(stream->remote_candidates,
2698 purple_media_candidate_list_to_fs(remote_candidates)); 2700 purple_media_candidate_list_to_fs(remote_candidates));
2714 * until they are needed. If they ever are. 2716 * until they are needed. If they ever are.
2715 */ 2717 */
2716 2718
2717 GList * 2719 GList *
2718 purple_media_get_active_local_candidates(PurpleMedia *media, 2720 purple_media_get_active_local_candidates(PurpleMedia *media,
2719 const gchar *sess_id, const gchar *name) 2721 const gchar *sess_id, const gchar *participant)
2720 { 2722 {
2721 #ifdef USE_VV 2723 #ifdef USE_VV
2722 PurpleMediaStream *stream; 2724 PurpleMediaStream *stream;
2723 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); 2725 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
2724 stream = purple_media_get_stream(media, sess_id, name); 2726 stream = purple_media_get_stream(media, sess_id, participant);
2725 return purple_media_candidate_list_from_fs( 2727 return purple_media_candidate_list_from_fs(
2726 stream->active_local_candidates); 2728 stream->active_local_candidates);
2727 #else 2729 #else
2728 return NULL; 2730 return NULL;
2729 #endif 2731 #endif
2730 } 2732 }
2731 2733
2732 GList * 2734 GList *
2733 purple_media_get_active_remote_candidates(PurpleMedia *media, 2735 purple_media_get_active_remote_candidates(PurpleMedia *media,
2734 const gchar *sess_id, const gchar *name) 2736 const gchar *sess_id, const gchar *participant)
2735 { 2737 {
2736 #ifdef USE_VV 2738 #ifdef USE_VV
2737 PurpleMediaStream *stream; 2739 PurpleMediaStream *stream;
2738 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); 2740 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL);
2739 stream = purple_media_get_stream(media, sess_id, name); 2741 stream = purple_media_get_stream(media, sess_id, participant);
2740 return purple_media_candidate_list_from_fs( 2742 return purple_media_candidate_list_from_fs(
2741 stream->active_remote_candidates); 2743 stream->active_remote_candidates);
2742 #else 2744 #else
2743 return NULL; 2745 return NULL;
2744 #endif 2746 #endif
2745 } 2747 }
2746 #endif 2748 #endif
2747 2749
2748 gboolean 2750 gboolean
2749 purple_media_set_remote_codecs(PurpleMedia *media, const gchar *sess_id, const gchar *name, GList *codecs) 2751 purple_media_set_remote_codecs(PurpleMedia *media, const gchar *sess_id,
2752 const gchar *participant, GList *codecs)
2750 { 2753 {
2751 #ifdef USE_VV 2754 #ifdef USE_VV
2752 PurpleMediaStream *stream; 2755 PurpleMediaStream *stream;
2753 FsStream *fsstream; 2756 FsStream *fsstream;
2754 GList *fscodecs; 2757 GList *fscodecs;
2755 GError *err = NULL; 2758 GError *err = NULL;
2756 2759
2757 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); 2760 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE);
2758 stream = purple_media_get_stream(media, sess_id, name); 2761 stream = purple_media_get_stream(media, sess_id, participant);
2759 2762
2760 if (stream == NULL) 2763 if (stream == NULL)
2761 return FALSE; 2764 return FALSE;
2762 2765
2763 fsstream = stream->stream; 2766 fsstream = stream->stream;
3027 purple_media_manager_remove_output_windows( 3030 purple_media_manager_remove_output_windows(
3028 media->priv->manager, media, 3031 media->priv->manager, media,
3029 stream->session->id, stream->participant); 3032 stream->session->id, stream->participant);
3030 } 3033 }
3031 3034
3032 iter = purple_media_get_session_names(media); 3035 iter = purple_media_get_session_ids(media);
3033 for (; iter; iter = g_list_delete_link(iter, iter)) { 3036 for (; iter; iter = g_list_delete_link(iter, iter)) {
3034 gchar *session_name = iter->data; 3037 gchar *session_name = iter->data;
3035 purple_media_manager_remove_output_windows( 3038 purple_media_manager_remove_output_windows(
3036 media->priv->manager, media, 3039 media->priv->manager, media,
3037 session_name, NULL); 3040 session_name, NULL);