I'm trying to call an async function, '
isConfigSupported' from WebCodecs API.
Here is what I did in C++,
val VideoDecoder = val::global("VideoDecoder");
ConfigCodec* config = new ConfigCodec(); // some struct
config->codec = "vp8";
config->codedWidth = 640;
config->codedHeight = 480;
val result = VideoDecoder.call<val>("isConfigSupported", config).await();
if (result["supported"].as<bool>()) {
EM_ASM(
console.log("Codec is supported");
);
} else {
EM_ASM(
console.error("Codec is not supported");
);
}
I have compiled emcc with this additional option, '-O3 -sASYNCIFY' as stated in the documentation.
The result is 'Codec is supported', however, I get an error in the console logs,
wasmapi.wasm:0x1e79f Uncaught (in promise) RuntimeError: unreachable
at wasmapi.wasm:0x1e79f
at wasmapi.wasm:0x1ca34
at wasmapi.wasm:0x118be
at ret.<computed> (wasmapi.js:1:87071)
at Object.doRewind (wasmapi.js:1:88672)
at wasmapi.js:1:89246
Did I miss something? What does this error mean?