22#include <libavcodec/avcodec.h>
186 if (
avpkt->size < 5) {
244 if (
avpkt->size < 6) {
250 ((
avpkt->data[5] >> 2) & 0x3f);
Audio and Alsa Interface Header File.
int DecodePassthrough(const AVPacket *, AVFrame *)
Passthrough audio data.
int UpdateFormat(void)
Handle audio format changes.
AVCodecContext * m_pAudioCtx
ffmpeg audio codec context
int m_currentHwSampleRate
current hw sample rate
void FlushBuffers(void)
Flush the audio decoder buffers.
int m_currentHwNumChannels
current number of hw channels
void Decode(const AVPacket *)
Decode an audio packet.
AVFrame * m_pFrame
decoded ffmpeg audio frame
int m_spdifIndex
index into SPDIF output buffer
int m_currentPassthroughMask
current passthrough mask
int m_passthroughMask
passthrough mask to be set
AVCodecID m_codecId
current codec id
cAudioDecoder(cSoftHdAudio *)
Create a new audio decoder for the given audio context.
void SetPassthroughMask(int)
Set audio pass-through mask.
int m_spdifRepeatCount
SPDIF repeat counter.
uint16_t m_spdifOutput[(MAX_FRAME_SIZE *4+16)/2]
SPDIF output buffer.
std::mutex m_mutex
decoder mutex
int64_t m_lastPts
last seen PTS
int m_currentSampleRate
current sample rate
void ResetSpdif(void)
Rest the internal SPDIF burst buffer.
cSoftHdAudio * m_pAudio
audio module
int m_currentNumChannels
current number of channels
void Open(AVCodecID, AVCodecParameters *=nullptr, AVRational={ .num=1,.den=90000 })
Open and initiate the audio decoder.
void Close(void)
Close the audio decoder.
void Filter(AVFrame *, AVCodecContext *)
Send audio frame to filter and enqueue it.
int Setup(AVCodecContext *, int, int, int)
Alsa setup wrapper.
void EnqueueSpdif(uint16_t *, int, AVFrame *)
Enqueue prepared spdif bursts in audio output queue.
void SetTimebase(AVRational *timebase)
Audio Decoder Header File.
@ IEC61937_DTS3
DTS type III (2048 samples)
@ IEC61937_DTS2
DTS type II (1024 samples)
@ IEC61937_EAC3
E-AC-3 data.
@ IEC61937_DTS1
DTS type I (512 samples)
@ CODEC_EAC3
E-AC-3 bit mask.
@ CODEC_AC3
AC-3 bit mask.
#define LOGDEBUG2
log to LOG_DEBUG and add a prefix
#define LOGERROR
log to LOG_ERR
#define LOGFATAL
log to LOG_ERR and abort