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_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 QWASMGLTEXTUREVIDEOBUFFER_H
5#define QWASMGLTEXTUREVIDEOBUFFER_H
6
7#include <QtGui/rhi/qrhi.h>
8#include <QSize>
9
10#include <QtMultimedia/private/qhwvideobuffer_p.h>
11#include "qvideoframe.h"
12
13#include <QtCore/private/quniquehandle_p.h>
14
15#include <emscripten/val.h>
16#include <GLES2/gl2.h>
17
18//
19// W A R N I N G
20// -------------
21//
22// This file is not part of the Qt API. It exists purely as an
23// implementation detail. This header file may change from version to
24// version without notice, or even be removed.
25//
26// We mean it.
27//
28
29QT_BEGIN_NAMESPACE
30
31struct QGlTextureHandleTraits
32{
33 using Type = GLuint;
34 static Type invalidValue() { return 0; }
35 static bool close(Type handle)
36 {
37 glDeleteTextures(1, &handle);
38 return true;
39 }
40};
41using QGlTextureHandle = QUniqueHandle<QGlTextureHandleTraits>;
42
44{
45public:
46 explicit QWasmGLTextureVideoBuffer(QGlTextureHandle textureHandle, const QSize &size);
47
49 void unmap() override;
50
51 QVideoFrameFormat format() const override { return m_videoFrameFormat; }
52 quint64 textureHandle(QRhi &, int plane) override;
53
54private:
55 QGlTextureHandle m_glTextureHandle;
56 QSize m_size;
57 QVideoFrameFormat m_videoFrameFormat;
58};
59
60QT_END_NAMESPACE
61
62#endif // QWASMGLTEXTUREVIDEOBUFFER_H
QVideoFrameFormat format() const override
Gets \l QVideoFrameFormat of the underlying video buffer.
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.
QWasmGLTextureVideoBuffer(QGlTextureHandle textureHandle, const QSize &size)
Combined button and popup list for selecting options.