Changeset 5102 for pjproject/trunk/pjsip/src/pjsua2/media.cpp
- Timestamp:
- May 28, 2015 7:14:24 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua2/media.cpp
r5045 r5102 1094 1094 #endif 1095 1095 } 1096 /////////////////////////////////////////////////////////////////////////////// 1097 1098 VideoPreviewOpParam::VideoPreviewOpParam() 1099 { 1100 #if PJSUA_HAS_VIDEO 1101 pjsua_vid_preview_param vid_prev_param; 1102 1103 pjsua_vid_preview_param_default(&vid_prev_param); 1104 fromPj(vid_prev_param); 1105 #endif 1106 } 1107 1108 void VideoPreviewOpParam::fromPj(const pjsua_vid_preview_param &prm) 1109 { 1110 #if PJSUA_HAS_VIDEO 1111 this->rendId = prm.rend_id; 1112 this->show = PJ2BOOL(prm.show); 1113 this->windowFlags = prm.wnd_flags; 1114 this->format.id = prm.format.id; 1115 this->format.type = prm.format.type; 1116 this->window.type = prm.wnd.type; 1117 this->window.handle.window = prm.wnd.info.window; 1118 #else 1119 PJ_UNUSED_ARG(prm); 1120 #endif 1121 } 1122 1123 pjsua_vid_preview_param VideoPreviewOpParam::toPj() const 1124 { 1125 pjsua_vid_preview_param param; 1126 #if PJSUA_HAS_VIDEO 1127 param.rend_id = this->rendId; 1128 param.show = this->show; 1129 param.wnd_flags = this->windowFlags; 1130 param.format.id = this->format.id; 1131 param.format.type = this->format.type; 1132 param.wnd.type = this->window.type; 1133 param.wnd.info.window = this->window.handle.window; 1134 #endif 1135 return param; 1136 } 1137 1138 VideoPreview::VideoPreview(int dev_id) 1139 : devId(dev_id) 1140 { 1141 1142 } 1143 1144 bool VideoPreview::hasNative() 1145 { 1146 #if PJSUA_HAS_VIDEO 1147 return(PJ2BOOL(pjsua_vid_preview_has_native(devId))); 1148 #else 1149 return false; 1150 #endif 1151 } 1152 1153 void VideoPreview::start(const VideoPreviewOpParam ¶m) throw(Error) 1154 { 1155 #if PJSUA_HAS_VIDEO 1156 pjsua_vid_preview_param prm = param.toPj(); 1157 PJSUA2_CHECK_EXPR(pjsua_vid_preview_start(devId, &prm)); 1158 #else 1159 PJ_UNUSED_ARG(param); 1160 #endif 1161 } 1162 1163 void VideoPreview::stop() throw(Error) 1164 { 1165 #if PJSUA_HAS_VIDEO 1166 pjsua_vid_preview_stop(devId); 1167 #endif 1168 } 1169 1170 VideoWindow VideoPreview::getVideoWindow() 1171 { 1172 #if PJSUA_HAS_VIDEO 1173 return (VideoWindow(pjsua_vid_preview_get_win(devId))); 1174 #else 1175 return (VideoWindow(PJSUA_INVALID_ID)); 1176 #endif 1177 } 1096 1178 1097 1179 ///////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.