[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] linphone add video command

From: 渭春 汪
Subject: [Linphone-developers] linphone add video command
Date: Fri, 29 Jan 2010 14:09:36 +0800 (CST)

Because project need, i must modify linphone for video . 

i use linphone-3.1.0 in Fedora8.
 1) use linphone-console. 
    when use linphonec -C ,will report segment error. i don't knowe why?
 2) because project need. i modify linphone, add video command
     video enable  -- enable video features globally.(= -V)
     video display -- enable video display only (=-D)
     video disable -- close video window.
 3) modify three file: commands.c linphonec.h linphonec.c
    commands.c --modify
        1. add: static int lpc_cmd_video(LinphoneCore *, char *);
        2. and in  LPC_COMMAND commands[] add codes : 
  LPC_COMMAND commands[] = {
    {"video", lpc_cmd_video,"Video display:",
                 "'video' \t: print video mod\n"
                 "'video enable' \t:print video enable\n"
                 "'video disable'\t:print vodeo mode is disable\n"
                 "'video display'\t:print enable video display only\n"
        3. lpc_cmd_video 
 static int lpc_cmd_video(LinphoneCore *lc,char *args)
  if(linphonec_get_video()) { 
   linphonec_out("Video is enabled. Use 'Video disable' to disable ");
  }else {
   linphonec_out("Video is disable.Use 'Video enable or video display' to 
  return 1;
  linphonec_out("Video is enable\n");
 else if (strstr(args,"disable")) 
  linphonec_out("Video is disable\n");
  else if (strstr(args,"display")) 
  linphonec_out("Video is enabled display only.\n");
 } else return 0;
 return 1; 
     linphonec.h --modify,add:
        void linphonec_set_video(bool_t enabled);
 void linphonec_set_video_display(bool_t enabled);
 void linphonec_set_video_disable(bool_t enabled);
 bool_t linphonec_get_video();
     linphonec.c --modify,add
 //wang-add: enable video features globally
 void linphonec_set_video(bool_t enabled){
  display_enabled = TRUE;
    vcap_enabled = TRUE;

 //wang-add:enable video display only
 void linphonec_set_video_display(bool_t enabled)
  display_enabled = TRUE;
    vcap_enabled = false;
 //wang-add: disable video 
 void linphonec_set_video_disable(bool_t enabled)
  display_enabled =FALSE;
    vcap_enabled = FALSE;
    preview_enabled = FALSE;
 bool_t linphonec_get_video(){
  return display_enabled;
  4) after compile. u can use command: video enable; video disable; video 
     > video enable
     > video disable
     > video display 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]