Changeset 5123 for pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp
- Timestamp:
- Jul 1, 2015 2:20:12 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp
r5121 r5123 388 388 } 389 389 390 clearCodecInfoList(); 390 clearCodecInfoList(codecInfoList); 391 clearCodecInfoList(videoCodecInfoList); 391 392 392 393 try { … … 1619 1620 } 1620 1621 1622 VidDevManager &Endpoint::vidDevManager() 1623 { 1624 return videoDevMgr; 1625 } 1626 1621 1627 /* 1622 1628 * Codec operations. … … 1629 1635 PJSUA2_CHECK_EXPR( pjsua_enum_codecs(pj_codec, &count) ); 1630 1636 1637 updateCodecInfoList(pj_codec, count, codecInfoList); 1638 return codecInfoList; 1639 } 1640 1641 void Endpoint::codecSetPriority(const string &codec_id, 1642 pj_uint8_t priority) throw(Error) 1643 { 1644 pj_str_t codec_str = str2Pj(codec_id); 1645 PJSUA2_CHECK_EXPR( pjsua_codec_set_priority(&codec_str, priority) ); 1646 } 1647 1648 CodecParam Endpoint::codecGetParam(const string &codec_id) const throw(Error) 1649 { 1650 pjmedia_codec_param *pj_param = NULL; 1651 pj_str_t codec_str = str2Pj(codec_id); 1652 1653 PJSUA2_CHECK_EXPR( pjsua_codec_get_param(&codec_str, pj_param) ); 1654 1655 return pj_param; 1656 } 1657 1658 void Endpoint::codecSetParam(const string &codec_id, 1659 const CodecParam param) throw(Error) 1660 { 1661 pj_str_t codec_str = str2Pj(codec_id); 1662 pjmedia_codec_param *pj_param = (pjmedia_codec_param*)param; 1663 1664 PJSUA2_CHECK_EXPR( pjsua_codec_set_param(&codec_str, pj_param) ); 1665 } 1666 1667 void Endpoint::clearCodecInfoList(CodecInfoVector &codec_list) 1668 { 1669 for (unsigned i=0;i<codec_list.size();++i) { 1670 delete codec_list[i]; 1671 } 1672 codec_list.clear(); 1673 } 1674 1675 void Endpoint::updateCodecInfoList(pjsua_codec_info pj_codec[], unsigned count, 1676 CodecInfoVector &codec_list) 1677 { 1631 1678 pj_enter_critical_section(); 1632 clearCodecInfoList( );1633 for (unsigned i =0; i<count; ++i) {1679 clearCodecInfoList(codec_list); 1680 for (unsigned i = 0; i<count; ++i) { 1634 1681 CodecInfo *codec_info = new CodecInfo; 1635 1682 … … 1638 1685 } 1639 1686 pj_leave_critical_section(); 1687 } 1688 1689 const CodecInfoVector &Endpoint::videoCodecEnum() throw(Error) 1690 { 1691 #if PJSUA_HAS_VIDEO 1692 pjsua_codec_info pj_codec[MAX_CODEC_NUM]; 1693 unsigned count = MAX_CODEC_NUM; 1694 1695 PJSUA2_CHECK_EXPR(pjsua_vid_enum_codecs(pj_codec, &count)); 1696 1697 updateCodecInfoList(pj_codec, count, videoCodecInfoList); 1698 #endif 1640 1699 return codecInfoList; 1641 1700 } 1642 1701 1643 void Endpoint::codecSetPriority(const string &codec_id, 1644 pj_uint8_t priority) throw(Error) 1645 { 1702 void Endpoint::videoCodecSetPriority(const string &codec_id, 1703 pj_uint8_t priority) throw(Error) 1704 { 1705 #if PJSUA_HAS_VIDEO 1646 1706 pj_str_t codec_str = str2Pj(codec_id); 1647 PJSUA2_CHECK_EXPR( pjsua_codec_set_priority(&codec_str, priority) ); 1648 } 1649 1650 CodecParam Endpoint::codecGetParam(const string &codec_id) const throw(Error) 1651 { 1652 pjmedia_codec_param *pj_param = NULL; 1707 PJSUA2_CHECK_EXPR(pjsua_vid_codec_set_priority(&codec_str, priority)); 1708 #endif 1709 } 1710 1711 CodecParam Endpoint::videoCodecGetParam(const string &codec_id) const 1712 throw(Error) 1713 { 1714 pjmedia_vid_codec_param *pj_param = NULL; 1715 #if PJSUA_HAS_VIDEO 1653 1716 pj_str_t codec_str = str2Pj(codec_id); 1654 1717 1655 PJSUA2_CHECK_EXPR( pjsua_codec_get_param(&codec_str, pj_param));1656 1718 PJSUA2_CHECK_EXPR(pjsua_vid_codec_get_param(&codec_str, pj_param)); 1719 #endif 1657 1720 return pj_param; 1658 1721 } 1659 1722 1660 void Endpoint::codecSetParam(const string &codec_id, 1661 const CodecParam param) throw(Error) 1662 { 1723 void Endpoint::videoCodecSetParam(const string &codec_id, 1724 const CodecParam param) throw(Error) 1725 { 1726 #if PJSUA_HAS_VIDEO 1663 1727 pj_str_t codec_str = str2Pj(codec_id); 1664 pjmedia_codec_param *pj_param = (pjmedia_codec_param*)param; 1665 1666 PJSUA2_CHECK_EXPR( pjsua_codec_set_param(&codec_str, pj_param) ); 1667 } 1668 1669 void Endpoint::clearCodecInfoList() 1670 { 1671 for (unsigned i=0;i<codecInfoList.size();++i) { 1672 delete codecInfoList[i]; 1673 } 1674 codecInfoList.clear(); 1675 } 1728 pjmedia_vid_codec_param *pj_param = (pjmedia_vid_codec_param*)param; 1729 1730 PJSUA2_CHECK_EXPR(pjsua_vid_codec_set_param(&codec_str, pj_param)); 1731 #endif 1732 } 1733
Note: See TracChangeset
for help on using the changeset viewer.