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