MythTV
master
|
#include <audiooutput.h>
Classes | |
class | AudioDeviceConfig |
Public Types | |
using | ADCVect = QVector< AudioDeviceConfig > |
Public Member Functions | |
AudioOutput ()=default | |
~AudioOutput () override | |
virtual void | Reconfigure (const AudioSettings &settings)=0 |
virtual void | SetStretchFactor (float factor) |
virtual float | GetStretchFactor (void) const |
virtual int | GetChannels (void) const |
virtual AudioFormat | GetFormat (void) const |
virtual int | GetBytesPerFrame (void) const |
virtual AudioOutputSettings * | GetOutputSettingsCleaned (bool digital=true) |
virtual AudioOutputSettings * | GetOutputSettingsUsers (bool digital=true) |
virtual bool | CanPassthrough (int samplerate, int channels, AVCodecID codec, int profile) const |
virtual bool | CanDownmix (void) const |
virtual void | SetEffDsp (int dsprate)=0 |
virtual void | Reset (void)=0 |
virtual bool | AddFrames (void *buffer, int frames, std::chrono::milliseconds timecode)=0 |
Add frames to the audiobuffer for playback. More... | |
virtual bool | AddData (void *buffer, int len, std::chrono::milliseconds timecode, int frames)=0 |
Add data to the audiobuffer for playback. More... | |
virtual bool | NeedDecodingBeforePassthrough (void) const |
virtual std::chrono::milliseconds | LengthLastData (void) const |
virtual void | SetTimecode (std::chrono::milliseconds timecode)=0 |
virtual bool | IsPaused (void) const =0 |
virtual void | Pause (bool paused)=0 |
virtual void | PauseUntilBuffered (void)=0 |
virtual void | Drain (void)=0 |
virtual std::chrono::milliseconds | GetAudiotime (void)=0 |
virtual std::chrono::milliseconds | GetAudioBufferedTime (void) |
report amount of audio buffered in milliseconds. More... | |
virtual void | SetSourceBitrate (int) |
QString | GetError (void) const |
QString | GetWarning (void) const |
virtual void | GetBufferStatus (uint &fill, uint &total) |
virtual void | bufferOutputData (bool y)=0 |
virtual int | readOutputData (unsigned char *read_buffer, size_t max_length)=0 |
virtual bool | IsUpmixing (void) |
virtual bool | ToggleUpmix (void) |
virtual bool | CanUpmix (void) |
bool | PulseStatus (void) const |
virtual bool | CanProcess (AudioFormat fmt) |
virtual uint32_t | CanProcess (void) |
virtual int | DecodeAudio (AVCodecContext *ctx, uint8_t *buffer, int &data_size, const AVPacket *pkt) |
Utility routine. More... | |
![]() | |
VolumeBase () | |
virtual | ~VolumeBase ()=default |
void | SWVolume (bool set) |
bool | SWVolume (void) const |
virtual uint | GetCurrentVolume (void) const |
virtual void | SetCurrentVolume (int value) |
virtual void | AdjustCurrentVolume (int change) |
virtual void | ToggleMute (void) |
virtual MuteState | GetMuteState (void) const |
virtual MuteState | SetMuteState (MuteState) |
![]() | |
OutputListeners ()=default | |
~OutputListeners () override=default | |
bool | hasVisual (void) |
void | addVisual (MythTV::Visual *v) |
void | removeVisual (MythTV::Visual *v) |
QMutex * | mutex () |
void | setBufferSize (unsigned int sz) |
unsigned int | bufferSize () const |
![]() | |
MythObservable () | |
virtual | ~MythObservable () |
void | addListener (QObject *listener) |
Add a listener to the observable. More... | |
void | removeListener (QObject *listener) |
Remove a listener to the observable. More... | |
void | dispatch (const MythEvent &event) |
Dispatch an event to all listeners. More... | |
bool | hasListeners (void) |
Static Public Member Functions | |
static void | Cleanup (void) |
static ADCVect * | GetOutputList (void) |
static AudioDeviceConfig * | GetAudioDeviceConfig (QString &name, const QString &desc, bool willsuspendpa=false) |
static AudioOutput * | OpenAudio (const QString &main_device, const QString &passthru_device, AudioFormat format, int channels, AVCodecID codec, int samplerate, AudioOutputSource source, bool set_initial_vol, bool passthru, int upmixer_startup=0, AudioOutputSettings *custom=nullptr) |
static AudioOutput * | OpenAudio (AudioSettings &settings, bool willsuspendpa=true) |
static AudioOutput * | OpenAudio (const QString &main_device, const QString &passthru_device=QString(), bool willsuspendpa=true) |
![]() | |
static MuteState | NextMuteState (MuteState) |
Static Public Attributes | |
static const int | kMaxSizeBuffer = 384000 |
kMaxSizeBuffer is the maximum size of a buffer to be used with DecodeAudio More... | |
Protected Member Functions | |
void | Error (const QString &msg) |
void | SilentError (const QString &msg) |
void | Warn (const QString &msg) |
void | ClearError (void) |
void | ClearWarning (void) |
![]() | |
virtual int | GetVolumeChannel (int channel) const =0 |
virtual void | SetVolumeChannel (int channel, int volume)=0 |
virtual void | SetSWVolume (int new_volume, bool save)=0 |
virtual int | GetSWVolume (void)=0 |
void | UpdateVolume (void) |
void | SyncVolume (void) |
void | SetChannels (int new_channels) |
![]() | |
void | error (const QString &e) |
void | dispatchVisual (uchar *b, unsigned long b_len, std::chrono::milliseconds timecode, int chan, int prec) |
void | prepareVisuals () |
Protected Attributes | |
QString | m_lastError |
QString | m_lastWarn |
bool | m_pulseWasSuspended {false} |
AVFrame * | m_frame {nullptr} |
![]() | |
bool | m_internalVol {false} |
![]() | |
QMutex * | m_lock {nullptr} |
QSet< QObject * > | m_listeners |
Private Member Functions | |
Q_DECLARE_TR_FUNCTIONS (AudioOutput) | |
Definition at line 26 of file audiooutput.h.
using AudioOutput::ADCVect = QVector<AudioDeviceConfig> |
Definition at line 49 of file audiooutput.h.
|
default |
|
override |
Definition at line 239 of file audiooutput.cpp.
|
private |
|
static |
Definition at line 49 of file audiooutput.cpp.
|
static |
Definition at line 411 of file audiooutput.cpp.
Referenced by AudioConfigSettings::AudioRescan(), and AudioSetupWizard::Load().
|
static |
Definition at line 299 of file audiooutput.cpp.
Referenced by AudioConfigSettings::AudioRescan(), AudioConfigSettings::CheckConfiguration(), AudioConfigSettings::CheckPassthrough(), fillSelectionsFromDir(), GetOutputList(), and AudioSetupWizard::Init().
|
static |
Definition at line 56 of file audiooutput.cpp.
Referenced by AudioTestThread::AudioTestThread(), GetAudioDeviceConfig(), OpenAudio(), MythRAOPConnection::OpenAudioDevice(), MusicPlayer::openOutputDevice(), and AudioPlayer::ReinitAudio().
|
static |
|
static |
Definition at line 69 of file audiooutput.cpp.
|
pure virtual |
Implemented in AudioOutputBase, and AudioReencodeBuffer.
Referenced by avfDecoder::initialize(), CdDecoder::initialize(), and AudioPlayer::ReinitAudio().
|
virtual |
Reimplemented in AudioOutputBase.
Definition at line 248 of file audiooutput.cpp.
Referenced by MusicPlayer::setSpeed(), and AudioPlayer::SetStretchFactor().
|
inlinevirtual |
Reimplemented in AudioOutputBase.
Definition at line 76 of file audiooutput.h.
|
inlinevirtual |
Reimplemented in AudioOutputBase.
Definition at line 77 of file audiooutput.h.
|
inlinevirtual |
Reimplemented in AudioOutputBase.
Definition at line 78 of file audiooutput.h.
|
inlinevirtual |
Reimplemented in AudioOutputBase.
Definition at line 79 of file audiooutput.h.
Referenced by AudioPlayer::AddAudioData(), and MythRAOPConnection::ProcessAudio().
|
virtual |
Reimplemented in AudioOutputBase.
Definition at line 252 of file audiooutput.cpp.
Referenced by GetAudioDeviceConfig().
|
virtual |
Reimplemented in AudioOutputBase.
Definition at line 257 of file audiooutput.cpp.
Referenced by AudioPlayer::GetMaxChannels(), AudioPlayer::GetMaxHDRate(), and TestDigitalFeature().
|
virtual |
Reimplemented in AudioReencodeBuffer, and AudioOutputBase.
Definition at line 262 of file audiooutput.cpp.
Referenced by AudioPlayer::CanPassthrough().
|
inlinevirtual |
Reimplemented in AudioOutputBase.
Definition at line 85 of file audiooutput.h.
Referenced by AudioPlayer::CanDownmix().
|
pure virtual |
Implemented in AudioOutputBase, and AudioReencodeBuffer.
Referenced by AudioPlayer::SetEffDsp().
|
pure virtual |
Implemented in AudioOutputBase, AudioReencodeBuffer, and AudioOutputNULL.
Referenced by MythRAOPConnection::ProcessAudio(), AudioPlayer::Reset(), MythRAOPConnection::ResetAudio(), and MusicPlayer::stop().
|
pure virtual |
Add frames to the audiobuffer for playback.
[in] | buffer | pointer to audio data |
[in] | frames | number of frames added. |
[in] | timecode | timecode of the first sample added (in msec) |
Implemented in AudioOutputBase, and AudioReencodeBuffer.
Referenced by AudioTestThread::run().
|
pure virtual |
Add data to the audiobuffer for playback.
[in] | buffer | pointer to audio data |
[in] | len | length of audio data added |
[in] | timecode | timecode of the first sample added (in msec) |
[in] | frames | number of frames added. |
Implemented in AudioOutputBase, AudioReencodeBuffer, and AudioOutputAudioTrack.
Referenced by AudioPlayer::AddAudioData(), MythRAOPConnection::AudioCardLatency(), MythRAOPConnection::ProcessAudio(), and avfDecoder::run().
|
inlinevirtual |
Reimplemented in AudioOutputBase.
Definition at line 124 of file audiooutput.h.
Referenced by AudioPlayer::NeedDecodingBeforePassthrough().
|
inlinevirtual |
Reimplemented in AudioOutputBase.
Definition at line 131 of file audiooutput.h.
Referenced by AudioPlayer::LengthLastData(), MythRAOPConnection::ProcessAudio(), and AudioTestThread::run().
|
pure virtual |
Implemented in AudioOutputBase, and AudioReencodeBuffer.
Referenced by MusicCommon::seek(), and MusicPlayer::seek().
|
pure virtual |
Implemented in AudioOutputBase, and AudioReencodeBuffer.
Referenced by AudioPlayer::IsPaused(), MusicPlayer::isPaused(), MusicCommon::keyPressEvent(), MythRAOPConnection::ProcessAudio(), and MusicPlayer::stop().
|
pure virtual |
Implemented in AudioOutputBase, AudioReencodeBuffer, and AudioOutputAudioTrack.
Referenced by AudioTestThread::AudioTestThread(), AudioPlayer::Pause(), MusicPlayer::pause(), MythRAOPConnection::ProcessAudio(), and AudioTestThread::run().
|
pure virtual |
Implemented in AudioOutputBase, and AudioReencodeBuffer.
Referenced by MusicPlayer::decoderHandlerReady(), avfDecoder::initialize(), CdDecoder::initialize(), AudioPlayer::PauseAudioUntilBuffered(), and CdDecoder::seek().
|
pure virtual |
Implemented in AudioOutputBase, AudioReencodeBuffer, and AudioOutputPulseAudio.
Referenced by AudioPlayer::AddAudioData(), avfDecoder::run(), CdDecoder::run(), and AudioTestThread::run().
|
pure virtual |
|
inlinevirtual |
report amount of audio buffered in milliseconds.
Reimplemented in AudioOutputBase.
Definition at line 144 of file audiooutput.h.
Referenced by MythPlayerUI::EventLoop(), AudioPlayer::GetAudioBufferedTime(), MythRAOPConnection::ProcessAudio(), MythRAOPConnection::ProcessSync(), and avfDecoder::run().
|
inlinevirtual |
Reimplemented in AudioOutputBase, and AudioOutputAudioTrack.
Definition at line 146 of file audiooutput.h.
Referenced by avfDecoder::initialize(), CdDecoder::initialize(), and AvFormatDecoder::SetupAudioStream().
|
inline |
Definition at line 148 of file audiooutput.h.
Referenced by MythRAOPConnection::OpenAudioDevice(), MusicPlayer::openOutputDevice(), AudioOutputBase::Reconfigure(), AudioPlayer::ReinitAudio(), AudioTestThread::result(), and AudioTestThread::run().
|
inline |
Definition at line 149 of file audiooutput.h.
Reimplemented in AudioOutputBase.
Definition at line 151 of file audiooutput.h.
Referenced by AudioPlayer::GetBufferStatus(), and CdDecoder::run().
|
pure virtual |
Implemented in AudioReencodeBuffer, and AudioOutputBase.
|
pure virtual |
Implemented in AudioOutputBase, AudioOutputNULL, and AudioReencodeBuffer.
|
inlinevirtual |
Reimplemented in AudioOutputBase.
Definition at line 159 of file audiooutput.h.
Referenced by AudioPlayer::IsUpmixing().
|
inlinevirtual |
Reimplemented in AudioOutputBase.
Definition at line 160 of file audiooutput.h.
Referenced by AudioPlayer::EnableUpmix(), and MusicCommon::toggleUpmix().
|
inlinevirtual |
Reimplemented in AudioOutputBase.
Definition at line 161 of file audiooutput.h.
Referenced by AudioPlayer::CanUpmix().
|
inline |
Definition at line 162 of file audiooutput.h.
|
inlinevirtual |
fmt | The audio format in question. return true if class can handle AudioFormat All AudioOutput derivative must be able to handle S16 |
Reimplemented in AudioOutputBase.
Definition at line 169 of file audiooutput.h.
Referenced by AudioPlayer::CanProcess().
|
inlinevirtual |
Reimplemented in AudioOutputBase.
Definition at line 175 of file audiooutput.h.
Referenced by DecodeAudio().
|
virtual |
Utility routine.
DecodeAudio Decode an audio packet, and compact it if data is planar Return negative error code if an error occurred during decoding or the number of bytes consumed from the input AVPacket data_size contains the size of decoded data copied into buffer.
Decode an audio packet, and compact it if data is planar Return negative error code if an error occurred during decoding or the number of bytes consumed from the input AVPacket data_size contains the size of decoded data copied into buffer data decoded will be S16 samples if class instance can't handle HD audio or S16 and above otherwise. No U8 PCM format can be returned
[in] | ctx | The current audio context information. |
[in] | buffer | Destination for the copy |
[out] | data_size | The number of bytes copied. |
[in] | pkt | The source data packet |
Definition at line 590 of file audiooutput.cpp.
Referenced by AudioPlayer::DecodeAudio(), and avfDecoder::run().
|
protected |
Definition at line 272 of file audiooutput.cpp.
Referenced by AudioOutputJACK::GetOutputSettings(), AudioOutputJACK::JackClientClose(), AudioOutputJACK::JackConnectPorts(), AudioOutputWin::OpenDevice(), AudioOutputALSA::OpenDevice(), AudioOutputOSS::OpenDevice(), AudioOutputJACK::OpenDevice(), AudioOutputBase::Reconfigure(), AudioOutputALSA::SetParameters(), AudioOutputOpenSLES::StartPlayer(), and AudioOutputALSA::WriteAudio().
|
protected |
Definition at line 278 of file audiooutput.cpp.
Referenced by AudioOutputBase::Reconfigure().
|
protected |
Definition at line 283 of file audiooutput.cpp.
Referenced by AudioOutputALSA::GetOutputSettings().
|
protected |
Definition at line 289 of file audiooutput.cpp.
Referenced by AudioReencodeBuffer::Reconfigure(), and AudioOutputBase::Reconfigure().
|
protected |
Definition at line 294 of file audiooutput.cpp.
|
static |
kMaxSizeBuffer is the maximum size of a buffer to be used with DecodeAudio
Definition at line 197 of file audiooutput.h.
Referenced by MythRAOPConnection::AudioCardLatency(), avfDecoder::avfDecoder(), AvFormatDecoder::AvFormatDecoder(), MythRAOPConnection::decodeAudioPacket(), and SPDIFEncoder::SPDIFEncoder().
|
protected |
Definition at line 206 of file audiooutput.h.
Referenced by ClearError(), Error(), and SilentError().
|
protected |
Definition at line 207 of file audiooutput.h.
Referenced by ClearWarning(), and Warn().
Definition at line 208 of file audiooutput.h.
Referenced by ~AudioOutput().
|
protected |
Definition at line 209 of file audiooutput.h.
Referenced by DecodeAudio(), and ~AudioOutput().