MythTV
master
|
#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, const uint8_t *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} |
Definition at line 14 of file spdifencoder.h.
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 | ( | ) |
Definition at line 89 of file spdifencoder.cpp.
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().
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().
int SPDIFEncoder::GetProcessedSize | ( | ) |
Definition at line 145 of file spdifencoder.cpp.
Referenced by AudioOutputBase::AddData(), and AudioOutputDigitalEncoder::Encode().
unsigned char * SPDIFEncoder::GetProcessedBuffer | ( | ) |
Definition at line 152 of file spdifencoder.cpp.
Referenced by AudioOutputBase::AddData().
void SPDIFEncoder::Reset | ( | ) |
Reset the internal encoder buffer.
Definition at line 162 of file spdifencoder.cpp.
Referenced by AudioOutputBase::AddData(), and Destroy().
|
inline |
Definition at line 24 of file spdifencoder.h.
Referenced by AudioOutputDigitalEncoder::Init(), and AudioOutputBase::SetupPassthrough().
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().
|
staticprivate |
funcIO: Internal callback function that will receive encoded frames
Definition at line 186 of file spdifencoder.cpp.
Referenced by SPDIFEncoder().
|
private |
Destroy and free all allocated memory.
Definition at line 204 of file spdifencoder.cpp.
Referenced by SPDIFEncoder(), and ~SPDIFEncoder().
Definition at line 32 of file spdifencoder.h.
Referenced by Destroy(), and SPDIFEncoder().
|
private |
Definition at line 33 of file spdifencoder.h.
Referenced by Destroy(), GetData(), GetProcessedBuffer(), GetProcessedSize(), SetMaxHDRate(), SPDIFEncoder(), and WriteFrame().
|
private |
Definition at line 34 of file spdifencoder.h.
Referenced by GetData(), GetProcessedSize(), and Reset().