1 | // Copyright (C) 2024 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 QPLATFORMAUDIOBUFFERINPUT_P_H |
5 | #define QPLATFORMAUDIOBUFFERINPUT_P_H |
6 | |
7 | #include "qaudioformat.h" |
8 | #include "qaudiobuffer.h" |
9 | |
10 | // |
11 | // W A R N I N G |
12 | // ------------- |
13 | // |
14 | // This file is not part of the Qt API. It exists purely as an |
15 | // implementation detail. This header file may change from version to |
16 | // version without notice, or even be removed. |
17 | // |
18 | // We mean it. |
19 | // |
20 | |
21 | QT_BEGIN_NAMESPACE |
22 | |
23 | class QMediaInputEncoderInterface; |
24 | |
25 | class Q_MULTIMEDIA_EXPORT QPlatformAudioBufferInputBase : public QObject |
26 | { |
27 | Q_OBJECT |
28 | Q_SIGNALS: |
29 | void newAudioBuffer(const QAudioBuffer &buffer); |
30 | }; |
31 | |
32 | class Q_MULTIMEDIA_EXPORT QPlatformAudioBufferInput : public QPlatformAudioBufferInputBase |
33 | { |
34 | Q_OBJECT |
35 | public: |
36 | QPlatformAudioBufferInput(const QAudioFormat &format = {}) : m_format(format) { } |
37 | |
38 | const QAudioFormat &audioFormat() const { return m_format; } |
39 | |
40 | QMediaInputEncoderInterface *encoderInterface() const { return m_encoderInterface; } |
41 | void setEncoderInterface(QMediaInputEncoderInterface *encoderInterface) |
42 | { |
43 | m_encoderInterface = encoderInterface; |
44 | } |
45 | |
46 | Q_SIGNALS: |
47 | void encoderUpdated(); |
48 | |
49 | private: |
50 | QMediaInputEncoderInterface *m_encoderInterface = nullptr; |
51 | QAudioFormat m_format; |
52 | }; |
53 | |
54 | QT_END_NAMESPACE |
55 | |
56 | #endif // QPLATFORMAUDIOBUFFERINPUT_P_H |
57 |