Commit 9139a6bd authored by Ghislain MARY's avatar Ghislain MARY

Deprecate linphone_core_is_mic_muted() and linphone_core_mute_mic().

Introduce linphone_core_enable_mic() and linphone_core_mic_enabled() to replace them.
parent 20829f37
......@@ -2031,7 +2031,7 @@ static int lpc_cmd_status(LinphoneCore *lc, char *args)
if (linphone_call_get_dir(call)==LinphoneCallOutgoing){
linphonec_out("Call out, hook=%s duration=%i, muted=%s rtp-xmit-muted=%s\n", linphonec_get_callee(),
linphone_core_get_current_call_duration(lc),
linphone_core_is_mic_muted (lc) ? "yes" : "no",
linphone_core_mic_enabled(lc) ? "no" : "yes",
linphone_core_is_rtp_muted(lc) ? "yes" : "no");
}else{
linphonec_out("hook=answered duration=%i %s\n" ,
......
......@@ -113,7 +113,7 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia
/*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));
linphone_core_enable_mic(lc, linphone_core_mic_enabled(lc));
#ifdef VIDEO_ENABLED
if (call->videostream && call->camera_active)
video_stream_change_camera(call->videostream,lc->video_conf.device );
......
......@@ -4276,11 +4276,6 @@ bool_t linphone_core_echo_limiter_enabled(const LinphoneCore *lc){
return lc->sound_conf.ea;
}
/**
* Mutes or unmutes the local microphone.
*
* @ingroup media_parameters
**/
void linphone_core_mute_mic(LinphoneCore *lc, bool_t val){
LinphoneCall *call=linphone_core_get_current_call(lc);
AudioStream *st=NULL;
......@@ -4303,9 +4298,7 @@ void linphone_core_mute_mic(LinphoneCore *lc, bool_t val){
}
}
/**
* Returns whether microphone is muted.
**/
bool_t linphone_core_is_mic_muted(LinphoneCore *lc) {
LinphoneCall *call=linphone_core_get_current_call(lc);
if (linphone_core_is_in_conference(lc)){
......@@ -4317,13 +4310,21 @@ bool_t linphone_core_is_mic_muted(LinphoneCore *lc) {
return call->audio_muted;
}
void linphone_core_enable_mic(LinphoneCore *lc, bool_t enable) {
linphone_core_mute_mic(lc, (enable == TRUE) ? FALSE : TRUE);
}
bool_t linphone_core_mic_enabled(LinphoneCore *lc) {
return (linphone_core_is_mic_muted(lc) == TRUE) ? FALSE : TRUE;
}
// returns rtp transmission status for an active stream
// if audio is muted and config parameter rtp_no_xmit_on_audio_mute
// was set on then rtp transmission is also muted
bool_t linphone_core_is_rtp_muted(LinphoneCore *lc){
LinphoneCall *call=linphone_core_get_current_call(lc);
if (call==NULL){
ms_warning("linphone_core_is_mic_muted(): No current call !");
ms_warning("linphone_core_is_rtp_muted(): No current call !");
return FALSE;
}
if( linphone_core_get_rtp_no_xmit_on_audio_mute(lc)){
......
......@@ -1651,14 +1651,33 @@ LINPHONE_PUBLIC bool_t linphone_core_echo_limiter_enabled(const LinphoneCore *lc
void linphone_core_enable_agc(LinphoneCore *lc, bool_t val);
bool_t linphone_core_agc_enabled(const LinphoneCore *lc);
/**
* @deprecated Use #linphone_core_enable_mic instead.
**/
LINPHONE_PUBLIC void linphone_core_mute_mic(LinphoneCore *lc, bool_t muted);
/**
* return mic state.
*
* @ingroup media_parameters
* Get mic state.
* @deprecated Use #linphone_core_is_mic_enabled instead
**/
LINPHONE_PUBLIC bool_t linphone_core_is_mic_muted(LinphoneCore *lc);
/**
* Enable or disable the microphone.
* @param[in] lc #LinphoneCore object
* @param[in] enable TRUE to enable the microphone, FALSE to disable it.
* @ingroup media_parameters
**/
LINPHONE_PUBLIC void linphone_core_enable_mic(LinphoneCore *lc, bool_t enable);
/**
* Tells whether the microphone is enabled.
* @param[in] lc #LinphoneCore object
* @returns TRUE if the microphone is enabled, FALSE if disabled.
* @ingroup media_parameters
**/
LINPHONE_PUBLIC bool_t linphone_core_mic_enabled(LinphoneCore *lc);
bool_t linphone_core_is_rtp_muted(LinphoneCore *lc);
bool_t linphone_core_get_rtp_no_xmit_on_audio_mute(const LinphoneCore *lc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment