BLOG | DOCUMENTATION | TRAC

Home --> Documentations --> PJSIP Reference

pj::MediaConfig Struct Reference

#include <endpoint.hpp>

Inheritance diagram for pj::MediaConfig:
pj::PersistentObject

Public Member Functions

 MediaConfig ()
 
void fromPj (const pjsua_media_config &mc)
 
pjsua_media_config toPj () const
 
virtual void readObject (const ContainerNode &node) PJSUA2_THROW(Error)
 
virtual void writeObject (ContainerNode &node) const PJSUA2_THROW(Error)
 
- Public Member Functions inherited from pj::PersistentObject
virtual ~PersistentObject ()
 

Data Fields

unsigned clockRate
 
unsigned sndClockRate
 
unsigned channelCount
 
unsigned audioFramePtime
 
unsigned maxMediaPorts
 
bool hasIoqueue
 
unsigned threadCnt
 
unsigned quality
 
unsigned ptime
 
bool noVad
 
unsigned ilbcMode
 
unsigned txDropPct
 
unsigned rxDropPct
 
unsigned ecOptions
 
unsigned ecTailLen
 
unsigned sndRecLatency
 
unsigned sndPlayLatency
 
int jbInit
 
int jbMinPre
 
int jbMaxPre
 
int jbMax
 
int sndAutoCloseTime
 
bool vidPreviewEnableNative
 

Detailed Description

This structure describes media configuration, which will be specified when calling Lib::init().

Constructor & Destructor Documentation

◆ MediaConfig()

pj::MediaConfig::MediaConfig ( )

Default constructor initialises with default values

Member Function Documentation

◆ fromPj()

void pj::MediaConfig::fromPj ( const pjsua_media_config mc)

Construct from pjsua_media_config.

◆ toPj()

pjsua_media_config pj::MediaConfig::toPj ( ) const

Export

◆ readObject()

virtual void pj::MediaConfig::readObject ( const ContainerNode node)
virtual

Read this object from a container.

Parameters
nodeContainer to write values from.

Implements pj::PersistentObject.

◆ writeObject()

virtual void pj::MediaConfig::writeObject ( ContainerNode node) const
virtual

Write this object to a container.

Parameters
nodeContainer to write values to.

Implements pj::PersistentObject.

Field Documentation

◆ clockRate

unsigned pj::MediaConfig::clockRate

Clock rate to be applied to the conference bridge. If value is zero, default clock rate will be used (PJSUA_DEFAULT_CLOCK_RATE, which by default is 16KHz).

◆ sndClockRate

unsigned pj::MediaConfig::sndClockRate

Clock rate to be applied when opening the sound device. If value is zero, conference bridge clock rate will be used.

◆ channelCount

unsigned pj::MediaConfig::channelCount

Channel count be applied when opening the sound device and conference bridge.

◆ audioFramePtime

unsigned pj::MediaConfig::audioFramePtime

Specify audio frame ptime. The value here will affect the samples per frame of both the sound device and the conference bridge. Specifying lower ptime will normally reduce the latency.

Default value: PJSUA_DEFAULT_AUDIO_FRAME_PTIME

◆ maxMediaPorts

unsigned pj::MediaConfig::maxMediaPorts

Specify maximum number of media ports to be created in the conference bridge. Since all media terminate in the bridge (calls, file player, file recorder, etc), the value must be large enough to support all of them. However, the larger the value, the more computations are performed.

Default value: PJSUA_MAX_CONF_PORTS

◆ hasIoqueue

bool pj::MediaConfig::hasIoqueue

Specify whether the media manager should manage its own ioqueue for the RTP/RTCP sockets. If yes, ioqueue will be created and at least one worker thread will be created too. If no, the RTP/RTCP sockets will share the same ioqueue as SIP sockets, and no worker thread is needed.

Normally application would say yes here, unless it wants to run everything from a single thread.

◆ threadCnt

unsigned pj::MediaConfig::threadCnt

Specify the number of worker threads to handle incoming RTP packets. A value of one is recommended for most applications.

◆ quality

unsigned pj::MediaConfig::quality

Media quality, 0-10, according to this table: 5-10: resampling use large filter, 3-4: resampling use small filter, 1-2: resampling use linear. The media quality also sets speex codec quality/complexity to the number.

Default: 5 (PJSUA_DEFAULT_CODEC_QUALITY).

◆ ptime

unsigned pj::MediaConfig::ptime

Specify default codec ptime.

Default: 0 (codec specific)

◆ noVad

bool pj::MediaConfig::noVad

Disable VAD?

Default: 0 (no (meaning VAD is enabled))

◆ ilbcMode

unsigned pj::MediaConfig::ilbcMode

iLBC mode (20 or 30).

Default: 30 (PJSUA_DEFAULT_ILBC_MODE)

◆ txDropPct

unsigned pj::MediaConfig::txDropPct

Percentage of RTP packet to drop in TX direction (to simulate packet lost).

Default: 0

◆ rxDropPct

unsigned pj::MediaConfig::rxDropPct

Percentage of RTP packet to drop in RX direction (to simulate packet lost).

Default: 0

◆ ecOptions

unsigned pj::MediaConfig::ecOptions

Echo canceller options (see pjmedia_echo_create())

Default: 0.

◆ ecTailLen

unsigned pj::MediaConfig::ecTailLen

Echo canceller tail length, in miliseconds. Setting this to zero will disable echo cancellation.

Default: PJSUA_DEFAULT_EC_TAIL_LEN

◆ sndRecLatency

unsigned pj::MediaConfig::sndRecLatency

Audio capture buffer length, in milliseconds.

Default: PJMEDIA_SND_DEFAULT_REC_LATENCY

◆ sndPlayLatency

unsigned pj::MediaConfig::sndPlayLatency

Audio playback buffer length, in milliseconds.

Default: PJMEDIA_SND_DEFAULT_PLAY_LATENCY

◆ jbInit

int pj::MediaConfig::jbInit

Jitter buffer initial prefetch delay in msec. The value must be between jb_min_pre and jb_max_pre below.

Default: -1 (to use default stream settings, currently 150 msec)

◆ jbMinPre

int pj::MediaConfig::jbMinPre

Jitter buffer minimum prefetch delay in msec.

Default: -1 (to use default stream settings, currently 60 msec)

◆ jbMaxPre

int pj::MediaConfig::jbMaxPre

Jitter buffer maximum prefetch delay in msec.

Default: -1 (to use default stream settings, currently 240 msec)

◆ jbMax

int pj::MediaConfig::jbMax

Set maximum delay that can be accomodated by the jitter buffer msec.

Default: -1 (to use default stream settings, currently 360 msec)

◆ sndAutoCloseTime

int pj::MediaConfig::sndAutoCloseTime

Specify idle time of sound device before it is automatically closed, in seconds. Use value -1 to disable the auto-close feature of sound device

Default : 1

◆ vidPreviewEnableNative

bool pj::MediaConfig::vidPreviewEnableNative

Specify whether built-in/native preview should be used if available. In some systems, video input devices have built-in capability to show preview window of the device. Using this built-in preview is preferable as it consumes less CPU power. If built-in preview is not available, the library will perform software rendering of the input. If this field is set to PJ_FALSE, software preview will always be used.

Default: PJ_TRUE


The documentation for this struct 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.