Changeset 5139 for pjproject/trunk/pjsip/src/pjsua2/media.cpp
- Timestamp:
- Jul 30, 2015 1:42:51 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua2/media.cpp
r5138 r5139 1020 1020 { 1021 1021 VideoWindowInfo vwi; 1022 pj_bzero(&vwi, sizeof(vwi)); 1022 1023 #if PJSUA_HAS_VIDEO 1023 1024 pjsua_vid_win_info pj_vwi; … … 1123 1124 { 1124 1125 pjsua_vid_preview_param param; 1126 pj_bzero(¶m, sizeof(param)); 1125 1127 #if PJSUA_HAS_VIDEO 1126 1128 param.rend_id = this->rendId; … … 1198 1200 maxBps = format.det.vid.max_bps; 1199 1201 #else 1202 PJ_UNUSED_ARG(format); 1200 1203 type = PJMEDIA_TYPE_UNKNOWN; 1201 1204 #endif … … 1227 1230 { 1228 1231 #if PJSUA_HAS_VIDEO 1232 id = dev_info.id; 1229 1233 name = dev_info.name; 1230 1234 driver = dev_info.driver; … … 1255 1259 1256 1260 /////////////////////////////////////////////////////////////////////////////// 1261 void VidDevManager::refreshDevs() throw(Error) 1262 { 1263 #if PJSUA_HAS_VIDEO 1264 PJSUA2_CHECK_EXPR(pjmedia_vid_dev_refresh()); 1265 #endif 1266 } 1267 1257 1268 unsigned VidDevManager::getDevCount() 1258 1269 { … … 1273 1284 1274 1285 dev_info.fromPj(pj_info); 1286 #else 1287 PJ_UNUSED_ARG(dev_id); 1275 1288 #endif 1276 1289 return dev_info; … … 1297 1310 } 1298 1311 1312 int VidDevManager::lookupDev(const string &drv_name, 1313 const string &dev_name) const throw(Error) 1314 { 1315 pjmedia_vid_dev_index pj_idx = 0; 1316 #if PJSUA_HAS_VIDEO 1317 PJSUA2_CHECK_EXPR(pjmedia_vid_dev_lookup(drv_name.c_str(), 1318 dev_name.c_str(), 1319 &pj_idx)); 1320 #else 1321 PJ_UNUSED_ARG(drv_name); 1322 PJ_UNUSED_ARG(dev_name); 1323 #endif 1324 return pj_idx; 1325 } 1326 1327 string VidDevManager::capName(pjmedia_vid_dev_cap cap) const 1328 { 1329 string cap_name; 1330 #if PJSUA_HAS_VIDEO 1331 cap_name = pjmedia_vid_dev_cap_name(cap, NULL); 1332 #else 1333 PJ_UNUSED_ARG(cap); 1334 #endif 1335 return cap_name; 1336 } 1337 1338 void VidDevManager::setFormat(int dev_id, 1339 const MediaFormatVideo &format, 1340 bool keep) throw(Error) 1341 { 1342 #if PJSUA_HAS_VIDEO 1343 pjmedia_format pj_format = format.toPj(); 1344 1345 PJSUA2_CHECK_EXPR(pjsua_vid_dev_set_setting(dev_id, 1346 PJMEDIA_VID_DEV_CAP_FORMAT, 1347 &pj_format, 1348 keep)); 1349 #else 1350 PJ_UNUSED_ARG(dev_id); 1351 PJ_UNUSED_ARG(format); 1352 PJ_UNUSED_ARG(keep); 1353 #endif 1354 } 1355 1356 MediaFormatVideo VidDevManager::getFormat(int dev_id) const throw(Error) 1357 { 1358 MediaFormatVideo vid_format; 1359 pj_bzero(&vid_format, sizeof(vid_format)); 1360 #if PJSUA_HAS_VIDEO 1361 pjmedia_format pj_format; 1362 PJSUA2_CHECK_EXPR(pjsua_vid_dev_get_setting(dev_id, 1363 PJMEDIA_VID_DEV_CAP_FORMAT, 1364 &pj_format)); 1365 vid_format.fromPj(pj_format); 1366 #else 1367 PJ_UNUSED_ARG(dev_id); 1368 #endif 1369 return vid_format; 1370 } 1371 1372 void VidDevManager::setInputScale(int dev_id, 1373 const MediaSize &scale, 1374 bool keep) throw(Error) 1375 { 1376 #if PJSUA_HAS_VIDEO 1377 pjmedia_rect_size pj_size; 1378 pj_size.w = scale.w; 1379 pj_size.h = scale.h; 1380 PJSUA2_CHECK_EXPR(pjsua_vid_dev_set_setting(dev_id, 1381 PJMEDIA_VID_DEV_CAP_INPUT_SCALE, 1382 &pj_size, 1383 keep)); 1384 #else 1385 PJ_UNUSED_ARG(dev_id); 1386 PJ_UNUSED_ARG(scale); 1387 PJ_UNUSED_ARG(keep); 1388 #endif 1389 } 1390 1391 MediaSize VidDevManager::getInputScale(int dev_id) const throw(Error) 1392 { 1393 MediaSize scale; 1394 pj_bzero(&scale, sizeof(scale)); 1395 #if PJSUA_HAS_VIDEO 1396 pjmedia_rect_size pj_size; 1397 PJSUA2_CHECK_EXPR(pjsua_vid_dev_get_setting(dev_id, 1398 PJMEDIA_VID_DEV_CAP_INPUT_SCALE, 1399 &pj_size)); 1400 1401 scale.w = pj_size.w; 1402 scale.h = pj_size.h; 1403 #else 1404 PJ_UNUSED_ARG(dev_id); 1405 #endif 1406 return scale; 1407 } 1408 1409 void VidDevManager::setOutputWindowFlags(int dev_id, 1410 int flags, 1411 bool keep) throw(Error) 1412 { 1413 #if PJSUA_HAS_VIDEO 1414 PJSUA2_CHECK_EXPR(pjsua_vid_dev_set_setting(dev_id, 1415 PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS, 1416 &flags, 1417 keep)); 1418 #else 1419 PJ_UNUSED_ARG(dev_id); 1420 PJ_UNUSED_ARG(flags); 1421 PJ_UNUSED_ARG(keep); 1422 #endif 1423 } 1424 1425 int VidDevManager::getOutputWindowFlags(int dev_id) throw(Error) 1426 { 1427 int flags = 0; 1428 1429 #if PJSUA_HAS_VIDEO 1430 PJSUA2_CHECK_EXPR(pjsua_vid_dev_get_setting(dev_id, 1431 PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS, 1432 &flags)); 1433 #else 1434 PJ_UNUSED_ARG(dev_id); 1435 #endif 1436 return flags; 1437 } 1438 1439 void VidDevManager::switchDev(int dev_id, 1440 const VideoSwitchParam ¶m) throw(Error) 1441 { 1442 #if PJSUA_HAS_VIDEO 1443 pjmedia_vid_dev_switch_param pj_param; 1444 pj_param.target_id = param.target_id; 1445 PJSUA2_CHECK_EXPR(pjsua_vid_dev_set_setting(dev_id, 1446 PJMEDIA_VID_DEV_CAP_SWITCH, 1447 &pj_param, 1448 PJ_FALSE)); 1449 #else 1450 PJ_UNUSED_ARG(dev_id); 1451 PJ_UNUSED_ARG(param); 1452 #endif 1453 } 1454 1299 1455 void VidDevManager::clearVideoDevList() 1300 1456 { … … 1325 1481 PJSUA2_CHECK_EXPR(pjsua_vid_dev_set_setting(dev_id, 1326 1482 PJMEDIA_VID_DEV_CAP_ORIENTATION, &orient, keep)); 1327 #endif 1328 } 1329 1483 #else 1484 PJ_UNUSED_ARG(dev_id); 1485 PJ_UNUSED_ARG(orient); 1486 PJ_UNUSED_ARG(keep); 1487 #endif 1488 } 1330 1489 1331 1490 VidDevManager::VidDevManager()
Note: See TracChangeset
for help on using the changeset viewer.