Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CAEEncoderFFmpeg Class Reference

#include <AEEncoderFFmpeg.h>

Inheritance diagram for CAEEncoderFFmpeg:
IAEEncoder

Public Member Functions

 CAEEncoderFFmpeg ()
 
 ~CAEEncoderFFmpeg () override
 
bool IsCompatible (const AEAudioFormat &format) override
 
bool Initialize (AEAudioFormat &format, bool allow_planar_input=false) override
 
void Reset () override
 
unsigned int GetBitRate () override
 
AVCodecID GetCodecID () override
 
unsigned int GetFrames () override
 
int Encode (uint8_t *in, int in_size, uint8_t *out, int out_size) override
 
int GetData (uint8_t **data) override
 
double GetDelay (unsigned int bufferSize) override
 
- Public Member Functions inherited from IAEEncoder
 IAEEncoder ()=default
 
virtual ~IAEEncoder ()=default
 

Constructor & Destructor Documentation

◆ CAEEncoderFFmpeg()

CAEEncoderFFmpeg::CAEEncoderFFmpeg ( )

◆ ~CAEEncoderFFmpeg()

CAEEncoderFFmpeg::~CAEEncoderFFmpeg ( )
override

Member Function Documentation

◆ Encode()

int CAEEncoderFFmpeg::Encode ( uint8_t * in,
int in_size,
uint8_t * out,
int out_size )
overridevirtual

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

@TODO: This is a workaround for our current design. The caller should be made

Implements IAEEncoder.

◆ GetBitRate()

unsigned int CAEEncoderFFmpeg::GetBitRate ( )
overridevirtual

Returns the bitrate of the encoder

Returns
bit rate in bits per second

Implements IAEEncoder.

◆ GetCodecID()

AVCodecID CAEEncoderFFmpeg::GetCodecID ( )
overridevirtual

Returns the AVCodecID of the encoder

Returns
the ffmpeg codec id

Implements IAEEncoder.

◆ GetData()

int CAEEncoderFFmpeg::GetData ( uint8_t ** data)
overridevirtual

Get the encoded data

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

Implements IAEEncoder.

◆ GetDelay()

double CAEEncoderFFmpeg::GetDelay ( unsigned int bufferSize)
overridevirtual

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

Implements IAEEncoder.

◆ GetFrames()

unsigned int CAEEncoderFFmpeg::GetFrames ( )
overridevirtual

Return the number of frames needed to encode

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

Implements IAEEncoder.

◆ Initialize()

bool CAEEncoderFFmpeg::Initialize ( AEAudioFormat & format,
bool allow_planar_input = false )
overridevirtual

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

Implements IAEEncoder.

◆ IsCompatible()

bool CAEEncoderFFmpeg::IsCompatible ( const AEAudioFormat & format)
overridevirtual

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

Implements IAEEncoder.

◆ Reset()

void CAEEncoderFFmpeg::Reset ( )
overridevirtual

Reset the encoder for new data

Implements IAEEncoder.


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