Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qwasmvideoframegrabber_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
//
5
// W A R N I N G
6
// -------------
7
//
8
// This file is not part of the Qt API. It exists purely as an
9
// implementation detail. This header file may change from version to
10
// version without notice, or even be removed.
11
//
12
// We mean it.
13
//
14
15
#
ifndef
QWASMVIDEOFRAMEGRABBER_H
16
#
define
QWASMVIDEOFRAMEGRABBER_H
17
18
#
include
<
QtMultimedia
/
qvideoframeformat
.
h
>
19
20
#
include
<
emscripten
/
html5_webgl
.
h
>
21
22
#
include
<
string_view
>
23
24
QT_BEGIN_NAMESPACE
25
26
class
QWasmVideoOutput;
27
28
class
QWasmVideoFrameGrabber
29
{
30
public
:
31
explicit
QWasmVideoFrameGrabber
(
QWasmVideoOutput
*videoOutput);
32
~
QWasmVideoFrameGrabber
();
33
34
void
startFrameLoop
();
35
36
static
QVideoFrameFormat
::
PixelFormat
fromJsPixelFormat
(std::string_view videoFormat);
37
38
private
:
39
void
detectWebGLContext();
40
void
processVideoFrame();
41
void
processWebGLVideoFrame();
42
43
QWasmVideoOutput
*m_videoOutput =
nullptr
;
44
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE m_glContextHandle = 0;
45
// Pending requestAnimationFrame id, 0 while no loop is scheduled.
46
int
m_animationFrameRequestId = 0;
47
bool
m_hasWebGLContext =
false
;
48
bool
m_webGLContextChecked =
false
;
49
};
50
51
QT_END_NAMESPACE
52
#
endif
// QWASMVIDEOFRAMEGRABBER_H
QWasmVideoFrameGrabber
Definition
qwasmvideoframegrabber_p.h:29
QWasmVideoFrameGrabber::QWasmVideoFrameGrabber
QWasmVideoFrameGrabber(QWasmVideoOutput *videoOutput)
Definition
qwasmvideoframegrabber.cpp:48
QWasmVideoFrameGrabber::startFrameLoop
void startFrameLoop()
Definition
qwasmvideoframegrabber.cpp:225
QWasmVideoFrameGrabber::fromJsPixelFormat
static QVideoFrameFormat::PixelFormat fromJsPixelFormat(std::string_view videoFormat)
Definition
qwasmvideoframegrabber.cpp:293
QWasmVideoFrameGrabber::~QWasmVideoFrameGrabber
~QWasmVideoFrameGrabber()
Definition
qwasmvideoframegrabber.cpp:53
QWasmVideoOutput
Definition
qwasmvideooutput_p.h:41
QWasmVideoOutput::isReady
bool isReady() const
Definition
qwasmvideooutput.cpp:341
QWasmVideoOutput::SurfaceCapture
@ SurfaceCapture
Definition
qwasmvideooutput_p.h:45
QWasmVideoOutput::m_videoSurfaceId
std::string m_videoSurfaceId
Definition
qwasmvideooutput_p.h:97
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
GL_CLAMP_TO_EDGE
#define GL_CLAMP_TO_EDGE
Definition
qopenglext.h:100
EM_JS
EM_JS(void, em_texImage2DFromVideo,(const char *videoId, int *widthOut, int *heightOut), { videoId=Number(videoId);widthOut=Number(widthOut);heightOut=Number(heightOut);var gl=GL.currentContext.GLctx;var video=document.getElementById(UTF8ToString(videoId));if(!video) { return;} var frame;try { frame=new VideoFrame(video);} catch(e) { return;} HEAP32[widthOut/4]=frame.displayWidth;HEAP32[heightOut/4]=frame.displayHeight;gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, frame);frame.close();})
qtmultimedia
src
plugins
multimedia
wasm
common
qwasmvideoframegrabber_p.h
Generated on
for Qt by
1.18.0