Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qffmpegaudiodecoder_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
4#ifndef QFFMPEGAUDIODECODER_H
5#define QFFMPEGAUDIODECODER_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtMultimedia/private/qplatformaudiodecoder_p.h>
19#include <QtFFmpegMediaPluginImpl/private/qffmpeg_p.h>
20#include <qurl.h>
21
23
24namespace QFFmpeg {
25class AudioDecoder;
26} // namespace QFFmpeg
27
29{
31
32public:
35
36 QUrl source() const override;
37 void setSource(const QUrl &fileName) override;
38
39 QIODevice *sourceDevice() const override;
40 void setSourceDevice(QIODevice *device) override;
41
42 void start() override;
43 void stop() override;
44
45 QAudioFormat audioFormat() const override;
46 void setAudioFormat(const QAudioFormat &format) override;
47
48 QAudioBuffer read() override;
49
50public Q_SLOTS:
51 void newAudioBuffer(const QAudioBuffer &b);
52 void done();
53 void errorSignal(int err, const QString &errorString);
54
55private:
56 using AudioDecoder = QFFmpeg::AudioDecoder;
57
58 QUrl m_url;
59 QIODevice *m_sourceDevice = nullptr;
60 std::unique_ptr<AudioDecoder> m_decoder;
61 QAudioFormat m_audioFormat;
62
63 QAudioBuffer m_audioBuffer;
64};
65
66QT_END_NAMESPACE
67
68#endif // QFFMPEGAUDIODECODER_H
void setSource(const QUrl &fileName) override
QIODevice * sourceDevice() const override
~QFFmpegAudioDecoder() override
void errorSignal(int err, const QString &errorString)
QAudioFormat audioFormat() const override
void setAudioFormat(const QAudioFormat &format) override
QAudioBuffer read() override
void setSourceDevice(QIODevice *device) override
QUrl source() const override
The QPlaybackOptions class enables low-level control of media playback options.
std::conditional_t< QT_FFMPEG_AVIO_WRITE_CONST, const uint8_t *, uint8_t * > AvioWriteBufferType
#define qCDebug(category,...)
#define Q_STATIC_LOGGING_CATEGORY(name,...)