Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qmultimedia_gl_support_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
4
#
ifndef
QMULTIMEDIA_GL_SUPPORT_P_H
5
#
define
QMULTIMEDIA_GL_SUPPORT_P_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
/
private
/
qtmultimediaglobal_p
.
h
>
19
#
include
<
QtGui
/
qopengl
.
h
>
20
#
include
<
QtCore
/
private
/
quniquehandle_p
.
h
>
21
#
include
<
QtCore
/
qstring
.
h
>
22
23
// thanks X.h
24
#
pragma
push_macro
(
"Success"
)
25
#
ifdef
Success
26
#
undef
Success
27
#
endif
28
29
#
pragma
push_macro
(
"BadAccess"
)
30
#
ifdef
BadAccess
31
#
undef
BadAccess
32
#
endif
33
34
#
pragma
push_macro
(
"BadAlloc"
)
35
#
ifdef
BadAlloc
36
#
undef
BadAlloc
37
#
endif
38
39
#
pragma
push_macro
(
"BadMatch"
)
40
#
ifdef
BadMatch
41
#
undef
BadMatch
42
#
endif
43
44
#
if
QT_CONFIG
(
egl
)
45
typedef
void
*EGLDisplay;
46
typedef
void
*EGLImage;
47
#
endif
48
49
QT_BEGIN_NAMESPACE
50
51
class
QOpenGLContext;
52
class
QDebug;
53
class
QRhi;
54
55
namespace
QtMultimediaPrivate
{
56
57
// Error codes returned by glGetError(), see
58
// https://registry.khronos.org/OpenGL-Refpages/gl4/html/glGetError.xhtml
59
enum
class
GLError
:
unsigned
int
{
60
NoError
= 0,
61
InvalidEnum
= 0x0500,
62
InvalidValue
= 0x0501,
63
InvalidOperation
= 0x0502,
64
StackOverflow
= 0x0503,
65
StackUnderflow
= 0x0504,
66
OutOfMemory
= 0x0505,
67
InvalidFramebufferOperation
= 0x0506,
68
};
69
70
Q_MULTIMEDIA_EXPORT QDebug
operator
<<(
QDebug
debug
,
GLError
error
);
71
72
#
if
QT_CONFIG
(
egl
)
73
74
// Error codes returned by eglGetError(), see
75
// https://registry.khronos.org/EGL/sdk/docs/man/html/eglGetError.xhtml
76
enum
class
EGLError
:
int
{
77
Success
= 0x3000,
78
NotInitialized
= 0x3001,
79
BadAccess
= 0x3002,
80
BadAlloc
= 0x3003,
81
BadAttribute
= 0x3004,
82
BadConfig
= 0x3005,
83
BadContext
= 0x3006,
84
BadCurrentSurface
= 0x3007,
85
BadDisplay
= 0x3008,
86
BadMatch
= 0x3009,
87
BadNativePixmap
= 0x300A,
88
BadNativeWindow
= 0x300B,
89
BadParameter
= 0x300C,
90
BadSurface
= 0x300D,
91
ContextLost
= 0x300E,
92
};
93
94
Q_MULTIMEDIA_EXPORT
QDebug
operator
<<(
QDebug
debug
,
EGLError
error
);
95
96
Q_MULTIMEDIA_EXPORT
EGLDisplay
resolveEglDisplay
(
QRhi
&);
97
98
///////////////////////////////////////////////////////////////////////////////
99
// (e)gl handle types
100
101
class
Q_MULTIMEDIA_EXPORT
EglImageDeleter
102
{
103
public
:
104
EglImageDeleter
() =
default
;
105
explicit
EglImageDeleter
(
EGLDisplay
display
) :
m_display
(
display
) { }
106
void
operator
()(
EGLImage
image
)
const
noexcept
;
107
108
private
:
109
EGLDisplay
m_display
= {};
// EGL_NO_DISPLAY;
110
};
111
112
struct
EGLImageHandleTraits
113
{
114
using
Type
=
EGLImage
;
115
static
Type
invalidValue
() {
return
nullptr
; }
// EGL_NO_IMAGE;
116
};
117
using
EGLImageHandle
=
QUniqueHandle
<
EGLImageHandleTraits
,
EglImageDeleter
>;
118
119
#
endif
// QT_CONFIG(egl)
120
121
class
Q_MULTIMEDIA_EXPORT
GlTextureDeleter
122
{
123
public
:
124
GlTextureDeleter
() =
default
;
125
explicit
GlTextureDeleter
(
QOpenGLContext
*
context
) :
m_context
(
context
) { }
126
void
operator
()(
GLuint
texture
)
const
noexcept
;
127
128
private
:
129
QOpenGLContext
*
m_context
=
nullptr
;
130
};
131
132
struct
GlTextureHandleTraits
133
{
134
using
Type
=
GLuint
;
135
static
Type
invalidValue
() {
return
0; }
136
};
137
using
GlTextureHandle
=
QUniqueHandle
<
GlTextureHandleTraits
,
GlTextureDeleter
>;
138
139
}
// namespace QtMultimediaPrivate
140
141
QT_END_NAMESPACE
142
143
#
pragma
pop_macro
(
"Success"
)
144
#
pragma
pop_macro
(
"BadAccess"
)
145
#
pragma
pop_macro
(
"BadAlloc"
)
146
#
pragma
pop_macro
(
"BadMatch"
)
147
148
#
endif
QtMultimediaPrivate::GlTextureDeleter
Definition
qmultimedia_gl_support_p.h:122
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QtMultimediaPrivate::impl
Definition
qaudiosystem_p.h:257
QtMultimediaPrivate::toString
static QString toString(GLError error)
Definition
qmultimedia_gl_support.cpp:23
QtMultimediaPrivate::GLError
GLError
Definition
qmultimedia_gl_support_p.h:59
QtMultimediaPrivate::GLError::InvalidOperation
@ InvalidOperation
Definition
qmultimedia_gl_support_p.h:63
QtMultimediaPrivate::GLError::InvalidValue
@ InvalidValue
Definition
qmultimedia_gl_support_p.h:62
QtMultimediaPrivate::GLError::StackUnderflow
@ StackUnderflow
Definition
qmultimedia_gl_support_p.h:65
QtMultimediaPrivate::GLError::InvalidFramebufferOperation
@ InvalidFramebufferOperation
Definition
qmultimedia_gl_support_p.h:67
QtMultimediaPrivate::GLError::NoError
@ NoError
Definition
qmultimedia_gl_support_p.h:60
QtMultimediaPrivate::GLError::StackOverflow
@ StackOverflow
Definition
qmultimedia_gl_support_p.h:64
QtMultimediaPrivate::GLError::OutOfMemory
@ OutOfMemory
Definition
qmultimedia_gl_support_p.h:66
QtMultimediaPrivate::GLError::InvalidEnum
@ InvalidEnum
Definition
qmultimedia_gl_support_p.h:61
QtMultimediaPrivate::GlTextureHandleTraits
Definition
qmultimedia_gl_support_p.h:133
QtMultimediaPrivate::GlTextureHandleTraits::invalidValue
static Type invalidValue()
Definition
qmultimedia_gl_support_p.h:135
qtmultimedia
src
multimedia
video
qmultimedia_gl_support_p.h
Generated on
for Qt by
1.16.1