Ignore:
Timestamp:
Jul 30, 2015 1:42:51 PM (6 years ago)
Author:
riza
Message:

Re #1863: Add missing video Device API.

  • refresh device list, lookup dev, cap name, set/get capabilities
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsua2/media.hpp

    r5138 r5139  
    13551355struct MediaSize 
    13561356{ 
    1357     unsigned    w;          /**< The width.             */ 
     1357    unsigned    w;          /**< The width.     */ 
    13581358    unsigned    h;          /**< The height.    */ 
    13591359}; 
     
    16041604{ 
    16051605    /** 
     1606     * The device ID 
     1607     */ 
     1608    pjmedia_vid_dev_index id; 
     1609 
     1610    /** 
    16061611     * The device name 
    16071612     */ 
     
    16471652 
    16481653/** 
     1654 * Parameter for switching device with PJMEDIA_VID_DEV_CAP_SWITCH capability. 
     1655 */ 
     1656struct VideoSwitchParam 
     1657{ 
     1658    /** 
     1659     * Target device ID to switch to. Once the switching is successful, the 
     1660     * video stream will use this device and the old device will be closed. 
     1661     */ 
     1662    pjmedia_vid_dev_index target_id; 
     1663}; 
     1664  
     1665/** 
    16491666 * Video device manager. 
    16501667 */ 
    16511668class VidDevManager { 
    16521669public: 
     1670    /** 
     1671     * Refresh the list of video devices installed in the system. This function 
     1672     * will only refresh the list of video device so all active video streams 
     1673     * will be unaffected. After refreshing the device list, application MUST 
     1674     * make sure to update all index references to video devices (i.e. all 
     1675     * variables of type pjmedia_vid_dev_index) before calling any function 
     1676     * that accepts video device index as its parameter. 
     1677     */ 
     1678    void refreshDevs() throw(Error); 
     1679 
    16531680    /** 
    16541681     * Get the number of video devices installed in the system. 
     
    16731700     */ 
    16741701    const VideoDevInfoVector &enumDev() throw(Error); 
     1702 
     1703    /** 
     1704     * Lookup device index based on the driver and device name. 
     1705     * 
     1706     * @param drv_name  The driver name. 
     1707     * @param dev_name  The device name. 
     1708     * 
     1709     * @return          The device ID. If the device is not found,  
     1710     *                  Error will be thrown. 
     1711     */ 
     1712    int lookupDev(const string &drv_name, 
     1713                  const string &dev_name) const throw(Error); 
     1714 
     1715    /** 
     1716     * Get string info for the specified capability. 
     1717     * 
     1718     * @param cap       The capability ID. 
     1719     * 
     1720     * @return          Capability name. 
     1721     */ 
     1722    string capName(pjmedia_vid_dev_cap cap) const; 
     1723 
     1724    /** 
     1725     * This will configure video format capability to the video device.  
     1726     * If video device is currently active, the method will forward the setting  
     1727     * to the video device instance to be applied immediately, if it  
     1728     * supports it. 
     1729     * 
     1730     * This method is only valid if the device has 
     1731     * PJMEDIA_VID_DEV_CAP_FORMAT capability in VideoDevInfo.caps flags, 
     1732     * otherwise Error will be thrown. 
     1733     * 
     1734     * Note that in case the setting is kept for future use, it will be applied 
     1735     * to any devices, even when application has changed the video device to be 
     1736     * used. 
     1737     * 
     1738     * @param dev_id    The video device id.     
     1739     * @param format    The video format. 
     1740     * @param keep      Specify whether the setting is to be kept for 
     1741     *                  future use. 
     1742     */ 
     1743    void setFormat(int dev_id,  
     1744                   const MediaFormatVideo &format,  
     1745                   bool keep) throw(Error); 
     1746 
     1747    /** 
     1748     * Get the video format capability to the video device. 
     1749     * If video device is currently active, the method will forward the request 
     1750     * to the video device. If video device is currently inactive, and if  
     1751     * application had previously set the setting and mark the setting as kept,  
     1752     * then that setting will be returned. Otherwise, this method will  
     1753     * raise error. 
     1754     * 
     1755     * This method is only valid if the device has 
     1756     * PJMEDIA_VID_DEV_CAP_FORMAT capability in VideoDevInfo.caps flags, 
     1757     * otherwise Error will be thrown. 
     1758     * 
     1759     * @param dev_id    The video device id. 
     1760     * @return keep     The video format. 
     1761     */ 
     1762    MediaFormatVideo getFormat(int dev_id) const throw(Error); 
     1763 
     1764    /** 
     1765     * This will configure video format capability to the video device. 
     1766     * If video device is currently active, the method will forward the setting 
     1767     * to the video device instance to be applied immediately, if it 
     1768     * supports it. 
     1769     * 
     1770     * This method is only valid if the device has 
     1771     * PJMEDIA_VID_DEV_CAP_INPUT_SCALE capability in VideoDevInfo.caps flags, 
     1772     * otherwise Error will be thrown. 
     1773     * 
     1774     * Note that in case the setting is kept for future use, it will be applied 
     1775     * to any devices, even when application has changed the video device to be 
     1776     * used. 
     1777     * 
     1778     * @param dev_id    The video device id. 
     1779     * @param scale     The video scale. 
     1780     * @param keep      Specify whether the setting is to be kept for 
     1781     *                  future use. 
     1782     */ 
     1783    void setInputScale(int dev_id,  
     1784                       const MediaSize &scale,  
     1785                       bool keep) throw(Error); 
     1786 
     1787    /** 
     1788     * Get the video input scale capability to the video device. 
     1789     * If video device is currently active, the method will forward the request 
     1790     * to the video device. If video device is currently inactive, and if 
     1791     * application had previously set the setting and mark the setting as kept, 
     1792     * then that setting will be returned. Otherwise, this method will 
     1793     * raise error. 
     1794     * 
     1795     * This method is only valid if the device has 
     1796     * PJMEDIA_VID_DEV_CAP_FORMAT capability in VideoDevInfo.caps flags, 
     1797     * otherwise Error will be thrown. 
     1798     * 
     1799     * @param dev_id    The video device id. 
     1800     * @return keep     The video format. 
     1801     */ 
     1802    MediaSize getInputScale(int dev_id) const throw(Error); 
     1803 
     1804    /** 
     1805     * This will configure fast switching to another video device. 
     1806     * If video device is currently active, the method will forward the setting 
     1807     * to the video device instance to be applied immediately, if it 
     1808     * supports it. 
     1809     * 
     1810     * This method is only valid if the device has  
     1811     * PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS capability in VideoDevInfo.caps  
     1812     * flags, otherwise Error will be thrown. 
     1813     *  
     1814     * Note that in case the setting is kept for future use, it will be applied 
     1815     * to any devices, even when application has changed the video device to be 
     1816     * used. 
     1817     * 
     1818     * @param dev_id    The video device id. 
     1819     * @param flags     The video window flag. 
     1820     * @param keep      Specify whether the setting is to be kept for 
     1821     *                  future use. 
     1822     */ 
     1823    void setOutputWindowFlags(int dev_id, int flags, bool keep) throw(Error); 
     1824     
     1825    /** 
     1826     * Get the window output flags capability to the video device. 
     1827     * If video device is currently active, the method will forward the request 
     1828     * to the video device. If video device is currently inactive, and if 
     1829     * application had previously set the setting and mark the setting as kept, 
     1830     * then that setting will be returned. Otherwise, this method will 
     1831     * raise error. 
     1832     * 
     1833     * This method is only valid if the device has 
     1834     * PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS capability in VideoDevInfo.caps  
     1835     * flags, otherwise Error will be thrown. 
     1836     * 
     1837     * @param dev_id    The video device id. 
     1838     * @return keep     The video format. 
     1839     */ 
     1840    int getOutputWindowFlags(int dev_id) throw(Error); 
     1841 
     1842    /** 
     1843     * This will configure fast switching to another video device. 
     1844     * If video device is currently active, the method will forward the setting 
     1845     * to the video device instance to be applied immediately, if it 
     1846     * supports it. 
     1847     * 
     1848     * This method is only valid if the device has 
     1849     * PJMEDIA_VID_DEV_CAP_SWITCH capability in VideoDevInfo.caps flags, 
     1850     * otherwise Error will be thrown. 
     1851     * 
     1852     * @param dev_id    The video device id. 
     1853     * @param param     The video switch param. 
     1854     */ 
     1855    void switchDev(int dev_id, 
     1856                   const VideoSwitchParam &param) throw(Error); 
    16751857 
    16761858    /** 
Note: See TracChangeset for help on using the changeset viewer.