|
|
This class is the interface for an encoder.
~ |
[virtual]
Virtual destructor.
const card16 |
[const pure virtual]
Get the encoder's type ID.
Returns: Encoder's type ID.
const char* |
[const pure virtual]
Get the encoder's name.
Returns: Encoder's name
void |
[pure virtual]
Activate the encoder. Usage example: Start an encoder thread.
void |
[pure virtual]
Deactivate the encoder. Usage example: Stop an encoder thread.
void |
[pure virtual]
Reset the encoder. Usage example: Reset an encoder thread.
card64 |
[pure virtual]
Check, when prepareNextFrame() call reaches a new interval().
Returns: Time to next interval in microseconds.
bool |
[pure virtual]
Prepare next frame. Usage example: Read the next frame from file, transform it into packages for transport.
Parameters:
headerSize | Size of underlying protocol's header (e.g. RTP packet) |
maxPacketSize | Maximum size of packet. |
flags | Encoder-specific flags (e.g. compression or encryption). |
Returns: true, if there was a next frame; false, if not.
cardinal |
[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:
packet | EncoderPacket structure. |
buffer | Buffer of the packet to write the data into. |
maxLength | Maximum 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 |
[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:
transportInfo | Pointer to TransportInfo. |
headerSize | Size of underlying protocol's header (e.g. RTP packet) |
maxPacketSize | Maximum size of packet. |
calculateLevels | true to calculate all level constants; false otherwise. |
void |
[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:
transportInfo | Pointer to TransportInfo. |
headerSize | Size of underlying protocol's header (e.g. RTP packet) |
maxPacketSize | Maximum size of packet. |
calculateLevels | true to calculate all level constants; false otherwise. |
void |
[pure virtual]
Adapt the quality of the transmission. Usage example: Reduce audio quality, if too many packets are lost.
Parameters:
fractionLost | Fraction of the packets lost. |
layer | Layer number. |
AbstractQoSDescription* |
[pure virtual]
Get QoS description. Important note: This result is a global pointer, it becomes invalid when encoder is deleted!
Parameters:
pktHeaderSize | Packet header size. |
pktMaxSize | Maximum packet size. |
offset | RTP position offset. |
Returns: QoS Description.
void |
[pure virtual]
Update encoder quality to changes made in QoS description returned by getQoSDescription().