Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qabstractvideobuffer_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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 QABSTRACTVIDEOBUFFER_H
5#define QABSTRACTVIDEOBUFFER_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 <QtMultimedia/qtmultimediaglobal.h>
19#include <QtMultimedia/qvideoframe.h>
20
21#include <QtCore/qmetatype.h>
22#include <QtGui/qmatrix4x4.h>
23#include <QtCore/private/qglobal_p.h>
24
25#include <memory>
26
28
29
30class QVariant;
31class QRhi;
32class QRhiTexture;
33
34class Q_MULTIMEDIA_EXPORT QVideoFrameTextures
35{
36public:
38 virtual QRhiTexture *texture(uint plane) const = 0;
39};
40
41class Q_MULTIMEDIA_EXPORT QAbstractVideoBuffer
42{
43public:
45 virtual ~QAbstractVideoBuffer();
46
48 QRhi *rhi() const;
49
50 struct MapData
51 {
52 int nPlanes = 0;
53 int bytesPerLine[4] = {};
54 uchar *data[4] = {};
55 int size[4] = {};
56 };
57
58 virtual QVideoFrame::MapMode mapMode() const = 0;
60 virtual void unmap() = 0;
61
62 virtual std::unique_ptr<QVideoFrameTextures> mapTextures(QRhi *) { return {}; }
63 virtual quint64 textureHandle(int /*plane*/) const { return 0; }
64
65 virtual QMatrix4x4 externalTextureMatrix() const { return {}; }
66protected:
68 QRhi *m_rhi = nullptr;
69
70private:
71 Q_DISABLE_COPY(QAbstractVideoBuffer)
72};
73
74#ifndef QT_NO_DEBUG_STREAM
75Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, QVideoFrame::MapMode);
76#endif
77
79
80#endif
The QAbstractVideoBuffer class is an abstraction for video data. \inmodule QtMultimedia.
virtual void unmap()=0
Releases the memory mapped by the map() function.
virtual std::unique_ptr< QVideoFrameTextures > mapTextures(QRhi *)
virtual MapData map(QVideoFrame::MapMode mode)=0
Independently maps the planes of a video buffer to memory.
virtual quint64 textureHandle(int) const
Returns a texture handle to the data buffer.
QVideoFrame::HandleType m_type
virtual QVideoFrame::MapMode mapMode() const =0
virtual QMatrix4x4 externalTextureMatrix() const
\inmodule QtCore
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
\inmodule QtGui
Definition qrhi.h:883
\inmodule QtGui
Definition qrhi.h:1767
\inmodule QtCore
Definition qvariant.h:64
virtual QRhiTexture * texture(uint plane) const =0
MapMode
Enumerates how a video buffer's data is mapped to system memory.
Definition qvideoframe.h:36
HandleType
Identifies the type of a video buffers handle.
Definition qvideoframe.h:30
Combined button and popup list for selecting options.
Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, QVideoFrame::MapMode)
GLenum mode
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum type
GLuint64 GLenum handleType
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
unsigned char uchar
Definition qtypes.h:27
unsigned long long quint64
Definition qtypes.h:56
unsigned int uint
Definition qtypes.h:29