(ed5bc105180202540d0ac57224887260ec4ecd93)
#include "qwasmvideoframegrabber_p.h"
#include "qwasmvideooutput_p.h"
#include "qwasmgltexturevideobuffer_p.h"
#include <QDebug>
#include <QOpenGLContext>
#include <QtGui/rhi/qrhi_platform.h>
#include <qpa/qplatformwindow_p.h>
#include <GLES2/gl2.h>
#include <qvideosink.h>
#include <private/qmemoryvideobuffer_p.h>
#include <private/qvideoframe_p.h>
#include <private/qstdweb_p.h>
#include <emscripten/emscripten.h>
#include <emscripten/em_js.h>
#include <emscripten/html5.h>
#include <emscripten/val.h>
Go to the source code of this file.
|
| | 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();}) |
| | 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() [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();} | ) |