Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qsgvideonode_p.h
Go to the documentation of this file.
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#include "private/qmultimediautils_p.h"
22
23#include <QtMultimedia/qvideoframe.h>
24#include <QtMultimedia/qvideoframeformat.h>
25#include <QtGui/qopenglfunctions.h>
26
28
30class QQuickVideoOutput;
31class QSGInternalTextNode;
32
34{
35public:
36 QSGVideoNode(QQuickVideoOutput *parent, const QVideoFrameFormat &videoFormat);
37 ~QSGVideoNode();
38
39 QVideoFrameFormat::PixelFormat pixelFormat() const { return m_videoFormat.pixelFormat(); }
40 void setCurrentFrame(const QVideoFrame &frame);
41 void setSurfaceFormat(const QRhiSwapChain::Format surfaceFormat);
42 void setHdrInfo(const QRhiSwapChainHdrInfo &hdrInfo);
43
44 void setTexturedRectGeometry(const QRectF &boundingRect, const QRectF &textureRect, int orientation);
45
46private:
47 void updateSubtitle(const QVideoFrame &frame);
48 void setSubtitleGeometry();
49
50 QQuickVideoOutput *m_parent = nullptr;
51 QRectF m_rect;
52 QRectF m_textureRect;
53 int m_orientation = -1;
54 NormalizedVideoTransformation m_frameTransformation;
55
56 QVideoFrameFormat m_videoFormat;
57 QSGVideoMaterial *m_material = nullptr;
58
59 QVideoTextureHelper::SubtitleLayout m_subtitleLayout;
60 QSGInternalTextNode *m_subtitleTextNode = nullptr;
61};
62
63QT_END_NAMESPACE
64
65#endif // QSGVIDEONODE_H
Render video or camera viewfinder.
void setHdrInfo(const QRhiSwapChainHdrInfo &hdrInfo)
void setTexturedRectGeometry(const QRectF &boundingRect, const QRectF &textureRect, int orientation)
void setSurfaceFormat(const QRhiSwapChain::Format surfaceFormat)
QVideoFrameFormat::PixelFormat pixelFormat() const
QSGVideoNode(QQuickVideoOutput *parent, const QVideoFrameFormat &videoFormat)
void setCurrentFrame(const QVideoFrame &frame)
Combined button and popup list for selecting options.
int qNormalizedOrientation(int o)