BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJSIP Reference

pj::ExtraAudioDevice Class Reference

#include <media.hpp>

Inheritance diagram for pj::ExtraAudioDevice:
pj::AudioMedia pj::Media

Public Member Functions

 ExtraAudioDevice (int playdev, int recdev)
 
virtual ~ExtraAudioDevice ()
 
void open ()
 
void close ()
 
bool isOpened ()
 
- Public Member Functions inherited from pj::AudioMedia
ConfPortInfo getPortInfo () const throw (Error)
 
int getPortId () const
 
void startTransmit (const AudioMedia &sink) const throw (Error)
 
void startTransmit2 (const AudioMedia &sink, const AudioMediaTransmitParam &param) const throw (Error)
 
void stopTransmit (const AudioMedia &sink) const throw (Error)
 
void adjustRxLevel (float level) throw (Error)
 
void adjustTxLevel (float level) throw (Error)
 
unsigned getRxLevel () const throw (Error)
 
unsigned getTxLevel () const throw (Error)
 
 AudioMedia ()
 
virtual ~AudioMedia ()
 
- Public Member Functions inherited from pj::Media
virtual ~Media ()
 
pjmedia_type getType () const
 

Protected Attributes

int playDev
 
int recDev
 
void * ext_snd_dev
 
- Protected Attributes inherited from pj::AudioMedia
int id
 

Additional Inherited Members

- Static Public Member Functions inherited from pj::AudioMedia
static ConfPortInfo getPortInfoFromId (int port_id) throw (Error)
 
static AudioMediatypecastFromMedia (Media *media)
 
- Protected Member Functions inherited from pj::AudioMedia
void registerMediaPort (MediaPort port) throw (Error)
 
void registerMediaPort2 (MediaPort port, pj_pool_t *pool) throw (Error)
 
void unregisterMediaPort ()
 
- Protected Member Functions inherited from pj::Media
 Media (pjmedia_type med_type)
 

Detailed Description

Extra audio device. This class allows application to have multiple sound device instances active concurrently.

Application may also use this class to improve media clock. Normally media clock is driven by sound device in master port, but unfortunately some sound devices may produce jittery clock. To improve media clock, application can install Null Sound Device (i.e: using AudDevManager::setNullDev()), which will act as a master port, and install the sound device as extra sound device.

Note that extra sound device will not have auto-close upon idle feature. Also note that the extra sound device only supports mono channel.

Constructor & Destructor Documentation

◆ ExtraAudioDevice()

pj::ExtraAudioDevice::ExtraAudioDevice ( int  playdev,
int  recdev 
)

Constructor.

Parameters
playdevPlayback device ID.
recdevRecord device ID.

◆ ~ExtraAudioDevice()

virtual pj::ExtraAudioDevice::~ExtraAudioDevice ( )
virtual

Destructor.

Member Function Documentation

◆ open()

void pj::ExtraAudioDevice::open ( )

Open the audio device using format (e.g.: clock rate, bit per sample, samples per frame) matched to the conference bridge's format, except the channel count, which will be set to one (mono channel). This will also register the audio device port to conference bridge.

◆ close()

void pj::ExtraAudioDevice::close ( )

Close the audio device and unregister the audio device port from the conference bridge.

◆ isOpened()

bool pj::ExtraAudioDevice::isOpened ( )

Is the extra audio device opened?

Returns
'true' if it is opened.

The documentation for this class was generated from the following file:

 


PJSIP Open Source, high performance, small footprint, and very very portable SIP stack
Copyright (C) 2006-2008 Teluu Inc.