kodi
Public Member Functions | List of all members
IAEEncoder Class Referenceabstract

IAEEncoder interface for on the fly audio compression. More...

#include <AEEncoder.h>

Inheritance diagram for IAEEncoder:
Inheritance graph
[legend]

Public Member Functions

 IAEEncoder ()=default
 Constructor.
 
virtual ~IAEEncoder ()=default
 Destructor.
 
virtual bool IsCompatible (const AEAudioFormat &format)=0
 Return true if the supplied format is compatible with the current open encoder. More...
 
virtual bool Initialize (AEAudioFormat &format, bool allow_planar_input=false)=0
 Called to setup the encoder to accept data in the specified format. More...
 
virtual void Reset ()=0
 Reset the encoder for new data.
 
virtual unsigned int GetBitRate ()=0
 Returns the bitrate of the encoder. More...
 
virtual AVCodecID GetCodecID ()=0
 Returns the AVCodecID of the encoder. More...
 
virtual unsigned int GetFrames ()=0
 Return the number of frames needed to encode. More...
 
virtual int Encode (uint8_t *in, int in_size, uint8_t *out, int out_size)=0
 Encodes the supplied samples into a provided buffer. More...
 
virtual int GetData (uint8_t **data)=0
 Get the encoded data. More...
 
virtual double GetDelay (unsigned int bufferSize)=0
 Get the delay in seconds. More...
 

Detailed Description

IAEEncoder interface for on the fly audio compression.

Member Function Documentation

◆ Encode()

virtual int IAEEncoder::Encode ( uint8_t *  in,
int  in_size,
uint8_t *  out,
int  out_size 
)
pure virtual

Encodes the supplied samples into a provided buffer.

Parameters
inthe PCM samples encoder requested format
in_sizeinput buffer size
outputbuffer
out_sizeoutput buffer size
Returns
size of encoded data

Implemented in CAEEncoderFFmpeg.

◆ GetBitRate()

virtual unsigned int IAEEncoder::GetBitRate ( )
pure virtual

Returns the bitrate of the encoder.

Returns
bit rate in bits per second

Implemented in CAEEncoderFFmpeg.

◆ GetCodecID()

virtual AVCodecID IAEEncoder::GetCodecID ( )
pure virtual

Returns the AVCodecID of the encoder.

Returns
the ffmpeg codec id

Implemented in CAEEncoderFFmpeg.

◆ GetData()

virtual int IAEEncoder::GetData ( uint8_t **  data)
pure virtual

Get the encoded data.

Parameters
datareturn pointer to the buffer with the current encoded block
Returns
the size in bytes of *data

Implemented in CAEEncoderFFmpeg.

◆ GetDelay()

virtual double IAEEncoder::GetDelay ( unsigned int  bufferSize)
pure virtual

Get the delay in seconds.

Parameters
bufferSizehow much encoded data the caller has buffered to add to the delay
Returns
the delay in seconds including any un-fetched encoded data

Implemented in CAEEncoderFFmpeg.

◆ GetFrames()

virtual unsigned int IAEEncoder::GetFrames ( )
pure virtual

Return the number of frames needed to encode.

Returns
number of frames (frames * channels = samples * bits per sample = bytes)

Implemented in CAEEncoderFFmpeg.

◆ Initialize()

virtual bool IAEEncoder::Initialize ( AEAudioFormat format,
bool  allow_planar_input = false 
)
pure virtual

Called to setup the encoder to accept data in the specified format.

Parameters
formatthe desired audio format, may be changed to suit the encoder
allow_planar_inputallow engine to use with planar formats
Returns
true on success, false on failure

Implemented in CAEEncoderFFmpeg.

◆ IsCompatible()

virtual bool IAEEncoder::IsCompatible ( const AEAudioFormat format)
pure virtual

Return true if the supplied format is compatible with the current open encoder.

Parameters
formatthe format to compare
Returns
true if compatible, false if not

Implemented in CAEEncoderFFmpeg.


The documentation for this class was generated from the following file: