|
vdr-plugin-softhddevice-drm-gles 1.6.2
|
FFMpeg Audio Decoder Frontend. More...
Classes | |
| class | cAudioDecoder |
| Audio Decoder. More... | |
Enumerations | |
| enum | PassthroughMask { CODEC_AC3 = (1 << 2) , CODEC_EAC3 = (1 << 3) , CODEC_DTS = (1 << 4) } |
| Bits used for the passthrough mask. More... | |
| enum | IEC61937Type { IEC61937_NULL = 0x00 , IEC61937_AC3 = 0x01 , IEC61937_EAC3 = 0x15 , IEC61937_DTS1 = 0x0B , IEC61937_DTS2 = 0x0C , IEC61937_DTS3 = 0x0D , IEC61937_DTSHD = 0x11 , IEC61937_TRUEHD = 0x16 } |
| IEC Data type. More... | |
| enum | IEC61937Preamble { IEC61937_PREAMBLE1 = 0xF872 , IEC61937_PREAMBLE2 = 0x4E1F , DTS_PREAMBLE_16BE_1 = 0x7FFE , DTS_PREAMBLE_16BE_2 = 0x8001 } |
| IEC Preambles. More... | |
| enum | CodecFrameSizes { DTS1_FRAME_SIZE = 512 , DTS2_FRAME_SIZE = 1024 , DTS3_FRAME_SIZE = 2048 , AC3_FRAME_SIZE = 1536 , EAC3_FRAME_SIZE = 6144 , MAX_FRAME_SIZE = EAC3_FRAME_SIZE , TRUEHD_FRAME_SIZE = 15360 } |
| Codec frame sizes for spdif. More... | |
Functions | |
| cAudioDecoder::cAudioDecoder (cSoftHdAudio *) | |
| Create a new audio decoder for the given audio context. | |
| cAudioDecoder::~cAudioDecoder (void) | |
| void | cAudioDecoder::Open (AVCodecID, AVCodecParameters *=nullptr, AVRational={ .num=1,.den=90000 }) |
| Open and initiate the audio decoder. | |
| void | cAudioDecoder::Close (void) |
| Close the audio decoder. | |
| int | cAudioDecoder::DecodePassthrough (const AVPacket *, AVFrame *) |
| Passthrough audio data. | |
| int | cAudioDecoder::UpdateFormat (void) |
| Handle audio format changes. | |
| void | cAudioDecoder::Decode (const AVPacket *) |
| Decode an audio packet. | |
| void | cAudioDecoder::FlushBuffers (void) |
| Flush the audio decoder buffers. | |
| void | cAudioDecoder::ResetSpdif (void) |
| void | cAudioDecoder::SetPassthroughMask (int) |
| Set audio pass-through mask. | |
FFMpeg Audio Decoder Frontend.
Codec frame sizes for spdif.
| Enumerator | |
|---|---|
| DTS1_FRAME_SIZE | |
| DTS2_FRAME_SIZE | |
| DTS3_FRAME_SIZE | |
| AC3_FRAME_SIZE | |
| EAC3_FRAME_SIZE | |
| MAX_FRAME_SIZE | |
| TRUEHD_FRAME_SIZE | (not used) |
Definition at line 67 of file codec_audio.h.
IEC Preambles.
| Enumerator | |
|---|---|
| IEC61937_PREAMBLE1 | |
| IEC61937_PREAMBLE2 | |
| DTS_PREAMBLE_16BE_1 | |
| DTS_PREAMBLE_16BE_2 | |
Definition at line 57 of file codec_audio.h.
IEC Data type.
Definition at line 43 of file codec_audio.h.
Bits used for the passthrough mask.
0x01 and 0x02 are kept unused for compatibility with an existing setup.conf
| Enumerator | |
|---|---|
| CODEC_AC3 | AC-3 bit mask. |
| CODEC_EAC3 | E-AC-3 bit mask. |
| CODEC_DTS | DTS bit mask. |
Definition at line 34 of file codec_audio.h.
| cAudioDecoder::cAudioDecoder | ( | cSoftHdAudio * | audio | ) |
Create a new audio decoder for the given audio context.
| audio | audio context |
Definition at line 41 of file codec_audio.cpp.
References L_CODEC, LOGDEBUG2, LOGFATAL, cAudioDecoder::m_passthroughMask, and cAudioDecoder::m_pFrame.
Close the audio decoder.
Definition at line 111 of file codec_audio.cpp.
References AV_NOPTS_VALUE, L_CODEC, LOGDEBUG2, cAudioDecoder::m_codecId, cAudioDecoder::m_lastPts, and cAudioDecoder::m_pAudioCtx.
Referenced by cSoftHdDevice::PlayAudio(), and cAudioDecoder::~cAudioDecoder().
Decode an audio packet.
| avpkt | audio packet to decode |
Definition at line 358 of file codec_audio.cpp.
References av_err2str, AV_NOPTS_VALUE, cAudioDecoder::DecodePassthrough(), cSoftHdAudio::Filter(), LOGERROR, cAudioDecoder::m_currentHwNumChannels, cAudioDecoder::m_currentHwSampleRate, cAudioDecoder::m_currentNumChannels, cAudioDecoder::m_currentPassthrough, cAudioDecoder::m_currentSampleRate, cAudioDecoder::m_lastPts, cAudioDecoder::m_passthroughMask, cAudioDecoder::m_pAudio, cAudioDecoder::m_pAudioCtx, cAudioDecoder::m_pFrame, and cAudioDecoder::UpdateFormat().
Referenced by cSoftHdDevice::PlayAudio(), and cSoftHdDevice::PlayAudioPkts().
Passthrough audio data.
Build spdif headers depending on the codec and send the data to the audio device. Currently supported: AC3, EAC3, DTS
| avpkt | undecoded audio packet |
| frame | decoded audio frame |
| 0 | codec is not supported for passthrough, use Filter to handle the data |
| -1 | sth went wrong, data will be discarded |
| 1 | data accepted if finished, spdif header was created and data was sent to passthrough device |
Definition at line 136 of file codec_audio.cpp.
References AC3_FRAME_SIZE, CODEC_AC3, CODEC_DTS, CODEC_EAC3, DTS1_FRAME_SIZE, DTS2_FRAME_SIZE, DTS3_FRAME_SIZE, DTS_PREAMBLE_16BE_1, DTS_PREAMBLE_16BE_2, EAC3_FRAME_SIZE, cSoftHdAudio::EnqueueSpdif(), IEC61937_AC3, IEC61937_DTS1, IEC61937_DTS2, IEC61937_DTS3, IEC61937_EAC3, IEC61937_NULL, IEC61937_PREAMBLE1, IEC61937_PREAMBLE2, LOGERROR, cAudioDecoder::m_currentHwSampleRate, cAudioDecoder::m_passthroughMask, cAudioDecoder::m_pAudio, cAudioDecoder::m_pAudioCtx, cAudioDecoder::m_spdifIndex, cAudioDecoder::m_spdifOutput, cAudioDecoder::m_spdifRepeatCount, cAudioDecoder::ResetSpdif(), and cSoftHdAudio::SetTimebase().
Referenced by cAudioDecoder::Decode().
Flush the audio decoder buffers.
Also resets the last PTS and Codec ID
Definition at line 421 of file codec_audio.cpp.
References AV_NOPTS_VALUE, L_CODEC, LOGDEBUG2, cAudioDecoder::m_codecId, cAudioDecoder::m_lastPts, cAudioDecoder::m_pAudioCtx, and cAudioDecoder::ResetSpdif().
Referenced by cSoftHdDevice::FlushAudio().
| void cAudioDecoder::Open | ( | AVCodecID | codecId, |
| AVCodecParameters * | par = nullptr, |
||
| AVRational | timebase = { .num = 1, .den = 90000 } |
||
| ) |
Open and initiate the audio decoder.
| codecId | audio codec id |
| par | audio codec parameters |
| timebase | timebase |
Definition at line 67 of file codec_audio.cpp.
References L_CODEC, LOGDEBUG2, LOGERROR, LOGFATAL, cAudioDecoder::m_codecId, cAudioDecoder::m_currentHwNumChannels, cAudioDecoder::m_currentHwSampleRate, cAudioDecoder::m_currentNumChannels, cAudioDecoder::m_currentPassthrough, cAudioDecoder::m_currentSampleRate, cAudioDecoder::m_passthroughMask, and cAudioDecoder::m_pAudioCtx.
Referenced by cSoftHdDevice::PlayAudio(), and cSoftHdDevice::SetAudioCodec().
Definition at line 433 of file codec_audio.cpp.
References cAudioDecoder::m_spdifIndex, and cAudioDecoder::m_spdifRepeatCount.
Referenced by cAudioDecoder::DecodePassthrough(), and cAudioDecoder::FlushBuffers().
Set audio pass-through mask.
| mask | codec mask to enable (AC-3, E-AC-3, DTS) |
Definition at line 444 of file codec_audio.cpp.
References CODEC_AC3, CODEC_DTS, CODEC_EAC3, L_CODEC, LOGDEBUG2, and cAudioDecoder::m_passthroughMask.
Referenced by cSoftHdDevice::SetPassthroughMask().
Handle audio format changes.
Setup audio, if format changed
| 0 | if new audio was correctly set up, otherwise return value of cSoftHdAudio::Setup() |
Definition at line 302 of file codec_audio.cpp.
References CODEC_AC3, CODEC_DTS, CODEC_EAC3, L_SOUND, LOGDEBUG2, LOGERROR, cAudioDecoder::m_currentHwNumChannels, cAudioDecoder::m_currentHwSampleRate, cAudioDecoder::m_currentNumChannels, cAudioDecoder::m_currentPassthrough, cAudioDecoder::m_currentSampleRate, cAudioDecoder::m_passthroughMask, cAudioDecoder::m_pAudio, cAudioDecoder::m_pAudioCtx, cAudioDecoder::m_spdifIndex, cAudioDecoder::m_spdifRepeatCount, and cSoftHdAudio::Setup().
Referenced by cAudioDecoder::Decode().
| cAudioDecoder::~cAudioDecoder | ( | void | ) |
Definition at line 51 of file codec_audio.cpp.
References cAudioDecoder::Close(), and cAudioDecoder::m_pFrame.