MythTV  master
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SPDIFEncoder Class Reference

#include <spdifencoder.h>

Public Member Functions

 SPDIFEncoder (const QString &muxer, AVCodecID codec_id)
 SPDIFEncoder constructor Args: QString muxer : name of the muxer. More...
 
 ~SPDIFEncoder ()
 
void WriteFrame (unsigned char *data, int size)
 Encode data through created muxer unsigned char data: pointer to data to encode int size: size of data to encode. More...
 
int GetData (unsigned char *buffer, int &dest_size)
 Retrieve encoded data and copy it in the provided buffer. More...
 
int GetProcessedSize ()
 
unsigned char * GetProcessedBuffer ()
 
void Reset ()
 Reset the internal encoder buffer. More...
 
bool Succeeded ()
 
bool SetMaxHDRate (int rate)
 Set the maximum HD rate. More...
 

Private Member Functions

void Destroy ()
 Destroy and free all allocated memory. More...
 

Static Private Member Functions

static int funcIO (void *opaque, unsigned char *buf, int size)
 funcIO: Internal callback function that will receive encoded frames More...
 

Private Attributes

bool m_complete {false}
 
AVFormatContext * m_oc {nullptr}
 
unsigned char m_buffer [AudioOutput::MAX_SIZE_BUFFER] {0}
 
long m_size {0}
 

Detailed Description

Definition at line 14 of file spdifencoder.h.

Constructor & Destructor Documentation

◆ SPDIFEncoder()

SPDIFEncoder::SPDIFEncoder ( const QString &  muxer,
AVCodecID  codec_id 
)

SPDIFEncoder constructor Args: QString muxer : name of the muxer.

Use "spdif" for IEC 958 or IEC 61937 encapsulation (AC3, DTS, E-AC3, TrueHD, DTS-HD-MA) Use "adts" for ADTS encpsulation (AAC) AVCodecContext *ctx : CodecContext to be encaspulated

Definition at line 24 of file spdifencoder.cpp.

◆ ~SPDIFEncoder()

SPDIFEncoder::~SPDIFEncoder ( void  )

Definition at line 89 of file spdifencoder.cpp.

Member Function Documentation

◆ WriteFrame()

void SPDIFEncoder::WriteFrame ( unsigned char *  data,
int  size 
)

Encode data through created muxer unsigned char data: pointer to data to encode int size: size of data to encode.

Definition at line 99 of file spdifencoder.cpp.

Referenced by AudioOutputBase::AddData(), and AudioOutputDigitalEncoder::Encode().

◆ GetData()

int SPDIFEncoder::GetData ( unsigned char *  buffer,
int &  dest_size 
)

Retrieve encoded data and copy it in the provided buffer.

Return -1 if there is no data to retrieve. On return, dest_size will contain the length of the data copied Upon completion, the internal encoder buffer is emptied.

Definition at line 120 of file spdifencoder.cpp.

Referenced by AudioOutputDigitalEncoder::Encode().

◆ GetProcessedSize()

int SPDIFEncoder::GetProcessedSize ( )
inline

Definition at line 21 of file spdifencoder.h.

Referenced by AudioOutputBase::AddData(), and AudioOutputDigitalEncoder::Encode().

◆ GetProcessedBuffer()

unsigned char* SPDIFEncoder::GetProcessedBuffer ( )
inline

Definition at line 22 of file spdifencoder.h.

Referenced by AudioOutputBase::AddData().

◆ Reset()

void SPDIFEncoder::Reset ( void  )

Reset the internal encoder buffer.

Definition at line 135 of file spdifencoder.cpp.

Referenced by AudioOutputBase::AddData(), and Destroy().

◆ Succeeded()

bool SPDIFEncoder::Succeeded ( )
inline

◆ SetMaxHDRate()

bool SPDIFEncoder::SetMaxHDRate ( int  rate)

Set the maximum HD rate.

If playing DTS-HD content, setting a HD rate of 0 will only use the DTS-Core and the HD stream be stripped out before encoding Input: rate = maximum HD rate in Hz

Definition at line 146 of file spdifencoder.cpp.

Referenced by AudioOutputBase::SetupPassthrough().

◆ funcIO()

int SPDIFEncoder::funcIO ( void *  opaque,
unsigned char *  buf,
int  size 
)
staticprivate

funcIO: Internal callback function that will receive encoded frames

Definition at line 159 of file spdifencoder.cpp.

Referenced by SPDIFEncoder().

◆ Destroy()

void SPDIFEncoder::Destroy ( )
private

Destroy and free all allocated memory.

Definition at line 171 of file spdifencoder.cpp.

Referenced by SPDIFEncoder(), and ~SPDIFEncoder().

Member Data Documentation

◆ m_complete

bool SPDIFEncoder::m_complete {false}
private

Definition at line 32 of file spdifencoder.h.

Referenced by Destroy(), and SPDIFEncoder().

◆ m_oc

AVFormatContext* SPDIFEncoder::m_oc {nullptr}
private

Definition at line 33 of file spdifencoder.h.

Referenced by Destroy(), SetMaxHDRate(), SPDIFEncoder(), and WriteFrame().

◆ m_buffer

unsigned char SPDIFEncoder::m_buffer[AudioOutput::MAX_SIZE_BUFFER] {0}
private

Definition at line 34 of file spdifencoder.h.

Referenced by funcIO(), GetData(), and SPDIFEncoder().

◆ m_size

long SPDIFEncoder::m_size {0}
private

Definition at line 35 of file spdifencoder.h.

Referenced by funcIO(), GetData(), and Reset().


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