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 QGSTREAMERAUDIOINPUT_P_H |
5 | #define QGSTREAMERAUDIOINPUT_P_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 <QtCore/qobject.h> |
19 | #include <QtMultimedia/private/qplatformaudioinput_p.h> |
20 | |
21 | #include <common/qgst_p.h> |
22 | |
23 | QT_BEGIN_NAMESPACE |
24 | |
25 | class QAudioDevice; |
26 | |
27 | class QGstreamerAudioInput : public QObject, public QPlatformAudioInput |
28 | { |
29 | public: |
30 | static QMaybe<QPlatformAudioInput *> create(QAudioInput *parent); |
31 | ~QGstreamerAudioInput(); |
32 | |
33 | void setAudioDevice(const QAudioDevice &) override; |
34 | void setVolume(float) override; |
35 | void setMuted(bool) override; |
36 | |
37 | QGstElement gstElement() const { return m_audioInputBin; } |
38 | |
39 | private: |
40 | explicit QGstreamerAudioInput(QAudioInput *parent); |
41 | |
42 | QGstElement createGstElement(); |
43 | |
44 | QAudioDevice m_audioDevice; |
45 | |
46 | // Gst elements |
47 | QGstBin m_audioInputBin; |
48 | |
49 | QGstElement m_audioSrc; |
50 | QGstElement m_audioVolume; |
51 | }; |
52 | |
53 | QT_END_NAMESPACE |
54 | |
55 | #endif |
56 |