- Timestamp:
- Oct 26, 2011 9:01:53 AM (13 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia-videodev/videodev.h
r3787 r3864 112 112 113 113 /** 114 * Enumeration of window flags. 115 */ 116 typedef enum pjmedia_vid_dev_wnd_flag 117 { 118 /** 119 * Window with border. 120 */ 121 PJMEDIA_VID_DEV_WND_BORDER = 1, 122 123 /** 124 * Window can be resized. 125 */ 126 PJMEDIA_VID_DEV_WND_RESIZABLE = 2 127 128 } pjmedia_vid_dev_wnd_flag; 129 130 131 /** 114 132 * Device index constants. 115 133 */ … … 238 256 */ 239 257 PJMEDIA_VID_DEV_CAP_SWITCH = 256, 258 259 /** 260 * Support for setting the output video window's flags. 261 * The value of this capability is a bitmask combination of 262 * #pjmedia_vid_dev_wnd_flag. 263 */ 264 PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS = 512, 240 265 241 266 /** … … 422 447 pjmedia_orient orient; 423 448 449 /** 450 * Video window flags. This setting is optional, and will only be used 451 * if PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS is set in the flags. 452 */ 453 unsigned window_flags; 454 424 455 } pjmedia_vid_dev_param; 425 456 -
pjproject/trunk/pjmedia/src/pjmedia-videodev/sdl_dev.c
r3794 r3864 494 494 PJMEDIA_VID_DEV_CAP_OUTPUT_RESIZE; 495 495 ddi->info.caps |= PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW; 496 ddi->info.caps |= PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS; 496 497 497 498 for (j = 0; j < ddi->info.fmt_cnt; j++) { … … 700 701 701 702 if (!strm->window) { 702 Uint32 flags = /*SDL_WINDOW_RESIZABLE; */ SDL_WINDOW_BORDERLESS; 703 Uint32 flags = 0; 704 705 if (strm->param.flags & PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS) { 706 if (!(strm->param.window_flags & PJMEDIA_VID_DEV_WND_BORDER)) 707 flags |= SDL_WINDOW_BORDERLESS; 708 if (strm->param.window_flags & PJMEDIA_VID_DEV_WND_RESIZABLE) 709 flags |= SDL_WINDOW_RESIZABLE; 710 } else { 711 flags |= SDL_WINDOW_BORDERLESS; 712 } 703 713 704 714 if (!((strm->param.flags & PJMEDIA_VID_DEV_CAP_OUTPUT_HIDE) && … … 971 981 { 972 982 pi->flags |= PJMEDIA_VID_DEV_CAP_OUTPUT_HIDE; 983 } 984 if (sdl_stream_get_cap(s, PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS, 985 &pi->window_flags) == PJ_SUCCESS) 986 { 987 pi->flags |= PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS; 973 988 } 974 989 … … 1038 1053 } else if (cap == PJMEDIA_VID_DEV_CAP_OUTPUT_HIDE) { 1039 1054 Uint32 flag = SDL_GetWindowFlags(strm->window); 1040 *((pj_bool_t *)pval) = (flag | SDL_WINDOW_HIDDEN)? PJ_TRUE: PJ_FALSE; 1055 *((pj_bool_t *)pval) = (flag & SDL_WINDOW_HIDDEN)? PJ_TRUE: PJ_FALSE; 1056 return PJ_SUCCESS; 1057 } else if (cap == PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS) { 1058 Uint32 flag = SDL_GetWindowFlags(strm->window); 1059 unsigned *wnd_flags = (unsigned *)pval; 1060 if (!(flag & SDL_WINDOW_BORDERLESS)) 1061 *wnd_flags |= PJMEDIA_VID_DEV_WND_BORDER; 1062 if (flag & SDL_WINDOW_RESIZABLE) 1063 *wnd_flags |= PJMEDIA_VID_DEV_WND_RESIZABLE; 1041 1064 return PJ_SUCCESS; 1042 1065 } -
pjproject/trunk/pjmedia/src/pjmedia-videodev/videodev.c
r3792 r3864 47 47 DEFINE_CAP("preview", "Input preview"), 48 48 DEFINE_CAP("orientation", "Video orientation"), 49 DEFINE_CAP("switch", "Switch device") 49 DEFINE_CAP("switch", "Switch device"), 50 DEFINE_CAP("wndflags", "Window flags") 50 51 }; 51 52 … … 189 190 * to switch immediately). 190 191 */ 192 case PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS: 193 FIELD_INFO(window_flags); 194 break; 191 195 default: 192 196 return PJMEDIA_EVID_INVCAP; -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r3863 r3864 3867 3867 acc_cfg->vid_in_auto_show = app_config.vid.in_auto_show; 3868 3868 acc_cfg->vid_out_auto_transmit = app_config.vid.out_auto_transmit; 3869 /* Note that normally GUI application will prefer a borderless 3870 * window. 3871 */ 3872 acc_cfg->vid_wnd_flags = PJMEDIA_VID_DEV_WND_BORDER | 3873 PJMEDIA_VID_DEV_WND_RESIZABLE; 3869 3874 acc_cfg->vid_cap_dev = app_config.vid.vcapture_dev; 3870 3875 acc_cfg->vid_rend_dev = app_config.vid.vrender_dev; … … 4022 4027 int dev_id = atoi(argv[4]); 4023 4028 if (on) { 4024 pjsua_vid_preview_start(dev_id, NULL); 4029 pjsua_vid_preview_param param; 4030 4031 pjsua_vid_preview_param_default(¶m); 4032 param.wnd_flags = PJMEDIA_VID_DEV_WND_BORDER | 4033 PJMEDIA_VID_DEV_WND_RESIZABLE; 4034 pjsua_vid_preview_start(dev_id, ¶m); 4025 4035 arrange_window(pjsua_vid_preview_get_win(dev_id)); 4026 4036 } else { -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r3850 r3864 2747 2747 2748 2748 /** 2749 * Specify video window's flags. The value is a bitmask combination of 2750 * #pjmedia_vid_dev_wnd_flag. 2751 * 2752 * Default: 0 2753 */ 2754 unsigned vid_wnd_flags; 2755 2756 /** 2749 2757 * Specify the default capture device to be used by this account. If 2750 2758 * \a vid_out_auto_transmit is enabled, this device will be used for … … 5739 5747 pj_bool_t show; 5740 5748 5749 /** 5750 * Window flags. The value is a bitmask combination of 5751 * #pjmedia_vid_dev_wnd_flag. 5752 * 5753 * Default: 0. 5754 */ 5755 unsigned wnd_flags; 5756 5741 5757 } pjsua_vid_preview_param; 5742 5758 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r3850 r3864 1065 1065 acc->cfg.vid_in_auto_show = cfg->vid_in_auto_show; 1066 1066 acc->cfg.vid_out_auto_transmit = cfg->vid_out_auto_transmit; 1067 acc->cfg.vid_wnd_flags = cfg->vid_wnd_flags; 1067 1068 acc->cfg.vid_cap_dev = cfg->vid_cap_dev; 1068 1069 acc->cfg.vid_rend_dev = cfg->vid_rend_dev; -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c
r3799 r3864 389 389 pjmedia_vid_dev_index cap_id, 390 390 pj_bool_t show, 391 unsigned wnd_flags, 391 392 pjsua_vid_win_id *id) 392 393 { … … 433 434 &hide); 434 435 436 pjmedia_vid_dev_stream_set_cap( 437 strm, PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS, 438 &wnd_flags); 439 435 440 /* Done */ 436 441 *id = wid; … … 483 488 vp_param.vidparam.flags |= PJMEDIA_VID_DEV_CAP_OUTPUT_HIDE; 484 489 vp_param.vidparam.window_hide = !show; 490 vp_param.vidparam.flags |= PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS; 491 vp_param.vidparam.window_flags = wnd_flags; 485 492 } 486 493 … … 544 551 vp_param.vidparam.flags |= PJMEDIA_VID_DEV_CAP_OUTPUT_HIDE; 545 552 vp_param.vidparam.window_hide = !show; 553 vp_param.vidparam.flags |= PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS; 554 vp_param.vidparam.window_flags = wnd_flags; 546 555 547 556 status = pjmedia_vid_port_create(w->pool, &vp_param, &w->vp_rend); … … 787 796 PJSUA_INVALID_ID, 788 797 acc->cfg.vid_in_auto_show, 798 acc->cfg.vid_wnd_flags, 789 799 &wid); 790 800 if (status != PJ_SUCCESS) { … … 826 836 if (si->dir & PJMEDIA_DIR_ENCODING && !call->local_hold) 827 837 { 838 pjsua_acc *acc = &pjsua_var.acc[call_med->call->acc_id]; 828 839 pjsua_vid_win *w; 829 840 pjsua_vid_win_id wid; … … 856 867 //acc->cfg.vid_cap_dev, 857 868 PJSUA_HIDE_WINDOW, 869 acc->cfg.vid_wnd_flags, 858 870 &wid); 859 871 if (status != PJ_SUCCESS) { … … 1071 1083 1072 1084 status = create_vid_win(PJSUA_WND_TYPE_PREVIEW, NULL, rend_id, id, 1073 prm->show, &wid);1085 prm->show, prm->wnd_flags, &wid); 1074 1086 if (status != PJ_SUCCESS) { 1075 1087 PJSUA_UNLOCK(); … … 1848 1860 new_wid = vid_preview_get_win(cap_dev, PJ_FALSE); 1849 1861 if (new_wid == PJSUA_INVALID_ID) { 1862 pjsua_acc *acc = &pjsua_var.acc[call_med->call->acc_id]; 1863 1850 1864 /* Create preview video window */ 1851 1865 status = create_vid_win(PJSUA_WND_TYPE_PREVIEW, … … 1854 1868 cap_dev, 1855 1869 PJSUA_HIDE_WINDOW, 1856 &new_wid); 1870 acc->cfg.vid_wnd_flags, 1871 &new_wid); 1857 1872 if (status != PJ_SUCCESS) 1858 1873 goto on_error;
Note: See TracChangeset
for help on using the changeset viewer.