class EncoderInterface

Encoder Interface. More...

Contains pure virtuals
Full nameCoral::EncoderInterface
Definition#include <encoderinterface.h>
Inherited byAdvancedAudioEncoder, AudioEncoderInterface, AudioEncoderRepository, AudioEncoderRepository, EncoderRepositoryInterface, SimpleAudioEncoder
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

This class is the interface for an encoder.

EncoderInterface ()

[virtual]

Virtual destructor.

const card16  getTypeID ()

[const pure virtual]

Get the encoder's type ID.

Returns: Encoder's type ID.

const char*  getTypeName ()

[const pure virtual]

Get the encoder's name.

Returns: Encoder's name

void  activate ()

[pure virtual]

Activate the encoder. Usage example: Start an encoder thread.

void  deactivate ()

[pure virtual]

Deactivate the encoder. Usage example: Stop an encoder thread.

void  reset ()

[pure virtual]

Reset the encoder. Usage example: Reset an encoder thread.

bool  checkInterval (card64& time, bool& newRUList)

[pure virtual]

Check, when prepareNextFrame() call reaches a new interval().

Parameters:
timeReference to store time to next interval in microseconds.
Referenceto store true, if new resource/utilization list has been reached since last call; false otherwise.

Returns: true, if new interval has been reached since last call; false otherwise.

bool  prepareNextFrame (const cardinal headerSize, const cardinal maxPacketSize, const cardinal flags = 0)

[pure virtual]

Prepare next frame. Usage example: Read the next frame from file, transform it into packages for transport.

Parameters:
headerSizeSize of underlying protocol's header (e.g. RTP packet)
maxPacketSizeMaximum size of packet.
flagsEncoder-specific flags (e.g. compression or encryption).

Returns: true, if there was a next frame; false, if not.

cardinal  getNextPacket (EncoderPacket* packet)

[pure virtual]

Get next packet from current frame. The maximum payload length of the packet (the size of packet->Buffer) is in packet->MaxLength.

Parameters:
packetEncoderPacket structure.
bufferBuffer of the packet to write the data into.
maxLengthMaximum length of the packet

Returns: Real length of the data written into the buffer or 0, if there is no more data of the current frame.

void  getTransportInfo (TransportInfo& transportInfo, const cardinal headerSize, const cardinal maxPacketSize, const bool calculateLevels = true)

[const pure virtual]

Get TransportInfo for encoding.

Note: maxPacketSize gives the total size of the packet. The size usable by the encoder is maxPacketSize - headerSize!

Parameters:
transportInfoPointer to TransportInfo.
headerSizeSize of underlying protocol's header (e.g. RTP packet)
maxPacketSizeMaximum size of packet.
calculateLevelstrue to calculate all level constants; false otherwise.

void  setTransportInfo (TransportInfo& transportInfo, const cardinal headerSize, const cardinal maxPacketSize, const bool calculateLevels = true)

[pure virtual]

Set TransportInfo for encoding.

Note 1: setTransportInfo() may adapt the settings in transportInfo to fit the encoding's requirements. The corrected settings are returned in transportInfo!

Note 2: maxPacketSize gives the total size of the packet. The size usable by the encoder is maxPacketSize - headerSize!

Parameters:
transportInfoPointer to TransportInfo.
headerSizeSize of underlying protocol's header (e.g. RTP packet)
maxPacketSizeMaximum size of packet.
calculateLevelstrue to calculate all level constants; false otherwise.

void  adaptQuality (const double fractionLost, const cardinal layer)

[pure virtual]

Adapt the quality of the transmission. Usage example: Reduce audio quality, if too many packets are lost.

Parameters:
fractionLostFraction of the packets lost.
layerLayer number.

AbstractQoSDescription*  getQoSDescription ( const cardinal pktHeaderSize, const cardinal pktMaxSize, const card64 offset)

[pure virtual]

Get QoS description. Important note: This result is a global pointer, it becomes invalid when encoder is deleted!

Parameters:
pktHeaderSizePacket header size.
pktMaxSizeMaximum packet size.
offsetRTP position offset.

Returns: QoS Description.

void  updateQuality (const AbstractQoSDescription* aqd)

[pure virtual]

Update encoder quality to changes made in QoS description returned by getQoSDescription().