]> sjero.net Git - linphone/commitdiff
Merge branch 'master' of git.savannah.nongnu.org:/srv/git/linphone
authorJehan Monnier <jehan.monnier@linphone.org>
Tue, 18 Jan 2011 11:36:24 +0000 (12:36 +0100)
committerJehan Monnier <jehan.monnier@linphone.org>
Tue, 18 Jan 2011 11:36:24 +0000 (12:36 +0100)
console/commands.c
console/linphonec.c
coreapi/linphonecall.c
coreapi/linphonecore.c
mediastreamer2

index bf18a0ac089d65930494761faee99c5279f23696..6d0d005f27e312e8d4c467de98b970656ea31988 100644 (file)
@@ -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 [<delay>] [<tail>] [<framesize>]' : 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);
index 8373f1f63326360ab53485fd5d0eb4b3880aaea3..d3bba84a6ced515d1b7de17831fd064db3dc1715 100644 (file)
@@ -34,6 +34,7 @@
 #endif /*_WIN32_WCE*/
 #include <limits.h>
 #include <ctype.h>
+#include <stdlib.h>
 
 #include <linphonecore.h>
 
@@ -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");
index 8210338aa863a60679131fac108d9e6f541288af..89e730a74f470c98b50725e6a7bf236a86092c48 100644 (file)
@@ -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);
                }
        }
                
index a9a326e6bbb48060aae82a49d1815c2a6a193d4c..1f6679999348b0de4c76a68b9c7fb299c7e83b31 100644 (file)
@@ -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;
 }
 
index 82220afa1b04a9ba380c720d5e2bf83347d7404b..e3fe3eb2896b03a41b82e0b864f4e56b0666a2e7 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 82220afa1b04a9ba380c720d5e2bf83347d7404b
+Subproject commit e3fe3eb2896b03a41b82e0b864f4e56b0666a2e7