From ba992227d5ec5521e4fb33a724067560fff24e65 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 14 Oct 2011 16:06:27 +0200 Subject: [PATCH 1/8] update ISO audio for IOS 5 --- m4/exosip.m4 | 15 ++++++++++++--- mediastreamer2 | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/m4/exosip.m4 b/m4/exosip.m4 index 2c21b129d..8e469969c 100644 --- a/m4/exosip.m4 +++ b/m4/exosip.m4 @@ -4,9 +4,18 @@ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([LP_CHECK_OSIP2]) -case $target_os in - *darwin*) - OSIP_LIBS="$OSIP_LIBS -framework CoreFoundation " +case $host_alias in + i386-apple*) + OSIP_LIBS="$OSIP_LIBS -framework CoreFoundation -framework CFNetwork" + ;; + armv6-apple*) + OSIP_LIBS="$OSIP_LIBS -framework CoreFoundation -framework CFNetwork" + ;; + armv7-apple*) + OSIP_LIBS="$OSIP_LIBS -framework CoreFoundation -framework CFNetwork" + ;; + x86_64-apple*) + OSIP_LIBS="$OSIP_LIBS -framework CoreFoundation" ;; esac diff --git a/mediastreamer2 b/mediastreamer2 index 3e62df330..4e245d3a0 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 3e62df330823c9efefaf314e894a6a7867f9ff76 +Subproject commit 4e245d3a00c55cc7120644adf5d97372224d2816 From e740628ab7cb69acae8751572506dfc840028607 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Fri, 14 Oct 2011 16:55:43 +0200 Subject: [PATCH 2/8] Update dependency. --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 4e245d3a0..3073a0ed6 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 4e245d3a00c55cc7120644adf5d97372224d2816 +Subproject commit 3073a0ed620856744e2718cc94868ed76c5e0a5c From 53600691960bb4c1e8d610ee17037327e2da7ea3 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 14 Oct 2011 17:36:44 +0200 Subject: [PATCH 3/8] Conference's pause/resume issue fixed --- coreapi/callbacks.c | 5 ++++- coreapi/linphonecall.c | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 2470606ab..550c98736 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -400,6 +400,8 @@ static void call_updating(SalOp *op){ if (md && !sal_media_description_empty(md)) { + linphone_core_update_streams (lc,call,md); + if (sal_media_description_has_dir(call->localdesc,SalStreamSendRecv)){ ms_message("Our local status is SalStreamSendRecv"); if (sal_media_description_has_dir (md,SalStreamRecvOnly) || sal_media_description_has_dir(md,SalStreamInactive)){ @@ -415,12 +417,13 @@ static void call_updating(SalOp *op){ lc->current_call=call; }else{ prevstate=call->state; + if(lc->vtable.display_status) + lc->vtable.display_status(lc,_("Call has been updated by remote...")); linphone_call_set_state(call, LinphoneCallUpdatedByRemote,"Call updated by remote"); } } /*accept the modification (sends a 200Ok)*/ sal_call_accept(op); - linphone_core_update_streams (lc,call,md); if (prevstate!=LinphoneCallIdle){ linphone_call_set_state (call,prevstate,"Connected (streams running)"); } diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 15b1aa723..cbe12af74 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -1083,7 +1083,7 @@ static void linphone_call_start_video_stream(LinphoneCall *call, const char *cna lc->previewstream=NULL; } call->current_params.has_video=FALSE; - if (vstream && vstream->dir!=SalStreamInactive && vstream->port!=0) { + if (vstream!=NULL && vstream->dir!=SalStreamInactive && vstream->port!=0) { 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){ @@ -1158,13 +1158,15 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut cname=linphone_address_as_string_uri_only(me); #if defined(VIDEO_ENABLED) - if (vstream && vstream->dir!=SalStreamInactive && vstream->payloads!=NULL){ + if (vstream!=NULL && vstream->dir!=SalStreamInactive && vstream->payloads!=NULL){ /*when video is used, do not make adaptive rate control on audio, it is stupid.*/ use_arc=FALSE; } #endif linphone_call_start_audio_stream(call,cname,all_inputs_muted,send_ringbacktone,use_arc); - if (call->videostream!=NULL) linphone_call_start_video_stream(call,cname,all_inputs_muted); + if (call->videostream!=NULL) { + linphone_call_start_video_stream(call,cname,all_inputs_muted); + } call->all_muted=all_inputs_muted; call->playing_ringbacktone=send_ringbacktone; From 67daaaa14d1d6ec4322f54c43a372fa51ee312de Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Mon, 17 Oct 2011 15:09:50 +0200 Subject: [PATCH 4/8] Take a reference on android camera preview. --- coreapi/linphonecore_jni.cc | 7 +++++++ mediastreamer2 | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index d351c77a8..e2dfd5db6 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1205,6 +1205,13 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPreviewWindowId(JNIEn ,jobject thiz ,jlong lc ,jobject obj) { + jobject oldWindow = (jobject) linphone_core_get_native_preview_window_id((LinphoneCore*)lc); + if (oldWindow != NULL) { + env->DeleteGlobalRef(oldWindow); + } + if (obj != NULL) { + obj = env->NewGlobalRef(obj); + } linphone_core_set_native_preview_window_id((LinphoneCore*)lc,(unsigned long)obj); } diff --git a/mediastreamer2 b/mediastreamer2 index 3073a0ed6..66355f56a 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 3073a0ed620856744e2718cc94868ed76c5e0a5c +Subproject commit 66355f56a793377d02d7a6e30604fbcd23378bd3 From 324551708e89dde781dc93a1eeae05532c8717f8 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Tue, 18 Oct 2011 15:41:04 +0200 Subject: [PATCH 5/8] Max calls limit (config, C, exposed to java) --- coreapi/linphonecore.c | 6 ++++++ coreapi/linphonecore.h | 2 ++ coreapi/linphonecore_jni.cc | 7 ++++++- coreapi/private.h | 1 + java/common/org/linphone/core/LinphoneCore.java | 3 +++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 3a21ae701..a85a4f622 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -973,6 +973,7 @@ void linphone_core_set_state(LinphoneCore *lc, LinphoneGlobalState gstate, const static void misc_config_read (LinphoneCore *lc) { LpConfig *config=lc->config; lc->max_call_logs=lp_config_get_int(config,"misc","history_max_size",15); + lc->max_calls=lp_config_get_int(config,"misc","max_calls",NB_MAX_CALLS); } static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vtable, const char *config_path, @@ -4300,6 +4301,11 @@ void linphone_core_stop_dtmf_stream(LinphoneCore* lc) { lc->ringstream=NULL; } +int linphone_core_get_max_calls(LinphoneCore *lc) { + return lc->max_calls; +} + + typedef struct Hook{ LinphoneCoreIterateHook fun; void *data; diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 65683870a..a85855def 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -1030,6 +1030,8 @@ float linphone_core_get_conference_local_input_volume(LinphoneCore *lc); int linphone_core_terminate_conference(LinphoneCore *lc); int linphone_core_get_conference_size(LinphoneCore *lc); +int linphone_core_get_max_calls(LinphoneCore *lc); + #ifdef __cplusplus } #endif diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index e2dfd5db6..8713e86d2 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1506,5 +1506,10 @@ extern "C" void msandroid_hack_speaker_state(bool speakerOn); extern "C" void Java_org_linphone_LinphoneManager_hackSpeakerState(JNIEnv* env,jobject thiz,jboolean speakerOn){ msandroid_hack_speaker_state(speakerOn); -// End Galaxy S hack functions +} +// End Galaxy S hack functions + + +extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getMaxCalls(JNIEnv *env,jobject thiz,jlong pCore) { + return (jint) linphone_core_get_max_calls((LinphoneCore *) pCore); } diff --git a/coreapi/private.h b/coreapi/private.h index d2b78942e..49c7c4016 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -467,6 +467,7 @@ struct _LinphoneCore bool_t use_preview_window; int device_rotation; bool_t ringstream_autorelease; + int max_calls; }; bool_t linphone_core_can_we_add_call(LinphoneCore *lc); diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index aef993ea0..88f1be6ff 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -621,4 +621,7 @@ public interface LinphoneCore { void transferCallToAnother(LinphoneCall callToTransfer, LinphoneCall destination); LinphoneCall findCallFromUri(String uri); + + int getMaxCalls(); + } From 7b3398d2ec99336d293877d328db97a09e028ae2 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 19 Oct 2011 10:55:44 +0200 Subject: [PATCH 6/8] implement and active adaptive rate control for audio & video. --- coreapi/linphonecall.c | 4 ++- coreapi/linphonecore.c | 2 +- gtk/parameters.ui | 76 +++++++++++++++++++++++++----------------- gtk/propertybox.c | 7 ++++ mediastreamer2 | 2 +- oRTP | 2 +- 6 files changed, 59 insertions(+), 34 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 15b1aa723..f4bc4f4d7 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -1092,7 +1092,9 @@ static void linphone_call_start_video_stream(LinphoneCall *call, const char *cna bool_t is_inactive=FALSE; call->current_params.has_video=TRUE; - + + video_stream_enable_adaptive_bitrate_control(call->videostream, + linphone_core_adaptive_rate_control_enabled(lc)); video_stream_set_sent_video_size(call->videostream,linphone_core_get_preferred_video_size(lc)); video_stream_enable_self_view(call->videostream,lc->video_conf.selfview); if (lc->video_window_id!=0) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 3a21ae701..8f3986a17 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -814,7 +814,7 @@ void linphone_core_enable_adaptive_rate_control(LinphoneCore *lc, bool_t enabled * See linphone_core_enable_adaptive_rate_control(). **/ bool_t linphone_core_adaptive_rate_control_enabled(const LinphoneCore *lc){ - return lp_config_get_int(lc->config,"net","adaptive_rate_control",FALSE); + return lp_config_get_int(lc->config,"net","adaptive_rate_control",TRUE); } bool_t linphone_core_rtcp_enabled(const LinphoneCore *lc){ diff --git a/gtk/parameters.ui b/gtk/parameters.ui index 9af426212..ce9373dae 100644 --- a/gtk/parameters.ui +++ b/gtk/parameters.ui @@ -1,7 +1,6 @@ - 500 3001 @@ -214,8 +213,6 @@ True False False - True - True adjustment1 @@ -334,8 +331,6 @@ True False False - True - True adjustment7 @@ -353,8 +348,6 @@ True False False - True - True adjustment2 @@ -374,8 +367,6 @@ True False False - True - True adjustment3 @@ -515,8 +506,6 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False False - True - True @@ -587,8 +576,6 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False False - True - True @@ -756,8 +743,6 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False False - True - True @@ -1108,8 +1093,6 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False False - True - True @@ -1148,8 +1131,6 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False False - True - True @@ -1167,8 +1148,6 @@ False False False - True - True 1 @@ -1220,13 +1199,14 @@ True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - automatic - automatic True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + @@ -1638,8 +1618,6 @@ virtual network ! True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - automatic - automatic out @@ -1647,6 +1625,9 @@ virtual network ! True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True + + + @@ -1843,7 +1824,7 @@ virtual network ! True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 2 + 3 2 @@ -1853,8 +1834,6 @@ virtual network ! 0 stands for "unlimited" False False - True - True adjustment5 @@ -1863,6 +1842,8 @@ virtual network ! 2 1 2 + GTK_FILL + @@ -1873,14 +1854,14 @@ virtual network ! 0 stands for "unlimited" False False - True - True adjustment6 1 2 + GTK_FILL + GTK_EXPAND @@ -1905,6 +1886,41 @@ virtual network ! right + + + Enable adaptive rate control + True + True + False + False + 0 + True + + + + 1 + 2 + 2 + 3 + GTK_FILL + + + + + + True + False + <i>Adaptive rate control is a technique to dynamically guess the available bandwidth during a call.</i> + True + True + + + 2 + 3 + GTK_FILL + + + diff --git a/gtk/propertybox.c b/gtk/propertybox.c index 193541029..78a8ca423 100644 --- a/gtk/propertybox.c +++ b/gtk/propertybox.c @@ -453,6 +453,11 @@ void linphone_gtk_upload_bw_changed(GtkWidget *w){ linphone_gtk_check_codec_bandwidth(v); } +void linphone_gtk_adaptive_rate_control_toggled(GtkToggleButton *button){ + gboolean active=gtk_toggle_button_get_active(button); + linphone_core_enable_adaptive_rate_control(linphone_gtk_get_core(),active); +} + static void linphone_gtk_codec_move(GtkWidget *button, int dir){ GtkTreeView *v=GTK_TREE_VIEW(linphone_gtk_get_widget(gtk_widget_get_toplevel(button),"codec_list")); GtkTreeSelection *sel=gtk_tree_view_get_selection(v); @@ -899,6 +904,8 @@ void linphone_gtk_show_parameters(void){ linphone_core_get_download_bandwidth(lc)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"upload_bw")), linphone_core_get_upload_bandwidth(lc)); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb,"adaptive_rate_control")), + linphone_core_adaptive_rate_control_enabled(lc)); /* UI CONFIG */ diff --git a/mediastreamer2 b/mediastreamer2 index 3e62df330..954911c0d 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 3e62df330823c9efefaf314e894a6a7867f9ff76 +Subproject commit 954911c0dbdf7351cd82df70d0999a84d163db7f diff --git a/oRTP b/oRTP index 0a878baa1..3256179b9 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 0a878baa150133e35acdfb7082ccc99a54be41fe +Subproject commit 3256179b911975ce7d3556f8e2c00b21881a84d2 From 8fcc886b1048d9f425056d430d2e8aab04c4d231 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Wed, 19 Oct 2011 17:05:01 +0200 Subject: [PATCH 7/8] Add options to linphonerc to activate speaker AGC --- coreapi/linphonecall.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 685b62ccb..410358e94 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -853,6 +853,7 @@ static void parametrize_equalizer(LinphoneCore *lc, AudioStream *st){ void _post_configure_audio_stream(AudioStream *st, LinphoneCore *lc, bool_t muted){ float mic_gain=lp_config_get_float(lc->config,"sound","mic_gain",1); + float spk_gain=lp_config_get_float(lc->config,"sound","speaker_gain",1); float thres = 0; float recv_gain; float ng_thres=lp_config_get_float(lc->config,"sound","ng_thres",0.05); @@ -868,6 +869,7 @@ void _post_configure_audio_stream(AudioStream *st, LinphoneCore *lc, bool_t mute if (recv_gain != 0) { linphone_core_set_playback_gain_db (lc,recv_gain); } + if (st->volsend){ ms_filter_call_method(st->volsend,MS_VOLUME_REMOVE_DC,&dc_removal); float speed=lp_config_get_float(lc->config,"sound","el_speed",-1); @@ -894,7 +896,10 @@ void _post_configure_audio_stream(AudioStream *st, LinphoneCore *lc, bool_t mute if (st->volrecv){ /* parameters for a limited noise-gate effect, using echo limiter threshold */ float floorgain = 1/mic_gain; - ms_filter_call_method(st->volrecv,MS_VOLUME_SET_NOISE_GATE_THRESHOLD,&thres); + int spk_agc=lp_config_get_int(lc->config,"sound","speaker_agc_enabled",0); + ms_filter_call_method(st->volrecv, MS_VOLUME_ENABLE_AGC, &spk_agc); + ms_filter_call_method(st->volrecv, MS_VOLUME_SET_GAIN, &spk_gain); + ms_filter_call_method(st->volrecv,MS_VOLUME_SET_NOISE_GATE_THRESHOLD,&ng_thres); ms_filter_call_method(st->volrecv,MS_VOLUME_SET_NOISE_GATE_FLOORGAIN,&floorgain); } parametrize_equalizer(lc,st); From 949b3cd84135d234abab27a023885ad977f715c9 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 19 Oct 2011 21:14:08 +0200 Subject: [PATCH 8/8] allow to force alsa sample rate --- coreapi/linphonecore.c | 2 ++ mediastreamer2 | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index a8596dec4..49a9aa9c2 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -383,6 +383,8 @@ static void sound_config_read(LinphoneCore *lc) MSSndCard *card=ms_alsa_card_new_custom(devid,devid); ms_snd_card_manager_add_card(ms_snd_card_manager_get(),card); } + tmp=lp_config_get_int(lc->config,"sound","alsa_forced_rate",-1); + ms_alsa_card_set_forced_sample_rate(tmp); #endif /* retrieve all sound devices */ build_sound_devices_table(lc); diff --git a/mediastreamer2 b/mediastreamer2 index 954911c0d..00dfc7dd6 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 954911c0dbdf7351cd82df70d0999a84d163db7f +Subproject commit 00dfc7dd6aab93dcc9b81527370842b38fc3987d