Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qffmpegaudiorenderer_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QFFMPEGAUDIORENDERER_P_H
4#define QFFMPEGAUDIORENDERER_P_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
18
19#include "qaudiobuffer.h"
20
22
23class QAudioOutput;
24class QAudioSink;
25
26namespace QFFmpeg {
27class Resampler;
28};
29
30namespace QFFmpeg {
31
32class AudioRenderer : public Renderer
33{
35public:
37
39
40 ~AudioRenderer() override;
41
42protected:
44
45 void onPlaybackRateChanged() override;
46
47 void freeOutput();
48
49 void updateOutput(const Codec *codec);
50
51 void initResempler(const Codec *codec);
52
53 void onDeviceChanged();
54
55 void updateVolume();
56
57 void updateSynchronization(const Frame &currentFrame);
58
59 std::chrono::microseconds currentBufferLoadingTime() const;
60
61private:
63 std::unique_ptr<QAudioSink> m_sink;
64 std::unique_ptr<Resampler> m_resampler;
65 QAudioFormat m_format;
66
67 QAudioBuffer m_bufferedData;
68 qsizetype m_bufferWritten = 0;
69 QIODevice *m_ioDevice = nullptr;
70
71 bool m_deviceChanged = false;
72};
73
74} // namespace QFFmpeg
75
77
78#endif // QFFMPEGAUDIORENDERER_P_H
\inmodule QtMultimedia
The QAudioFormat class stores audio stream parameter information.
\qmltype AudioOutput \instantiates QAudioOutput
The QAudioSink class provides an interface for sending audio data to an audio output device.
Definition qaudiosink.h:24
void updateSynchronization(const Frame &currentFrame)
RenderingResult renderInternal(Frame frame) override
std::chrono::microseconds currentBufferLoadingTime() const
void setOutput(QAudioOutput *output)
void updateOutput(const Codec *codec)
void initResempler(const Codec *codec)
\inmodule QtCore \reentrant
Definition qiodevice.h:34
\inmodule QtCore
Definition qpointer.h:18
Combined button and popup list for selecting options.
QMediaFormat::AudioCodec codec
const GLfloat * tc
#define Q_OBJECT
ptrdiff_t qsizetype
Definition qtypes.h:70
QT_BEGIN_NAMESPACE typedef uchar * output
QFrame frame
[0]