| * This tool lets you test if the compiled Javascript decoder is functioning properly. You'll |
| * need to download a SpiderMonkey js-shell to run this script. |
| * https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/ |
| * js-shell inspect-cli.js video.ivf |
| var buffer = read(scriptArgs[0], "binary"); |
| printErr(`Loaded Javascript Decoder OK`); |
| memoryInitializerPrefixURL: "bin/", |
| arguments: ['input.ivf', 'output.raw'], |
| on_frame_decoded_json: function (jsonString) { |
| let json = JSON.parse("[" + Module.UTF8ToString(jsonString) + "null]"); |
| Module.FS.writeFile("/tmp/input.ivf", buffer, { encoding: "binary" }); |
| Module._set_layers(0xFFFFFFFF); // Set this to zero if you want to benchmark decoding. |
| printErr("Decoding Frame ..."); |
| if (Module._read_frame()) { |