wasm: fix video frame grabber on wasm64
EM_JS functions are raw wasm imports. With MEMORY64 every pointer
argument, including EM_VAL and char*, arrives in JS as a BigInt and a
pointer sized return value must also be a BigInt. Emval.toValue()
asserts on a BigInt handle and HEAP32[ptr >> 2] throws, which aborts
the frame loop on wasm64.
Convert the EM_JS pointer arguments with Number(), which is a no-op on
wasm32, and use EM_ASM_PTR for the VideoFrame handle so Emscripten
marshals it on both targets.
Drop the EM_JS canvas scan in favour of
emscripten_webgl_get_current_context(). QWasmOpenGLContext::makeCurrent()
ends in emscripten_webgl_make_context_current(), so the handle is already
available from the C API in its native width. The scan returned a JS
Number for a pointer sized result, which cannot work on wasm64, and with
pthreads the handle is a malloc() result rather than a small index, so no
integer return type is correct for every configuration.
Fixes: QTBUG-150969
Pick-to: 6.12
Change-Id: I4a682ccddf51e96e7ed4fb8ebb53c1ad33cf0078
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>