Changeset 5102 for pjproject/trunk/pjsip/include/pjsua2/media.hpp
- Timestamp:
- May 28, 2015 7:14:24 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsua2/media.hpp
r4996 r5102 1489 1489 }; 1490 1490 1491 /** 1492 * This structure contains parameters for VideoPreview::start() 1493 */ 1494 struct VideoPreviewOpParam { 1495 /** 1496 * Device ID for the video renderer to be used for rendering the 1497 * capture stream for preview. This parameter is ignored if native 1498 * preview is being used. 1499 * 1500 * Default: PJMEDIA_VID_DEFAULT_RENDER_DEV 1501 */ 1502 pjmedia_vid_dev_index rendId; 1503 1504 /** 1505 * Show window initially. 1506 * 1507 * Default: PJ_TRUE. 1508 */ 1509 bool show; 1510 1511 /** 1512 * Window flags. The value is a bitmask combination of 1513 * \a pjmedia_vid_dev_wnd_flag. 1514 * 1515 * Default: 0. 1516 */ 1517 unsigned windowFlags; 1518 1519 /** 1520 * Media format. If left unitialized, this parameter will not be used. 1521 */ 1522 MediaFormat format; 1523 1524 /** 1525 * Optional output window to be used to display the video preview. 1526 * This parameter will only be used if the video device supports 1527 * PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW capability and the capability 1528 * is not read-only. 1529 */ 1530 VideoWindowHandle window; 1531 1532 public: 1533 /** 1534 * Default constructor initializes with default values. 1535 */ 1536 VideoPreviewOpParam(); 1537 1538 /** 1539 * Convert from pjsip 1540 */ 1541 void fromPj(const pjsua_vid_preview_param &prm); 1542 1543 /** 1544 * Convert to pjsip 1545 */ 1546 pjsua_vid_preview_param toPj() const; 1547 }; 1548 1549 /** 1550 * Video Preview 1551 */ 1552 class VideoPreview { 1553 public: 1554 /** 1555 * Constructor 1556 */ 1557 VideoPreview(int dev_id); 1558 1559 /** 1560 * Determine if the specified video input device has built-in native 1561 * preview capability. This is a convenience function that is equal to 1562 * querying device's capability for PJMEDIA_VID_DEV_CAP_INPUT_PREVIEW 1563 * capability. 1564 * 1565 * @return true if it has. 1566 */ 1567 bool hasNative(); 1568 1569 /** 1570 * Start video preview window for the specified capture device. 1571 * 1572 * @param p Video preview parameters. 1573 */ 1574 void start(const VideoPreviewOpParam ¶m) throw(Error); 1575 1576 /** 1577 * Stop video preview. 1578 */ 1579 void stop() throw(Error); 1580 1581 /* 1582 * Get the preview window handle associated with the capture device,if any. 1583 */ 1584 VideoWindow getVideoWindow(); 1585 1586 private: 1587 pjmedia_vid_dev_index devId; 1588 }; 1589 1491 1590 /************************************************************************* 1492 1591 * Codec management
Note: See TracChangeset
for help on using the changeset viewer.