| 1 | // Copyright (C) 2024 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 QPLATFORMVIDEOFRAMEINPUT_P_H |
| 5 | #define QPLATFORMVIDEOFRAMEINPUT_P_H |
| 6 | |
| 7 | #include "qplatformvideosource_p.h" |
| 8 | #include "qmetaobject.h" |
| 9 | #include "qpointer.h" |
| 10 | |
| 11 | // |
| 12 | // W A R N I N G |
| 13 | // ------------- |
| 14 | // |
| 15 | // This file is not part of the Qt API. It exists purely as an |
| 16 | // implementation detail. This header file may change from version to |
| 17 | // version without notice, or even be removed. |
| 18 | // |
| 19 | // We mean it. |
| 20 | // |
| 21 | |
| 22 | QT_BEGIN_NAMESPACE |
| 23 | |
| 24 | class QMediaInputEncoderInterface; |
| 25 | |
| 26 | class Q_MULTIMEDIA_EXPORT QPlatformVideoFrameInput : public QPlatformVideoSource |
| 27 | { |
| 28 | Q_OBJECT |
| 29 | public: |
| 30 | QPlatformVideoFrameInput(QVideoFrameFormat format = {}) : m_format(std::move(format)) { } |
| 31 | |
| 32 | void setActive(bool) final { } |
| 33 | bool isActive() const final { return true; } |
| 34 | |
| 35 | QVideoFrameFormat frameFormat() const final { return m_format; } |
| 36 | |
| 37 | QString errorString() const final { return {}; } |
| 38 | |
| 39 | QMediaInputEncoderInterface *encoderInterface() const { return m_encoderInterface; } |
| 40 | void setEncoderInterface(QMediaInputEncoderInterface *encoderInterface) |
| 41 | { |
| 42 | m_encoderInterface = encoderInterface; |
| 43 | } |
| 44 | |
| 45 | Q_SIGNALS: |
| 46 | void encoderUpdated(); |
| 47 | |
| 48 | private: |
| 49 | QMediaInputEncoderInterface *m_encoderInterface = nullptr; |
| 50 | QVideoFrameFormat m_format; |
| 51 | }; |
| 52 | |
| 53 | QT_END_NAMESPACE |
| 54 | |
| 55 | #endif // QPLATFORMVIDEOFRAMEINPUT_P_H |
| 56 |
