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
qwasmvideooutput.cpp File Reference

(ba5872fe7c27e2af503adfcad2c894f3821362ca)

#include <QDebug>
#include <QUrl>
#include <QPoint>
#include <QRect>
#include <QMediaPlayer>
#include <QVideoFrame>
#include <QFile>
#include <QBuffer>
#include <QMimeDatabase>
#include <QGuiApplication>
#include <QOpenGLContext>
#include <QtGui/rhi/qrhi_platform.h>
#include <qpa/qplatformwindow_p.h>
#include <GLES2/gl2.h>
#include "qwasmvideooutput_p.h"
#include <qvideosink.h>
#include <private/qplatformvideosink_p.h>
#include <private/qmemoryvideobuffer_p.h>
#include <private/qvideotexturehelper_p.h>
#include <private/qvideoframe_p.h>
#include <private/qstdweb_p.h>
#include <QTimer>
#include <emscripten/bind.h>
#include <emscripten/val.h>
#include "moc_qwasmvideooutput_p.cpp"
Include dependency graph for qwasmvideooutput.cpp:

Go to the source code of this file.

Functions

 EM_JS (void, em_texImage2DFromVideo,(const char *videoId, int *pW, int *pH), { 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[pW > > 2]=frame.displayWidth;HEAP32[pH > > 2]=frame.displayHeight;gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, frame);frame.close();})
static bool checkForVideoFrame ()
 EM_JS (EMSCRIPTEN_WEBGL_CONTEXT_HANDLE, qwasm_find_webgl_context_for_canvas,(EM_VAL canvasHandle), { var canvas=Emval.toValue(canvasHandle);for(var id in GL.contexts) { var entry=GL.contexts[id];if(entry &&entry.GLctx &&entry.GLctx.canvas===canvas) return parseInt(id);} return 0;})

Function Documentation

◆ checkForVideoFrame()

bool checkForVideoFrame ( )
static

Definition at line 57 of file qwasmvideooutput.cpp.

◆ EM_JS() [1/2]

EM_JS ( EMSCRIPTEN_WEBGL_CONTEXT_HANDLE ,
qwasm_find_webgl_context_for_canvas ,
(EM_VAL canvasHandle) ,
{ var canvas=Emval.toValue(canvasHandle);for(var id in GL.contexts) { var entry=GL.contexts[id];if(entry &&entry.GLctx &&entry.GLctx.canvas===canvas) return parseInt(id);} return 0;}  )

◆ EM_JS() [2/2]

EM_JS ( void ,
em_texImage2DFromVideo ,
(const char *videoId, int *pW, int *pH) ,
{ 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[pW > > 2]=frame.displayWidth;HEAP32[pH > > 2]=frame.displayHeight;gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, frame);frame.close();}  )

References EM_JS().

Referenced by EM_JS().

Here is the call graph for this function:
Here is the caller graph for this function: