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 QPLATFORMVIDEOSOURCE_P_H |
5 | #define QPLATFORMVIDEOSOURCE_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 "qvideoframeformat.h" |
19 | |
20 | #include <QtCore/qobject.h> |
21 | #include <QtCore/qnativeinterface.h> |
22 | #include <QtCore/private/qglobal_p.h> |
23 | |
24 | #include <optional> |
25 | |
26 | QT_BEGIN_NAMESPACE |
27 | |
28 | class QVideoFrame; |
29 | class QPlatformMediaCaptureSession; |
30 | |
31 | class Q_MULTIMEDIA_EXPORT QPlatformVideoSource : public QObject |
32 | { |
33 | Q_OBJECT |
34 | public: |
35 | using QObject::QObject; |
36 | |
37 | virtual void setActive(bool active) = 0; |
38 | virtual bool isActive() const = 0; |
39 | |
40 | virtual QVideoFrameFormat frameFormat() const = 0; |
41 | |
42 | virtual std::optional<int> ffmpegHWPixelFormat() const; |
43 | |
44 | virtual void setCaptureSession(QPlatformMediaCaptureSession *) { } |
45 | |
46 | Q_SIGNALS: |
47 | void newVideoFrame(const QVideoFrame &); |
48 | void activeChanged(bool); |
49 | }; |
50 | |
51 | QT_END_NAMESPACE |
52 | |
53 | #endif // QPLATFORMVIDEOSOURCE_P_H |
54 | |