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
qeglimagefunctions_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 QEGLIMAGEFUNCTIONS_P_H
4#define QEGLIMAGEFUNCTIONS_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 <QtMultimedia/private/qmultimedia_drm_support_p.h>
18#include <QtMultimedia/private/qmultimedia_gl_support_p.h>
19#include <QtMultimedia/private/qtmultimediaglobal_p.h>
20#include <QtGui/qopengl.h>
21#include <QtCore/qspan.h>
22
23#include <EGL/egl.h>
24#include <EGL/eglext.h>
25
26#include <optional>
27
28QT_BEGIN_NAMESPACE
29
30namespace QtMultimediaPrivate {
31
32class Q_MULTIMEDIA_EXPORT QEglImageFunctions
33{
35
36public:
37 static const QEglImageFunctions &instance();
38
39 bool isValid() const;
40
42
43 EGLImageHandle eglCreateImage(EGLDisplay, EGLContext, EGLenum, EGLClientBuffer,
44 QSpan<const EGLAttrib> attribs = {}) const;
45 EGLBoolean eglDestroyImage(EGLDisplay, EGLImage) const;
46
47 // Returns whether `modifier` is a supported dma-buf import modifier for `drmFormat` on
48 // `display`, or nullopt if this EGL implementation doesn't support querying modifiers at
49 // all (EGL_EXT_image_dma_buf_import_modifiers unavailable).
50 std::optional<bool> isDmaBufModifierSupported(EGLDisplay display, DRMFormat drmFormat,
51 DRMModifier modifier) const;
52
53private:
54#ifdef GL_OES_EGL_image
56#endif
57
58#ifdef EGL_VERSION_1_5
59 // egl.h declares eglCreateImage/eglDestroyImage, but the egl library may not provide the
60 // symbols, so we need to resolve them at run-time.
61
62 // NB: android does not declare these function pointer types
64 EGLClientBuffer, const EGLAttrib *);
65 typedef EGLBoolean(EGLAPIENTRYP PFNEGLDESTROYIMAGEPROC)(EGLDisplay, EGLImage);
66
67 const PFNEGLCREATEIMAGEPROC m_eglCreateImage = nullptr;
68 const PFNEGLDESTROYIMAGEPROC m_eglDestroyImage = nullptr;
69#endif
70#if defined(EGL_KHR_image)
71 const PFNEGLCREATEIMAGEKHRPROC m_eglCreateImageKHR = nullptr;
72 const PFNEGLDESTROYIMAGEKHRPROC m_eglDestroyImageKHR = nullptr;
73#endif
74#if defined(EGL_EXT_image_dma_buf_import_modifiers)
75 const PFNEGLQUERYDMABUFMODIFIERSEXTPROC m_eglQueryDmaBufModifiersEXT = nullptr;
76#endif
77};
78
79} // namespace QtMultimediaPrivate
80
81QT_END_NAMESPACE
82
83#endif // QEGLIMAGEFUNCTIONS_P_H
std::optional< bool > isDmaBufModifierSupported(EGLDisplay display, DRMFormat drmFormat, DRMModifier modifier) const
void glEGLImageTargetTexture2DOES(GLenum, GLeglImageOES) const
EGLBoolean eglDestroyImage(EGLDisplay, EGLImage) const
EGLImageHandle eglCreateImage(EGLDisplay, EGLContext, EGLenum, EGLClientBuffer, QSpan< const EGLAttrib > attribs={}) const