void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMediaDescription *new_md){ SalMediaDescription *oldmd=call->resultdesc; if (lc->ringstream!=NULL){ ring_stop(lc->ringstream); lc->ringstream=NULL; } if (new_md!=NULL){ sal_media_description_ref(new_md); call->media_pending=FALSE; }else{ call->media_pending=TRUE; } call->resultdesc=new_md; if (call->audiostream && call->audiostream->ticker){ /* we already started media: check if we really need to restart it*/ if (oldmd){ if (!media_parameters_changed(call,oldmd,new_md) && !call->playing_ringbacktone){ sal_media_description_unref(oldmd); if (call->all_muted){ ms_message("Early media finished, unmuting inputs..."); /*we were in early media, now we want to enable real media */ linphone_call_enable_camera (call,linphone_call_camera_enabled (call)); if (call->audiostream) linphone_core_mute_mic (lc, linphone_core_is_mic_muted(lc)); #ifdef VIDEO_ENABLED if (call->videostream && call->camera_active) video_stream_change_camera(call->videostream,lc->video_conf.device ); #endif } ms_message("No need to restart streams, SDP is unchanged."); return; }else{ ms_message("Media descriptions are different, need to restart the streams."); } } linphone_call_stop_media_streams (call); linphone_call_init_media_streams (call); } if (oldmd) sal_media_description_unref(oldmd); if (new_md) { bool_t all_muted=FALSE; bool_t send_ringbacktone=FALSE; if (call->audiostream==NULL){ /*this happens after pausing the call locally. The streams is destroyed and then we wait the 200Ok to recreate it*/ linphone_call_init_media_streams (call); } if (call->state==LinphoneCallIncomingEarlyMedia && linphone_core_get_remote_ringback_tone (lc)!=NULL){ send_ringbacktone=TRUE; } if (call->state==LinphoneCallIncomingEarlyMedia || (call->state==LinphoneCallOutgoingEarlyMedia && !call->params.real_early_media)){ all_muted=TRUE; } linphone_call_start_media_streams(call,all_muted,send_ringbacktone); } }
void conferenceframe::on_pushButton_mute_clicked() { linphone_core_mute_mic(linphone_qt_get_core(),!muted); muted = !muted; if(muted){ ui->pushButton_muteMe->setIcon(QIcon("icons:mic_muted.png")); }else{ ui->pushButton_muteMe->setIcon(QIcon("icons:mic_active.png")); } }
void linphone_gtk_mute_clicked(GtkButton *button) { int active=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(button),"active")); linphone_core_mute_mic(linphone_gtk_get_core(),!active); linphone_gtk_draw_mute_button(button,!active); }