#include <spdifencoder.h>
Public Member Functions | |
| SPDIFEncoder (QString muxer, int codec_id) | |
| SPDIFEncoder constructor Args: QString muxer : name of the muxer. | |
| ~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. | |
| int | GetData (unsigned char *buffer, int &dest_size) |
| Retrieve encoded data and copy it in the provided buffer. | |
| int | GetProcessedSize () |
| unsigned char * | GetProcessedBuffer () |
| void | Reset () |
| Reset the internal encoder buffer. | |
| bool | Succeeded () |
| bool | SetMaxHDRate (int rate) |
| Set the maximum HD rate. | |
Private Member Functions | |
| void | Destroy () |
| Destroy and free all allocated memory. | |
Static Private Member Functions | |
| static int | funcIO (void *opaque, unsigned char *buf, int size) |
| funcIO: Internal callback function that will receive encoded frames | |
Private Attributes | |
| bool | m_complete |
| AVFormatContext * | m_oc |
| AVStream * | m_stream |
| unsigned char | m_buffer [AVCODEC_MAX_AUDIO_FRAME_SIZE] |
| long | m_size |
Definition at line 14 of file spdifencoder.h.
| SPDIFEncoder::SPDIFEncoder | ( | QString | muxer, | |
| int | 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 | ( | void | ) |
Definition at line 82 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 92 of file spdifencoder.cpp.
Referenced by AudioOutputBase::AddData(), and AudioOutputDigitalEncoder::Encode().
| 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 113 of file spdifencoder.cpp.
Referenced by AudioOutputDigitalEncoder::Encode().
| int SPDIFEncoder::GetProcessedSize | ( | ) | [inline] |
Definition at line 21 of file spdifencoder.h.
Referenced by AudioOutputBase::AddData(), and AudioOutputDigitalEncoder::Encode().
| unsigned char* SPDIFEncoder::GetProcessedBuffer | ( | ) | [inline] |
Definition at line 22 of file spdifencoder.h.
Referenced by AudioOutputBase::AddData().
| void SPDIFEncoder::Reset | ( | void | ) |
Reset the internal encoder buffer.
Definition at line 128 of file spdifencoder.cpp.
Referenced by AudioOutputBase::AddData(), and Destroy().
| bool SPDIFEncoder::Succeeded | ( | ) | [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 139 of file spdifencoder.cpp.
Referenced by AudioOutputBase::SetupPassthrough().
| int SPDIFEncoder::funcIO | ( | void * | opaque, | |
| unsigned char * | buf, | |||
| int | size | |||
| ) | [static, private] |
funcIO: Internal callback function that will receive encoded frames
Definition at line 152 of file spdifencoder.cpp.
Referenced by SPDIFEncoder().
| void SPDIFEncoder::Destroy | ( | ) | [private] |
Destroy and free all allocated memory.
Definition at line 164 of file spdifencoder.cpp.
Referenced by SPDIFEncoder(), and ~SPDIFEncoder().
bool SPDIFEncoder::m_complete [private] |
Definition at line 32 of file spdifencoder.h.
Referenced by Destroy(), and SPDIFEncoder().
AVFormatContext* SPDIFEncoder::m_oc [private] |
Definition at line 33 of file spdifencoder.h.
Referenced by Destroy(), SetMaxHDRate(), SPDIFEncoder(), and WriteFrame().
AVStream* SPDIFEncoder::m_stream [private] |
Definition at line 34 of file spdifencoder.h.
Referenced by Destroy(), and SPDIFEncoder().
unsigned char SPDIFEncoder::m_buffer[AVCODEC_MAX_AUDIO_FRAME_SIZE] [private] |
Definition at line 35 of file spdifencoder.h.
Referenced by funcIO(), GetData(), and SPDIFEncoder().
long SPDIFEncoder::m_size [private] |
Definition at line 36 of file spdifencoder.h.
1.6.3