From 7fc7f0e0e2b2db73a0441f048812db6769cf2006 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 14 Jan 2011 12:53:12 +0100 Subject: [PATCH 1/3] update ms2 for new echo limiter features --- console/commands.c | 17 +++++++++++++++++ coreapi/linphonecall.c | 3 +++ mediastreamer2 | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/console/commands.c b/console/commands.c index bf18a0ac0..6d0d005f2 100644 --- a/console/commands.c +++ b/console/commands.c @@ -83,6 +83,7 @@ static int lpc_cmd_acodec(LinphoneCore *lc, char *args); static int lpc_cmd_vcodec(LinphoneCore *lc, char *args); static int lpc_cmd_codec(int type, LinphoneCore *lc, char *args); static int lpc_cmd_echocancellation(LinphoneCore *lc, char *args); +static int lpc_cmd_echolimiter(LinphoneCore *lc, char *args); static int lpc_cmd_pause(LinphoneCore *lc, char *args); static int lpc_cmd_resume(LinphoneCore *lc, char *args); static int lpc_cmd_mute_mic(LinphoneCore *lc, char *args); @@ -269,6 +270,10 @@ static LPC_COMMAND advanced_commands[] = { "'ec on [] [] []' : turn EC on with given delay, tail length and framesize\n" "'ec off' : turn echo cancellation (EC) off\n" "'ec show' : show EC status" }, + { "el", lpc_cmd_echolimiter, "Echo limiter", + "'el on turns on echo limiter (automatic half duplex, for cases where echo canceller cannot work)\n" + "'el off' : turn echo limiter off\n" + "'el show' : show echo limiter status" }, { "nortp-on-audio-mute", lpc_cmd_rtp_no_xmit_on_audio_mute, "Set the rtp_no_xmit_on_audio_mute configuration parameter", " If set to 1 then rtp transmission will be muted when\n" @@ -2210,6 +2215,18 @@ static int lpc_cmd_echocancellation(LinphoneCore *lc, char *args){ return 1; } +static int lpc_cmd_echolimiter(LinphoneCore *lc, char *args){ + if (args){ + if (strcmp(args,"on")==0){ + linphone_core_enable_echo_limiter (lc,TRUE); + }else if (strcmp(args,"off")==0){ + linphone_core_enable_echo_limiter (lc,FALSE); + } + } + linphonec_out("Echo limiter is now %s.\n",linphone_core_echo_limiter_enabled (lc) ? "on":"off"); + return 1; +} + static int lpc_cmd_mute_mic(LinphoneCore *lc, char *args) { linphone_core_mute_mic(lc, 1); diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 8210338aa..89e730a74 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -678,6 +678,7 @@ static void post_configure_audio_streams(LinphoneCall*call){ 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; @@ -689,6 +690,8 @@ static void post_configure_audio_streams(LinphoneCall*call){ 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); } } diff --git a/mediastreamer2 b/mediastreamer2 index 82220afa1..3bdc6245e 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 82220afa1b04a9ba380c720d5e2bf83347d7404b +Subproject commit 3bdc6245ee1577ae4b123e1a2ab0f56388f34b13 From 7ea80e07236b0f51c70721b05b80a2ea8fbb87b5 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 17 Jan 2011 15:17:08 +0100 Subject: [PATCH 2/3] merge patch about linphonec improvements, update ms2 --- console/linphonec.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/console/linphonec.c b/console/linphonec.c index 8373f1f63..d3bba84a6 100644 --- a/console/linphonec.c +++ b/console/linphonec.c @@ -34,6 +34,7 @@ #endif /*_WIN32_WCE*/ #include #include +#include #include @@ -162,6 +163,7 @@ static char *logfile_name = NULL; static char configfile_name[PATH_MAX]; static const char *factory_configfile_name=NULL; static char *sipAddr = NULL; /* for autocall */ +static int window_id = 0; /* 0=standalone window, or window id for embedding video */ #if !defined(_WIN32_WCE) static ortp_pipe_t client_sock=ORTP_PIPE_INVALID; #endif /*_WIN32_WCE*/ @@ -391,7 +393,7 @@ static void linphonec_text_received(LinphoneCore *lc, LinphoneChatRoom *cr, const LinphoneAddress *from, const char *msg) { - printf("%s: %s\n", linphone_address_as_string(from), msg); + linphonec_out("Message received from %s: %s\n", linphone_address_as_string(from), msg); // TODO: provide mechanism for answering.. ('say' command?) } @@ -716,6 +718,12 @@ linphonec_init(int argc, char **argv) */ linphonec=linphone_core_new (&linphonec_vtable, configfile_name, factory_configfile_name, NULL); linphone_core_enable_video(linphonec,vcap_enabled,display_enabled); + if (display_enabled && window_id != 0) + { + printf ("Setting window_id: 0x%x\n", window_id); + linphone_core_set_native_video_window_id(linphonec,window_id); + } + linphone_core_enable_video_preview(linphonec,preview_enabled); if (!(vcap_enabled || display_enabled)) printf("Warning: video is disabled in linphonec, use -V or -C or -D to enable.\n"); #ifdef HAVE_READLINE @@ -878,6 +886,7 @@ usage: linphonec [-c file] [-s sipaddr] [-a] [-V] [-d level ] [-l logfile]\n\ -C enable video capture only (disabled by default)\n\ -D enable video display only (disabled by default)\n\ -S show general state messages (disabled by default)\n\ + --wid windowid force embedding of video window into provided windowid (disabled by default)\n\ -v or --version display version and exits.\n"); exit(exit_status); @@ -1226,6 +1235,14 @@ linphonec_parse_cmdline(int argc, char **argv) { unix_socket=1; } + else if (strncmp ("--wid", argv[arg_num], 5) == 0) + { + arg_num++; + if (arg_num < argc) { + char *tmp; + window_id = strtol( argv[arg_num], &tmp, 0 ); + } + } else if (old_arg_num == arg_num) { fprintf (stderr, "ERROR: bad arguments\n"); From 01371818c22118533f5aa362730fe5715ea758ec Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 18 Jan 2011 10:18:53 +0100 Subject: [PATCH 3/3] update ms2 --- coreapi/linphonecore.c | 35 +++++++++++++++++++++++------------ mediastreamer2 | 2 +- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index a9a326e6b..1f6679999 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2162,23 +2162,34 @@ bool_t linphone_core_inc_invite_pending(LinphoneCore*lc){ } /** - * Updates a running call according to supplied call parameters. + * Updates a running call according to supplied call parameters or parameters changed in the LinphoneCore. * - * For the moment, this is limited to enabling or disabling the video stream. + * In this version this is limited to the following use cases: + * - setting up/down the video stream according to the video parameter of the LinphoneCallParams (see linphone_call_params_enable_video() ). + * - changing the size of the transmitted video after calling linphone_core_set_preferred_video_size() + * + * In case no changes are requested through the LinphoneCallParams argument, then this argument can be ommitted and set to NULL. * * @return 0 if successful, -1 otherwise. **/ int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params){ - int err; - if (call->localdesc) - sal_media_description_unref(call->localdesc); - call->params=*params; - call->localdesc=create_local_media_description (lc,call); - call->camera_active=params->has_video; - if (lc->vtable.display_status) - lc->vtable.display_status(lc,_("Modifying call parameters...")); - sal_call_set_local_media_description (call->op,call->localdesc); - err=sal_call_update(call->op); + int err=0; + if (params!=NULL){ + if (call->localdesc) + sal_media_description_unref(call->localdesc); + call->params=*params; + call->localdesc=create_local_media_description (lc,call); + call->camera_active=params->has_video; + if (lc->vtable.display_status) + lc->vtable.display_status(lc,_("Modifying call parameters...")); + sal_call_set_local_media_description (call->op,call->localdesc); + err=sal_call_update(call->op); + }else{ + if (call->videostream!=NULL){ + video_stream_set_sent_video_size(call->videostream,linphone_core_get_preferred_video_size(lc)); + video_stream_update_video_params (call->videostream); + } + } return err; } diff --git a/mediastreamer2 b/mediastreamer2 index 3bdc6245e..e3fe3eb28 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 3bdc6245ee1577ae4b123e1a2ab0f56388f34b13 +Subproject commit e3fe3eb2896b03a41b82e0b864f4e56b0666a2e7