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
27
QT_BEGIN_NAMESPACE
28
29
30
class
QVariant
;
31
class
QRhi
;
32
class
QRhiTexture
;
33
34
class
Q_MULTIMEDIA_EXPORT
QVideoFrameTextures
35
{
36
public
:
37
virtual
~QVideoFrameTextures
() {}
38
virtual
QRhiTexture
*
texture
(
uint
plane)
const
= 0;
39
};
40
41
class
Q_MULTIMEDIA_EXPORT
QAbstractVideoBuffer
42
{
43
public
:
44
QAbstractVideoBuffer
(
QVideoFrame::HandleType
type
,
QRhi
*rhi =
nullptr
);
45
virtual
~QAbstractVideoBuffer
();
46
47
QVideoFrame::HandleType
handleType
()
const
;
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;
59
virtual
MapData
map
(
QVideoFrame::MapMode
mode
) = 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
{}; }
66
protected
:
67
QVideoFrame::HandleType
m_type
;
68
QRhi
*m_rhi =
nullptr
;
69
70
private
:
71
Q_DISABLE_COPY(
QAbstractVideoBuffer
)
72
};
73
74
#ifndef QT_NO_DEBUG_STREAM
75
Q_MULTIMEDIA_EXPORT
QDebug
operator<<
(
QDebug
,
QVideoFrame::MapMode
);
76
#endif
77
78
QT_END_NAMESPACE
79
80
#endif
QAbstractVideoBuffer
The QAbstractVideoBuffer class is an abstraction for video data. \inmodule QtMultimedia.
Definition
qabstractvideobuffer_p.h:42
QAbstractVideoBuffer::unmap
virtual void unmap()=0
Releases the memory mapped by the map() function.
QAbstractVideoBuffer::mapTextures
virtual std::unique_ptr< QVideoFrameTextures > mapTextures(QRhi *)
Definition
qabstractvideobuffer_p.h:62
QAbstractVideoBuffer::map
virtual MapData map(QVideoFrame::MapMode mode)=0
Independently maps the planes of a video buffer to memory.
QAbstractVideoBuffer::textureHandle
virtual quint64 textureHandle(int) const
Returns a texture handle to the data buffer.
Definition
qabstractvideobuffer_p.h:63
QAbstractVideoBuffer::m_type
QVideoFrame::HandleType m_type
Definition
qabstractvideobuffer_p.h:67
QAbstractVideoBuffer::mapMode
virtual QVideoFrame::MapMode mapMode() const =0
QAbstractVideoBuffer::externalTextureMatrix
virtual QMatrix4x4 externalTextureMatrix() const
Definition
qabstractvideobuffer_p.h:65
QDebug
\inmodule QtCore
QMatrix4x4
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition
qmatrix4x4.h:25
QRhiTexture
\inmodule QtGui
Definition
qrhi.h:883
QRhi
\inmodule QtGui
Definition
qrhi.h:1767
QVariant
\inmodule QtCore
Definition
qvariant.h:64
QVideoFrameTextures
Definition
qabstractvideobuffer_p.h:35
QVideoFrameTextures::texture
virtual QRhiTexture * texture(uint plane) const =0
QVideoFrameTextures::~QVideoFrameTextures
virtual ~QVideoFrameTextures()
Definition
qabstractvideobuffer_p.h:37
QVideoFrame::MapMode
MapMode
Enumerates how a video buffer's data is mapped to system memory.
Definition
qvideoframe.h:36
QVideoFrame::HandleType
HandleType
Identifies the type of a video buffers handle.
Definition
qvideoframe.h:30
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
operator<<
Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, QVideoFrame::MapMode)
Definition
qabstractvideobuffer.cpp:179
mode
GLenum mode
Definition
qopengles2ext.h:333
size
GLenum GLuint GLintptr GLsizeiptr size
[1]
Definition
qopengles2ext.h:660
type
GLenum type
Definition
qopengles2ext.h:150
handleType
GLuint64 GLenum handleType
Definition
qopengles2ext.h:1558
data
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
Definition
qopengles2ext.h:206
uchar
unsigned char uchar
Definition
qtypes.h:27
quint64
unsigned long long quint64
Definition
qtypes.h:56
uint
unsigned int uint
Definition
qtypes.h:29
QAbstractVideoBuffer::MapData
Definition
qabstractvideobuffer_p.h:51
qtmultimedia
src
multimedia
video
qabstractvideobuffer_p.h
Generated by
1.9.7