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 QGSTREAMERAUDIOOUTPUT_P_H |
5 | #define QGSTREAMERAUDIOOUTPUT_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 <private/qtmultimediaglobal_p.h> |
19 | #include <private/qmultimediautils_p.h> |
20 | #include <qaudiodevice.h> |
21 | |
22 | #include <QtCore/qobject.h> |
23 | |
24 | #include <qgst_p.h> |
25 | #include <qgstpipeline_p.h> |
26 | #include <private/qplatformaudiooutput_p.h> |
27 | |
28 | QT_BEGIN_NAMESPACE |
29 | |
30 | class QGstreamerMessage; |
31 | class QAudioDevice; |
32 | |
33 | class Q_MULTIMEDIA_EXPORT QGstreamerAudioOutput : public QObject, public QPlatformAudioOutput |
34 | { |
35 | Q_OBJECT |
36 | |
37 | public: |
38 | static QMaybe<QPlatformAudioOutput *> create(QAudioOutput *parent); |
39 | ~QGstreamerAudioOutput(); |
40 | |
41 | void setAudioDevice(const QAudioDevice &) override; |
42 | void setVolume(float volume) override; |
43 | void setMuted(bool muted) override; |
44 | |
45 | void setPipeline(const QGstPipeline &pipeline); |
46 | |
47 | QGstElement gstElement() const { return gstAudioOutput; } |
48 | |
49 | Q_SIGNALS: |
50 | void mutedChanged(bool); |
51 | void volumeChanged(int); |
52 | |
53 | private: |
54 | QGstreamerAudioOutput(QGstElement audioconvert, QGstElement audioresample, QGstElement volume, |
55 | QGstElement autoaudiosink, QAudioOutput *parent); |
56 | |
57 | QAudioDevice m_audioOutput; |
58 | |
59 | // Gst elements |
60 | QGstPipeline gstPipeline; |
61 | QGstBin gstAudioOutput; |
62 | |
63 | QGstElement audioQueue; |
64 | QGstElement audioConvert; |
65 | QGstElement audioResample; |
66 | QGstElement audioVolume; |
67 | QGstElement audioSink; |
68 | }; |
69 | |
70 | QT_END_NAMESPACE |
71 | |
72 | #endif |
73 | |