Changeset 5969 for pjproject/trunk/pjsip/src/pjsua2/media.cpp
- Timestamp:
- Apr 15, 2019 10:52:16 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua2/media.cpp
r5956 r5969 158 158 } 159 159 160 void AudioMedia::registerMediaPort2(MediaPort port, pj_pool_t *pool) 161 throw(Error) 162 { 163 /* Check if media already added to Conf bridge. */ 164 pj_assert(!Endpoint::instance().mediaExists(*this)); 165 166 if (port != NULL) { 167 pj_assert(id == PJSUA_INVALID_ID); 168 pj_assert(pool); 169 170 PJSUA2_CHECK_EXPR( pjsua_conf_add_port(pool, 171 (pjmedia_port *)port, 172 &id) ); 173 } 174 175 Endpoint::instance().mediaAdd(*this); 176 } 177 160 178 void AudioMedia::unregisterMediaPort() 161 179 { … … 176 194 AudioMedia::~AudioMedia() 177 195 { 178 unregisterMediaPort();179 196 } 180 197 … … 409 426 void AudioMediaRecorder::createRecorder(const string &file_name, 410 427 unsigned enc_type, 411 pj_ssize_tmax_size,428 long max_size, 412 429 unsigned options) 413 430 throw(Error) … … 481 498 } 482 499 483 registerMediaPort (tonegen);500 registerMediaPort2(tonegen, pool); 484 501 } 485 502 … … 746 763 pj_leave_critical_section(); 747 764 return audioDevList; 765 } 766 767 AudioDevInfoVector2 AudDevManager::enumDev2() const throw(Error) 768 { 769 pjmedia_aud_dev_info pj_info[MAX_DEV_COUNT]; 770 unsigned count = MAX_DEV_COUNT; 771 AudioDevInfoVector2 adiv2; 772 773 PJSUA2_CHECK_EXPR( pjsua_enum_aud_devs(pj_info, &count) ); 774 775 for (unsigned i = 0; i<count ;++i) { 776 AudioDevInfo di; 777 di.fromPj(pj_info[i]); 778 adiv2.push_back(di); 779 } 780 781 return adiv2; 748 782 } 749 783 … … 1427 1461 } 1428 1462 1463 VideoDevInfoVector2 VidDevManager::enumDev2() const throw(Error) 1464 { 1465 VideoDevInfoVector2 vdiv2; 1466 #if PJSUA_HAS_VIDEO 1467 pjmedia_vid_dev_info pj_info[MAX_DEV_COUNT]; 1468 unsigned count = MAX_DEV_COUNT; 1469 1470 PJSUA2_CHECK_EXPR(pjsua_vid_enum_devs(pj_info, &count)); 1471 1472 for (unsigned i = 0; i<count;++i) { 1473 VideoDevInfo vdi; 1474 vdi.fromPj(pj_info[i]); 1475 vdiv2.push_back(vdi); 1476 } 1477 #endif 1478 return vdiv2; 1479 } 1480 1429 1481 int VidDevManager::lookupDev(const string &drv_name, 1430 1482 const string &dev_name) const throw(Error)
Note: See TracChangeset
for help on using the changeset viewer.