MythTV
master
|
#include <libmyth/audio/audiooutputbase.h>
Public Member Functions | |
AudioOutputBase (const AudioSettings &settings) | |
~AudioOutputBase () override | |
Destructor. More... | |
AudioOutputSettings * | GetOutputSettingsCleaned (bool digital=true) override |
Returns capabilities supported by the audio device amended to take into account the digital audio options (AC3, DTS, E-AC3 and TrueHD) More... | |
AudioOutputSettings * | GetOutputSettingsUsers (bool digital=false) override |
Returns capabilities supported by the audio device amended to take into account the digital audio options (AC3, DTS, E-AC3 and TrueHD) as well as the user settings. More... | |
void | Reconfigure (const AudioSettings &settings) override |
(Re)Configure AudioOutputBase More... | |
void | SetEffDsp (int dsprate) override |
Set the effective DSP rate. More... | |
void | SetStretchFactor (float factor) override |
Set the timestretch factor. More... | |
float | GetStretchFactor (void) const override |
Get the timetretch factor. More... | |
int | GetChannels (void) const override |
AudioFormat | GetFormat (void) const override |
int | GetBytesPerFrame (void) const override |
bool | CanPassthrough (int samplerate, int channels, AVCodecID codec, int profile) const override |
Test if we can output digital audio and if sample rate is supported. More... | |
bool | CanDownmix (void) const override |
bool | IsUpmixing (void) override |
Source is currently being upmixed. More... | |
bool | ToggleUpmix (void) override |
Toggle between stereo and upmixed 5.1 if the source material is stereo. More... | |
bool | CanUpmix (void) override |
Upmixing of the current source is available if requested. More... | |
bool | CanProcess (AudioFormat) override |
uint32_t | CanProcess (void) override |
void | Reset (void) override |
Reset the audiobuffer, timecode and mythmusic visualisation. More... | |
void | SetSWVolume (int new_volume, bool save) override |
Set the volume for software volume control. More... | |
int | GetSWVolume (void) override |
Get the volume for software volume control. More... | |
bool | AddFrames (void *buffer, int frames, std::chrono::milliseconds timecode) override |
Add frames to the audiobuffer and perform any required processing. More... | |
bool | AddData (void *buffer, int len, std::chrono::milliseconds timecode, int frames) override |
Add data to the audiobuffer and perform any required processing. More... | |
bool | NeedDecodingBeforePassthrough () const override |
std::chrono::milliseconds | LengthLastData (void) const override |
void | SetTimecode (std::chrono::milliseconds timecode) override |
Set the timecode of the samples most recently added to the audiobuffer. More... | |
bool | IsPaused (void) const override |
void | Pause (bool paused) override |
void | PauseUntilBuffered (void) override |
void | Drain (void) override |
Block until all available frames have been written to the device. More... | |
std::chrono::milliseconds | GetAudiotime (void) override |
Calculate the timecode of the samples that are about to become audible. More... | |
std::chrono::milliseconds | GetAudioBufferedTime (void) override |
Get the difference in timecode between the samples that are about to become audible and the samples most recently added to the audiobuffer, i.e. More... | |
virtual void | Status (void) |
Report status via an OutputEvent. More... | |
void | SetSourceBitrate (int rate) override |
Set the bitrate of the source material, reported in periodic OutputEvents. More... | |
void | GetBufferStatus (uint &fill, uint &total) override |
Fill in the number of bytes in the audiobuffer and the total size of the audiobuffer. More... | |
void | bufferOutputData (bool y) override |
int | readOutputData (unsigned char *read_buffer, size_t max_length) override |
Public Member Functions inherited from AudioOutput | |
AudioOutput ()=default | |
~AudioOutput () override | |
QString | GetError (void) const |
QString | GetWarning (void) const |
bool | PulseStatus (void) const |
virtual int | DecodeAudio (AVCodecContext *ctx, uint8_t *buffer, int &data_size, const AVPacket *pkt) |
Utility routine. More... | |
Public Member Functions inherited from VolumeBase | |
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) |
Public Member Functions inherited from OutputListeners | |
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 |
Public Member Functions inherited from MythObservable | |
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) |
Public Member Functions inherited from MThread | |
MThread (const QString &objectName) | |
Standard constructor. More... | |
MThread (const QString &objectName, QRunnable *runnable) | |
Use this constructor if you want the default run() method to run the QRunnable's run() method instead of entering the Qt event loop. More... | |
virtual | ~MThread () |
MThread (const MThread &)=delete | |
MThread & | operator= (const MThread &)=delete |
void | RunProlog (void) |
Sets up a thread, call this if you reimplement run(). More... | |
void | RunEpilog (void) |
Cleans up a thread's resources, call this if you reimplement run(). More... | |
QThread * | qthread (void) |
Returns the thread, this will always return the same pointer no matter how often you restart the thread. More... | |
void | setObjectName (const QString &name) |
QString | objectName (void) const |
void | setPriority (QThread::Priority priority) |
QThread::Priority | priority (void) const |
bool | isFinished (void) const |
bool | isRunning (void) const |
void | setStackSize (uint stackSize) |
uint | stackSize (void) const |
void | exit (int retcode=0) |
Use this to exit from the thread if you are using a Qt event loop. More... | |
void | start (QThread::Priority p=QThread::InheritPriority) |
Tell MThread to start running the thread in the near future. More... | |
void | terminate (void) |
Kill a thread unsafely. More... | |
void | quit (void) |
calls exit(0) More... | |
bool | wait (std::chrono::milliseconds time=std::chrono::milliseconds::max()) |
Wait for the MThread to exit, with a maximum timeout. More... | |
Static Public Member Functions | |
static const char * | quality_string (int q) |
Static Public Member Functions inherited from AudioOutput | |
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 Public Member Functions inherited from VolumeBase | |
static MuteState | NextMuteState (MuteState) |
Static Public Member Functions inherited from MThread | |
static void | ThreadSetup (const QString &name) |
This is to be called on startup in those few threads that haven't been ported to MThread. More... | |
static void | ThreadCleanup (void) |
This is to be called on exit in those few threads that haven't been ported to MThread. More... | |
static void | Cleanup (void) |
This will print out all the running threads, call exit(1) on each and then wait up to 5 seconds total for all the threads to exit. More... | |
static void | GetAllThreadNames (QStringList &list) |
static void | GetAllRunningThreadNames (QStringList &list) |
Static Public Attributes | |
static const uint | kAudioSRCInputSize = 16384 |
static const uint | kAudioRingBufferSize = 10239936U |
Audio Buffer Size – should be divisible by 32,24,16,12,10,8,6,4,2.. More... | |
Static Public Attributes inherited from AudioOutput | |
static const int | kMaxSizeBuffer = 384000 |
kMaxSizeBuffer is the maximum size of a buffer to be used with DecodeAudio More... | |
Protected Types | |
enum | : std::int8_t { QUALITY_DISABLED = -1, QUALITY_LOW = 0, QUALITY_MEDIUM = 1, QUALITY_HIGH = 2 } |
Protected Member Functions | |
void | InitSettings (const AudioSettings &settings) |
virtual bool | OpenDevice (void)=0 |
virtual void | CloseDevice (void)=0 |
virtual void | WriteAudio (unsigned char *aubuf, int size)=0 |
virtual int | GetBufferedOnSoundcard (void) const =0 |
Return the size in bytes of frames currently in the audio buffer adjusted with the audio playback latency. More... | |
virtual AudioOutputSettings * | GetOutputSettings (bool) |
void | KillAudio (void) |
Kill the output thread and cleanup. More... | |
virtual bool | StartOutputThread (void) |
virtual void | StopOutputThread (void) |
int | GetAudioData (uchar *buffer, int buf_size, bool full_buffer, volatile uint *local_raud=nullptr) |
Copy frames from the audiobuffer into the buffer provided. More... | |
void | OutputAudioLoop (void) |
Run in the output thread, write frames to the output device as they become available and there's space in the device buffer to write them. More... | |
void | run () override |
Main routine for the output thread. More... | |
int | CheckFreeSpace (int &frames) |
Check that there's enough space in the audiobuffer to write the provided number of frames. More... | |
int | audiolen () const |
Get the number of bytes in the audiobuffer. More... | |
int | audiofree () const |
Get the free space in the audiobuffer in bytes. More... | |
int | audioready () const |
Get the scaled number of bytes in the audiobuffer, i.e. More... | |
void | SetStretchFactorLocked (float factor) |
Set the timestretch factor. More... | |
std::chrono::milliseconds | GetBaseAudBufTimeCode () const |
bool | usesSpdif () const |
Protected Member Functions inherited from AudioOutput | |
void | Error (const QString &msg) |
void | SilentError (const QString &msg) |
void | Warn (const QString &msg) |
void | ClearError (void) |
void | ClearWarning (void) |
Protected Member Functions inherited from VolumeBase | |
virtual int | GetVolumeChannel (int channel) const =0 |
virtual void | SetVolumeChannel (int channel, int volume)=0 |
void | UpdateVolume (void) |
void | SyncVolume (void) |
void | SetChannels (int new_channels) |
Protected Member Functions inherited from OutputListeners | |
void | error (const QString &e) |
void | dispatchVisual (uchar *b, unsigned long b_len, std::chrono::milliseconds timecode, int chan, int prec) |
void | prepareVisuals () |
Protected Member Functions inherited from MThread | |
int | exec (void) |
Enters the qt event loop. call exit or quit to exit thread. More... | |
Private Member Functions | |
bool | SetupPassthrough (AVCodecID codec, int codec_profile, int &samplerate_tmp, int &channels_tmp) |
AudioOutputSettings * | OutputSettings (bool digital=true) |
int | CopyWithUpmix (char *buffer, int frames, uint &org_waud) |
Copy frames into the audiobuffer, upmixing en route if necessary. More... | |
void | SetAudiotime (int frames, std::chrono::milliseconds timecode) |
Set the timecode of the top of the ringbuffer Exclude all other processing elements as they dont vary between AddData calls. More... | |
Additional Inherited Members | |
Public Types inherited from AudioOutput | |
using | ADCVect = QVector< AudioDeviceConfig > |
Static Protected Member Functions inherited from MThread | |
static void | setTerminationEnabled (bool enabled=true) |
static void | usleep (std::chrono::microseconds time) |
template<typename R , typename P > | |
static std::enable_if_t< std::chrono::treat_as_floating_point< R >::value, void > | usleep (std::chrono::duration< R, P > time) |
Definition at line 51 of file audiooutputbase.h.
|
protected |
Enumerator | |
---|---|
QUALITY_DISABLED | |
QUALITY_LOW | |
QUALITY_MEDIUM | |
QUALITY_HIGH |
Definition at line 208 of file audiooutputbase.h.
|
explicit |
Definition at line 65 of file audiooutputbase.cpp.
|
override |
Destructor.
You must kill the output thread via KillAudio() prior to destruction
Definition at line 93 of file audiooutputbase.cpp.
|
static |
Definition at line 53 of file audiooutputbase.cpp.
Referenced by AudioOutputBase(), and Reconfigure().
|
overridevirtual |
Returns capabilities supported by the audio device amended to take into account the digital audio options (AC3, DTS, E-AC3 and TrueHD)
Reimplemented from AudioOutput.
Definition at line 155 of file audiooutputbase.cpp.
Referenced by GetOutputSettingsUsers().
|
overridevirtual |
Returns capabilities supported by the audio device amended to take into account the digital audio options (AC3, DTS, E-AC3 and TrueHD) as well as the user settings.
Reimplemented from AudioOutput.
Definition at line 186 of file audiooutputbase.cpp.
Referenced by InitSettings().
|
overridevirtual |
(Re)Configure AudioOutputBase
Must be called from concrete subclasses
Implements AudioOutput.
Definition at line 472 of file audiooutputbase.cpp.
Referenced by AudioOutputALSA::AudioOutputALSA(), AudioOutputAudioTrack::AudioOutputAudioTrack(), AudioOutputCA::AudioOutputCA(), AudioOutputDX::AudioOutputDX(), AudioOutputJACK::AudioOutputJACK(), AudioOutputNULL::AudioOutputNULL(), AudioOutputOpenSLES::AudioOutputOpenSLES(), AudioOutputOSS::AudioOutputOSS(), AudioOutputPulseAudio::AudioOutputPulseAudio(), AudioOutputWin::AudioOutputWin(), and ToggleUpmix().
|
overridevirtual |
Set the effective DSP rate.
Equal to 100 * samples per second NuppelVideo sets this every sync frame to achieve av sync
Implements AudioOutput.
Definition at line 984 of file audiooutputbase.cpp.
|
overridevirtual |
Set the timestretch factor.
Reimplemented from AudioOutput.
Definition at line 360 of file audiooutputbase.cpp.
|
overridevirtual |
Get the timetretch factor.
Reimplemented from AudioOutput.
Definition at line 369 of file audiooutputbase.cpp.
|
inlineoverridevirtual |
Reimplemented from AudioOutput.
Definition at line 70 of file audiooutputbase.h.
|
inlineoverridevirtual |
Reimplemented from AudioOutput.
Definition at line 71 of file audiooutputbase.h.
|
inlineoverridevirtual |
Reimplemented from AudioOutput.
Definition at line 72 of file audiooutputbase.h.
|
overridevirtual |
Test if we can output digital audio and if sample rate is supported.
Reimplemented from AudioOutput.
Definition at line 212 of file audiooutputbase.cpp.
|
inlineoverridevirtual |
Reimplemented from AudioOutput.
Definition at line 77 of file audiooutputbase.h.
|
overridevirtual |
Source is currently being upmixed.
Reimplemented from AudioOutput.
Definition at line 377 of file audiooutputbase.cpp.
Referenced by ToggleUpmix().
|
overridevirtual |
Toggle between stereo and upmixed 5.1 if the source material is stereo.
Reimplemented from AudioOutput.
Definition at line 385 of file audiooutputbase.cpp.
|
overridevirtual |
Upmixing of the current source is available if requested.
Reimplemented from AudioOutput.
Definition at line 403 of file audiooutputbase.cpp.
|
inlineoverridevirtual |
fmt | The audio format in question. return true if class can handle AudioFormat All AudioOutput derivative must be able to handle S16 |
Reimplemented from AudioOutput.
Definition at line 81 of file audiooutputbase.h.
|
inlineoverridevirtual |
Reimplemented from AudioOutput.
Definition at line 82 of file audiooutputbase.h.
|
overridevirtual |
Reset the audiobuffer, timecode and mythmusic visualisation.
Implements AudioOutput.
Reimplemented in AudioOutputNULL.
Definition at line 934 of file audiooutputbase.cpp.
Referenced by PauseUntilBuffered(), and AudioOutputNULL::Reset().
|
overridevirtual |
Set the volume for software volume control.
Implements VolumeBase.
Definition at line 1172 of file audiooutputbase.cpp.
|
overridevirtual |
Get the volume for software volume control.
Implements VolumeBase.
Definition at line 1182 of file audiooutputbase.cpp.
|
overridevirtual |
Add frames to the audiobuffer and perform any required processing.
Returns false if there's not enough space right now
Implements AudioOutput.
Definition at line 1316 of file audiooutputbase.cpp.
|
overridevirtual |
Add data to the audiobuffer and perform any required processing.
Returns false if there's not enough space right now
Implements AudioOutput.
Definition at line 1328 of file audiooutputbase.cpp.
Referenced by AudioOutputAudioTrack::AddData(), and AddFrames().
|
inlineoverridevirtual |
Reimplemented from AudioOutput.
Definition at line 96 of file audiooutputbase.h.
|
inlineoverridevirtual |
Reimplemented from AudioOutput.
Definition at line 97 of file audiooutputbase.h.
|
overridevirtual |
Set the timecode of the samples most recently added to the audiobuffer.
Used by mythmusic for seeking since it doesn't provide timecodes to AddData()
Implements AudioOutput.
Definition at line 972 of file audiooutputbase.cpp.
|
inlineoverridevirtual |
Implements AudioOutput.
Definition at line 100 of file audiooutputbase.h.
|
overridevirtual |
Implements AudioOutput.
Definition at line 912 of file audiooutputbase.cpp.
Referenced by AddData(), AudioOutputAudioTrack::Pause(), and PauseUntilBuffered().
|
overridevirtual |
Implements AudioOutput.
Definition at line 924 of file audiooutputbase.cpp.
|
overridevirtual |
Block until all available frames have been written to the device.
Implements AudioOutput.
Reimplemented in AudioOutputPulseAudio.
Definition at line 1839 of file audiooutputbase.cpp.
Referenced by AudioOutputPulseAudio::Drain().
|
overridevirtual |
Calculate the timecode of the samples that are about to become audible.
Implements AudioOutput.
Reimplemented in AudioOutputCA.
Definition at line 1028 of file audiooutputbase.cpp.
Referenced by GetAudioBufferedTime(), OutputAudioLoop(), SetAudiotime(), and Status().
|
overridevirtual |
Get the difference in timecode between the samples that are about to become audible and the samples most recently added to the audiobuffer, i.e.
the time in ms representing the sum total of buffered samples
Reimplemented from AudioOutput.
Definition at line 1160 of file audiooutputbase.cpp.
|
virtual |
Report status via an OutputEvent.
Definition at line 1624 of file audiooutputbase.cpp.
Referenced by AudioOutputJACK::JackCallback(), and OutputAudioLoop().
|
overridevirtual |
Set the bitrate of the source material, reported in periodic OutputEvents.
Reimplemented from AudioOutput.
Definition at line 274 of file audiooutputbase.cpp.
Referenced by AudioOutputAudioTrack::SetSourceBitrate().
Fill in the number of bytes in the audiobuffer and the total size of the audiobuffer.
Reimplemented from AudioOutput.
Definition at line 1648 of file audiooutputbase.cpp.
|
inlineoverridevirtual |
Implements AudioOutput.
Definition at line 118 of file audiooutputbase.h.
|
overridevirtual |
Implements AudioOutput.
Reimplemented in AudioOutputNULL.
Definition at line 1864 of file audiooutputbase.cpp.
|
protected |
Definition at line 119 of file audiooutputbase.cpp.
Referenced by AudioOutputALSA::AudioOutputALSA(), AudioOutputAudioTrack::AudioOutputAudioTrack(), AudioOutputCA::AudioOutputCA(), AudioOutputDX::AudioOutputDX(), AudioOutputJACK::AudioOutputJACK(), AudioOutputNULL::AudioOutputNULL(), AudioOutputOpenSLES::AudioOutputOpenSLES(), AudioOutputOSS::AudioOutputOSS(), AudioOutputPulseAudio::AudioOutputPulseAudio(), and AudioOutputWin::AudioOutputWin().
|
protectedpure virtual |
Implemented in AudioOutputCA, AudioOutputNULL, AudioOutputPulseAudio, AudioOutputJACK, AudioOutputAudioTrack, AudioOutputOpenSLES, AudioOutputOSS, AudioOutputALSA, AudioOutputDX, and AudioOutputWin.
Referenced by Reconfigure().
|
protectedpure virtual |
Implemented in AudioOutputCA, AudioOutputNULL, AudioOutputPulseAudio, AudioOutputJACK, AudioOutputAudioTrack, AudioOutputOpenSLES, AudioOutputOSS, AudioOutputALSA, AudioOutputDX, and AudioOutputWin.
Referenced by KillAudio().
|
protectedpure virtual |
Implemented in AudioOutputDX, AudioOutputCA, AudioOutputNULL, AudioOutputPulseAudio, AudioOutputJACK, AudioOutputAudioTrack, AudioOutputOpenSLES, AudioOutputOSS, AudioOutputALSA, and AudioOutputWin.
Referenced by OutputAudioLoop().
|
protectedpure virtual |
Return the size in bytes of frames currently in the audio buffer adjusted with the audio playback latency.
Implemented in AudioOutputCA, AudioOutputNULL, AudioOutputPulseAudio, AudioOutputJACK, AudioOutputAudioTrack, AudioOutputOpenSLES, AudioOutputOSS, AudioOutputALSA, AudioOutputDX, and AudioOutputWin.
Referenced by GetAudiotime().
|
inlineprotectedvirtual |
Reimplemented in AudioOutputALSA, AudioOutputDX, AudioOutputNULL, AudioOutputJACK, AudioOutputPulseAudio, AudioOutputAudioTrack, AudioOutputOpenSLES, AudioOutputOSS, AudioOutputWin, and AudioOutputCA.
Definition at line 142 of file audiooutputbase.h.
Referenced by GetOutputSettingsCleaned().
|
protected |
Kill the output thread and cleanup.
Definition at line 870 of file audiooutputbase.cpp.
Referenced by Reconfigure(), AudioOutputALSA::~AudioOutputALSA(), AudioOutputAudioTrack::~AudioOutputAudioTrack(), AudioOutputCA::~AudioOutputCA(), AudioOutputDX::~AudioOutputDX(), AudioOutputJACK::~AudioOutputJACK(), AudioOutputNULL::~AudioOutputNULL(), AudioOutputOpenSLES::~AudioOutputOpenSLES(), AudioOutputOSS::~AudioOutputOSS(), AudioOutputPulseAudio::~AudioOutputPulseAudio(), and AudioOutputWin::~AudioOutputWin().
|
protectedvirtual |
Reimplemented in AudioOutputCA, AudioOutputJACK, and AudioOutputAudioTrack.
Definition at line 846 of file audiooutputbase.cpp.
Referenced by Reconfigure(), and AudioOutputAudioTrack::StartOutputThread().
|
protectedvirtual |
Reimplemented in AudioOutputCA, AudioOutputJACK, and AudioOutputAudioTrack.
Definition at line 858 of file audiooutputbase.cpp.
Referenced by KillAudio(), and AudioOutputAudioTrack::StopOutputThread().
|
protected |
Copy frames from the audiobuffer into the buffer provided.
If 'full_buffer' is true we copy either 'size' bytes (if available) or nothing. Otherwise, we'll copy less than 'size' bytes if that's all that's available. Returns the number of bytes copied.
Definition at line 1752 of file audiooutputbase.cpp.
Referenced by AudioOutputJACK::JackCallback(), OutputAudioLoop(), and AudioOutputCA::RenderAudio().
|
protected |
Run in the output thread, write frames to the output device as they become available and there's space in the device buffer to write them.
Definition at line 1659 of file audiooutputbase.cpp.
Referenced by run().
|
overrideprotectedvirtual |
Main routine for the output thread.
Reimplemented from MThread.
Definition at line 1855 of file audiooutputbase.cpp.
|
protected |
Check that there's enough space in the audiobuffer to write the provided number of frames.
If there is not enough space, set 'frames' to the number that will fit
Returns the number of bytes that the frames will take up
Definition at line 1195 of file audiooutputbase.cpp.
Referenced by AddData(), and CopyWithUpmix().
|
inlineprotected |
Get the number of bytes in the audiobuffer.
Definition at line 993 of file audiooutputbase.cpp.
Referenced by audiofree(), and audioready().
|
protected |
Get the free space in the audiobuffer in bytes.
Definition at line 1003 of file audiooutputbase.cpp.
Referenced by AddData(), CheckFreeSpace(), and GetBufferStatus().
|
protected |
Get the scaled number of bytes in the audiobuffer, i.e.
the number of samples * the output bytes per sample
This value can differ from that returned by audiolen if samples are being converted to floats and the output sample format is not 32 bits
Definition at line 1018 of file audiooutputbase.cpp.
Referenced by AddData(), Drain(), GetAudioData(), AudioOutputCA::GetAudiotime(), GetAudiotime(), and OutputAudioLoop().
|
protected |
Set the timestretch factor.
You must hold the audio_buflock to call this safely
Definition at line 285 of file audiooutputbase.cpp.
Referenced by Reconfigure(), and SetStretchFactor().
|
inlineprotected |
Definition at line 167 of file audiooutputbase.h.
Referenced by AudioOutputCA::GetAudiotime().
|
inlineprotected |
Definition at line 170 of file audiooutputbase.h.
Referenced by GetAudiotime().
|
private |
Definition at line 412 of file audiooutputbase.cpp.
Referenced by Reconfigure().
|
private |
Definition at line 460 of file audiooutputbase.cpp.
Referenced by Reconfigure().
|
private |
Copy frames into the audiobuffer, upmixing en route if necessary.
Returns the number of frames written, which may be less than requested if the upmixer buffered some (or all) of them
Definition at line 1230 of file audiooutputbase.cpp.
Referenced by AddData().
|
private |
Set the timecode of the top of the ringbuffer Exclude all other processing elements as they dont vary between AddData calls.
Definition at line 1110 of file audiooutputbase.cpp.
Referenced by AddData().
|
static |
Definition at line 122 of file audiooutputbase.h.
Referenced by AddData(), and Reconfigure().
|
static |
Audio Buffer Size – should be divisible by 32,24,16,12,10,8,6,4,2..
Definition at line 126 of file audiooutputbase.h.
Referenced by AddData(), audiofree(), audiolen(), CopyWithUpmix(), GetAudioData(), and GetBufferStatus().
|
protected |
Definition at line 174 of file audiooutputbase.h.
Referenced by AudioOutputPulseAudio::ConnectPlaybackStream(), AudioOutputJACK::DeinterleaveAudio(), GetChannels(), AudioOutputJACK::JackCallback(), AudioOutputJACK::JackConnectPorts(), AudioOutputJACK::JackGraphOrderCallback(), CoreAudioData::OpenAnalog(), AudioOutputWin::OpenDevice(), AudioOutputALSA::OpenDevice(), AudioOutputOSS::OpenDevice(), AudioOutputAudioTrack::OpenDevice(), AudioOutputJACK::OpenDevice(), AudioOutputPulseAudio::OpenDevice(), AudioOutputALSA::OpenMixer(), Reconfigure(), AudioOutputCA::RenderAudio(), and AudioOutputALSA::WriteAudio().
|
protected |
Definition at line 175 of file audiooutputbase.h.
Referenced by AudioOutputAudioTrack::OpenDevice(), Reconfigure(), and ToggleUpmix().
|
protected |
Definition at line 176 of file audiooutputbase.h.
Referenced by AddData(), audioready(), CheckFreeSpace(), CopyWithUpmix(), GetAudiotime(), Reconfigure(), SetStretchFactorLocked(), and AudioOutputOpenSLES::StartPlayer().
|
protected |
Definition at line 177 of file audiooutputbase.h.
Referenced by audioready(), AudioOutputPulseAudio::ConnectPlaybackStream(), AudioOutputCA::GetAudiotime(), GetAudiotime(), AudioOutputALSA::GetBufferedOnSoundcard(), AudioOutputJACK::GetBufferedOnSoundcard(), AudioOutputPulseAudio::GetBufferedOnSoundcard(), AudioOutputJACK::JackCallback(), AudioOutputJACK::JackXRunCallback(), CoreAudioData::OpenAnalog(), AudioOutputWin::OpenDevice(), AudioOutputOSS::OpenDevice(), AudioOutputOpenSLES::OpenDevice(), AudioOutputAudioTrack::OpenDevice(), AudioOutputJACK::OpenDevice(), OutputAudioLoop(), Reconfigure(), AudioOutputCA::RenderAudio(), AudioOutputALSA::SetParameters(), and AudioOutputALSA::WriteAudio().
|
protected |
Definition at line 178 of file audiooutputbase.h.
Referenced by AddData(), CopyWithUpmix(), GetFormat(), Reconfigure(), Status(), and ToggleUpmix().
|
protected |
Definition at line 179 of file audiooutputbase.h.
Referenced by GetAudioData(), CoreAudioData::OpenAnalog(), AudioOutputWin::OpenDevice(), AudioOutputALSA::OpenDevice(), AudioOutputOSS::OpenDevice(), AudioOutputAudioTrack::OpenDevice(), AudioOutputPulseAudio::OpenDevice(), Reconfigure(), AudioOutputCA::RenderAudio(), AudioOutputOpenSLES::StartPlayer(), and AudioOutputALSA::WriteAudio().
|
protected |
Definition at line 180 of file audiooutputbase.h.
Referenced by AudioOutputPulseAudio::ConnectPlaybackStream(), GetAudiotime(), AudioOutputAudioTrack::GetBufferedOnSoundcard(), AudioOutputPulseAudio::GetBufferedOnSoundcard(), AudioOutputJACK::JackXRunCallback(), CoreAudioData::OpenAnalog(), AudioOutputWin::OpenDevice(), AudioOutputALSA::OpenDevice(), AudioOutputOSS::OpenDevice(), AudioOutputOpenSLES::OpenDevice(), AudioOutputAudioTrack::OpenDevice(), AudioOutputJACK::OpenDevice(), AudioOutputPulseAudio::OpenDevice(), CoreAudioData::OpenSPDIF(), OutputAudioLoop(), Reconfigure(), SetStretchFactorLocked(), and AudioOutputOpenSLES::StartPlayer().
|
protected |
Definition at line 181 of file audiooutputbase.h.
Referenced by AudioOutputCA::GetAudiotime(), GetAudiotime(), Reconfigure(), AudioOutputCA::RenderAudio(), SetAudiotime(), and SetEffDsp().
|
protected |
Definition at line 182 of file audiooutputbase.h.
Referenced by AddData(), AudioOutputPulseAudio::ConnectPlaybackStream(), Drain(), AudioOutputWin::GetBufferedOnSoundcard(), AudioOutputOpenSLES::GetBufferedOnSoundcard(), AudioOutputJACK::GetBufferedOnSoundcard(), AudioOutputJACK::JackCallback(), AudioOutputJACK::JackXRunCallback(), AudioOutputWin::OpenDevice(), AudioOutputOSS::OpenDevice(), AudioOutputOpenSLES::OpenDevice(), AudioOutputAudioTrack::OpenDevice(), AudioOutputJACK::OpenDevice(), AudioOutputNULL::OpenDevice(), OutputAudioLoop(), Reconfigure(), AudioOutputALSA::SetParameters(), and AudioOutputOpenSLES::WriteAudio().
|
protected |
Definition at line 183 of file audiooutputbase.h.
Referenced by AudioOutputPulseAudio::ConnectPlaybackStream(), AudioOutputDXPrivate::FillBuffer(), AudioOutputWin::OpenDevice(), AudioOutputOSS::OpenDevice(), AudioOutputOpenSLES::OpenDevice(), AudioOutputAudioTrack::OpenDevice(), AudioOutputNULL::OpenDevice(), and AudioOutputALSA::SetParameters().
|
protected |
Definition at line 185 of file audiooutputbase.h.
Referenced by AudioOutputALSA::AudioOutputALSA(), AudioOutputBase(), AudioOutputCA::AudioOutputCA(), AudioOutputDX::AudioOutputDX(), AudioOutputPulseAudio::ChooseHost(), AudioOutputALSA::GetOutputSettings(), AudioOutputOSS::GetOutputSettings(), AudioOutputDXPrivate::InitDirectSound(), AudioOutputJACK::JackGetPorts(), AudioOutputOSS::OpenDevice(), AudioOutputJACK::OpenDevice(), Reconfigure(), AudioOutputALSA::TryOpenDevice(), and AudioOutputOSS::WriteAudio().
|
protected |
Definition at line 186 of file audiooutputbase.h.
Referenced by AudioOutputALSA::AudioOutputALSA(), AudioOutputDX::AudioOutputDX(), AudioOutputALSA::GetOutputSettings(), AudioOutputDXPrivate::InitDirectSound(), and AudioOutputALSA::TryOpenDevice().
Definition at line 187 of file audiooutputbase.h.
Referenced by AudioOutputALSA::AudioOutputALSA(), AudioOutputDX::AudioOutputDX(), AudioOutputALSA::GetOutputSettings(), GetOutputSettingsCleaned(), GetOutputSettingsUsers(), and AudioOutputALSA::TryOpenDevice().
Definition at line 189 of file audiooutputbase.h.
Referenced by AddData(), audioready(), GetAudioData(), GetAudiotime(), AudioOutputWin::OpenDevice(), AudioOutputALSA::OpenDevice(), AudioOutputOSS::OpenDevice(), AudioOutputAudioTrack::OpenDevice(), AudioOutputCA::OpenDevice(), Reconfigure(), AudioOutputCA::RenderAudio(), AudioOutputAudioTrack::SetSourceBitrate(), ToggleUpmix(), and AudioOutputALSA::WriteAudio().
Definition at line 190 of file audiooutputbase.h.
Referenced by audioready(), GetAudioData(), GetAudiotime(), KillAudio(), AudioOutputWin::OpenDevice(), AudioOutputALSA::OpenDevice(), AudioOutputAudioTrack::OpenDevice(), AudioOutputCA::OpenDevice(), Reconfigure(), and AudioOutputAudioTrack::SetSourceBitrate().
Definition at line 191 of file audiooutputbase.h.
Referenced by Reconfigure().
|
protected |
Definition at line 193 of file audiooutputbase.h.
Referenced by AddData(), AudioOutputCA::GetAudiotime(), GetStretchFactor(), KillAudio(), Reconfigure(), and SetStretchFactorLocked().
|
protected |
Definition at line 194 of file audiooutputbase.h.
Referenced by GetAudiotime(), SetAudiotime(), and SetStretchFactorLocked().
|
protected |
Definition at line 195 of file audiooutputbase.h.
Referenced by Reconfigure().
Definition at line 197 of file audiooutputbase.h.
Referenced by AudioOutputJACK::JackCallback(), KillAudio(), OutputAudioLoop(), Reconfigure(), AudioOutputCA::RenderAudio(), and ~AudioOutputBase().
Definition at line 199 of file audiooutputbase.h.
Referenced by AddData(), Drain(), AudioOutputJACK::JackCallback(), OutputAudioLoop(), Pause(), Reconfigure(), AudioOutputCA::RenderAudio(), Reset(), and SetStretchFactorLocked().
Definition at line 200 of file audiooutputbase.h.
Referenced by IsPaused(), AudioOutputJACK::JackCallback(), OutputAudioLoop(), Pause(), Reconfigure(), AudioOutputCA::RenderAudio(), SetStretchFactorLocked(), and AudioOutputAudioTrack::WriteAudio().
Definition at line 201 of file audiooutputbase.h.
Referenced by AudioOutputJACK::JackCallback(), OutputAudioLoop(), Pause(), Reconfigure(), Reset(), and SetStretchFactorLocked().
Definition at line 202 of file audiooutputbase.h.
Referenced by AddData(), Pause(), PauseUntilBuffered(), Reconfigure(), Reset(), and SetStretchFactorLocked().
|
protected |
Definition at line 203 of file audiooutputbase.h.
Referenced by AudioOutputPulseAudio::ConnectPlaybackStream(), AudioOutputCA::OpenDevice(), AudioOutputALSA::OpenMixer(), Reconfigure(), AudioOutputOSS::VolumeInit(), and AudioOutputJACK::VolumeInit().
Definition at line 204 of file audiooutputbase.h.
Referenced by bufferOutputData(), AudioOutputNULL::GetBufferedOnSoundcard(), AudioOutputNULL::Reset(), and AudioOutputNULL::WriteAudio().
|
protected |
Definition at line 206 of file audiooutputbase.h.
Referenced by AddData(), GetAudioData(), InitSettings(), Reconfigure(), and SetStretchFactorLocked().
|
protected |
Definition at line 207 of file audiooutputbase.h.
Referenced by CanPassthrough(), InitSettings(), Reconfigure(), and ToggleUpmix().
|
protected |
Definition at line 215 of file audiooutputbase.h.
Referenced by AudioOutputBase(), Reconfigure(), and AudioOutputALSA::SetParameters().
|
protected |
Definition at line 216 of file audiooutputbase.h.
Referenced by GetAudiotime(), AudioOutputAudioTrack::OpenDevice(), Reconfigure(), AudioOutputAudioTrack::SetSourceBitrate(), SetSourceBitrate(), and Status().
|
protected |
Definition at line 217 of file audiooutputbase.h.
Referenced by AddData(), GetAudiotime(), AudioOutputAudioTrack::OpenDevice(), Reconfigure(), AudioOutputAudioTrack::SetSourceBitrate(), SetTimecode(), Status(), and ToggleUpmix().
|
private |
Definition at line 225 of file audiooutputbase.h.
Referenced by GetOutputSettingsCleaned(), and ~AudioOutputBase().
|
private |
Definition at line 226 of file audiooutputbase.h.
Referenced by GetOutputSettingsUsers(), InitSettings(), OutputSettings(), Reconfigure(), and ~AudioOutputBase().
|
private |
Definition at line 227 of file audiooutputbase.h.
Referenced by GetOutputSettingsCleaned(), and ~AudioOutputBase().
|
private |
Definition at line 228 of file audiooutputbase.h.
Referenced by CanPassthrough(), GetOutputSettingsUsers(), InitSettings(), OutputSettings(), Reconfigure(), SetupPassthrough(), and ~AudioOutputBase().
Definition at line 229 of file audiooutputbase.h.
Referenced by AddData(), KillAudio(), and Reconfigure().
|
private |
Definition at line 230 of file audiooutputbase.h.
Referenced by AddData(), CheckFreeSpace(), KillAudio(), and Reconfigure().
|
private |
Definition at line 231 of file audiooutputbase.h.
Referenced by AddData(), KillAudio(), Reset(), SetAudiotime(), and SetStretchFactorLocked().
|
private |
Definition at line 232 of file audiooutputbase.h.
Referenced by AddData(), KillAudio(), Reconfigure(), Reset(), and SetAudiotime().
|
private |
Definition at line 233 of file audiooutputbase.h.
Referenced by AddData(), CopyWithUpmix(), IsUpmixing(), KillAudio(), Reconfigure(), Reset(), and SetAudiotime().
|
private |
Definition at line 235 of file audiooutputbase.h.
Referenced by AddData(), CopyWithUpmix(), Reconfigure(), SetStretchFactorLocked(), Status(), and ToggleUpmix().
|
private |
Definition at line 236 of file audiooutputbase.h.
Referenced by AddData(), AddFrames(), GetBytesPerFrame(), and Reconfigure().
Definition at line 237 of file audiooutputbase.h.
Referenced by CanPassthrough(), InitSettings(), Reconfigure(), and ToggleUpmix().
Definition at line 238 of file audiooutputbase.h.
Referenced by AddData(), CopyWithUpmix(), IsUpmixing(), KillAudio(), Reconfigure(), Reset(), SetAudiotime(), and SetStretchFactorLocked().
Definition at line 239 of file audiooutputbase.h.
Referenced by AddData(), Reconfigure(), and SetStretchFactorLocked().
|
private |
Definition at line 240 of file audiooutputbase.h.
Referenced by Reconfigure().
|
private |
Definition at line 241 of file audiooutputbase.h.
Referenced by KillAudio(), and Reconfigure().
|
private |
Definition at line 242 of file audiooutputbase.h.
Referenced by AddData(), GetSWVolume(), Reconfigure(), and SetSWVolume().
|
private |
Definition at line 243 of file audiooutputbase.h.
Referenced by Reconfigure(), and SetSWVolume().
Definition at line 245 of file audiooutputbase.h.
Referenced by AddData(), CopyWithUpmix(), GetAudioData(), Reconfigure(), and SetStretchFactorLocked().
|
private |
Definition at line 247 of file audiooutputbase.h.
Referenced by AddData(), Reconfigure(), Reset(), SetStretchFactorLocked(), and SetTimecode().
Definition at line 249 of file audiooutputbase.h.
Referenced by StartOutputThread(), and StopOutputThread().
|
private |
Writes to the audiobuffer, reconfigures and audiobuffer resets can only take place while holding this lock.
Definition at line 255 of file audiooutputbase.h.
Referenced by AddData(), Drain(), KillAudio(), Reconfigure(), Reset(), and SetStretchFactor().
|
private |
must hold avsync_lock to read or write 'audiotime' and 'audiotime_updated'
Definition at line 261 of file audiooutputbase.h.
Referenced by GetAudiotime(), Reconfigure(), and Reset().
|
private |
timecode of audio leaving the soundcard (same units as timecodes)
Definition at line 266 of file audiooutputbase.h.
Referenced by GetAudiotime(), OutputAudioLoop(), Reconfigure(), Reset(), SetAudiotime(), SetStretchFactorLocked(), and SetTimecode().
|
private |
Audio circular buffer.
Definition at line 271 of file audiooutputbase.h.
Referenced by audiolen(), Drain(), GetAudioData(), OutputAudioLoop(), Reconfigure(), Reset(), and SetStretchFactorLocked().
|
private |
Definition at line 272 of file audiooutputbase.h.
Referenced by AddData(), audiolen(), Drain(), Reconfigure(), Reset(), and SetStretchFactorLocked().
|
private |
timecode of audio most recently placed into buffer
Definition at line 276 of file audiooutputbase.h.
Referenced by GetAudioBufferedTime(), GetAudiotime(), GetBaseAudBufTimeCode(), Reconfigure(), Reset(), SetAudiotime(), SetStretchFactorLocked(), and SetTimecode().
|
private |
Definition at line 277 of file audiooutputbase.h.
Referenced by OutputAudioLoop(), Reconfigure(), Reset(), and SetStretchFactorLocked().
|
private |
Definition at line 279 of file audiooutputbase.h.
Referenced by KillAudio().
|
private |
Definition at line 281 of file audiooutputbase.h.
Referenced by Reconfigure(), Reset(), and Status().
|
private |
Definition at line 283 of file audiooutputbase.h.
Referenced by AddData(), AudioOutputBase(), and Reconfigure().
|
private |
Definition at line 286 of file audiooutputbase.h.
Referenced by AddData(), and Reconfigure().
|
private |
Definition at line 287 of file audiooutputbase.h.
Referenced by ~AudioOutputBase().
|
private |
Definition at line 288 of file audiooutputbase.h.
Referenced by AddData(), and AudioOutputBase().
|
private |
Definition at line 289 of file audiooutputbase.h.
Referenced by ~AudioOutputBase().
|
private |
Definition at line 290 of file audiooutputbase.h.
Referenced by AddData(), Reconfigure(), and ~AudioOutputBase().
|
private |
Definition at line 291 of file audiooutputbase.h.
Referenced by Reconfigure(), and ~AudioOutputBase().
|
private |
Definition at line 292 of file audiooutputbase.h.
Referenced by ~AudioOutputBase().
|
private |
|
private |
Definition at line 297 of file audiooutputbase.h.
Referenced by ~AudioOutputBase().
Definition at line 298 of file audiooutputbase.h.
Referenced by AddData(), GetAudiotime(), Reconfigure(), SetAudiotime(), and SetStretchFactorLocked().
|
private |
Definition at line 299 of file audiooutputbase.h.
Referenced by AddData(), and LengthLastData().
Definition at line 302 of file audiooutputbase.h.
Referenced by AudioOutputBase(), SetupPassthrough(), and usesSpdif().
|
private |
Definition at line 303 of file audiooutputbase.h.
Referenced by AddData(), and SetupPassthrough().
Definition at line 306 of file audiooutputbase.h.
Referenced by Reconfigure(), and SetStretchFactorLocked().
|
private |
Definition at line 307 of file audiooutputbase.h.
Referenced by SetStretchFactorLocked().