VoEVideoSync


The VoEVideoSync sub-API mainly adds the following functionalities to VoEBase:

  • RTP header modification (time stamp and sequence number fields).

  • Playout delay tuning to synchronize the voice with video.

  • Playout delay monitoring.

NOTE: The VoEVideoSync:: prefix is excluded for most API names throughout this chapter.


GetInterface

Retrieves a pointer to the VoEVideoSync sub-API and increases an internal reference counter for this sub API.

Syntax

static VoEVideoSync* GetInterface(VoiceEngine* voiceEngine);

Parameters

voiceEngine [in] Pointer to an already created VoiceEngine object.

Return Values

If the function succeeds, the return value is a pointer to the new VoEVideoSync interface.

If the function fails, the return value is NULL.

Remarks

Each call to this function increments an internal reference counter for the specified VoiceEngine object. This reference count is decreased by calling the corresponding Release() method and it must be zero when the VoiceEngine instance is deleted (see also VoiceEngine::Delete() ).

Example Code

See VoEBase::GetInterface().

Requirements

Supported platforms

Windows, Mac OS X, Linux

Header

Declared in voe_video_sync.h


Release

Releases the VoEVideoSync sub-API and decreases an internal reference counter for this sub API.

Syntax

int Release();

Return Values

If the function succeeds, the return value is the value of the internal reference count, which can be used for diagnostic purposes.

If the function fails, the return value is -1 and a specific error code can be retrieved by calling VoEBase::LastError().

Remarks

The number of calls to Release() should always match the number of calls to GetInterface().

When the reference count of all sub-APIs reaches zero, VoiceEngine::Delete() can be performed to release the allocated resources.

It is considered safe to delete the VoiceEngine instance even if Release() has been called too many times; however, -1 is given as return value to indicate that the number of calls to Release() does not match the number of calls to GetInterface().

Example Code

See VoEBase::Release().

Requirements

Supported platforms

Windows, Mac OS X, Linux

Header

Declared in voe_video_sync.h


GetPlayoutBufferSize

This function returns the current sound card buffer size (playout delay).

Syntax

int GetPlayoutBufferSize(int& bufferMs);

Parameters

bufferMs [out] The current sound card buffer size in milliseconds.

Return Values

The return value is 0 if the function succeeds. If the function fails, the return value is -1 and a specific error code can be retrieved by calling VoEBase::LastError().

Remarks

This is the delay that occurs between the decoding of a packet and its playout.

Requirements

Supported platforms

Windows, Mac OS X, Linux

Header

Declared in voe_video_sync.h



SetMinimumPlayoutDelay

This function sets an additional delay for the playout jitter buffer.

Syntax

int SetMinimumPlayoutDelay(int channel, int delayMs);

Parameters

channel [in] The channel ID number.

delayMs [in] The additional playout delay, in milliseconds. Allowed range is 0-1000 ms.

Return Values

The return value is 0 if the function succeeds. If the function fails, the return value is -1 and a specific error code can be retrieved by calling VoEBase::LastError().

Remarks

This function increases the playout delay by the specified amount. By default it is zero. This enables you to synchronize the voice with video.

Requirements

Supported platforms

Windows, Mac OS X, Linux

Header

Declared in voe_video_sync.h


GetDelayEstimate

This function returns the sum of the algorithmic delay, jitter buffer delay, and the playout buffer delay for a channel.

Syntax

int GetDelayEstimate(int channel, int& delayMs);

Parameters

channel [in] The channel ID number.

delayMs [out] The delay estimate in milliseconds.

Return Values

The return value is 0 if the function succeeds. If the function fails, the return value is -1 and a specific error code can be retrieved by calling VoEBase::LastError().

Remarks

This value does not include the transmission delay.

Requirements

Supported platforms

Windows, Mac OS X, Linux

Header

Declared in voe_video_sync.h


SetInitTimestamp

This function allows manual initialization of the RTP timestamp.

Syntax

int SetInitTimestamp(int channel, unsigned int timestamp);

Parameters

channel [in] The channel ID number.

timestamp [in] The RTP timestamp.

Return Values

The return value is 0 if the function succeeds. If the function fails, the return value is -1 and a specific error code can be retrieved by calling VoEBase::LastError().

Remarks

If this call has been made the channel must be re-created for VoiceEngine to initialize the RTP timestamp.

This call should be performed before VoEBase::StartSend() is called.

Requirements

Supported platforms

Windows, Mac OS X, Linux

Header

Declared in voe_video_sync.h


SetInitSequenceNumber

This function allows manual initialization of the RTP sequence number.

Syntax

int SetInitSequenceNumber(int channel, short sequenceNumber);

Parameters

channel [in] The channel ID number.

sequenceNumber [in] The RTP sequence number.

Return Values

The return value is 0 if the function succeeds. If the function fails, the return value is -1 and a specific error code can be retrieved by calling VoEBase::LastError().

Remarks

If this call has been made the channel must be re-created for VoiceEngine to initialize the RTP sequence number.

This call should be performed before VoEBase::StartSend() is called.

Requirements

Supported platforms

Windows, Mac OS X, Linux

Header

Declared in voe_video_sync.h


GetPlayoutTimeStamp

This function returns the RTP timestamp of the audio that is currently being played out.

Syntax

int GetPlayoutTimestamp(int channel, unsigned int& timestamp);

Parameters

channel [in] The channel ID number.

timestamp [out] The RTP timestamp.

Return Values

The return value is 0 if the function succeeds. If the function fails, the return value is -1 and a specific error code can be retrieved by calling VoEBase::LastError().

Remarks

This function can be used to synchronize video with the voice stream.

Requirements

Supported platforms

Windows, Mac OS X, Linux

Header

Declared in voe_video_sync.h


GetRtpRtcp

Provides access to the internal RTP/RTCP module.

Syntax

int GetRtpRtcp (int channel, RtpRtcp* &rtpRtcpModule);

Parameters

channel [in] The channel ID number.

rtpRtcpModule [out] The RTCP Module.

Return Values

The return value is 0 if the function succeeds. If the function fails, the return value is -1 and a specific error code can be retrieved by calling VoEBase::LastError().

Requirements

Supported platforms

Windows, Mac OS X, Linux

Header

Declared in voe_video_sync.h


Comments