MythTV master
audiooutputnull.h
Go to the documentation of this file.
1#ifndef AUDIOOUTPUTNULL
2#define AUDIOOUTPUTNULL
3
4#include "audiooutputbase.h"
5
6static constexpr int32_t NULLAUDIO_OUTPUT_BUFFER_SIZE { 32768 };
7
8/*
9
10 In its default invocation, this AudioOutput object does almost nothing.
11 It takes all bytes written to its "device" and just ignores them. Since
12 there is no device in the way consuming the audio bytes, nothing
13 throttles the speed of decoding.
14
15 If it is told to buffer the output data (bufferOutputData(true)), then
16 it will maintain a small buffer and will not let anymore audio data be
17 decoded until something pulls the data off (via readOutputData()).
18
19*/
20
22{
23 public:
24 explicit AudioOutputNULL(const AudioSettings &settings);
25 ~AudioOutputNULL() override;
26
27 void Reset(void) override; // AudioOutputBase
28
29
30 // Volume control
31 int GetVolumeChannel(int /* channel */) const override // VolumeBase
32 { return 100; }
33 void SetVolumeChannel(int /* channel */, int /* volume */) override // VolumeBase
34 {}
35
36 int readOutputData(unsigned char *read_buffer, size_t max_length) override; // AudioOutputBase
37
38 protected:
39 // AudioOutputBase
40 bool OpenDevice(void) override; // AudioOutputBase
41 void CloseDevice(void) override; // AudioOutputBase
42 void WriteAudio(unsigned char *aubuf, int size) override; // AudioOutputBase
43 int GetBufferedOnSoundcard(void) const override; // AudioOutputBase
44 AudioOutputSettings* GetOutputSettings(bool digital) override; // AudioOutputBase
45
46 private:
48 std::vector<unsigned char> m_pcmOutputBuffer {0};
49};
50
51#endif
52
static constexpr int32_t NULLAUDIO_OUTPUT_BUFFER_SIZE
int GetVolumeChannel(int) const override
void WriteAudio(unsigned char *aubuf, int size) override
int GetBufferedOnSoundcard(void) const override
Return the size in bytes of frames currently in the audio buffer adjusted with the audio playback lat...
QMutex m_pcmOutputBufferMutex
void Reset(void) override
Reset the audiobuffer, timecode and mythmusic visualisation.
AudioOutputNULL(const AudioSettings &settings)
void CloseDevice(void) override
AudioOutputSettings * GetOutputSettings(bool digital) override
~AudioOutputNULL() override
int readOutputData(unsigned char *read_buffer, size_t max_length) override
void SetVolumeChannel(int, int) override
bool OpenDevice(void) override
std::vector< unsigned char > m_pcmOutputBuffer