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
qdmabuftextureimporter_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
QDMABUFTEXTUREIMPORTER_P_H
4
#
define
QDMABUFTEXTUREIMPORTER_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
#
include
"qhwvideobuffer_p.h"
18
19
#
include
<
QtMultimedia
/
qvideoframeformat
.
h
>
20
#
include
<
QtMultimedia
/
private
/
qdmabufimportfailure_p
.
h
>
21
#
include
<
QtMultimedia
/
private
/
qmultimedia_drm_support_p
.
h
>
22
#
include
<
QtMultimedia
/
private
/
qmultimedia_gl_support_p
.
h
>
23
#
include
<
QtMultimedia
/
private
/
qtmultimediaglobal_p
.
h
>
24
25
#
include
<
QtGui
/
qopenglfunctions
.
h
>
26
27
#
include
<
QtCore
/
qsize
.
h
>
28
#
include
<
QtCore
/
private
/
qexpected_p
.
h
>
29
30
#
include
<
EGL
/
egl
.
h
>
31
32
#
include
<
memory
>
33
#
include
<
vector
>
34
35
static_assert
(QT_CONFIG(linux_dmabuf_egl));
36
37
QT_BEGIN_NAMESPACE
38
39
class
QRhi;
40
class
QOpenGLContext;
41
42
namespace
QtMultimediaPrivate
{
43
44
class
Q_MULTIMEDIA_EXPORT
DmaBufEglContext
45
{
46
public
:
47
explicit
DmaBufEglContext
(
QRhi
*
rhi
);
48
49
bool
isValid
()
const
{
return
m_valid
; }
50
void
invalidate
() {
m_valid
=
false
; }
51
52
QOpenGLContext
*
glContext
()
const
{
return
m_glContext
; }
53
EGLDisplay
eglDisplay
()
const
{
return
m_eglDisplay
; }
54
55
private
:
56
QOpenGLContext
*
m_glContext
=
nullptr
;
57
EGLDisplay
m_eglDisplay
=
nullptr
;
58
bool
m_valid
=
false
;
59
};
60
61
class
Q_MULTIMEDIA_EXPORT DmaBufTextureHandles
final
:
public
QVideoFrameTexturesHandles
62
{
63
public
:
64
DmaBufTextureHandles
(
QRhi
&
rhi
,
std
::
vector
<
GlTextureHandle
>
textures
,
65
QVideoFrameFormat
::
PixelFormat
format
,
66
std
::
shared_ptr
<
void
>
parentKeepAlive
= {});
67
68
~
DmaBufTextureHandles
()
override
;
69
70
quint64
textureHandle
(
QRhi
&,
int
plane
)
override
{
return
m_textures
[
plane
].
get
(); }
71
std
::
optional
<
QVideoFrameFormat
::
PixelFormat
>
texturePixelFormat
()
const
override
72
{
73
return
m_texturePixelFormat
;
74
}
75
76
private
:
77
const
std
::
shared_ptr
<
void
>
m_parentKeepAlive
;
// keep the backend alive
78
QRhi
&
m_rhi
;
79
const
std
::
vector
<
GlTextureHandle
>
m_textures
;
80
const
QVideoFrameFormat
::
PixelFormat
m_texturePixelFormat
;
81
};
82
83
Q_MULTIMEDIA_EXPORT
q23
::
expected
<
QVideoFrameTexturesHandlesUPtr
,
FailureSeverity
>
84
importDmaBufTextures
(
QRhi
&
rhi
,
const
DmaBufEglContext
&
eglContext
,
QSpan
<
const
DmaBufPlane
>
planes
,
85
QVideoFrameFormat
::
PixelFormat
qtFormat
,
QSize
frameSize
,
86
std
::
shared_ptr
<
void
>
parentKeepAlive
= {},
87
DmaBufImportMode
importMode
=
DmaBufImportMode
::
PerPlane
);
88
89
}
// namespace QtMultimediaPrivate
90
91
QT_END_NAMESPACE
92
93
#
endif
// QDMABUFTEXTUREIMPORTER_P_H
QtMultimediaPrivate::DmaBufEglContext
Definition
qdmabuftextureimporter_p.h:45
QtMultimediaPrivate::impl
Definition
qaudiosystem_p.h:257
QtMultimediaPrivate::dmaModifierIsNotSupportedByDisplay
static bool dmaModifierIsNotSupportedByDisplay(const DmaBufPlane &plane, EGLDisplay eglDisplay)
Definition
qdmabuftextureimporter.cpp:78
QtMultimediaPrivate::isExternalOesOnly
static bool isExternalOesOnly(const QEglImageFunctions &eglFunctions, EGLDisplay eglDisplay, const DmaBufPlane &plane)
Definition
qdmabuftextureimporter.cpp:91
QtMultimediaPrivate::importDmaBufTextures
q23::expected< QVideoFrameTexturesHandlesUPtr, FailureSeverity > importDmaBufTextures(QRhi &rhi, const DmaBufEglContext &eglContext, QSpan< const DmaBufPlane > planes, QVideoFrameFormat::PixelFormat qtFormat, QSize frameSize, std::shared_ptr< void > parentKeepAlive, DmaBufImportMode importMode)
Definition
qdmabuftextureimporter.cpp:103
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
Q_STATIC_LOGGING_CATEGORY
QT_BEGIN_NAMESPACE Q_STATIC_LOGGING_CATEGORY(lcSynthesizedIterableAccess, "qt.iterable.synthesized", QtWarningMsg)
qtmultimedia
src
multimedia
video
qdmabuftextureimporter_p.h
Generated on
for Qt by
1.18.0