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

#include <libmyth/audio/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, size_t &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 () const
 
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}
 
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 23 of file spdifencoder.cpp.

◆ ~SPDIFEncoder()

SPDIFEncoder::~SPDIFEncoder ( )

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,
size_t &  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 127 of file spdifencoder.cpp.

Referenced by AudioOutputDigitalEncoder::Encode().

◆ GetProcessedSize()

int SPDIFEncoder::GetProcessedSize ( )

◆ GetProcessedBuffer()

unsigned char * SPDIFEncoder::GetProcessedBuffer ( )

Definition at line 152 of file spdifencoder.cpp.

Referenced by AudioOutputBase::AddData().

◆ Reset()

void SPDIFEncoder::Reset ( )

Reset the internal encoder buffer.

Definition at line 162 of file spdifencoder.cpp.

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

◆ Succeeded()

bool SPDIFEncoder::Succeeded ( ) const
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 173 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 186 of file spdifencoder.cpp.

Referenced by SPDIFEncoder().

◆ Destroy()

void SPDIFEncoder::Destroy ( )
private

Destroy and free all allocated memory.

Definition at line 204 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

◆ m_size

long SPDIFEncoder::m_size {0}
private

Definition at line 34 of file spdifencoder.h.

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


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