VoEEncryption


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

  • External encryption and decryption.

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


GetInterface

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

Syntax

static VoEEncryption* 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 VoEEncryption 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_encryption.h


Release

Releases the VoEEncryption 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_encryption.h


RegisterExternalEncryption

Installs an Encryption instance and enables external encryption for the selected channel.

Syntax

int RegisterExternalEncryption(int channel, Encryption& encryption);

Parameters

channel [in] The channel ID number.

encryption [in] Reference to an instance which derives from Encryption and implements the external encryption functionality.

Return Values

The return value is 0 if the function succeeds. If the function fails, the return value is -1.

Requirements

Supported platforms

Windows, Mac OS X, Linux

Header

Declared in voe_encryption.h


DeRegisterExternalEncryption

Removes an Encryption instance and disables external encryption for the selected channel.

Syntax

int DeRegisterExternalEncryption(int channel);

Parameters

channel [in] The channel ID number.

Return Values

The return value is 0 if the function succeeds. If the function fails, the return value is -1.

Requirements

Supported platforms

Windows, Mac OS X, Linux

Header

Declared in voe_encryption.h


Comments