MythTV  master
audiooutputbase.h
Go to the documentation of this file.
1 #ifndef AUDIOOUTPUTBASE
2 #define AUDIOOUTPUTBASE
3 
4 // POSIX headers
5 #include <sys/time.h> // for struct timeval
6 
7 // Qt headers
8 #include <QString>
9 #include <QMutex>
10 #include <QWaitCondition>
11 
12 // MythTV headers
13 #include "audiooutput.h"
14 #include "mythlogging.h"
15 #include "mthread.h"
16 
17 #include "samplerate.h"
18 
19 #define VBAUDIO(str) LOG(VB_AUDIO, LOG_INFO, LOC + (str))
20 #define VBAUDIOTS(str) LOG(VB_AUDIO | VB_TIMESTAMP, LOG_INFO, LOC + (str))
21 #define VBGENERAL(str) LOG(VB_GENERAL, LOG_INFO, LOC + (str))
22 #define VBERROR(str) LOG(VB_GENERAL, LOG_ERR, LOC + (str))
23 #define VBWARN(str) LOG(VB_GENERAL, LOG_WARNING, LOC + (str))
24 #define VBERRENO(str) Error(LOC + (str) + ": " + ENO)
25 #define VBERRNOCONST(str) LOG(VB_GENERAL, LOG_ERR, LOC + (str) + ": " + ENO)
26 
27 namespace soundtouch {
28 class SoundTouch;
29 };
30 class FreeSurround;
32 struct AVCodecContext;
33 
35 {
36 public:
37  AsyncLooseLock() = default;
38  void Clear() { m_head = m_tail = 0; }
39  void Ref() { m_head++; }
40  bool TestAndDeref() { bool r = false; if ((r=(m_head != m_tail))) m_tail++; return r; }
41 private:
42  int m_head {0};
43  int m_tail {0};
44 };
45 
46 // Forward declaration of SPDIF encoder
47 class SPDIFEncoder;
48 
49 class AudioOutputBase : public AudioOutput, public MThread
50 {
51  public:
52  static const char *quality_string(int q);
53  explicit AudioOutputBase(const AudioSettings &settings);
54  ~AudioOutputBase() override;
55 
56  AudioOutputSettings* GetOutputSettingsCleaned(bool digital = true) override; // AudioOutput
57  AudioOutputSettings* GetOutputSettingsUsers(bool digital = false) override; // AudioOutput
58 
59  // reconfigure sound out for new params
60  void Reconfigure(const AudioSettings &settings) override; // AudioOutput
61 
62  // dsprate is in 100 * samples/second
63  void SetEffDsp(int dsprate) override; // AudioOutput
64 
65  // timestretch
66  void SetStretchFactor(float factor) override; // AudioOutput
67  float GetStretchFactor(void) const override; // AudioOutput
68  int GetChannels(void) const override { return m_channels; } // AudioOutput
69  AudioFormat GetFormat(void) const override { return m_format; }; // AudioOutput
70  int GetBytesPerFrame(void) const override // AudioOutput
71  { return m_sourceBytesPerFrame; }
72 
73  bool CanPassthrough(int samplerate, int channels,
74  AVCodecID codec, int profile) const override; // AudioOutput
75  bool CanDownmix(void) const override { return true; } // AudioOutput
76  bool IsUpmixing(void) override; // AudioOutput
77  bool ToggleUpmix(void) override; // AudioOutput
78  bool CanUpmix(void) override; // AudioOutput
79  bool CanProcess(AudioFormat /*fmt*/) override { return true; } // AudioOutput
80  uint32_t CanProcess(void) override // AudioOutput
81  {
82  // we support all codec
83  return ~(((~0ULL) >> FORMAT_FLT) << FORMAT_FLT);
84  }
85 
86  void Reset(void) override; // AudioOutput
87 
88  void SetSWVolume(int new_volume, bool save) override; // VolumeBase
89  int GetSWVolume(void) override; // VolumeBase
90 
91  // timecode is in milliseconds.
92  bool AddFrames(void *buffer, int frames, int64_t timecode) override; // AudioOutput
93  bool AddData(void *buffer, int len, int64_t timecode, int frames) override; // AudioOutput
94  bool NeedDecodingBeforePassthrough() const override { return false; }; // AudioOutput
95  int64_t LengthLastData(void) const override { return m_lengthLastData; } // AudioOutput
96 
97  void SetTimecode(int64_t timecode) override; // AudioOutput
98  bool IsPaused(void) const override { return m_actuallyPaused; } // AudioOutput
99  void Pause(bool paused) override; // AudioOutput
100  void PauseUntilBuffered(void) override; // AudioOutput
101 
102  // Wait for all data to finish playing
103  void Drain(void) override; // AudioOutput
104 
105  int64_t GetAudiotime(void) override; // AudioOutput
106  int64_t GetAudioBufferedTime(void) override; // AudioOutput
107 
108  // Send output events showing current progress
109  virtual void Status(void);
110 
111  void SetSourceBitrate(int rate) override; // AudioOutput
112 
113  void GetBufferStatus(uint &fill, uint &total) override; // AudioOutput
114 
115  // Only really used by the AudioOutputNULL object
116  void bufferOutputData(bool y) override // AudioOutput
117  { m_bufferOutputDataForUse = y; }
118  int readOutputData(unsigned char *read_buffer, int max_length) override; // AudioOutput
119 
120  static const uint kAudioSRCInputSize = 16384;
121 
123  // In other words, divisible by 96.
124  static const uint kAudioRingBufferSize = 10239936U;
125 
126  protected:
127  // Following function must be called from subclass constructor
128  void InitSettings(const AudioSettings &settings);
129 
130  // You need to implement the following functions
131  virtual bool OpenDevice(void) = 0;
132  virtual void CloseDevice(void) = 0;
133  virtual void WriteAudio(unsigned char *aubuf, int size) = 0;
138  virtual int GetBufferedOnSoundcard(void) const = 0;
139  // Default implementation only supports 2ch s16le at 48kHz
140  virtual AudioOutputSettings* GetOutputSettings(bool /*digital*/)
141  { return new AudioOutputSettings; }
142  // You need to call this from any implementation in the dtor.
143  void KillAudio(void);
144 
145  // The following functions may be overridden, but don't need to be
146  virtual bool StartOutputThread(void);
147  virtual void StopOutputThread(void);
148 
149  int GetAudioData(uchar *buffer, int buf_size, bool full_buffer,
150  volatile uint *local_raud = nullptr);
151 
152  void OutputAudioLoop(void);
153 
154  void run() override; // MThread
155 
156  int CheckFreeSpace(int &frames);
157 
158  inline int audiolen() const; // number of valid bytes in audio buffer
159  int audiofree() const; // number of free bytes in audio buffer
160  int audioready() const; // number of bytes ready to be written
161 
162  void SetStretchFactorLocked(float factor);
163 
164  // For audiooutputca
165  int GetBaseAudBufTimeCode() const { return m_audbufTimecode; }
166 
167  bool usesSpdif() const { return m_usesSpdif; }
168 
169  protected:
170  // Basic details about the audio stream
171  int m_channels {-1};
172  AVCodecID m_codec {AV_CODEC_ID_NONE};
177  int m_sampleRate {-1};
178  int m_effDsp {0}; // from the recorded stream (NuppelVideo)
179  int m_fragmentSize {0};
181 
182  QString m_mainDevice;
184  bool m_discreteDigital {false};
185 
186  bool m_passthru {false};
187  bool m_enc {false};
188  bool m_reEnc {false};
189 
190  float m_stretchFactor {1.0F};
191  int m_effStretchFactor {100000}; // scaled to 100000 ase ffdsp is
193 
194  bool m_killAudio {false};
195 
196  bool m_pauseAudio {false};
197  bool m_actuallyPaused {false};
198  bool m_wasPaused {false};
199  bool m_unpauseWhenReady {false};
201  bool m_bufferOutputDataForUse {false}; // used by AudioOutputNULL
202 
204  int m_maxChannels {0};
205  enum
206  {
211  };
213  long m_sourceBitRate {-1};
215 
216  private:
217  bool SetupPassthrough(AVCodecID codec, int codec_profile,
218  int &samplerate_tmp, int &channels_tmp);
219  AudioOutputSettings* OutputSettings(bool digital = true);
220  int CopyWithUpmix(char *buffer, int frames, uint &org_waud);
221  void SetAudiotime(int frames, int64_t timecode);
226  bool m_needResampler {false};
227  SRC_STATE *m_srcCtx {nullptr};
228  soundtouch::SoundTouch *m_pSoundStretch {nullptr};
231 
234  bool m_upmixDefault {false};
235  bool m_needsUpmix {false};
236  bool m_needsDownmix {false};
238  float m_oldStretchFactor {1.0F};
239  int m_volume {80};
241 
242  bool m_processing {false};
243 
244  int64_t m_framesBuffered {0};
245 
246  bool m_audioThreadExists {false};
247 
253 
258  QMutex m_avsyncLock;
259 
263  int64_t m_audioTime {0};
264 
268  volatile uint m_raud {0}; // read position
269  volatile uint m_waud {0}; // write position
273  int64_t m_audbufTimecode {0};
275 
276  QMutex m_killAudioLock {QMutex::NonRecursive};
277 
278  long m_currentSeconds {-1};
279 
280  float *m_srcIn;
281 
282  // All actual buffers
283  SRC_DATA m_srcData {};
285  alignas(16) float m_srcInBuf[kAudioSRCInputSize] {};
287  float *m_srcOut {nullptr};
295  bool m_configureSucceeded {false};
296  int64_t m_lengthLastData {0};
297 
298  // SPDIF Encoder for digital passthrough
299  bool m_usesSpdif {true};
301 
302  // Flag indicating if SetStretchFactor enabled audio float processing
303  bool m_forcedProcessing {false};
304  int m_previousBpf {0};
305 };
306 
307 #endif
AudioOutputBase::m_srcOut
float * m_srcOut
Definition: audiooutputbase.h:287
AudioOutputBase::m_enc
bool m_enc
Definition: audiooutputbase.h:187
FORMAT_NONE
@ FORMAT_NONE
Definition: audiooutputsettings.h:26
AudioOutputBase::m_outputSettingsRaw
AudioOutputSettings * m_outputSettingsRaw
Definition: audiooutputbase.h:222
AudioOutputBase::m_srcIn
float * m_srcIn
Definition: audiooutputbase.h:280
AudioOutputBase::Reset
void Reset(void) override
Reset the audiobuffer, timecode and mythmusic visualisation.
Definition: audiooutputbase.cpp:920
AudioOutputBase::m_pSoundStretch
soundtouch::SoundTouch * m_pSoundStretch
Definition: audiooutputbase.h:228
AudioOutputBase::GetBytesPerFrame
int GetBytesPerFrame(void) const override
Definition: audiooutputbase.h:70
AudioOutputBase::m_discreteDigital
bool m_discreteDigital
Definition: audiooutputbase.h:184
AudioOutputBase::Pause
void Pause(bool paused) override
Definition: audiooutputbase.cpp:898
AudioOutputBase::m_raud
volatile uint m_raud
Audio circular buffer.
Definition: audiooutputbase.h:268
soundtouch
Definition: audiooutputbase.h:27
AudioOutputBase::CheckFreeSpace
int CheckFreeSpace(int &frames)
Check that there's enough space in the audiobuffer to write the provided number of frames.
Definition: audiooutputbase.cpp:1177
AudioOutputBase::m_currentSeconds
long m_currentSeconds
Definition: audiooutputbase.h:278
AudioOutputBase::audiolen
int audiolen() const
Get the number of bytes in the audiobuffer.
Definition: audiooutputbase.cpp:978
AudioOutputBase::m_bufferOutputDataForUse
bool m_bufferOutputDataForUse
Definition: audiooutputbase.h:201
AudioOutputBase::m_resetActive
AsyncLooseLock m_resetActive
Definition: audiooutputbase.h:274
AudioOutputBase::m_avsyncLock
QMutex m_avsyncLock
must hold avsync_lock to read or write 'audiotime' and 'audiotime_updated'
Definition: audiooutputbase.h:258
AudioOutputBase::m_forcedProcessing
bool m_forcedProcessing
Definition: audiooutputbase.h:303
AudioOutputBase::CanPassthrough
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.
Definition: audiooutputbase.cpp:205
AsyncLooseLock
Definition: audiooutputbase.h:35
AudioOutputBase::m_needResampler
bool m_needResampler
Definition: audiooutputbase.h:226
AudioOutputBase::m_audbufTimecode
int64_t m_audbufTimecode
timecode of audio most recently placed into buffer
Definition: audiooutputbase.h:273
AudioOutputBase::CloseDevice
virtual void CloseDevice(void)=0
AudioOutputBase::m_configureSucceeded
bool m_configureSucceeded
Definition: audiooutputbase.h:295
AudioOutputBase::m_memoryCorruptionTest2
uint m_memoryCorruptionTest2
Definition: audiooutputbase.h:289
AudioOutputBase::SetupPassthrough
bool SetupPassthrough(AVCodecID codec, int codec_profile, int &samplerate_tmp, int &channels_tmp)
Definition: audiooutputbase.cpp:404
AudioOutputBase::audiofree
int audiofree() const
Get the free space in the audiobuffer in bytes.
Definition: audiooutputbase.cpp:988
AudioOutputBase::m_previousBpf
int m_previousBpf
Definition: audiooutputbase.h:304
AudioOutputBase::KillAudio
void KillAudio(void)
Kill the output thread and cleanup.
Definition: audiooutputbase.cpp:856
AudioOutputBase::m_audioBuffer
uchar m_audioBuffer[kAudioRingBufferSize]
main audio buffer
Definition: audiooutputbase.h:293
AudioOutputBase::GetStretchFactor
float GetStretchFactor(void) const override
Get the timetretch factor.
Definition: audiooutputbase.cpp:361
FreeSurround
Definition: freesurround.h:27
AudioOutputBase::IsUpmixing
bool IsUpmixing(void) override
Source is currently being upmixed.
Definition: audiooutputbase.cpp:369
AudioOutputBase::SetEffDsp
void SetEffDsp(int dsprate) override
Set the effective DSP rate.
Definition: audiooutputbase.cpp:969
AudioOutputBase::CanDownmix
bool CanDownmix(void) const override
Definition: audiooutputbase.h:75
AudioOutputBase::quality_string
static const char * quality_string(int q)
Definition: audiooutputbase.cpp:44
AudioOutputBase::m_sampleRate
int m_sampleRate
Definition: audiooutputbase.h:177
AudioOutputBase::m_volume
int m_volume
Definition: audiooutputbase.h:239
AudioOutputBase::m_sourceChannels
int m_sourceChannels
Definition: audiooutputbase.h:232
AudioOutputBase::m_killAudio
bool m_killAudio
Definition: audiooutputbase.h:194
AsyncLooseLock::AsyncLooseLock
AsyncLooseLock()=default
AudioOutputBase::m_lengthLastData
int64_t m_lengthLastData
Definition: audiooutputbase.h:296
AudioOutputBase::GetBufferedOnSoundcard
virtual int GetBufferedOnSoundcard(void) const =0
Return the size in bytes of frames currently in the audio buffer adjusted with the audio playback lat...
AudioOutputBase::m_kAudioSRCOutputSize
int m_kAudioSRCOutputSize
Definition: audiooutputbase.h:288
AudioSettings
Definition: audiosettings.h:29
AudioOutputBase::m_mainDevice
QString m_mainDevice
Definition: audiooutputbase.h:182
AudioOutputBase::SetTimecode
void SetTimecode(int64_t timecode) override
Set the timecode of the samples most recently added to the audiobuffer.
Definition: audiooutputbase.cpp:957
AsyncLooseLock::Ref
void Ref()
Definition: audiooutputbase.h:39
AudioOutputBase::Drain
void Drain(void) override
Block until all available frames have been written to the device.
Definition: audiooutputbase.cpp:1815
AudioOutputBase::m_soundcardBufferSize
long m_soundcardBufferSize
Definition: audiooutputbase.h:180
AudioOutputBase::m_stretchFactor
float m_stretchFactor
Definition: audiooutputbase.h:190
AudioOutputBase::SetAudiotime
void SetAudiotime(int frames, int64_t timecode)
Set the timecode of the top of the ringbuffer Exclude all other processing elements as they dont vary...
Definition: audiooutputbase.cpp:1092
AudioOutputBase::m_unpauseWhenReady
bool m_unpauseWhenReady
Definition: audiooutputbase.h:199
AudioOutputBase::GetChannels
int GetChannels(void) const override
Definition: audiooutputbase.h:68
AudioOutput
Definition: audiooutput.h:26
AudioOutputBase
Definition: audiooutputbase.h:50
AudioOutputDigitalEncoder
Definition: audiooutputdigitalencoder.h:15
AudioOutputBase::m_upmixer
FreeSurround * m_upmixer
Definition: audiooutputbase.h:230
AudioOutputBase::m_killAudioLock
QMutex m_killAudioLock
Definition: audiooutputbase.h:276
mythlogging.h
AudioOutputBase::m_srcQuality
int m_srcQuality
Definition: audiooutputbase.h:212
AudioOutputBase::m_volumeControl
QString m_volumeControl
Definition: audiooutputbase.h:240
AudioOutputBase::m_audioThreadExists
bool m_audioThreadExists
Definition: audiooutputbase.h:246
hardwareprofile.scan.profile
profile
Definition: scan.py:99
AudioOutputBase::m_format
AudioFormat m_format
Definition: audiooutputbase.h:175
AudioOutputBase::AudioOutputBase
AudioOutputBase(const AudioSettings &settings)
Definition: audiooutputbase.cpp:56
AudioOutputBase::m_waud
volatile uint m_waud
Definition: audiooutputbase.h:269
AudioOutputBase::m_sourceSampleRate
int m_sourceSampleRate
Definition: audiooutputbase.h:214
AsyncLooseLock::m_head
int m_head
Definition: audiooutputbase.h:42
AudioOutputBase::QUALITY_LOW
@ QUALITY_LOW
Definition: audiooutputbase.h:208
AudioOutputBase::GetOutputSettingsCleaned
AudioOutputSettings * GetOutputSettingsCleaned(bool digital=true) override
Returns capabilities supported by the audio device amended to take into account the digital audio opt...
Definition: audiooutputbase.cpp:152
AudioOutputBase::m_needsUpmix
bool m_needsUpmix
Definition: audiooutputbase.h:235
AudioOutputBase::m_effStretchFactor
int m_effStretchFactor
Definition: audiooutputbase.h:191
AudioOutputBase::StopOutputThread
virtual void StopOutputThread(void)
Definition: audiooutputbase.cpp:844
FORMAT_FLT
@ FORMAT_FLT
Definition: audiooutputsettings.h:32
AudioOutputBase::Reconfigure
void Reconfigure(const AudioSettings &settings) override
(Re)Configure AudioOutputBase
Definition: audiooutputbase.cpp:464
AudioOutputBase::GetOutputSettings
virtual AudioOutputSettings * GetOutputSettings(bool)
Definition: audiooutputbase.h:140
AudioOutputBase::~AudioOutputBase
~AudioOutputBase() override
Destructor.
Definition: audiooutputbase.cpp:85
AudioOutputBase::m_memoryCorruptionTest1
uint m_memoryCorruptionTest1
Definition: audiooutputbase.h:286
AudioOutputBase::m_oldStretchFactor
float m_oldStretchFactor
Definition: audiooutputbase.h:238
AudioOutputBase::GetAudioData
int GetAudioData(uchar *buffer, int buf_size, bool full_buffer, volatile uint *local_raud=nullptr)
Copy frames from the audiobuffer into the buffer provided.
Definition: audiooutputbase.cpp:1728
AudioOutputBase::m_maxChannels
int m_maxChannels
Definition: audiooutputbase.h:204
AudioOutputBase::NeedDecodingBeforePassthrough
bool NeedDecodingBeforePassthrough() const override
Definition: audiooutputbase.h:94
AudioOutputBase::m_outputSettingsDigitalRaw
AudioOutputSettings * m_outputSettingsDigitalRaw
Definition: audiooutputbase.h:224
AudioOutputBase::readOutputData
int readOutputData(unsigned char *read_buffer, int max_length) override
Definition: audiooutputbase.cpp:1840
AudioOutputBase::m_pauseAudio
bool m_pauseAudio
Definition: audiooutputbase.h:196
AudioOutputBase::QUALITY_MEDIUM
@ QUALITY_MEDIUM
Definition: audiooutputbase.h:209
AudioOutputBase::GetAudioBufferedTime
int64_t GetAudioBufferedTime(void) override
Get the difference in timecode between the samples that are about to become audible and the samples m...
Definition: audiooutputbase.cpp:1142
AudioOutputBase::kAudioRingBufferSize
static const uint kAudioRingBufferSize
Audio Buffer Size – should be divisible by 32,24,16,12,10,8,6,4,2..
Definition: audiooutputbase.h:124
AudioOutputBase::run
void run() override
Main routine for the output thread.
Definition: audiooutputbase.cpp:1831
AudioOutputBase::bufferOutputData
void bufferOutputData(bool y) override
Definition: audiooutputbase.h:116
AudioOutputBase::m_sourceBytesPerFrame
int m_sourceBytesPerFrame
Definition: audiooutputbase.h:233
uint
unsigned int uint
Definition: compat.h:140
AudioOutputBase::m_upmixDefault
bool m_upmixDefault
Definition: audiooutputbase.h:234
AudioOutputBase::GetAudiotime
int64_t GetAudiotime(void) override
Calculate the timecode of the samples that are about to become audible.
Definition: audiooutputbase.cpp:1013
AudioOutputBase::m_passthru
bool m_passthru
Definition: audiooutputbase.h:186
AudioOutputBase::OutputAudioLoop
void OutputAudioLoop(void)
Run in the output thread, write frames to the output device as they become available and there's spac...
Definition: audiooutputbase.cpp:1633
AudioOutputBase::m_outputFormat
AudioFormat m_outputFormat
Definition: audiooutputbase.h:176
AudioOutputBase::m_encoder
AudioOutputDigitalEncoder * m_encoder
Definition: audiooutputbase.h:229
AudioOutputBase::m_reEnc
bool m_reEnc
Definition: audiooutputbase.h:188
AudioOutputBase::GetSWVolume
int GetSWVolume(void) override
Get the volume for software volume control.
Definition: audiooutputbase.cpp:1164
AudioOutputBase::audioready
int audioready() const
Get the scaled number of bytes in the audiobuffer, i.e.
Definition: audiooutputbase.cpp:1003
AudioOutputBase::AddFrames
bool AddFrames(void *buffer, int frames, int64_t timecode) override
Add frames to the audiobuffer and perform any required processing.
Definition: audiooutputbase.cpp:1298
AudioOutputBase::m_channels
int m_channels
Definition: audiooutputbase.h:171
AudioOutputBase::CopyWithUpmix
int CopyWithUpmix(char *buffer, int frames, uint &org_waud)
Copy frames into the audiobuffer, upmixing en route if necessary.
Definition: audiooutputbase.cpp:1212
AudioOutputBase::m_configuredChannels
int m_configuredChannels
Definition: audiooutputbase.h:203
AudioOutputBase::m_setInitialVol
bool m_setInitialVol
Definition: audiooutputbase.h:200
AudioOutputBase::m_passthruDevice
QString m_passthruDevice
Definition: audiooutputbase.h:183
AudioOutputBase::m_srcInBuf
float m_srcInBuf[kAudioSRCInputSize]
Definition: audiooutputbase.h:285
AudioOutputBase::m_spdifEnc
SPDIFEncoder * m_spdifEnc
Definition: audiooutputbase.h:300
AudioOutputBase::m_codec
AVCodecID m_codec
Definition: audiooutputbase.h:172
AudioOutputBase::SetSWVolume
void SetSWVolume(int new_volume, bool save) override
Set the volume for software volume control.
Definition: audiooutputbase.cpp:1154
AudioOutputBase::CanUpmix
bool CanUpmix(void) override
Upmixing of the current source is available if requested.
Definition: audiooutputbase.cpp:395
AudioOutputBase::Status
virtual void Status(void)
Report status via an OutputEvent.
Definition: audiooutputbase.cpp:1598
AudioOutputBase::GetFormat
AudioFormat GetFormat(void) const override
Definition: audiooutputbase.h:69
AudioOutputBase::WriteAudio
virtual void WriteAudio(unsigned char *aubuf, int size)=0
AudioOutputBase::m_outputBytesPerFrame
int m_outputBytesPerFrame
Definition: audiooutputbase.h:174
AudioOutputBase::m_sourceBitRate
long m_sourceBitRate
Definition: audiooutputbase.h:213
AudioOutputBase::m_actuallyPaused
bool m_actuallyPaused
Definition: audiooutputbase.h:197
AudioOutputBase::m_memoryCorruptionTest0
uint m_memoryCorruptionTest0
Definition: audiooutputbase.h:284
AsyncLooseLock::m_tail
int m_tail
Definition: audiooutputbase.h:43
AudioOutputBase::m_wasPaused
bool m_wasPaused
Definition: audiooutputbase.h:198
AudioOutputBase::m_surroundMode
int m_surroundMode
Definition: audiooutputbase.h:237
AudioOutputBase::m_processing
bool m_processing
Definition: audiooutputbase.h:242
AsyncLooseLock::Clear
void Clear()
Definition: audiooutputbase.h:38
AudioOutputBase::GetBaseAudBufTimeCode
int GetBaseAudBufTimeCode() const
Definition: audiooutputbase.h:165
AudioOutputSettings
Definition: audiooutputsettings.h:53
AudioOutputBase::usesSpdif
bool usesSpdif() const
Definition: audiooutputbase.h:167
audiooutput.h
AudioOutputBase::QUALITY_DISABLED
@ QUALITY_DISABLED
Definition: audiooutputbase.h:207
AudioOutputBase::SetStretchFactor
void SetStretchFactor(float factor) override
Set the timestretch factor.
Definition: audiooutputbase.cpp:352
AudioOutputBase::m_bytesPerFrame
int m_bytesPerFrame
Definition: audiooutputbase.h:173
AudioOutputBase::m_effDsp
int m_effDsp
Definition: audiooutputbase.h:178
AudioOutputBase::CanProcess
bool CanProcess(AudioFormat) override
Definition: audiooutputbase.h:79
AudioOutputBase::InitSettings
void InitSettings(const AudioSettings &settings)
Definition: audiooutputbase.cpp:116
AudioOutputBase::QUALITY_HIGH
@ QUALITY_HIGH
Definition: audiooutputbase.h:210
AudioOutputBase::OpenDevice
virtual bool OpenDevice(void)=0
AudioOutputBase::IsPaused
bool IsPaused(void) const override
Definition: audiooutputbase.h:98
AudioOutputBase::PauseUntilBuffered
void PauseUntilBuffered(void) override
Definition: audiooutputbase.cpp:910
AudioOutputBase::CanProcess
uint32_t CanProcess(void) override
Definition: audiooutputbase.h:80
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:49
AudioOutputBase::StartOutputThread
virtual bool StartOutputThread(void)
Definition: audiooutputbase.cpp:832
AudioOutputBase::AddData
bool AddData(void *buffer, int len, int64_t timecode, int frames) override
Add data to the audiobuffer and perform any required processing.
Definition: audiooutputbase.cpp:1310
mthread.h
AudioOutputSource
AudioOutputSource
Definition: audiosettings.h:21
AudioOutputBase::LengthLastData
int64_t LengthLastData(void) const override
Definition: audiooutputbase.h:95
AudioOutputBase::m_audioBufLock
QMutex m_audioBufLock
Writes to the audiobuffer, reconfigures and audiobuffer resets can only take place while holding this...
Definition: audiooutputbase.h:252
AudioOutputBase::m_source
AudioOutputSource m_source
Definition: audiooutputbase.h:192
AudioOutputBase::GetOutputSettingsUsers
AudioOutputSettings * GetOutputSettingsUsers(bool digital=false) override
Returns capabilities supported by the audio device amended to take into account the digital audio opt...
Definition: audiooutputbase.cpp:181
AudioOutputBase::SetStretchFactorLocked
void SetStretchFactorLocked(float factor)
Set the timestretch factor.
Definition: audiooutputbase.cpp:278
AudioOutputBase::m_fragmentSize
int m_fragmentSize
Definition: audiooutputbase.h:179
AudioOutputBase::m_audioTime
int64_t m_audioTime
timecode of audio leaving the soundcard (same units as timecodes)
Definition: audiooutputbase.h:263
SPDIFEncoder
Definition: spdifencoder.h:15
AudioOutputBase::m_outputSettings
AudioOutputSettings * m_outputSettings
Definition: audiooutputbase.h:223
AudioFormat
AudioFormat
Definition: audiooutputsettings.h:25
AudioOutputBase::GetBufferStatus
void GetBufferStatus(uint &fill, uint &total) override
Fill in the number of bytes in the audiobuffer and the total size of the audiobuffer.
Definition: audiooutputbase.cpp:1622
AudioOutputBase::m_framesBuffered
int64_t m_framesBuffered
Definition: audiooutputbase.h:244
AudioOutputBase::m_srcCtx
SRC_STATE * m_srcCtx
Definition: audiooutputbase.h:227
AudioOutputBase::m_usesSpdif
bool m_usesSpdif
Definition: audiooutputbase.h:299
AudioOutputBase::kAudioSRCInputSize
static const uint kAudioSRCInputSize
Definition: audiooutputbase.h:120
AudioOutputBase::m_memoryCorruptionTest3
uint m_memoryCorruptionTest3
Definition: audiooutputbase.h:294
AudioOutputBase::ToggleUpmix
bool ToggleUpmix(void) override
Toggle between stereo and upmixed 5.1 if the source material is stereo.
Definition: audiooutputbase.cpp:377
AudioOutputBase::m_srcData
SRC_DATA m_srcData
Definition: audiooutputbase.h:283
AudioOutputBase::SetSourceBitrate
void SetSourceBitrate(int rate) override
Set the bitrate of the source material, reported in periodic OutputEvents.
Definition: audiooutputbase.cpp:267
AudioOutputBase::m_outputSettingsDigital
AudioOutputSettings * m_outputSettingsDigital
Definition: audiooutputbase.h:225
AudioOutputBase::m_needsDownmix
bool m_needsDownmix
Definition: audiooutputbase.h:236
AsyncLooseLock::TestAndDeref
bool TestAndDeref()
Definition: audiooutputbase.h:40
AudioOutputBase::OutputSettings
AudioOutputSettings * OutputSettings(bool digital=true)
Definition: audiooutputbase.cpp:452