}
#endif
+
void linphone_call_init_media_streams(LinphoneCall *call){
LinphoneCore *lc=call->core;
SalMediaDescription *md=call->localdesc;
}
if (st->volsend){
ms_filter_call_method(st->volsend,MS_VOLUME_REMOVE_DC,&dc_removal);
- }
- if (linphone_core_echo_limiter_enabled(lc)){
float speed=lp_config_get_float(lc->config,"sound","el_speed",-1);
thres=lp_config_get_float(lc->config,"sound","el_thres",-1);
float force=lp_config_get_float(lc->config,"sound","el_force",-1);
int sustain=lp_config_get_int(lc->config,"sound","el_sustain",-1);
float transmit_thres=lp_config_get_float(lc->config,"sound","el_transmit_thres",-1);
MSFilter *f=NULL;
- if (st->el_type!=ELInactive){
- f=st->volsend;
- if (speed==-1) speed=0.03;
- if (force==-1) force=25;
- ms_filter_call_method(f,MS_VOLUME_SET_EA_SPEED,&speed);
- ms_filter_call_method(f,MS_VOLUME_SET_EA_FORCE,&force);
- if (thres!=-1)
- ms_filter_call_method(f,MS_VOLUME_SET_EA_THRESHOLD,&thres);
- if (sustain!=-1)
- ms_filter_call_method(f,MS_VOLUME_SET_EA_SUSTAIN,&sustain);
- if (transmit_thres!=-1)
+ f=st->volsend;
+ if (speed==-1) speed=0.03;
+ if (force==-1) force=25;
+ ms_filter_call_method(f,MS_VOLUME_SET_EA_SPEED,&speed);
+ ms_filter_call_method(f,MS_VOLUME_SET_EA_FORCE,&force);
+ if (thres!=-1)
+ ms_filter_call_method(f,MS_VOLUME_SET_EA_THRESHOLD,&thres);
+ if (sustain!=-1)
+ ms_filter_call_method(f,MS_VOLUME_SET_EA_SUSTAIN,&sustain);
+ if (transmit_thres!=-1)
ms_filter_call_method(f,MS_VOLUME_SET_EA_TRANSMIT_THRESHOLD,&transmit_thres);
- }
- }
-
- if (st->volsend){
+
ms_filter_call_method(st->volsend,MS_VOLUME_SET_NOISE_GATE_THRESHOLD,&ng_thres);
ms_filter_call_method(st->volsend,MS_VOLUME_SET_NOISE_GATE_FLOORGAIN,&ng_floorgain);
}
sal_call_send_vfu_request(call->op);
}
#endif
+
+void linphone_call_enable_echo_cancellation(LinphoneCall *call, bool_t enable) {
+ if (call!=NULL && call->audiostream!=NULL && call->audiostream->ec){
+ bool_t bypass_mode = !enable;
+ ms_filter_call_method(call->audiostream->ec,MS_ECHO_CANCELLER_SET_BYPASS_MODE,&bypass_mode);
+ }
+}
+bool_t linphone_call_echo_cancellation_enabled(LinphoneCall *call) {
+ if (call!=NULL && call->audiostream!=NULL && call->audiostream->ec){
+ bool_t val;
+ ms_filter_call_method(call->audiostream->ec,MS_ECHO_CANCELLER_GET_BYPASS_MODE,&val);
+ return !val;
+ } else {
+ return linphone_core_echo_cancellation_enabled(call->core);
+ }
+}
+
+void linphone_call_enable_echo_limiter(LinphoneCall *call, bool_t val){
+ if (call!=NULL && call->audiostream!=NULL ) {
+ if (val) {
+ const char *type=lp_config_get_string(call->core->config,"sound","el_type","mic");
+ if (strcasecmp(type,"mic")==0)
+ audio_stream_enable_echo_limiter(call->audiostream,ELControlMic);
+ else if (strcasecmp(type,"full")==0)
+ audio_stream_enable_echo_limiter(call->audiostream,ELControlFull);
+ } else {
+ audio_stream_enable_echo_limiter(call->audiostream,ELInactive);
+ }
+ }
+}
+
+bool_t linphone_call_echo_limiter_enabled(const LinphoneCall *call){
+ if (call!=NULL && call->audiostream!=NULL ){
+ return call->audiostream->el_type !=ELInactive ;
+ } else {
+ return linphone_core_echo_limiter_enabled(call->core);
+ }
+}
+
const char *linphone_call_get_remote_user_agent(LinphoneCall *call);
void *linphone_call_get_user_pointer(LinphoneCall *call);
void linphone_call_set_user_pointer(LinphoneCall *call, void *user_pointer);
-
-
+/**
+ * Enables or disable echo cancellation for this call
+ * @param call
+ * @param val
+ *
+ * @ingroup media_parameters
+**/
+void linphone_call_enable_echo_cancellation(LinphoneCall *call, bool_t val) ;
+/**
+ * Returns TRUE if echo cancellation is enabled.
+ *
+ * @ingroup media_parameters
+**/
+bool_t linphone_call_echo_cancellation_enabled(LinphoneCall *lc);
+/**
+ * Enables or disable echo limiter for this call
+ * @param call
+ * @param val
+ *
+ * @ingroup media_parameters
+**/
+void linphone_call_enable_echo_limiter(LinphoneCall *call, bool_t val);
+/**
+ * Returns TRUE if echo limiter is enabled.
+ *
+ * @ingroup media_parameters
+**/
+bool_t linphone_call_echo_limiter_enabled(const LinphoneCall *call);
/**
* @addtogroup proxies
* @{
return ((LinphoneCallLog*)ptr)->dir==LinphoneCallIncoming?JNI_TRUE:JNI_FALSE;
}
+/*payloadType*/
extern "C" jstring Java_org_linphone_core_PayloadTypeImpl_toString(JNIEnv* env,jobject thiz,jlong ptr) {
PayloadType* pt = (PayloadType*)ptr;
char* value = ms_strdup_printf("[%s] clock [%i], bitrate [%i]"
,jlong ptr) {
return (jint)linphone_call_get_state((LinphoneCall*)ptr);
}
+extern "C" void Java_org_linphone_core_LinphoneCallImpl_enableEchoCancellation( JNIEnv* env
+ ,jobject thiz
+ ,jlong ptr
+ ,jboolean value) {
+ linphone_call_enable_echo_cancellation((LinphoneCall*)ptr,value);
+}
+extern "C" jboolean Java_org_linphone_core_LinphoneCallImpl_isEchoCancellationEnabled( JNIEnv* env
+ ,jobject thiz
+ ,jlong ptr) {
+ return linphone_call_echo_cancellation_enabled((LinphoneCall*)ptr);
+}
+
+extern "C" void Java_org_linphone_core_LinphoneCallImpl_enableEchoLimiter( JNIEnv* env
+ ,jobject thiz
+ ,jlong ptr
+ ,jboolean value) {
+ linphone_call_enable_echo_limiter((LinphoneCall*)ptr,value);
+}
+extern "C" jboolean Java_org_linphone_core_LinphoneCallImpl_isEchoLimiterEnabled( JNIEnv* env
+ ,jobject thiz
+ ,jlong ptr) {
+ return linphone_call_echo_limiter_enabled((LinphoneCall*)ptr);
+}
+
//LinphoneFriend
extern "C" long Java_org_linphone_core_LinphoneFriendImpl_newLinphoneFriend(JNIEnv* env
import java.util.Vector;
/**
- * Object representing a Call. calls are created using {@link LinphoneCore#invite(LinphoneAddress)} or paased to the application by listener {@link LinphoneCoreListener#callState(LinphoneCore, LinphoneCall, State, String)}
+ * Object representing a Call. calls are created using {@link LinphoneCore#invite(LinphoneAddress)} or passed to the application by listener {@link LinphoneCoreListener#callState(LinphoneCore, LinphoneCall, State, String)}
*
*/
@SuppressWarnings("unchecked")
public LinphoneCallParams getCurrentParamsCopy();
public void enableCamera(boolean enabled);
+ /**
+ * Enables or disable echo cancellation.
+ * @param enable
+ */
+ public void enableEchoCancellation(boolean enable);
+ /**
+ * get EC status
+ * @return true if echo cancellation is enabled.
+ */
+ public boolean isEchoCancellationEnabled();
+ /**
+ * Enables or disable echo limiter cancellation.
+ * @param enable
+ */
+ public void enableEchoLimiter(boolean enable);
+ /**
+ * get EL status
+ * @return true if echo limiter is enabled.
+ */
+ public boolean isEchoLimiterEnabled();
}