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
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
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
35static_assert(QT_CONFIG(linux_dmabuf_egl));
36
37QT_BEGIN_NAMESPACE
38
39class QRhi;
40class QOpenGLContext;
41
42namespace QtMultimediaPrivate {
43
44class Q_MULTIMEDIA_EXPORT DmaBufEglContext
45{
46public:
47 explicit DmaBufEglContext(QRhi *rhi);
48
49 bool isValid() const { return m_valid; }
50 void invalidate() { m_valid = false; }
51
54
55private:
56 QOpenGLContext *m_glContext = nullptr;
57 EGLDisplay m_eglDisplay = nullptr;
58 bool m_valid = false;
59};
60
61class Q_MULTIMEDIA_EXPORT DmaBufTextureHandles final : public QVideoFrameTexturesHandles
62{
63public:
66 std::shared_ptr<void> parentKeepAlive = {});
67
69
75
76private:
77 const std::shared_ptr<void> m_parentKeepAlive; // keep the backend alive
78 QRhi &m_rhi;
81};
82
86 std::shared_ptr<void> parentKeepAlive = {},
88
89} // namespace QtMultimediaPrivate
90
91QT_END_NAMESPACE
92
93#endif // QDMABUFTEXTUREIMPORTER_P_H
static bool dmaModifierIsNotSupportedByDisplay(const DmaBufPlane &plane, EGLDisplay eglDisplay)
static bool isExternalOesOnly(const QEglImageFunctions &eglFunctions, EGLDisplay eglDisplay, const DmaBufPlane &plane)
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)
QT_BEGIN_NAMESPACE Q_STATIC_LOGGING_CATEGORY(lcSynthesizedIterableAccess, "qt.iterable.synthesized", QtWarningMsg)