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
qwasmgltexturevideobuffer.cpp
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
5#include <private/qhwvideobuffer_p.h>
6
8
9
11 const QSize &size,
12 EMSCRIPTEN_WEBGL_CONTEXT_HANDLE glContext,
13 QRhi *rhi)
14 : QHwVideoBuffer(QVideoFrame::RhiTextureHandle),
15 m_glTextureHandle(std::move(textureHandle)),
16 m_size(size),
17 m_videoFrameFormat(size, QVideoFrameFormat::Format_RGBA8888),
18 m_glContext(glContext),
19 m_rhi(rhi),
20 m_rhiThread(QThread::currentThread())
21{
22}
23
28
32
34{
35 if (plane != 0 || !m_glTextureHandle)
36 return 0;
37 // Ensure the context that owns this texture is current before
38 // the caller binds or samples it.
39 emscripten_webgl_make_context_current(m_glContext);
40 return static_cast<quint64>(m_glTextureHandle.get());
41}
42
43QT_END_NAMESPACE
quint64 textureHandle(QRhi &, int plane) override
void unmap() override
Releases the memory mapped by the map() function.
QWasmGLTextureVideoBuffer::MapData map(QVideoFrame::MapMode) override
Maps the planes of a video buffer to memory.
Combined button and popup list for selecting options.