Changeset 4676


Ignore:
Timestamp:
Dec 4, 2013 7:05:35 AM (10 years ago)
Author:
bennylp
Message:

Re #1519: added AudioMedia? for the sound device

Location:
pjproject/branches/projects/pjsua2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/pjsua2/pjsip-apps/build/Makefile

    r4631 r4676  
    6464#  x   x  x  x  x  x  x   x  x  x  x  x  x   x  x  x  x  x  x   x  x  x  x  x 
    6565#TARGETS := swig pjsua pjsystest samples 
    66 TARGETS := swig samples 
     66TARGETS := swig pjsua pjsystest samples 
    6767 
    6868.PHONY: $(TARGETS) 
  • pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/media.hpp

    r4672 r4676  
    473473     * created, it is possible that the function returns -1 as device IDs. 
    474474     * 
    475      * @return  Device ID of the capture device. 
     475     * @return                  Device ID of the capture device. 
    476476     */ 
    477477    int getCaptureDev() const throw(Error); 
     478 
     479    /** 
     480     * Get the AudioMedia of the capture audio device. 
     481     * 
     482     * @return                  Audio media for the capture device. 
     483     */ 
     484    AudioMedia &getCaptureDevMedia() throw(Error); 
    478485 
    479486    /** 
     
    481488     * been created, it is possible that the function returns -1 as device IDs. 
    482489     * 
    483      * @return  Device ID of the playback device. 
     490     * @return                  Device ID of the playback device. 
    484491     */ 
    485492    int getPlaybackDev() const throw(Error); 
     493 
     494    /** 
     495     * Get the AudioMedia of the speaker/playback audio device. 
     496     * 
     497     * @return                  Audio media for the speaker/playback device. 
     498     */ 
     499    AudioMedia &getPlaybackDevMedia() throw(Error); 
    486500 
    487501    /** 
     
    504518     * Enum all audio devices installed in the system. 
    505519     * 
    506      * @return          The list of audio device info. 
     520     * @return                  The list of audio device info. 
    507521     */ 
    508522    const AudioDevInfoVector &enumDev() throw(Error); 
     
    520534     * application connect the bridge to it's own sound device/master port. 
    521535     * 
    522      * @return          The port interface of the conference bridge, 
    523      *                  so that application can connect this to it's own 
    524      *                  sound device or master port. 
     536     * @return                  The port interface of the conference bridge, 
     537     *                          so that application can connect this to it's 
     538     *                          own sound device or master port. 
    525539     */ 
    526540    MediaPort *setNoDev(); 
     
    555569     * Get current echo canceller tail length. 
    556570     * 
    557      * @return          The EC tail length in milliseconds, 
    558      *                  If AEC is disabled, the value will be zero. 
     571     * @return                  The EC tail length in milliseconds, 
     572     *                          If AEC is disabled, the value will be zero. 
    559573     */ 
    560574    unsigned getEcTail() const throw(Error); 
     
    582596     * Get the number of sound devices installed in the system. 
    583597     * 
    584      * @return  The number of sound devices installed in the system. 
     598     * @return                  The number of sound devices installed in the 
     599     *                          system. 
    585600     * 
    586601     */ 
     
    600615     * Lookup device index based on the driver and device name. 
    601616     * 
    602      * @param drv_name  The driver name. 
    603      * @param dev_name  The device name. 
    604      * 
    605      * @return          The device ID. If the device is not found, Error will be 
    606      *                  thrown. 
    607      * 
     617     * @param drv_name          The driver name. 
     618     * @param dev_name          The device name. 
     619     * 
     620     * @return                  The device ID. If the device is not found, 
     621     *                          Error will be thrown. 
    608622     */ 
    609623    int lookupDev(const string &drv_name, 
     
    633647     * used. 
    634648     * 
    635      * @param format    The audio format. 
    636      * @param keep      Specify whether the setting is to be kept for 
    637      *                  future use. 
     649     * @param format            The audio format. 
     650     * @param keep              Specify whether the setting is to be kept for 
     651     *                          future use. 
    638652     * 
    639653     */ 
     
    653667     * otherwise Error will be thrown. 
    654668     * 
    655      * @return      The audio format. 
     669     * @return                  The audio format. 
    656670     * 
    657671     */ 
     
    672686     * used. 
    673687     * 
    674      * @param latency_msec          The input latency. 
    675      * @param keep                  Specify whether the setting is to be kept 
    676      *                              for future use. 
    677      * 
     688     * @param latency_msec      The input latency. 
     689     * @param keep              Specify whether the setting is to be kept 
     690     *                          for future use. 
    678691     */ 
    679692    void 
     
    692705     * otherwise Error will be thrown. 
    693706     * 
    694      * @return      The audio input latency. 
     707     * @return                  The audio input latency. 
    695708     * 
    696709     */ 
     
    731744     * otherwise Error will be thrown. 
    732745     * 
    733      * @return      The audio output latency. 
     746     * @return                  The audio output latency. 
    734747     * 
    735748     */ 
     
    751764     * used. 
    752765     * 
    753      * @param volume    The input volume level, in percent. 
    754      * @param keep      Specify whether the setting is to be kept for future 
    755      *                  use. 
     766     * @param volume            The input volume level, in percent. 
     767     * @param keep              Specify whether the setting is to be kept for 
     768     *                          future use. 
    756769     * 
    757770     */ 
     
    770783     * flags, otherwise Error will be thrown.     * 
    771784 
    772      * @return      The audio input volume level, in percent. 
     785     * @return                  The audio input volume level, in percent. 
    773786     * 
    774787     */ 
     
    789802     * used. 
    790803     * 
    791      * @param volume    The output volume level, in percent. 
    792      * @param keep      Specify whether the setting is to be kept 
    793      *                  for future use. 
     804     * @param volume            The output volume level, in percent. 
     805     * @param keep              Specify whether the setting is to be kept 
     806     *                          for future use. 
    794807     * 
    795808     */ 
     
    808821     * flags, otherwise Error will be thrown. 
    809822     * 
    810      * @return      The audio output volume level, in percent. 
     823     * @return                  The audio output volume level, in percent. 
    811824     * 
    812825     */ 
     
    825838     * flags, otherwise Error will be thrown. 
    826839     * 
    827      * @return      The audio input signal level, in percent. 
     840     * @return                  The audio input signal level, in percent. 
    828841     * 
    829842     */ 
     
    842855     * flags, otherwise Error will be thrown. 
    843856     * 
    844      * @return      The audio output signal level, in percent. 
     857     * @return                  The audio output signal level, in percent. 
    845858     * 
    846859     */ 
     
    861874     * used. 
    862875     * 
    863      * @param route     The audio input route. 
    864      * @param keep      Specify whether the setting is to be kept 
    865      *                  for future use. 
     876     * @param route             The audio input route. 
     877     * @param keep              Specify whether the setting is to be kept 
     878     *                          for future use. 
    866879     * 
    867880     */ 
     
    881894     * flags, otherwise Error will be thrown. 
    882895     * 
    883      * @return      The audio input route. 
     896     * @return                  The audio input route. 
    884897     * 
    885898     */ 
     
    900913     * used. 
    901914     * 
    902      * @param route     The audio output route. 
    903      * @param keep      Specify whether the setting is to be kept 
    904      *                  for future use. 
     915     * @param route             The audio output route. 
     916     * @param keep              Specify whether the setting is to be kept 
     917     *                          for future use. 
    905918     * 
    906919     */ 
     
    920933     * flags, otherwise Error will be thrown. 
    921934     * 
    922      * @return      The audio output route. 
     935     * @return                  The audio output route. 
    923936     * 
    924937     */ 
     
    957970     * capability in AudioDevInfo.caps flags, otherwise Error will be thrown. 
    958971     * 
    959      * @return      The audio voice activity detection feature. 
     972     * @return                  The audio voice activity detection feature. 
    960973     * 
    961974     */ 
     
    9941007     * capability in AudioDevInfo.caps flags, otherwise Error will be thrown. 
    9951008     * 
    996      * @return      The audio comfort noise generation feature. 
     1009     * @return                  The audio comfort noise generation feature. 
    9971010     * 
    9981011     */ 
     
    10311044     * capability in AudioDevInfo.caps flags, otherwise Error will be thrown. 
    10321045     * 
    1033      * @return      The audio packet loss concealment feature. 
     1046     * @return                  The audio packet loss concealment feature. 
    10341047     * 
    10351048     */ 
     
    10381051private: 
    10391052    AudioDevInfoVector           audioDevList; 
     1053    AudioMedia                  *devMedia; 
    10401054 
    10411055    /** 
  • pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/media.cpp

    r4672 r4676  
    356356    extFmt.clear(); 
    357357} 
     358 
     359/////////////////////////////////////////////////////////////////////////////// 
     360/* 
     361 * Simple AudioMedia class for sound device. 
     362 */ 
     363class DevAudioMedia : public AudioMedia 
     364{ 
     365public: 
     366    DevAudioMedia(); 
     367}; 
     368 
     369DevAudioMedia::DevAudioMedia() 
     370{ 
     371    this->id = 0; 
     372    registerMediaPort(NULL); 
     373} 
     374 
    358375/////////////////////////////////////////////////////////////////////////////// 
    359376/* Audio device operations. */ 
    360377 
     378AudDevManager::AudDevManager() 
     379{ 
     380    devMedia = new DevAudioMedia; 
     381} 
     382 
     383AudDevManager::~AudDevManager() 
     384{ 
     385    delete devMedia; 
     386    clearAudioDevList(); 
     387} 
     388 
    361389int AudDevManager::getCaptureDev() const throw(Error) 
    362390{ 
     
    364392} 
    365393 
     394AudioMedia &AudDevManager::getCaptureDevMedia() throw(Error) 
     395{ 
     396    return *devMedia; 
     397} 
     398 
    366399int AudDevManager::getPlaybackDev() const throw(Error) 
    367400{ 
    368401    return getActiveDev(false); 
     402} 
     403 
     404AudioMedia &AudDevManager::getPlaybackDevMedia() throw(Error) 
     405{ 
     406    return *devMedia; 
    369407} 
    370408 
     
    682720} 
    683721 
    684 AudDevManager::AudDevManager() 
    685 { 
    686  
    687  
    688 } 
    689  
    690 AudDevManager::~AudDevManager() 
    691 { 
    692     clearAudioDevList(); 
    693 } 
    694  
    695722void AudDevManager::clearAudioDevList() 
    696723{ 
Note: See TracChangeset for help on using the changeset viewer.