| 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 <QtCore/qobject.h> |
| 19 | #include <QtMultimedia/private/qplatformaudiooutput_p.h> |
| 20 | |
| 21 | #include <common/qgst_p.h> |
| 22 | |
| 23 | QT_BEGIN_NAMESPACE |
| 24 | |
| 25 | class QAudioDevice; |
| 26 | |
| 27 | class QGstreamerAudioOutput : public QObject, public QPlatformAudioOutput |
| 28 | { |
| 29 | public: |
| 30 | static QMaybe<QPlatformAudioOutput *> create(QAudioOutput *parent); |
| 31 | ~QGstreamerAudioOutput() override; |
| 32 | |
| 33 | void setAudioDevice(const QAudioDevice &) override; |
| 34 | void setVolume(float) override; |
| 35 | void setMuted(bool) override; |
| 36 | void setAsync(bool); |
| 37 | |
| 38 | QGstElement gstElement() const { return m_audioOutputBin; } |
| 39 | |
| 40 | private: |
| 41 | explicit QGstreamerAudioOutput(QAudioOutput *parent); |
| 42 | |
| 43 | QGstElement createGstElement(); |
| 44 | |
| 45 | QAudioDevice m_audioDevice; |
| 46 | |
| 47 | // Gst elements |
| 48 | QGstBin m_audioOutputBin; |
| 49 | |
| 50 | QGstElement m_audioQueue; |
| 51 | QGstElement m_audioConvert; |
| 52 | QGstElement m_audioResample; |
| 53 | QGstElement m_audioVolume; |
| 54 | QGstElement m_audioSink; |
| 55 | |
| 56 | bool m_sinkIsAsync = true; |
| 57 | }; |
| 58 | |
| 59 | QT_END_NAMESPACE |
| 60 | |
| 61 | #endif |
| 62 | |