| 1 | // Copyright (C) 2016 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 QABSTRACTVIDEOSINK_H | 
| 5 | #define QABSTRACTVIDEOSINK_H | 
| 6 | |
| 7 | #include <QtMultimedia/qtmultimediaglobal.h> | 
| 8 | #include <QtCore/qobject.h> | 
| 9 | #include <QtGui/qwindowdefs.h> | 
| 10 | |
| 11 | QT_BEGIN_NAMESPACE | 
| 12 | |
| 13 | class QRectF; | 
| 14 | class QVideoFrameFormat; | 
| 15 | class QVideoFrame; | 
| 16 | |
| 17 | class QVideoSinkPrivate; | 
| 18 | class QPlatformVideoSink; | 
| 19 | class QRhi; | 
| 20 | |
| 21 | class Q_MULTIMEDIA_EXPORT QVideoSink : public QObject | 
| 22 | { | 
| 23 | Q_OBJECT | 
| 24 | Q_PROPERTY(QString subtitleText READ subtitleText WRITE setSubtitleText NOTIFY subtitleTextChanged) | 
| 25 | Q_PROPERTY(QSize videoSize READ videoSize NOTIFY videoSizeChanged) | 
| 26 | public: | 
| 27 | QVideoSink(QObject *parent = nullptr); | 
| 28 | ~QVideoSink() override; | 
| 29 | |
| 30 | QRhi *rhi() const; | 
| 31 | void setRhi(QRhi *rhi); | 
| 32 | |
| 33 | QSize videoSize() const; | 
| 34 | |
| 35 | QString subtitleText() const; | 
| 36 | void setSubtitleText(const QString &subtitle); | 
| 37 | |
| 38 | void setVideoFrame(const QVideoFrame &frame); | 
| 39 | QVideoFrame videoFrame() const; | 
| 40 | |
| 41 | QPlatformVideoSink *platformVideoSink() const; | 
| 42 | Q_SIGNALS: | 
| 43 | void videoFrameChanged(const QVideoFrame &frame) QT6_ONLY(const); | 
| 44 | void subtitleTextChanged(const QString &subtitleText) QT6_ONLY(const); | 
| 45 | void videoSizeChanged(); | 
| 46 | |
| 47 | private: | 
| 48 | friend class QMediaPlayerPrivate; | 
| 49 | friend class QMediaCaptureSessionPrivate; | 
| 50 | void setSource(QObject *source); | 
| 51 | |
| 52 | QVideoSinkPrivate *d = nullptr; | 
| 53 | }; | 
| 54 | |
| 55 | QT_END_NAMESPACE | 
| 56 | |
| 57 | #endif | 
| 58 | 
