Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qdmabufvideobuffer_p.h
Go to the documentation of this file.
1
// Copyright (C) 2026 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
#
ifndef
QDMABUFVIDEOBUFFER_P_H
4
#
define
QDMABUFVIDEOBUFFER_P_H
5
6
//
7
// W A R N I N G
8
// -------------
9
//
10
// This file is not part of the Qt API. It exists purely as an
11
// implementation detail. This header file may change from version to
12
// version without notice, or even be removed.
13
//
14
// We mean it.
15
//
16
17
18
#
include
<
QtMultimedia
/
qvideoframeformat
.
h
>
19
#
include
<
QtMultimedia
/
private
/
qhwvideobuffer_p
.
h
>
20
#
include
<
QtMultimedia
/
private
/
qmultimedia_drm_support_p
.
h
>
21
#
include
<
QtMultimedia
/
private
/
qtmultimediaglobal_p
.
h
>
22
#
include
<
QtCore
/
qsize
.
h
>
23
#
include
<
QtCore
/
qspan
.
h
>
24
#
include
<
QtCore
/
qvarlengtharray
.
h
>
25
#
include
<
QtCore
/
private
/
quniquehandle_types_p
.
h
>
26
27
#
include
<
memory
>
28
29
static_assert
(QT_CONFIG(linux_dmabuf));
30
31
QT_BEGIN_NAMESPACE
32
33
class
QRhi;
34
35
namespace
QtMultimediaPrivate
{
36
37
class
Q_MULTIMEDIA_EXPORT
QDmaBufVideoBuffer
:
public
QHwVideoBuffer
38
{
39
public
:
40
QDmaBufVideoBuffer
(
QVideoFrameFormat
::
PixelFormat
format
,
QSize
size
,
41
QSpan
<
const
DmaBufPlane
>
planes
,
std
::
shared_ptr
<
void
>
keepAlive
= {},
42
DmaBufImportMode
importMode
=
DmaBufImportMode
::
PerPlane
);
43
~
QDmaBufVideoBuffer
()
override
;
44
45
bool
isDmaBuf
()
const
override
{
return
true
; }
46
47
QVideoFrameTexturesUPtr
mapTextures
(
QRhi
&
rhi
)
override
;
48
49
MapData
map
(
QVideoFrame
::
MapMode
mode
)
override
;
50
void
unmap
()
override
;
51
52
QVideoFrameFormat
::
PixelFormat
pixelFormat
()
const
{
return
m_format
; }
53
QSize
size
()
const
{
return
m_size
; }
54
DmaBufImportMode
importMode
()
const
{
return
m_importMode
; }
55
56
private
:
57
const
QVideoFrameFormat
::
PixelFormat
m_format
;
58
const
QSize
m_size
;
59
QVarLengthArray
<
DmaBufPlane
, 4>
m_planes
;
// later: std::inplace_vector
60
61
const
std
::
shared_ptr
<
void
>
m_keepAlive
;
62
const
DmaBufImportMode
m_importMode
;
63
64
QVideoFrame
::
MapMode
m_mapMode
=
QVideoFrame
::
NotMapped
;
65
struct
MappedRegion
66
{
67
QUniqueFileDescriptorHandle
fd
;
68
QSpan
<
std
::
byte
>
data
;
69
};
70
QVarLengthArray
<
MappedRegion
, 4>
m_mappedRegions
;
71
72
static
void
unmapRegions
(
QSpan
<
const
MappedRegion
>
regions
);
73
};
74
75
}
// namespace QtMultimediaPrivate
76
77
QT_END_NAMESPACE
78
79
#
endif
// QDMABUFVIDEOBUFFER_P_H
QtMultimediaPrivate::QDmaBufVideoBuffer
Definition
qdmabufvideobuffer_p.h:38
QtMultimediaPrivate::impl
Definition
qaudiosystem_p.h:257
Q_STATIC_LOGGING_CATEGORY
QT_BEGIN_NAMESPACE Q_STATIC_LOGGING_CATEGORY(lcSynthesizedIterableAccess, "qt.iterable.synthesized", QtWarningMsg)
MAP_FAILED
#define MAP_FAILED
Definition
qresource.cpp:1189
qtmultimedia
src
multimedia
video
qdmabufvideobuffer_p.h
Generated on
for Qt by
1.18.0