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 QAUDIOBUFFERINPUT_H |
5 | #define QAUDIOBUFFERINPUT_H |
6 | |
7 | #include <QtMultimedia/qtmultimediaexports.h> |
8 | #include <QtMultimedia/qaudiobuffer.h> |
9 | #include <QtCore/qobject.h> |
10 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | class QPlatformAudioBufferInput; |
14 | class QAudioBufferInputPrivate; |
15 | class QMediaCaptureSession; |
16 | |
17 | class Q_MULTIMEDIA_EXPORT QAudioBufferInput : public QObject |
18 | { |
19 | Q_OBJECT |
20 | public: |
21 | explicit QAudioBufferInput(QObject *parent = nullptr); |
22 | |
23 | explicit QAudioBufferInput(const QAudioFormat &format, QObject *parent = nullptr); |
24 | |
25 | ~QAudioBufferInput() override; |
26 | |
27 | bool sendAudioBuffer(const QAudioBuffer &audioBuffer); |
28 | |
29 | QAudioFormat format() const; |
30 | |
31 | QMediaCaptureSession *captureSession() const; |
32 | |
33 | Q_SIGNALS: |
34 | void readyToSendAudioBuffer(); |
35 | |
36 | private: |
37 | void setCaptureSession(QMediaCaptureSession *captureSession); |
38 | |
39 | QPlatformAudioBufferInput *platformAudioBufferInput() const; |
40 | |
41 | friend class QMediaCaptureSession; |
42 | Q_DISABLE_COPY(QAudioBufferInput) |
43 | Q_DECLARE_PRIVATE(QAudioBufferInput) |
44 | }; |
45 | |
46 | QT_END_NAMESPACE |
47 | |
48 | #endif // QAUDIOBUFFERINPUT_H |
49 |