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
11QT_BEGIN_NAMESPACE
12
13class QRectF;
14class QVideoFrameFormat;
15class QVideoFrame;
16
17class QVideoSinkPrivate;
18class QPlatformVideoSink;
19class QRhi;
20
21class 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)
26public:
27 QVideoSink(QObject *parent = nullptr);
28 ~QVideoSink();
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;
42Q_SIGNALS:
43 void videoFrameChanged(const QVideoFrame &frame) QT6_ONLY(const);
44 void subtitleTextChanged(const QString &subtitleText) QT6_ONLY(const);
45 void videoSizeChanged();
46
47private:
48 friend class QMediaPlayerPrivate;
49 friend class QMediaCaptureSessionPrivate;
50 void setSource(QObject *source);
51
52 QVideoSinkPrivate *d = nullptr;
53};
54
55QT_END_NAMESPACE
56
57#endif
58

source code of qtmultimedia/src/multimedia/video/qvideosink.h