]> sjero.net Git - linphone/commitdiff
merge patch about linphonec improvements, update ms2
authorSimon Morlat <simon.morlat@linphone.org>
Mon, 17 Jan 2011 14:17:08 +0000 (15:17 +0100)
committerSimon Morlat <simon.morlat@linphone.org>
Mon, 17 Jan 2011 14:17:08 +0000 (15:17 +0100)
console/linphonec.c

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");