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
/
qmultimedia_drm_support_p
.
h
>
21
#
include
<
QtMultimedia
/
private
/
qmultimedia_gl_support_p
.
h
>
22
#
include
<
QtMultimedia
/
private
/
qtmultimediaglobal_p
.
h
>
23
24
#
include
<
QtGui
/
qopenglfunctions
.
h
>
25
26
#
include
<
QtCore
/
qsize
.
h
>
27
#
include
<
QtCore
/
private
/
qexpected_p
.
h
>
28
29
#
include
<
EGL
/
egl
.
h
>
30
31
#
include
<
memory
>
32
#
include
<
vector
>
33
34
static_assert
(QT_CONFIG(linux_dmabuf));
35
36
QT_BEGIN_NAMESPACE
37
38
class
QRhi;
39
class
QOpenGLContext;
40
41
namespace
QtMultimediaPrivate
{
42
43
class
Q_MULTIMEDIA_EXPORT
DmaBufEglContext
44
{
45
public
:
46
explicit
DmaBufEglContext
(
QRhi
*
rhi
);
47
48
bool
isValid
()
const
{
return
m_valid
; }
49
void
invalidate
() {
m_valid
=
false
; }
50
51
QOpenGLContext
*
glContext
()
const
{
return
m_glContext
; }
52
EGLDisplay
eglDisplay
()
const
{
return
m_eglDisplay
; }
53
54
private
:
55
QOpenGLContext
*
m_glContext
=
nullptr
;
56
EGLDisplay
m_eglDisplay
=
nullptr
;
57
bool
m_valid
=
false
;
58
};
59
60
class
Q_MULTIMEDIA_EXPORT DmaBufTextureHandles
final
:
public
QVideoFrameTexturesHandles
61
{
62
public
:
63
DmaBufTextureHandles
(
QRhi
&
rhi
,
std
::
vector
<
GlTextureHandle
>
textures
,
64
QVideoFrameFormat
::
PixelFormat
format
,
65
std
::
shared_ptr
<
void
>
parentKeepAlive
= {});
66
67
~
DmaBufTextureHandles
()
override
;
68
69
quint64
textureHandle
(
QRhi
&,
int
plane
)
override
{
return
m_textures
[
plane
].
get
(); }
70
std
::
optional
<
QVideoFrameFormat
::
PixelFormat
>
texturePixelFormat
()
const
override
71
{
72
return
m_texturePixelFormat
;
73
}
74
75
private
:
76
const
std
::
shared_ptr
<
void
>
m_parentKeepAlive
;
// keep the backend alive
77
QRhi
&
m_rhi
;
78
const
std
::
vector
<
GlTextureHandle
>
m_textures
;
79
const
QVideoFrameFormat
::
PixelFormat
m_texturePixelFormat
;
80
};
81
82
// Severity of a failure to import DMABUF planes as GL textures.
83
enum
class
FailureSeverity
{
84
recoverable
,
// the caller may retry, e.g. with a different frame
85
unrecoverable
,
// the caller should permanently disable DMABUF import
86
};
87
88
Q_MULTIMEDIA_EXPORT
q23
::
expected
<
QVideoFrameTexturesHandlesUPtr
,
FailureSeverity
>
89
importDmaBufTextures
(
QRhi
&
rhi
,
const
DmaBufEglContext
&
eglContext
,
QSpan
<
const
DmaBufPlane
>
planes
,
90
QVideoFrameFormat
::
PixelFormat
qtFormat
,
QSize
frameSize
,
91
std
::
shared_ptr
<
void
>
parentKeepAlive
= {},
92
DmaBufImportMode
importMode
=
DmaBufImportMode
::
PerPlane
);
93
94
}
// namespace QtMultimediaPrivate
95
96
QT_END_NAMESPACE
97
98
#
endif
// QDMABUFTEXTUREIMPORTER_P_H
QtMultimediaPrivate::DmaBufEglContext
Definition
qdmabuftextureimporter_p.h:44
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::FailureSeverity
FailureSeverity
Definition
qdmabuftextureimporter_p.h:83
QtMultimediaPrivate::FailureSeverity::unrecoverable
@ unrecoverable
Definition
qdmabuftextureimporter_p.h:85
QtMultimediaPrivate::FailureSeverity::recoverable
@ recoverable
Definition
qdmabuftextureimporter_p.h:84
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