- Timestamp:
- Jul 15, 2011 7:41:02 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/2.0-dev/pjsip-apps/src/pjsua/pjsua_app.c
r3652 r3657 3324 3324 puts("| |"); 3325 3325 puts("| vid help Show this help screen |"); 3326 puts("| vid call rx on|off Enable/disable incoming video for current call|");3327 puts("| vid call tx on|off Enable/disable video tx for current call|");3326 puts("| vid call rx on|off N Enable/disable video rx for stream N in curr call |"); 3327 puts("| vid call tx on|off N Enable/disable video tx for stream N in curr call |"); 3328 3328 puts("| vid call add Add video stream for current call |"); 3329 puts("| vid call enable/disable N Enable/disable stream #N for current call|");3330 puts("| vid call set-cap N ID Set capture dev ID for stream #N for current call|");3329 puts("| vid call enable/disable N Enable/disable stream #N in current call |"); 3330 puts("| vid call set-cap N ID Set capture dev ID for stream #N in current call |"); 3331 3331 puts("| vid dev list List all video devices |"); 3332 3332 puts("| vid dev refresh Refresh video device list |"); … … 3769 3769 pjsua_call_vid_strm_op_param param; 3770 3770 3771 if (argc == 4 && strcmp(argv[2], "rx")==0) { 3771 if (argc == 5 && strcmp(argv[2], "rx")==0) { 3772 pjsua_stream_info si; 3772 3773 pj_bool_t on = (strcmp(argv[3], "on") == 0); 3773 PJ_TODO(vid_enable_disable_video_RX_on_call); 3774 PJ_LOG(1,(THIS_FILE, "Not implemented")); 3774 3775 param.med_idx = atoi(argv[4]); 3776 if (pjsua_call_get_stream_info(current_call, param.med_idx, &si) || 3777 si.type != PJMEDIA_TYPE_VIDEO) 3778 { 3779 PJ_PERROR(1,(THIS_FILE, PJ_EINVAL, "Invalid stream")); 3780 return; 3781 } 3782 3783 if (on) param.dir = (si.info.vid.dir | PJMEDIA_DIR_DECODING); 3784 else param.dir = (si.info.vid.dir & PJMEDIA_DIR_ENCODING); 3785 3786 pjsua_call_set_vid_strm(current_call, PJSUA_CALL_VID_STRM_CHANGE_DIR, ¶m); 3775 3787 } 3776 else if (argc == 4&& strcmp(argv[2], "tx")==0) {3788 else if (argc == 5 && strcmp(argv[2], "tx")==0) { 3777 3789 pj_bool_t on = (strcmp(argv[3], "on") == 0); 3778 3790 pjsua_call_vid_strm_op op = on? PJSUA_CALL_VID_STRM_START_TRANSMIT : 3779 3791 PJSUA_CALL_VID_STRM_STOP_TRANSMIT; 3780 pjsua_call_set_vid_strm(current_call, op, NULL); 3792 3793 param.med_idx = atoi(argv[4]); 3794 3795 pjsua_call_set_vid_strm(current_call, op, ¶m); 3781 3796 } 3782 3797 else if (argc == 3 && strcmp(argv[2], "add")==0) { 3783 3798 pjsua_call_set_vid_strm(current_call, PJSUA_CALL_VID_STRM_ADD, NULL); 3784 3799 } 3785 else if (argc == 4&&3800 else if (argc >= 3 && 3786 3801 (strcmp(argv[2], "disable")==0 || strcmp(argv[2], "enable")==0)) 3787 3802 { 3788 3803 pj_bool_t enable = (strcmp(argv[2], "enable") == 0); 3789 pjsua_call_vid_strm_op op = enable? PJSUA_CALL_VID_STRM_ENABLE : 3790 PJSUA_CALL_VID_STRM_DISABLE; 3804 pjsua_call_vid_strm_op op = enable? PJSUA_CALL_VID_STRM_CHANGE_DIR : 3805 PJSUA_CALL_VID_STRM_REMOVE; 3806 3791 3807 param.med_idx = argc >= 4? atoi(argv[3]) : -1; 3808 param.dir = PJMEDIA_DIR_ENCODING_DECODING; 3792 3809 pjsua_call_set_vid_strm(current_call, op, ¶m); 3793 3810 } 3794 else if (argc == 5&& strcmp(argv[2], "set-cap")==0) {3811 else if (argc >= 3 && strcmp(argv[2], "set-cap")==0) { 3795 3812 param.med_idx = argc >= 4? atoi(argv[3]) : -1; 3796 3813 param.cap_dev = argc >= 5? atoi(argv[4]) : PJMEDIA_VID_DEFAULT_CAPTURE_DEV; … … 3798 3815 } else 3799 3816 goto on_error; 3800 } else if ( strcmp(argv[1], "dev")==0) {3817 } else if (argc >= 3 && strcmp(argv[1], "dev")==0) { 3801 3818 if (strcmp(argv[2], "list")==0) { 3802 3819 vid_list_devs();
Note: See TracChangeset
for help on using the changeset viewer.