From 903fc38a9128a0f05e658989ee354c517a7d62e6 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Mon, 13 Dec 2010 16:48:42 +0100 Subject: [PATCH 1/5] Merge --- .../java/org/linphone/core/tutorials/TutorialRegistration.java | 2 +- coreapi/linphonecore_jni.cc | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/coreapi/help/java/org/linphone/core/tutorials/TutorialRegistration.java b/coreapi/help/java/org/linphone/core/tutorials/TutorialRegistration.java index 49689ba32..9fbcb25c7 100644 --- a/coreapi/help/java/org/linphone/core/tutorials/TutorialRegistration.java +++ b/coreapi/help/java/org/linphone/core/tutorials/TutorialRegistration.java @@ -64,7 +64,7 @@ public class TutorialRegistration implements LinphoneCoreListener { * Registration state notification listener */ public void registrationState(LinphoneCore lc, LinphoneProxyConfig cfg,RegistrationState cstate, String smessage) { - write(cfg.getIdentity() + " : "+smessage+"\n"); + write(cfg.getIdentity() + " : "+smessage); } public void show(LinphoneCore lc) {} diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 64c5997d6..dc3969b8d 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -993,7 +993,6 @@ extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_sendMessage(JNIEnv* } -<<<<<<< HEAD extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoWindowId(JNIEnv* env ,jobject thiz ,jlong lc @@ -1084,7 +1083,7 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setDownloadBandwidth(JNI extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setUploadBandwidth(JNIEnv *env, jobject thiz, jlong lc, jint bw){ linphone_core_set_upload_bandwidth((LinphoneCore *)lc, (int) bw); - +} extern "C" int Java_org_linphone_core_LinphoneProxyConfigImpl_getState(JNIEnv* env,jobject thiz,jlong ptr) { return (int) linphone_proxy_config_get_state((const LinphoneProxyConfig *) ptr); } From de0d399e989d02f42bf70a5ebf7ab19f1762e902 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 13 Dec 2010 21:18:24 +0100 Subject: [PATCH 2/5] disable e-c on android when there is a video stream --- coreapi/linphonecall.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 7c06ecd3a..b0bc3f3a3 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -777,6 +777,10 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut const char *tool="linphone-" LINPHONE_VERSION; char *cname; int used_pt=-1; +#ifdef VIDEO_ENABLED + const SalStreamDescription *vstream=sal_media_description_find_stream(call->resultdesc, + SalProtoRtpAvp,SalVideo); +#endif if(call->audiostream == NULL) { @@ -800,6 +804,8 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut const char *playfile=lc->play_file; const char *recfile=lc->rec_file; call->audio_profile=make_profile(call,call->resultdesc,stream,&used_pt); + bool_t use_ec; + if (used_pt!=-1){ if (playcard==NULL) { ms_warning("No card defined for playback !"); @@ -827,6 +833,12 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut captcard=NULL; playcard=NULL; } + use_ec=captcard==NULL ? FALSE : linphone_core_echo_cancellation_enabled(lc); +#if defined(VIDEO_ENABLED) && defined(ANDROID) + /*On android we have to disable the echo canceller to preserve CPU for video codecs */ + if (vstream && vstream->dir!=SalStreamInactive && vstream->payloads!=NULL) + use_ec=FALSE; +#endif audio_stream_start_full( call->audiostream, call->audio_profile, @@ -839,7 +851,8 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut recfile, playcard, captcard, - captcard==NULL ? FALSE : linphone_core_echo_cancellation_enabled(lc)); + use_ec + ); post_configure_audio_streams(call); if (all_inputs_muted && !send_ringbacktone){ audio_stream_set_mic_gain(call->audiostream,0); @@ -853,8 +866,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut } #ifdef VIDEO_ENABLED { - const SalStreamDescription *stream=sal_media_description_find_stream(call->resultdesc, - SalProtoRtpAvp,SalVideo); + used_pt=-1; /* shutdown preview */ if (lc->previewstream!=NULL) { @@ -862,9 +874,9 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut lc->previewstream=NULL; } call->current_params.has_video=FALSE; - if (stream && stream->dir!=SalStreamInactive) { - const char *addr=stream->addr[0]!='\0' ? stream->addr : call->resultdesc->addr; - call->video_profile=make_profile(call,call->resultdesc,stream,&used_pt); + if (vstream && vstream->dir!=SalStreamInactive) { + const char *addr=vstream->addr[0]!='\0' ? vstream->addr : call->resultdesc->addr; + call->video_profile=make_profile(call,call->resultdesc,vstream,&used_pt); if (used_pt!=-1){ VideoStreamDir dir=VideoStreamSendRecv; MSWebCam *cam=lc->video_conf.device; @@ -880,12 +892,12 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut video_stream_set_native_preview_window_id (call->videostream,lc->preview_window_id); video_stream_use_preview_video_window (call->videostream,lc->use_preview_window); - if (stream->dir==SalStreamSendOnly && lc->video_conf.capture ){ + if (vstream->dir==SalStreamSendOnly && lc->video_conf.capture ){ cam=get_nowebcam_device(); dir=VideoStreamSendOnly; - }else if (stream->dir==SalStreamRecvOnly && lc->video_conf.display ){ + }else if (vstream->dir==SalStreamRecvOnly && lc->video_conf.display ){ dir=VideoStreamRecvOnly; - }else if (stream->dir==SalStreamSendRecv){ + }else if (vstream->dir==SalStreamSendRecv){ if (lc->video_conf.display && lc->video_conf.capture) dir=VideoStreamSendRecv; else if (lc->video_conf.display) @@ -903,8 +915,8 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut if (!is_inactive){ video_stream_set_direction (call->videostream, dir); video_stream_start(call->videostream, - call->video_profile, addr, stream->port, - stream->port+1, + call->video_profile, addr, vstream->port, + vstream->port+1, used_pt, jitt_comp, cam); video_stream_set_rtcp_information(call->videostream, cname,tool); } From a60b590c6f21a3b5858c7b3390389e24f2a7e37f Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 14 Dec 2010 12:35:25 +0100 Subject: [PATCH 3/5] update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index dbde0ad6f..3261a161d 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit dbde0ad6f4b7a21f99d1e0e5a5ddd9bf6cfe4692 +Subproject commit 3261a161dad5dc7f456f32dacbf37634c228c662 From 1534f84c60132dcf5c7126417afc0388c15aba2c Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 14 Dec 2010 12:53:26 +0100 Subject: [PATCH 4/5] allow declining within the state callback --- coreapi/callbacks.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index b67f7f812..bf60f4c0d 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -193,21 +193,26 @@ static void call_received(SalOp *h){ }else{ /*TODO : play a tone within the context of the current call */ } + + + linphone_call_ref(call); /*prevent the call from being destroyed while we are notifying, if the user declines within the state callback */ linphone_call_set_state(call,LinphoneCallIncomingReceived,"Incoming call"); - sal_call_notify_ringing(h,propose_early_media || ringback_tone!=NULL); + if (call->state==LinphoneCallIncomingReceived){ + sal_call_notify_ringing(h,propose_early_media || ringback_tone!=NULL); - if (propose_early_media || ringback_tone!=NULL){ - linphone_call_set_state(call,LinphoneCallIncomingEarlyMedia,"Incoming call early media"); - linphone_core_update_streams(lc,call,md); + if (propose_early_media || ringback_tone!=NULL){ + linphone_call_set_state(call,LinphoneCallIncomingEarlyMedia,"Incoming call early media"); + linphone_core_update_streams(lc,call,md); + } + if (sal_call_get_replaces(call->op)!=NULL && lp_config_get_int(lc->config,"sip","auto_answer_replacing_calls",1)){ + linphone_core_accept_call(lc,call); + } } + linphone_call_unref(call); + ms_free(barmesg); ms_free(tmp); - - - if (sal_call_get_replaces(call->op)!=NULL && lp_config_get_int(lc->config,"sip","auto_answer_replacing_calls",1)){ - linphone_core_accept_call(lc,call); - } } static void call_ringing(SalOp *h){ From 611e7ef23df38b1679916dc4c57b2d68f4f95332 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 15 Dec 2010 14:25:33 +0100 Subject: [PATCH 5/5] update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 3261a161d..983babc1e 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 3261a161dad5dc7f456f32dacbf37634c228c662 +Subproject commit 983babc1ee79425212486a9c0896e6acaf3fa5f8