Changeset 5165
- Timestamp:
- Aug 21, 2015 6:00:46 AM (9 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/swig/pjsua2.i
r5132 r5165 113 113 %template(CodecInfoVector) std::vector<pj::CodecInfo*>; 114 114 %template(VideoDevInfoVector) std::vector<pj::VideoDevInfo*>; 115 %template(CodecFmtpVector) std::vector<pj::CodecFmtp>; 115 116 116 117 /* pj::WindowHandle::setWindow() receives Surface object */ -
pjproject/trunk/pjsip-apps/src/swig/symbols.i
r5138 r5165 98 98 typedef enum pjmedia_format_id {PJMEDIA_FORMAT_L16 = 0, PJMEDIA_FORMAT_PCM = PJMEDIA_FORMAT_L16, PJMEDIA_FORMAT_PCMA = ((('W' << 24) | ('A' << 16)) | ('L' << 8)) | 'A', PJMEDIA_FORMAT_ALAW = PJMEDIA_FORMAT_PCMA, PJMEDIA_FORMAT_PCMU = ((('W' << 24) | ('A' << 16)) | ('L' << 8)) | 'u', PJMEDIA_FORMAT_ULAW = PJMEDIA_FORMAT_PCMU, PJMEDIA_FORMAT_AMR = ((('R' << 24) | ('M' << 16)) | ('A' << 8)) | ' ', PJMEDIA_FORMAT_G729 = ((('9' << 24) | ('2' << 16)) | ('7' << 8)) | 'G', PJMEDIA_FORMAT_ILBC = ((('C' << 24) | ('B' << 16)) | ('L' << 8)) | 'I', PJMEDIA_FORMAT_RGB24 = ((('3' << 24) | ('B' << 16)) | ('G' << 8)) | 'R', PJMEDIA_FORMAT_RGBA = ((('A' << 24) | ('B' << 16)) | ('G' << 8)) | 'R', PJMEDIA_FORMAT_BGRA = ((('A' << 24) | ('R' << 16)) | ('G' << 8)) | 'B', PJMEDIA_FORMAT_RGB32 = PJMEDIA_FORMAT_RGBA, PJMEDIA_FORMAT_DIB = (((' ' << 24) | ('B' << 16)) | ('I' << 8)) | 'D', PJMEDIA_FORMAT_GBRP = ((('P' << 24) | ('R' << 16)) | ('B' << 8)) | 'G', PJMEDIA_FORMAT_AYUV = ((('V' << 24) | ('U' << 16)) | ('Y' << 8)) | 'A', PJMEDIA_FORMAT_YUY2 = ((('2' << 24) | ('Y' << 16)) | ('U' << 8)) | 'Y', PJMEDIA_FORMAT_UYVY = ((('Y' << 24) | ('V' << 16)) | ('Y' << 8)) | 'U', PJMEDIA_FORMAT_YVYU = ((('U' << 24) | ('Y' << 16)) | ('V' << 8)) | 'Y', PJMEDIA_FORMAT_I420 = ((('0' << 24) | ('2' << 16)) | ('4' << 8)) | 'I', PJMEDIA_FORMAT_IYUV = PJMEDIA_FORMAT_I420, PJMEDIA_FORMAT_YV12 = ((('2' << 24) | ('1' << 16)) | ('V' << 8)) | 'Y', PJMEDIA_FORMAT_NV21 = ((('1' << 24) | ('2' << 16)) | ('V' << 8)) | 'N', PJMEDIA_FORMAT_I422 = ((('2' << 24) | ('2' << 16)) | ('4' << 8)) | 'I', PJMEDIA_FORMAT_I420JPEG = ((('0' << 24) | ('2' << 16)) | ('4' << 8)) | 'J', PJMEDIA_FORMAT_I422JPEG = ((('2' << 24) | ('2' << 16)) | ('4' << 8)) | 'J', PJMEDIA_FORMAT_H261 = ((('1' << 24) | ('6' << 16)) | ('2' << 8)) | 'H', PJMEDIA_FORMAT_H263 = ((('3' << 24) | ('6' << 16)) | ('2' << 8)) | 'H', PJMEDIA_FORMAT_H263P = ((('3' << 24) | ('6' << 16)) | ('2' << 8)) | 'P', PJMEDIA_FORMAT_H264 = ((('4' << 24) | ('6' << 16)) | ('2' << 8)) | 'H', PJMEDIA_FORMAT_MJPEG = ((('G' << 24) | ('P' << 16)) | ('J' << 8)) | 'M', PJMEDIA_FORMAT_MPEG1VIDEO = ((('V' << 24) | ('1' << 16)) | ('P' << 8)) | 'M', PJMEDIA_FORMAT_MPEG2VIDEO = ((('V' << 24) | ('2' << 16)) | ('P' << 8)) | 'M', PJMEDIA_FORMAT_MPEG4 = ((('4' << 24) | ('G' << 16)) | ('P' << 8)) | 'M'} pjmedia_format_id; 99 99 100 typedef enum pjmedia_vid_packing {PJMEDIA_VID_PACKING_UNKNOWN, PJMEDIA_VID_PACKING_PACKETS = 1, PJMEDIA_VID_PACKING_WHOLE = 2} pjmedia_vid_packing; 101 100 102 typedef enum pjsip_cred_data_type {PJSIP_CRED_DATA_PLAIN_PASSWD = 0, PJSIP_CRED_DATA_DIGEST = 1, PJSIP_CRED_DATA_EXT_AKA = 16} pjsip_cred_data_type; 101 103 -
pjproject/trunk/pjsip-apps/src/swig/symbols.lst
r5138 r5165 17 17 pjmedia/types.h pjmedia_type pjmedia_dir pjmedia_tp_proto pjmedia_orient 18 18 pjmedia/format.h pjmedia_format_id 19 pjmedia/vid_codec.h pjmedia_vid_packing 19 20 20 21 pjsip/sip_auth.h pjsip_cred_data_type -
pjproject/trunk/pjsip/include/pjsua2/call.hpp
r4996 r5165 46 46 47 47 ////////////////////////////////////////////////////////////////////////////// 48 49 /**50 * Codec parameters, corresponds to pjmedia_codec_param or51 * pjmedia_vid_codec_param.52 */53 typedef void *CodecParam;54 48 55 49 /** -
pjproject/trunk/pjsip/include/pjsua2/endpoint.hpp
r5131 r5165 1151 1151 * 1152 1152 */ 1153 CodecParam videoCodecGetParam(const string &codec_id) const throw(Error);1153 VidCodecParam getVideoCodecParam(const string &codec_id) const throw(Error); 1154 1154 1155 1155 /** … … 1157 1157 * 1158 1158 * @param codec_id Codec ID. 1159 * @param param Codec parameter to set. Set to NULL to reset 1160 * codec parameter to library default settings. 1161 * 1162 */ 1163 void videoCodecSetParam(const string &codec_id, 1164 const CodecParam param) throw(Error); 1159 * @param param Codec parameter to set. 1160 * 1161 */ 1162 void setVideoCodecParam(const string &codec_id, 1163 const VidCodecParam ¶m) throw(Error); 1164 1165 /** 1166 * Reset video codec parameters to library default settings. 1167 * 1168 * @param codec_id Codec ID. 1169 * 1170 */ 1171 void resetVideoCodecParam(const string &codec_id) throw(Error); 1165 1172 1166 1173 public: -
pjproject/trunk/pjsip/include/pjsua2/media.hpp
r5139 r5165 1942 1942 1943 1943 /** 1944 * Codec parameters, corresponds to pjmedia_codec_param or 1945 * pjmedia_vid_codec_param. 1944 * Codec parameters, corresponds to pjmedia_codec_param. 1946 1945 */ 1947 1946 typedef void *CodecParam; 1948 1947 1948 /** 1949 * Structure of codec specific parameters which contains name=value pairs. 1950 * The codec specific parameters are to be used with SDP according to 1951 * the standards (e.g: RFC 3555) in SDP 'a=fmtp' attribute. 1952 */ 1953 typedef struct CodecFmtp 1954 { 1955 string name; 1956 string val; 1957 } CodecFmtp; 1958 1959 /** Array of codec fmtp */ 1960 typedef std::vector<CodecFmtp> CodecFmtpVector; 1961 1962 /** 1963 * Detailed codec attributes used in configuring a codec and in querying 1964 * the capability of codec factories. 1965 * 1966 * Please note that codec parameter also contains SDP specific setting, 1967 * #decFmtp and #encFmtp, which may need to be set appropriately based on 1968 * the effective setting. See each codec documentation for more detail. 1969 */ 1970 struct VidCodecParam 1971 { 1972 pjmedia_dir dir; /**< Direction */ 1973 pjmedia_vid_packing packing; /**< Packetization strategy. */ 1974 1975 struct 1976 MediaFormatVideo encFmt; /**< Encoded format */ 1977 CodecFmtpVector encFmtp; /**< Encoder fmtp params */ 1978 unsigned encMtu; /**< MTU or max payload size setting*/ 1979 1980 struct 1981 MediaFormatVideo decFmt; /**< Decoded format */ 1982 CodecFmtpVector decFmtp; /**< Decoder fmtp params */ 1983 1984 bool ignoreFmtp; /**< Ignore fmtp params. If set to 1985 true, the codec will apply 1986 format settings specified in 1987 encFmt and decFmt only. */ 1988 1989 void fromPj(const pjmedia_vid_codec_param ¶m); 1990 1991 pjmedia_vid_codec_param toPj() const; 1992 1993 private: 1994 void setCodecFmtp(const pjmedia_codec_fmtp &in_fmtp, 1995 CodecFmtpVector &out_fmtp); 1996 1997 void getCodecFmtp(const CodecFmtpVector &in_fmtp, 1998 pjmedia_codec_fmtp &out_fmtp) const; 1999 2000 }; 2001 1949 2002 1950 2003 /** -
pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp
r5139 r5165 1684 1684 1685 1685 codec_info->fromPj(pj_codec[i]); 1686 codec InfoList.push_back(codec_info);1686 codec_list.push_back(codec_info); 1687 1687 } 1688 1688 pj_leave_critical_section(); … … 1699 1699 updateCodecInfoList(pj_codec, count, videoCodecInfoList); 1700 1700 #endif 1701 return codecInfoList;1701 return videoCodecInfoList; 1702 1702 } 1703 1703 … … 1714 1714 } 1715 1715 1716 CodecParam Endpoint::videoCodecGetParam(const string &codec_id) const 1717 throw(Error)1718 { 1719 pjmedia_vid_codec_param *pj_param = NULL;1716 VidCodecParam Endpoint::getVideoCodecParam(const string &codec_id) const 1717 throw(Error) 1718 { 1719 VidCodecParam codec_param; 1720 1720 #if PJSUA_HAS_VIDEO 1721 pj_str_t codec_str = str2Pj(codec_id); 1722 1723 PJSUA2_CHECK_EXPR(pjsua_vid_codec_get_param(&codec_str, pj_param)); 1721 pjmedia_vid_codec_param pj_param; 1722 pj_str_t codec_str = str2Pj(codec_id); 1723 1724 PJSUA2_CHECK_EXPR(pjsua_vid_codec_get_param(&codec_str, &pj_param)); 1725 codec_param.fromPj(pj_param); 1724 1726 #else 1725 1727 PJ_UNUSED_ARG(codec_id); 1726 1728 #endif 1727 return pj_param;1728 } 1729 1730 void Endpoint:: videoCodecSetParam(const string &codec_id,1731 const CodecParamparam) throw(Error)1729 return codec_param; 1730 } 1731 1732 void Endpoint::setVideoCodecParam(const string &codec_id, 1733 const VidCodecParam ¶m) throw(Error) 1732 1734 { 1733 1735 #if PJSUA_HAS_VIDEO 1734 1736 pj_str_t codec_str = str2Pj(codec_id); 1735 pjmedia_vid_codec_param *pj_param = (pjmedia_vid_codec_param*)param;1736 1737 PJSUA2_CHECK_EXPR(pjsua_vid_codec_set_param(&codec_str, pj_param));1737 pjmedia_vid_codec_param pj_param = param.toPj(); 1738 1739 PJSUA2_CHECK_EXPR(pjsua_vid_codec_set_param(&codec_str, &pj_param)); 1738 1740 #else 1739 1741 PJ_UNUSED_ARG(codec_id); … … 1742 1744 } 1743 1745 1746 void Endpoint::resetVideoCodecParam(const string &codec_id) throw(Error) 1747 { 1748 #if PJSUA_HAS_VIDEO 1749 pj_str_t codec_str = str2Pj(codec_id); 1750 1751 PJSUA2_CHECK_EXPR(pjsua_vid_codec_set_param(&codec_str, NULL)); 1752 #else 1753 PJ_UNUSED_ARG(codec_id); 1754 PJ_UNUSED_ARG(param); 1755 #endif 1756 } -
pjproject/trunk/pjsip/src/pjsua2/media.cpp
r5157 r5165 1507 1507 desc = pj2Str(codec_info.desc); 1508 1508 } 1509 1510 void VidCodecParam::fromPj(const pjmedia_vid_codec_param ¶m) 1511 { 1512 dir = param.dir; 1513 packing = param.packing; 1514 ignoreFmtp = param.ignore_fmtp; 1515 encMtu = param.enc_mtu; 1516 encFmt.fromPj(param.enc_fmt); 1517 decFmt.fromPj(param.dec_fmt); 1518 setCodecFmtp(param.enc_fmtp, encFmtp); 1519 setCodecFmtp(param.dec_fmtp, decFmtp); 1520 } 1521 1522 pjmedia_vid_codec_param VidCodecParam::toPj() const 1523 { 1524 pjmedia_vid_codec_param param; 1525 pj_bzero(¶m, sizeof(param)); 1526 param.dir = dir; 1527 param.packing = packing; 1528 param.ignore_fmtp = ignoreFmtp; 1529 param.enc_mtu = encMtu; 1530 param.enc_fmt = encFmt.toPj(); 1531 param.dec_fmt = decFmt.toPj(); 1532 getCodecFmtp(encFmtp, param.enc_fmtp); 1533 getCodecFmtp(decFmtp, param.dec_fmtp); 1534 return param; 1535 } 1536 1537 void VidCodecParam::setCodecFmtp(const pjmedia_codec_fmtp &in_fmtp, 1538 CodecFmtpVector &out_fmtp) 1539 { 1540 unsigned i = 0; 1541 for ( ; i<in_fmtp.cnt; ++i) { 1542 CodecFmtp fmtp; 1543 fmtp.name = pj2Str(in_fmtp.param[i].name); 1544 fmtp.val = pj2Str(in_fmtp.param[i].val); 1545 1546 out_fmtp.push_back(fmtp); 1547 } 1548 } 1549 1550 void VidCodecParam::getCodecFmtp(const CodecFmtpVector &in_fmtp, 1551 pjmedia_codec_fmtp &out_fmtp) const 1552 { 1553 CodecFmtpVector::const_iterator i; 1554 out_fmtp.cnt = 0; 1555 for (i=in_fmtp.begin(); i!=in_fmtp.end();++i) { 1556 if (out_fmtp.cnt >= PJMEDIA_CODEC_MAX_FMTP_CNT) { 1557 break; 1558 } 1559 out_fmtp.param[out_fmtp.cnt].name = str2Pj((*i).name); 1560 out_fmtp.param[out_fmtp.cnt].val = str2Pj((*i).val); 1561 ++out_fmtp.cnt; 1562 } 1563 }
Note: See TracChangeset
for help on using the changeset viewer.