Changeset 5972


Ignore:
Timestamp:
Apr 23, 2019 10:49:56 AM (5 years ago)
Author:
nanang
Message:

Re #2181: Implemented video conference APIs for PJSUA2.

Location:
pjproject/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/swig/pjsua2.i

    r5969 r5972  
    109109%template(AudioMediaVector)             std::vector<pj::AudioMedia*>; 
    110110%template(AudioMediaVector2)            std::vector<pj::AudioMedia>; 
     111%template(VideoMediaVector)             std::vector<pj::VideoMedia>; 
    111112%template(ToneDescVector)               std::vector<pj::ToneDesc>; 
    112113%template(ToneDigitVector)              std::vector<pj::ToneDigit>; 
  • pjproject/trunk/pjsip/include/pjsua2/call.hpp

    r5969 r5972  
    334334/** 
    335335 * Call media information. 
     336 * 
     337 * Application can query conference bridge port of this media using 
     338 * Call::getAudioMedia() if the media type is audio, 
     339 * or Call::getEncodingVideoMedia()/Call::getDecodingVideoMedia() 
     340 * if the media type is video. 
    336341 */ 
    337342struct CallMediaInfo 
     
    358363     
    359364    /** 
     365     * Warning: this is deprecated, application can query conference bridge 
     366     * port of this media using Call::getAudioMedia(). 
     367     * 
    360368     * The conference port number for the call. Only valid if the media type 
    361369     * is audio. 
     
    375383     */ 
    376384    VideoWindow             videoWindow; 
    377      
     385 
    378386    /** 
    379387     * The video capture device for outgoing transmission, if any, 
     
    12511259     * index is not audio or invalid or inactive, exception will be thrown. 
    12521260     * 
    1253      * @param med_idx       Media index. 
     1261     * @param med_idx       Media index, or -1 to specify any first audio 
     1262     *                      media registered in the conference bridge. 
    12541263     * 
    12551264     * @return              The audio media. 
    12561265     */ 
    1257     AudioMedia getAudioMedia(unsigned med_idx) const throw(Error); 
     1266    AudioMedia getAudioMedia(int med_idx) const throw(Error); 
     1267 
     1268    /** 
     1269     * Get video media in encoding direction for the specified media index. 
     1270     * If the specified media index is not video or invalid or the direction 
     1271     * is receive only, exception will be thrown. 
     1272     * 
     1273     * @param med_idx       Media index, or -1 to specify any first video 
     1274     *                      media with encoding direction registered in the 
     1275     *                      conference bridge. 
     1276     * 
     1277     * @return              The video media. 
     1278     */ 
     1279    VideoMedia getEncodingVideoMedia(int med_idx) const throw(Error); 
     1280 
     1281    /** 
     1282     * Get video media in decoding direction for the specified media index. 
     1283     * If the specified media index is not video or invalid or the direction 
     1284     * is send only, exception will be thrown. 
     1285     * 
     1286     * @param med_idx       Media index, or -1 to specify any first video 
     1287     *                      media with decoding direction registered in the 
     1288     *                      conference bridge. 
     1289     * 
     1290     * @return              The video media. 
     1291     */ 
     1292    VideoMedia getDecodingVideoMedia(int med_idx) const throw(Error); 
    12581293 
    12591294    /** 
  • pjproject/trunk/pjsip/include/pjsua2/endpoint.hpp

    r5969 r5972  
    13971397     */ 
    13981398    AudioMediaVector2 mediaEnumPorts2() const throw(Error); 
     1399 
     1400    /** 
     1401     * Enumerate all video media port. 
     1402     * 
     1403     * @return          The list of video media port. 
     1404     */ 
     1405    VideoMediaVector mediaEnumVidPorts() const throw(Error); 
    13991406 
    14001407    /** 
  • pjproject/trunk/pjsip/include/pjsua2/media.hpp

    r5969 r5972  
    149149    /** 
    150150     * Array of listeners (in other words, ports where this port is 
    151      * transmitting to. 
     151     * transmitting to). 
    152152     */ 
    153153    IntVector           listeners; 
     
    196196}; 
    197197 
     198/** 
     199 * Parameters for AudioMedia::startTransmit2() method. 
     200 */ 
    198201struct AudioMediaTransmitParam 
    199202{ 
     
    348351 
    349352    /** 
    350      * Default Constructor. Normally application will not create AudioMedia 
    351      * object directly, but it may instantiate an AudioMedia derived class. 
     353     * Default Constructor. 
     354     * 
     355     * Normally application will not create AudioMedia object directly, 
     356     * but it instantiates an AudioMedia derived class. This is set as public 
     357     * because some STL vector implementations require it. 
    352358     */ 
    353359    AudioMedia(); 
     
    401407    pj_caching_pool      mediaCachingPool; 
    402408    pj_pool_t           *mediaPool; 
    403  
    404     friend class Endpoint; 
    405409}; 
    406410 
     
    15471551}; 
    15481552 
     1553 
     1554/** 
     1555 * This structure descibes information about a particular media port that 
     1556 * has been registered into the conference bridge.  
     1557 */ 
     1558struct VidConfPortInfo 
     1559{ 
     1560    /** 
     1561     * Conference port number. 
     1562     */ 
     1563    int                 portId; 
     1564 
     1565    /** 
     1566     * Port name. 
     1567     */ 
     1568    string              name; 
     1569 
     1570    /** 
     1571     * Media audio format information 
     1572     */ 
     1573    MediaFormatVideo    format; 
     1574 
     1575    /** 
     1576     * Array of listeners (in other words, ports where this port is 
     1577     * transmitting to). 
     1578     */ 
     1579    IntVector           listeners; 
     1580 
     1581    /** 
     1582     * Array of listeners (in other words, ports where this port is 
     1583     * listening to). 
     1584     */ 
     1585    IntVector           transmitters; 
     1586 
     1587public: 
     1588    /** 
     1589     * Construct from pjsua_conf_port_info. 
     1590     */ 
     1591    void fromPj(const pjsua_vid_conf_port_info &port_info); 
     1592}; 
     1593 
     1594/** 
     1595 * Parameters for VideoMedia::startTransmit() method. 
     1596 */ 
     1597struct VideoMediaTransmitParam 
     1598{ 
     1599}; 
     1600 
     1601/** 
     1602 * Video Media. 
     1603 */ 
     1604class VideoMedia : public Media 
     1605{ 
     1606public: 
     1607    /** 
     1608    * Get information about the specified conference port. 
     1609    */ 
     1610    VidConfPortInfo getPortInfo() const throw(Error); 
     1611 
     1612    /** 
     1613     * Get port Id. 
     1614     */ 
     1615    int getPortId() const; 
     1616 
     1617    /** 
     1618     * Get information from specific port id. 
     1619     */ 
     1620    static VidConfPortInfo getPortInfoFromId(int port_id) throw(Error); 
     1621 
     1622    /** 
     1623     * Establish unidirectional media flow to sink. This media port 
     1624     * will act as a source, and it may transmit to multiple destinations/sink. 
     1625     * And if multiple sources are transmitting to the same sink, the media 
     1626     * will be mixed together. Source and sink may refer to the same Media, 
     1627     * effectively looping the media. 
     1628     * 
     1629     * If bidirectional media flow is desired, application needs to call 
     1630     * this method twice, with the second one called from the opposite source 
     1631     * media. 
     1632     * 
     1633     * @param sink              The destination Media. 
     1634     * @param param             The parameter. 
     1635     */ 
     1636    void startTransmit(const VideoMedia &sink,  
     1637                       const VideoMediaTransmitParam &param) const 
     1638         throw(Error); 
     1639 
     1640    /** 
     1641     *  Stop media flow to destination/sink port. 
     1642     * 
     1643     * @param sink              The destination media. 
     1644     * 
     1645     */ 
     1646    void stopTransmit(const VideoMedia &sink) const throw(Error); 
     1647 
     1648    /** 
     1649     * Default Constructor. 
     1650     * 
     1651     * Normally application will not create VideoMedia object directly, 
     1652     * but it instantiates a VideoMedia derived class. This is set as public 
     1653     * because some STL vector implementations require it. 
     1654     */ 
     1655    VideoMedia(); 
     1656 
     1657    /** 
     1658     * Virtual Destructor 
     1659     */ 
     1660    virtual ~VideoMedia(); 
     1661 
     1662protected: 
     1663    /** 
     1664     * Conference port Id. 
     1665     */ 
     1666    int                  id; 
     1667 
     1668protected: 
     1669    /** 
     1670     * This method needs to be called by descendants of this class to register 
     1671     * the media port created to the conference bridge and Endpoint's 
     1672     * media list. 
     1673     * 
     1674     * param port  The media port to be registered to the conference bridge. 
     1675     * param pool  The memory pool. 
     1676     */ 
     1677    void registerMediaPort(MediaPort port, pj_pool_t *pool) throw(Error); 
     1678 
     1679    /** 
     1680     * This method needs to be called by descendants of this class to remove 
     1681     * the media port from the conference bridge and Endpoint's media list. 
     1682     * Descendant should only call this method if it has registered the media 
     1683     * with the previous call to registerMediaPort(). 
     1684     */ 
     1685    void unregisterMediaPort(); 
     1686}; 
     1687 
     1688/** Array of Video Media */ 
     1689typedef std::vector<VideoMedia> VideoMediaVector; 
     1690 
     1691 
    15491692/** 
    15501693 * Window handle. 
     
    16281771     */ 
    16291772    VideoWindowInfo getInfo() const throw(Error); 
     1773 
     1774    /** 
     1775     * Get video media or conference bridge port of the renderer of 
     1776     * this video window. 
     1777     * 
     1778     * @return                  Video media of this renderer window. 
     1779     */ 
     1780    VideoMedia getVideoMedia() throw(Error); 
    16301781     
    16311782    /** 
     
    17811932     */ 
    17821933    VideoWindow getVideoWindow(); 
     1934 
     1935    /** 
     1936     * Get video media or conference bridge port of the video capture device. 
     1937     * 
     1938     * @return                  Video media of the video capture device. 
     1939     */ 
     1940    VideoMedia getVideoMedia() throw(Error); 
    17831941 
    17841942private: 
  • pjproject/trunk/pjsip/src/pjsua2/call.cpp

    r5969 r5972  
    152152////////////////////////////////////////////////////////////////////////////// 
    153153 
    154 /* Call Audio Media. */ 
    155 class CallAudioMedia : public AudioMedia 
    156 { 
    157 public: 
    158     /* 
    159      * Set the conference port identification associated with the 
    160      * call audio media. 
    161      */ 
    162     void setPortId(int id); 
    163  
    164     /** 
    165      * Destructor 
    166      */ 
    167     virtual ~CallAudioMedia(); 
    168 }; 
    169  
    170  
    171 void CallAudioMedia::setPortId(int pid) 
    172 { 
    173     this->id = pid; 
    174 } 
    175  
    176 CallAudioMedia::~CallAudioMedia() 
    177 { 
    178     id = PJSUA_INVALID_ID; 
    179 } 
    180  
    181154CallOpParam::CallOpParam(bool useDefaultCallSetting) 
    182155: statusCode(pjsip_status_code(0)), reason(""), options(0) 
     
    271244 
    272245CallMediaInfo::CallMediaInfo() 
    273 : videoWindow(PJSUA_INVALID_ID) 
     246: audioConfSlot(PJSUA_INVALID_ID), 
     247  videoWindow(PJSUA_INVALID_ID), 
     248  videoIncomingWindowId(PJSUA_INVALID_ID), 
     249  videoCapDev(PJMEDIA_VID_INVALID_DEV) 
    274250{ 
    275251} 
     
    522498} 
    523499 
    524 AudioMedia Call::getAudioMedia(unsigned med_idx) const throw(Error) 
    525 { 
    526     CallAudioMedia cam; 
    527     CallInfo ci = getInfo(); 
    528  
    529     if (med_idx < ci.media.size() && 
    530         ci.media[med_idx].type == PJMEDIA_TYPE_AUDIO) 
    531     { 
    532         cam.setPortId(ci.media[med_idx].audioConfSlot); 
    533     } 
    534     return cam; 
     500AudioMedia Call::getAudioMedia(int med_idx) const throw(Error) 
     501{ 
     502    pjsua_call_info pj_ci; 
     503    pjsua_call_get_info(id, &pj_ci); 
     504     
     505    if (med_idx < 0) { 
     506        for (unsigned i = 0; i < pj_ci.media_cnt; ++i) { 
     507            if (pj_ci.media[med_idx].type == PJMEDIA_TYPE_AUDIO && 
     508                pj_ci.media[med_idx].stream.aud.conf_slot != PJSUA_INVALID_ID) 
     509            { 
     510                med_idx = i; 
     511                break; 
     512            } 
     513        } 
     514        if (med_idx < 0) { 
     515            PJSUA2_RAISE_ERROR3(PJ_ENOTFOUND, "getAudioMedia()", 
     516                                "no active audio media"); 
     517        } 
     518    } 
     519 
     520    if (med_idx >= (int)pj_ci.media_cnt) { 
     521        PJSUA2_RAISE_ERROR3(PJ_EINVAL, "getAudioMedia()", 
     522                            "invalid media index"); 
     523    } 
     524    if (pj_ci.media[med_idx].type != PJMEDIA_TYPE_AUDIO) { 
     525        PJSUA2_RAISE_ERROR3(PJ_EINVAL, "getAudioMedia()", 
     526                            "media is not audio"); 
     527    } 
     528    if (pj_ci.media[med_idx].stream.aud.conf_slot == PJSUA_INVALID_ID) { 
     529        PJSUA2_RAISE_ERROR3(PJ_EINVAL, "getAudioMedia()", 
     530                            "no audio slot (inactive?)"); 
     531    } 
     532 
     533    AudioMediaHelper am; 
     534    am.setPortId(pj_ci.media[med_idx].stream.aud.conf_slot); 
     535    return am; 
     536} 
     537 
     538VideoMedia Call::getEncodingVideoMedia(int med_idx) const throw(Error) 
     539{ 
     540    pjsua_call_info pj_ci; 
     541    pjsua_call_get_info(id, &pj_ci); 
     542 
     543    if (med_idx < 0) { 
     544        for (unsigned i = 0; i < pj_ci.media_cnt; ++i) { 
     545            if (pj_ci.media[med_idx].type == PJMEDIA_TYPE_VIDEO && 
     546                pj_ci.media[med_idx].stream.vid.enc_slot != PJSUA_INVALID_ID) 
     547            { 
     548                med_idx = i; 
     549                break; 
     550            } 
     551        } 
     552        if (med_idx < 0) { 
     553            PJSUA2_RAISE_ERROR3(PJ_ENOTFOUND, "getEncodingVideoMedia()", 
     554                                "no active encoding video media"); 
     555        } 
     556    } 
     557 
     558    if (med_idx >= (int)pj_ci.media_cnt) { 
     559        PJSUA2_RAISE_ERROR3(PJ_EINVAL, "getEncodingVideoMedia()", 
     560                            "invalid media index"); 
     561    } 
     562    if (pj_ci.media[med_idx].type != PJMEDIA_TYPE_VIDEO) { 
     563        PJSUA2_RAISE_ERROR3(PJ_EINVAL, "getEncodingVideoMedia()", 
     564                            "media is not video"); 
     565    } 
     566    if (pj_ci.media[med_idx].stream.vid.enc_slot == PJSUA_INVALID_ID) { 
     567        PJSUA2_RAISE_ERROR3(PJ_EINVAL, "getEncodingVideoMedia()", 
     568                            "no encoding slot (recvonly?)"); 
     569    } 
     570 
     571    VideoMediaHelper vm; 
     572    vm.setPortId(pj_ci.media[med_idx].stream.vid.enc_slot); 
     573    return vm; 
     574} 
     575 
     576VideoMedia Call::getDecodingVideoMedia(int med_idx) const throw(Error) 
     577{ 
     578    pjsua_call_info pj_ci; 
     579    pjsua_call_get_info(id, &pj_ci); 
     580 
     581    if (med_idx < 0) { 
     582        for (unsigned i = 0; i < pj_ci.media_cnt; ++i) { 
     583            if (pj_ci.media[med_idx].type == PJMEDIA_TYPE_VIDEO && 
     584                pj_ci.media[med_idx].stream.vid.dec_slot != PJSUA_INVALID_ID) 
     585            { 
     586                med_idx = i; 
     587                break; 
     588            } 
     589        } 
     590        if (med_idx < 0) { 
     591            PJSUA2_RAISE_ERROR3(PJ_ENOTFOUND, "getDecodingVideoMedia()", 
     592                                "no active decoding video media"); 
     593        } 
     594    } 
     595 
     596    if (med_idx >= (int)pj_ci.media_cnt) { 
     597        PJSUA2_RAISE_ERROR3(PJ_EINVAL, "getDecodingVideoMedia()", 
     598                            "invalid media index"); 
     599    } 
     600    if (pj_ci.media[med_idx].type != PJMEDIA_TYPE_VIDEO) { 
     601        PJSUA2_RAISE_ERROR3(PJ_EINVAL, "getDecodingVideoMedia()", 
     602                            "media is not video"); 
     603    } 
     604    if (pj_ci.media[med_idx].stream.vid.dec_slot == PJSUA_INVALID_ID) { 
     605        PJSUA2_RAISE_ERROR3(PJ_EINVAL, "getDecodingVideoMedia()", 
     606                            "no decoding slot (sendonly?)"); 
     607    } 
     608 
     609    VideoMediaHelper vm; 
     610    vm.setPortId(pj_ci.media[med_idx].stream.vid.dec_slot); 
     611    return vm; 
    535612} 
    536613 
     
    791868            if (mi >= medias.size()) { 
    792869                if (pj_ci.media[mi].type == PJMEDIA_TYPE_AUDIO) { 
    793                     medias.push_back(new CallAudioMedia); 
     870                    medias.push_back(new AudioMediaHelper); 
    794871                } else { 
    795872                    medias.push_back(NULL); 
     
    798875             
    799876            if (pj_ci.media[mi].type == PJMEDIA_TYPE_AUDIO) { 
    800                 CallAudioMedia *aud_med = (CallAudioMedia *)medias[mi]; 
    801                  
     877                AudioMediaHelper *aud_med = (AudioMediaHelper*)medias[mi]; 
    802878                aud_med->setPortId(pj_ci.media[mi].stream.aud.conf_slot); 
    803                 /* Add media if the conference slot ID is valid. */ 
     879 
     880                /* Add media if the conference slot ID is valid. */ 
    804881                if (pj_ci.media[mi].stream.aud.conf_slot != PJSUA_INVALID_ID) 
    805882                { 
     
    808885                    Endpoint::instance().mediaRemove((AudioMedia &)*aud_med); 
    809886                } 
    810             } 
     887            } 
    811888        } 
    812889    } 
  • pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp

    r5969 r5972  
    20552055    PJSUA2_CHECK_EXPR( pjsua_enum_conf_ports(ids, &count) ); 
    20562056    for (i = 0; i < count; ++i) { 
    2057         AudioMedia am; 
    2058         am.id = ids[i]; 
     2057        AudioMediaHelper am; 
     2058        am.setPortId(ids[i]); 
    20592059        amv2.push_back(am); 
    20602060    } 
    20612061 
    20622062    return amv2; 
     2063} 
     2064 
     2065VideoMediaVector Endpoint::mediaEnumVidPorts() const throw(Error) 
     2066{ 
     2067    VideoMediaVector vmv; 
     2068    pjsua_conf_port_id ids[PJSUA_MAX_CONF_PORTS]; 
     2069    unsigned i, count = PJSUA_MAX_CONF_PORTS; 
     2070 
     2071    PJSUA2_CHECK_EXPR( pjsua_vid_conf_enum_ports(ids, &count) ); 
     2072    for (i = 0; i < count; ++i) { 
     2073        VideoMediaHelper vm; 
     2074        vm.setPortId(ids[i]); 
     2075        vmv.push_back(vm); 
     2076    } 
     2077 
     2078    return vmv; 
    20632079} 
    20642080 
  • pjproject/trunk/pjsip/src/pjsua2/media.cpp

    r5969 r5972  
    11951195    return vwi; 
    11961196} 
    1197      
     1197 
     1198VideoMedia VideoWindow::getVideoMedia() throw(Error) 
     1199{ 
     1200#if PJSUA_HAS_VIDEO 
     1201    pjsua_vid_win_info pj_vwi; 
     1202    PJSUA2_CHECK_EXPR( pjsua_vid_win_get_info(winId, &pj_vwi) ); 
     1203 
     1204    pjsua_conf_port_id id = pj_vwi.slot_id; 
     1205    if (id != PJSUA_INVALID_ID) { 
     1206        VideoMediaHelper vm; 
     1207        vm.setPortId(id); 
     1208        return vm; 
     1209    } else { 
     1210        PJSUA2_RAISE_ERROR(PJ_ENOTFOUND); 
     1211    } 
     1212#else 
     1213    PJSUA2_RAISE_ERROR(PJ_EINVALIDOP); 
     1214#endif 
     1215} 
     1216 
    11981217void VideoWindow::Show(bool show) throw(Error) 
    11991218{ 
     
    13331352#else 
    13341353    return (VideoWindow(PJSUA_INVALID_ID)); 
     1354#endif 
     1355} 
     1356 
     1357VideoMedia VideoPreview::getVideoMedia() throw(Error) 
     1358{ 
     1359#if PJSUA_HAS_VIDEO 
     1360    pjsua_conf_port_id id = pjsua_vid_preview_get_vid_conf_port(devId); 
     1361    if (id != PJSUA_INVALID_ID) { 
     1362        VideoMediaHelper vm; 
     1363        vm.setPortId(id); 
     1364        return vm; 
     1365    } else { 
     1366        PJSUA2_RAISE_ERROR2(PJ_EINVALIDOP, "Preview not started"); 
     1367    } 
     1368#else 
     1369    PJSUA2_RAISE_ERROR(PJ_EINVALIDOP); 
    13351370#endif 
    13361371} 
     
    18081843} 
    18091844 
     1845 
     1846/////////////////////////////////////////////////////////////////////////////// 
     1847 
     1848void VidConfPortInfo::fromPj(const pjsua_vid_conf_port_info &port_info) 
     1849{ 
     1850    portId = port_info.slot_id; 
     1851    name = pj2Str(port_info.name); 
     1852    format.fromPj(port_info.format); 
     1853    listeners.clear(); 
     1854    for (unsigned i=0; i<port_info.listener_cnt; ++i) { 
     1855        listeners.push_back(port_info.listeners[i]); 
     1856    } 
     1857    transmitters.clear(); 
     1858    for (unsigned i=0; i<port_info.transmitter_cnt; ++i) { 
     1859        transmitters.push_back(port_info.transmitters[i]); 
     1860    } 
     1861} 
     1862 
     1863VideoMedia::VideoMedia()  
     1864: Media(PJMEDIA_TYPE_VIDEO), id(PJSUA_INVALID_ID) 
     1865{ 
     1866 
     1867} 
     1868 
     1869void VideoMedia::registerMediaPort(MediaPort port, pj_pool_t *pool) 
     1870     throw(Error) 
     1871{ 
     1872    if (!pool) { 
     1873        PJSUA2_RAISE_ERROR3(PJ_EINVAL, "registerMediaPort()", 
     1874                            "pool must be supplied"); 
     1875    } 
     1876    if (!port) { 
     1877        PJSUA2_RAISE_ERROR3(PJ_EINVAL, "registerMediaPort()", 
     1878                            "port must be supplied"); 
     1879    } 
     1880    if (id != PJSUA_INVALID_ID) { 
     1881        PJSUA2_RAISE_ERROR3(PJ_EINVALIDOP, "registerMediaPort()", 
     1882                            "VideoMedia is occupied"); 
     1883    } 
     1884 
     1885    PJSUA2_CHECK_EXPR( pjsua_vid_conf_add_port(pool, 
     1886                                               (pjmedia_port*)port, NULL, 
     1887                                               &id) ); 
     1888} 
     1889 
     1890void VideoMedia::unregisterMediaPort() 
     1891{ 
     1892    if (id != PJSUA_INVALID_ID) { 
     1893        pjsua_vid_conf_remove_port(id); 
     1894        id = PJSUA_INVALID_ID; 
     1895    } 
     1896} 
     1897 
     1898VideoMedia::~VideoMedia()  
     1899{ 
     1900} 
     1901 
     1902VidConfPortInfo VideoMedia::getPortInfo() const throw(Error) 
     1903{ 
     1904    return VideoMedia::getPortInfoFromId(id); 
     1905} 
     1906 
     1907int VideoMedia::getPortId() const 
     1908{ 
     1909    return id; 
     1910} 
     1911 
     1912VidConfPortInfo VideoMedia::getPortInfoFromId(int port_id) throw(Error) 
     1913{ 
     1914    pjsua_vid_conf_port_info pj_info; 
     1915    VidConfPortInfo pi; 
     1916 
     1917    PJSUA2_CHECK_EXPR( pjsua_vid_conf_get_port_info(port_id, &pj_info) ); 
     1918    pi.fromPj(pj_info); 
     1919    return pi; 
     1920} 
     1921 
     1922void VideoMedia::startTransmit(const VideoMedia &sink, 
     1923                               const VideoMediaTransmitParam &param) const 
     1924     throw(Error) 
     1925{ 
     1926    PJ_UNUSED_ARG(param); 
     1927    PJSUA2_CHECK_EXPR( pjsua_vid_conf_connect(id, sink.id, NULL) ); 
     1928} 
     1929 
     1930void VideoMedia::stopTransmit(const VideoMedia &sink) const throw(Error) 
     1931{ 
     1932    PJSUA2_CHECK_EXPR( pjsua_vid_conf_disconnect(id, sink.id) ); 
     1933} 
  • pjproject/trunk/pjsip/src/pjsua2/util.hpp

    r5601 r5972  
    1919 
    2020#include <pjsua2/types.hpp> 
     21#include <pjsua2/media.hpp> 
    2122#include <string> 
    2223 
     
    4243} 
    4344 
     45class AudioMediaHelper : public AudioMedia 
     46{ 
     47public: 
     48    void setPortId(int port_id) { id = port_id; } 
     49}; 
    4450 
    45 }       // namespace 
     51class VideoMediaHelper : public VideoMedia 
     52{ 
     53public: 
     54    void setPortId(int port_id) { id = port_id; } 
     55}; 
     56 
     57} // namespace pj 
Note: See TracChangeset for help on using the changeset viewer.