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 QGSTREAMERINTEGRATION_H |
5 | #define QGSTREAMERINTEGRATION_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 <QtMultimedia/private/qplatformmediaintegration_p.h> |
19 | #include <QtMultimedia/private/qgstreamer_platformspecificinterface_p.h> |
20 | |
21 | #include <gst/gst.h> |
22 | |
23 | QT_BEGIN_NAMESPACE |
24 | |
25 | class QGstreamerFormatInfo; |
26 | |
27 | class QGStreamerPlatformSpecificInterfaceImplementation : public QGStreamerPlatformSpecificInterface |
28 | { |
29 | public: |
30 | ~QGStreamerPlatformSpecificInterfaceImplementation() override; |
31 | |
32 | QAudioDevice makeCustomGStreamerAudioInput(const QByteArray &gstreamerPipeline) override; |
33 | QAudioDevice makeCustomGStreamerAudioOutput(const QByteArray &gstreamerPipeline) override; |
34 | QCamera *makeCustomGStreamerCamera(const QByteArray &gstreamerPipeline, |
35 | QObject *parent) override; |
36 | |
37 | QCamera *makeCustomGStreamerCamera(GstElement *, QObject *parent) override; |
38 | |
39 | GstPipeline *gstPipeline(QMediaPlayer *) override; |
40 | GstPipeline *gstPipeline(QMediaCaptureSession *) override; |
41 | }; |
42 | |
43 | class QGstreamerIntegration : public QPlatformMediaIntegration |
44 | { |
45 | public: |
46 | QGstreamerIntegration(); |
47 | |
48 | static QGstreamerIntegration *instance() |
49 | { |
50 | return static_cast<QGstreamerIntegration *>(QPlatformMediaIntegration::instance()); |
51 | } |
52 | |
53 | QMaybe<QPlatformAudioDecoder *> createAudioDecoder(QAudioDecoder *decoder) override; |
54 | QMaybe<QPlatformMediaCaptureSession *> createCaptureSession() override; |
55 | QMaybe<QPlatformMediaPlayer *> createPlayer(QMediaPlayer *player) override; |
56 | QMaybe<QPlatformCamera *> createCamera(QCamera *) override; |
57 | QMaybe<QPlatformMediaRecorder *> createRecorder(QMediaRecorder *) override; |
58 | QMaybe<QPlatformImageCapture *> createImageCapture(QImageCapture *) override; |
59 | |
60 | QMaybe<QPlatformVideoSink *> createVideoSink(QVideoSink *sink) override; |
61 | |
62 | QMaybe<QPlatformAudioInput *> createAudioInput(QAudioInput *) override; |
63 | QMaybe<QPlatformAudioOutput *> createAudioOutput(QAudioOutput *) override; |
64 | |
65 | const QGstreamerFormatInfo *gstFormatsInfo(); |
66 | GstDevice *videoDevice(const QByteArray &id); |
67 | |
68 | QAbstractPlatformSpecificInterface *platformSpecificInterface() override; |
69 | |
70 | protected: |
71 | QPlatformMediaFormatInfo *createFormatInfo() override; |
72 | QPlatformVideoDevices *createVideoDevices() override; |
73 | |
74 | QGStreamerPlatformSpecificInterfaceImplementation m_platformSpecificImplementation; |
75 | }; |
76 | |
77 | QT_END_NAMESPACE |
78 | |
79 | #endif |
80 | |