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 QSGVIDEONODE_P_H
5#define QSGVIDEONODE_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 <QtQuick/qsgnode.h>
19#include <private/qtmultimediaquickglobal_p.h>
20#include "private/qvideotexturehelper_p.h"
21
22#include <QtMultimedia/qvideoframe.h>
23#include <QtMultimedia/qvideoframeformat.h>
24#include <QtGui/qopenglfunctions.h>
25
26QT_BEGIN_NAMESPACE
27
28class QSGVideoMaterial;
29class QQuickVideoOutput;
30class QQuickTextNode;
31
32class QSGVideoNode : public QSGGeometryNode
33{
34public:
35 QSGVideoNode(QQuickVideoOutput *parent, const QVideoFrameFormat &format);
36 ~QSGVideoNode();
37
38 QVideoFrameFormat::PixelFormat pixelFormat() const {
39 return m_format.pixelFormat();
40 }
41 void setCurrentFrame(const QVideoFrame &frame);
42
43 void setTexturedRectGeometry(const QRectF &boundingRect, const QRectF &textureRect, int orientation);
44
45private:
46 void updateSubtitle(const QVideoFrame &frame);
47 void setSubtitleGeometry();
48
49 QQuickVideoOutput *m_parent = nullptr;
50 QRectF m_rect;
51 QRectF m_textureRect;
52 int m_orientation;
53 int m_frameOrientation;
54 bool m_frameMirrored;
55
56 QVideoFrameFormat m_format;
57 QSGVideoMaterial *m_material;
58
59 QVideoTextureHelper::SubtitleLayout m_subtitleLayout;
60 QQuickTextNode *m_subtitleTextNode = nullptr;
61};
62
63QT_END_NAMESPACE
64
65#endif // QSGVIDEONODE_H
66

source code of qtmultimedia/src/multimediaquick/qsgvideonode_p.h