Changeset 5165 for pjproject/trunk/pjsip/src/pjsua2/media.cpp
- Timestamp:
- Aug 21, 2015 6:00:46 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.