7 #include <QCoreApplication>
22 struct AVCodecContext;
41 m_name(std::move(name)), m_desc(std::move(desc)),
49 using ADCVect = QVector<AudioDeviceConfig>;
51 static void Cleanup(
void);
52 static ADCVect* GetOutputList(
void);
54 QString &name,
const QString &desc,
bool willsuspendpa =
false);
58 const QString &main_device,
const QString &passthru_device,
59 AudioFormat format,
int channels, AVCodecID codec,
int samplerate,
63 bool willsuspendpa =
true);
65 const QString &main_device,
66 const QString &passthru_device = QString(),
67 bool willsuspendpa =
true);
75 virtual void SetStretchFactor(
float factor);
83 virtual bool CanPassthrough(
int samplerate,
int channels,
84 AVCodecID codec,
int profile)
const;
88 virtual void SetEffDsp(
int dsprate) = 0;
90 virtual void Reset(
void) = 0;
102 virtual bool AddFrames(
void *buffer,
int frames,
103 std::chrono::milliseconds timecode) = 0;
116 virtual bool AddData(
void *buffer,
int len,
117 std::chrono::milliseconds timecode,
int frames) = 0;
133 virtual void SetTimecode(std::chrono::milliseconds timecode) = 0;
134 virtual bool IsPaused(
void)
const = 0;
135 virtual void Pause(
bool paused) = 0;
136 virtual void PauseUntilBuffered(
void) = 0;
139 virtual void Drain(
void) = 0;
141 virtual std::chrono::milliseconds GetAudiotime(
void) = 0;
148 QString
GetError(
void)
const {
return m_lastError; }
152 { fill = total = 0; }
155 virtual void bufferOutputData(
bool y) = 0;
156 virtual int readOutputData(
unsigned char *read_buffer,
157 size_t max_length) = 0;
191 virtual int DecodeAudio(AVCodecContext *ctx,
192 uint8_t *buffer,
int &data_size,
193 const AVPacket *pkt);
197 static const int kMaxSizeBuffer = 384000;
200 void Error(
const QString &msg);
201 void SilentError(
const QString &msg);
202 void Warn(
const QString &msg);
203 void ClearError(
void);
204 void ClearWarning(
void);
208 bool m_pulseWasSuspended {
false};