Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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(QRhi *, int /*plane*/) const { return 0; }
64
65 virtual QMatrix4x4 externalTextureMatrix() const { return {}; }
66
67 virtual QByteArray underlyingByteArray(int /*plane*/) const { return {}; }
68protected:
70 QRhi *m_rhi = nullptr;
71
72private:
73 Q_DISABLE_COPY(QAbstractVideoBuffer)
74};
75
76#ifndef QT_NO_DEBUG_STREAM
77Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, QVideoFrame::MapMode);
78#endif
79
81
82#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 QByteArray underlyingByteArray(int) const
QVideoFrame::HandleType m_type
virtual QVideoFrame::MapMode mapMode() const =0
virtual quint64 textureHandle(QRhi *, int) const
Returns a texture handle to the data buffer.
virtual QMatrix4x4 externalTextureMatrix() const
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
\inmodule QtGui
Definition qrhi.h:895
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
\inmodule QtCore
Definition qvariant.h:65
virtual QRhiTexture * texture(uint plane) const =0
MapMode
Enumerates how a video buffer's data is mapped to system memory.
Definition qvideoframe.h:37
HandleType
Identifies the type of a video buffers handle.
Definition qvideoframe.h:31
Combined button and popup list for selecting options.
Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, QVideoFrame::MapMode)
GLenum mode
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum type
GLuint64 GLenum handleType
unsigned char uchar
Definition qtypes.h:32
unsigned long long quint64
Definition qtypes.h:61
unsigned int uint
Definition qtypes.h:34