alpha2 0.4.6 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/abort.d.ts +12 -0
- package/dist/abort.js +48 -0
- package/dist/active-clock.d.ts +35 -0
- package/dist/active-clock.js +99 -0
- package/dist/assets.d.ts +51 -22
- package/dist/assets.js +8 -12
- package/dist/audio-layout.d.ts +52 -74
- package/dist/audio-layout.js +114 -148
- package/dist/audio-timeline.d.ts +89 -117
- package/dist/audio-timeline.js +102 -118
- package/dist/audio-worker.d.ts +12 -21
- package/dist/audio-worker.js +8 -13
- package/dist/audio-worklet-processor.js +45 -58
- package/dist/audio-worklet.d.ts +45 -76
- package/dist/audio-worklet.js +44 -79
- package/dist/audio.d.ts +15 -23
- package/dist/audio.js +9 -13
- package/dist/builder.d.ts +45 -63
- package/dist/builder.js +49 -45
- package/dist/capabilities.d.ts +99 -16
- package/dist/capabilities.js +2 -2
- package/dist/captions.d.ts +45 -22
- package/dist/captions.js +60 -15
- package/dist/chroma-siting.d.ts +24 -41
- package/dist/chroma-siting.js +38 -71
- package/dist/containers.d.ts +41 -30
- package/dist/containers.js +59 -27
- package/dist/decoder-fallback.d.ts +13 -0
- package/dist/decoder-fallback.js +38 -0
- package/dist/decoder-order.d.ts +24 -39
- package/dist/decoder-order.js +28 -42
- package/dist/edit.d.ts +77 -154
- package/dist/edit.js +98 -180
- package/dist/effects.d.ts +125 -176
- package/dist/effects.js +7 -9
- package/dist/export-destination.d.ts +25 -41
- package/dist/export-destination.js +20 -32
- package/dist/export-failure.d.ts +34 -59
- package/dist/export-failure.js +54 -48
- package/dist/export-metrics.d.ts +116 -0
- package/dist/export-metrics.js +74 -0
- package/dist/export-retry.d.ts +46 -29
- package/dist/export-retry.js +86 -51
- package/dist/exporter.d.ts +67 -116
- package/dist/exporter.js +133 -133
- package/dist/extensions.d.ts +69 -115
- package/dist/extensions.js +55 -82
- package/dist/frame-intake.d.ts +92 -0
- package/dist/frame-intake.js +114 -0
- package/dist/frame-supply.d.ts +96 -162
- package/dist/frame-supply.js +181 -171
- package/dist/frames.d.ts +23 -0
- package/dist/frames.js +34 -0
- package/dist/generated/project-schema.d.ts +712 -485
- package/dist/generated/project-schema.js +55 -2
- package/dist/generated/project-shape.js +276 -16
- package/dist/geometry.d.ts +28 -34
- package/dist/geometry.js +18 -23
- package/dist/gpu-recovery.d.ts +92 -0
- package/dist/gpu-recovery.js +135 -0
- package/dist/hdr-frames.d.ts +82 -67
- package/dist/hdr-frames.js +112 -49
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/json-text.d.ts +13 -23
- package/dist/json-text.js +10 -20
- package/dist/layout-values.d.ts +14 -22
- package/dist/layout-values.js +18 -21
- package/dist/layout.d.ts +48 -63
- package/dist/layout.js +37 -37
- package/dist/loudness.d.ts +27 -32
- package/dist/loudness.js +19 -23
- package/dist/media.d.ts +85 -237
- package/dist/media.js +133 -287
- package/dist/mediabunny.d.ts +178 -246
- package/dist/mediabunny.js +781 -583
- package/dist/paint.d.ts +23 -0
- package/dist/paint.js +37 -0
- package/dist/physical-frames.d.ts +5 -17
- package/dist/physical-frames.js +4 -11
- package/dist/player.d.ts +56 -47
- package/dist/player.js +155 -40
- package/dist/presented-frames.d.ts +2 -7
- package/dist/presented-frames.js +3 -8
- package/dist/project.d.ts +74 -118
- package/dist/project.js +384 -445
- package/dist/rate-control.d.ts +9 -23
- package/dist/rate-control.js +7 -18
- package/dist/renderer-choice.d.ts +41 -0
- package/dist/renderer-choice.js +82 -0
- package/dist/repacked-bytes.d.ts +0 -2
- package/dist/repacked-bytes.js +2 -5
- package/dist/robustness.d.ts +25 -37
- package/dist/robustness.js +71 -54
- package/dist/sha256.d.ts +5 -13
- package/dist/sha256.js +9 -24
- package/dist/text.d.ts +97 -71
- package/dist/text.js +33 -70
- package/dist/video-frames.d.ts +7 -25
- package/dist/video-frames.js +12 -29
- package/dist/waveform.d.ts +5 -11
- package/dist/waveform.js +4 -9
- package/dist/worker-error.d.ts +5 -20
- package/dist/worker-error.js +8 -25
- package/dist/worker.d.ts +82 -95
- package/dist/worker.js +235 -143
- package/package.json +26 -2
- package/wasm/alpha2_audio_worklet.wasm +0 -0
- package/wasm/alpha2_extensions.d.ts +26 -47
- package/wasm/alpha2_extensions.js +26 -47
- package/wasm/alpha2_extensions_bg.wasm +0 -0
- package/wasm/alpha2_wasm.d.ts +501 -587
- package/wasm/alpha2_wasm.js +661 -616
- package/wasm/alpha2_wasm_bg.wasm +0 -0
- package/wasm/alpha2_wasm_bg.wasm.d.ts +22 -12
- package/wasm/rust-crate-licenses.md +2 -2
- package/wasm/snippets/{alpha2-wasm-c62e60c964e88a52 → alpha2-wasm-070d94113471ef0a}/inline1.js +1 -0
- package/wasm/snippets/alpha2-wasm-070d94113471ef0a/inline2.js +82 -0
- package/wasm/snippets/alpha2-wasm-c62e60c964e88a52/inline2.js +0 -52
- /package/wasm/snippets/{alpha2-wasm-c62e60c964e88a52 → alpha2-wasm-070d94113471ef0a}/inline0.js +0 -0
- /package/wasm/snippets/{alpha2-wasm-c62e60c964e88a52 → alpha2-wasm-070d94113471ef0a}/inline3.js +0 -0
package/wasm/alpha2_wasm.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/* @ts-self-types="./alpha2_wasm.d.ts" */
|
|
2
|
-
import { alpha2Canvas2d, alpha2ImagePixels, alpha2PutRgba, alpha2ResizeCanvas } from './snippets/alpha2-wasm-
|
|
3
|
-
import {
|
|
4
|
-
import { alpha2CopyExternalImage } from './snippets/alpha2-wasm-
|
|
5
|
-
import * as import1 from "./snippets/alpha2-wasm-
|
|
6
|
-
import * as import2 from "./snippets/alpha2-wasm-
|
|
2
|
+
import { alpha2Canvas2d, alpha2ImagePixels, alpha2PutRgba, alpha2ResizeCanvas } from './snippets/alpha2-wasm-070d94113471ef0a/inline0.js';
|
|
3
|
+
import { alpha2BitmapUploadProbe, alpha2FrameBitmap } from './snippets/alpha2-wasm-070d94113471ef0a/inline2.js';
|
|
4
|
+
import { alpha2CopyExternalImage } from './snippets/alpha2-wasm-070d94113471ef0a/inline3.js';
|
|
5
|
+
import * as import1 from "./snippets/alpha2-wasm-070d94113471ef0a/inline1.js"
|
|
6
|
+
import * as import2 from "./snippets/alpha2-wasm-070d94113471ef0a/inline1.js"
|
|
7
|
+
import * as import3 from "./snippets/alpha2-wasm-070d94113471ef0a/inline1.js"
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
|
-
* Converts one source's audio to the project rate. Positions are sample
|
|
11
|
-
*
|
|
11
|
+
* Converts one source's audio to the project rate. Positions are sample indexes: the source's
|
|
12
|
+
* at its own rate, the output's at the project rate.
|
|
12
13
|
*/
|
|
13
14
|
export class AudioResampler {
|
|
14
15
|
__destroy_into_raw() {
|
|
@@ -25,8 +26,8 @@ export class AudioResampler {
|
|
|
25
26
|
* A converter from `source_rate` to `target_rate`.
|
|
26
27
|
*
|
|
27
28
|
* # Errors
|
|
28
|
-
* Rejects a rate of zero or above 768 kHz, and a source rate more than
|
|
29
|
-
*
|
|
29
|
+
* Rejects a rate of zero or above 768 kHz, and a source rate more than 8192 times the
|
|
30
|
+
* target rate.
|
|
30
31
|
* @param {number} source_rate
|
|
31
32
|
* @param {number} target_rate
|
|
32
33
|
*/
|
|
@@ -40,8 +41,8 @@ export class AudioResampler {
|
|
|
40
41
|
return this;
|
|
41
42
|
}
|
|
42
43
|
/**
|
|
43
|
-
* `frames` outputs from `target_start`, from `input`, whose first sample
|
|
44
|
-
*
|
|
44
|
+
* `frames` outputs from `target_start`, from `input`, whose first sample is source sample
|
|
45
|
+
* `input_start`. The source is silent outside `input`.
|
|
45
46
|
*
|
|
46
47
|
* # Errors
|
|
47
48
|
* Rejects a position that is not a whole sample index.
|
|
@@ -158,8 +159,8 @@ export class ClockStep {
|
|
|
158
159
|
if (Symbol.dispose) ClockStep.prototype[Symbol.dispose] = ClockStep.prototype.free;
|
|
159
160
|
|
|
160
161
|
/**
|
|
161
|
-
* A runtime effect compiled by
|
|
162
|
-
*
|
|
162
|
+
* A runtime effect compiled by a renderer's `compileEffect`, waiting for the same renderer's
|
|
163
|
+
* `registerCompiledEffect`.
|
|
163
164
|
*/
|
|
164
165
|
export class CompiledEffect {
|
|
165
166
|
static __wrap(ptr) {
|
|
@@ -237,9 +238,8 @@ export class LoudnessMeter {
|
|
|
237
238
|
return this;
|
|
238
239
|
}
|
|
239
240
|
/**
|
|
240
|
-
* Adds one block
|
|
241
|
-
*
|
|
242
|
-
* silence.
|
|
241
|
+
* Adds one block of planar samples, channel after channel, all of one length. NaN or
|
|
242
|
+
* infinite samples measure as silence.
|
|
243
243
|
*
|
|
244
244
|
* # Errors
|
|
245
245
|
* Rejects a block whose length is not a multiple of the channel count.
|
|
@@ -313,13 +313,12 @@ export class PlaybackClock {
|
|
|
313
313
|
return ret[0] !== 0;
|
|
314
314
|
}
|
|
315
315
|
/**
|
|
316
|
-
* A clock starting at `tick` at wall time `now_ms`, playing at `rate`
|
|
317
|
-
*
|
|
318
|
-
* `
|
|
316
|
+
* A clock starting at `tick` at wall time `now_ms`, playing at `rate` under `policy`
|
|
317
|
+
* (`drop_video_keep_audio`, `preserve_every_video_frame`, `silent_scrub`, or
|
|
318
|
+
* `offline_exact`).
|
|
319
319
|
*
|
|
320
320
|
* # Errors
|
|
321
|
-
* Rejects an unknown policy, an invalid frame rate, or a rate or tick
|
|
322
|
-
* that is not finite.
|
|
321
|
+
* Rejects an unknown policy, an invalid frame rate, or a non-finite rate or tick.
|
|
323
322
|
* @param {string} policy
|
|
324
323
|
* @param {number} frame_rate_num
|
|
325
324
|
* @param {number} frame_rate_den
|
|
@@ -339,10 +338,9 @@ export class PlaybackClock {
|
|
|
339
338
|
return this;
|
|
340
339
|
}
|
|
341
340
|
/**
|
|
342
|
-
* The time to show at wall time `now_ms`. `heard` is the audio output's
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
* the clock last asked for has been shown.
|
|
341
|
+
* The time to show at wall time `now_ms`. `heard` is the audio output's position in ticks
|
|
342
|
+
* while it runs, else `undefined` (positions before the clock's start clamp to it);
|
|
343
|
+
* `presented` says whether the frame last asked for has been shown.
|
|
346
344
|
*
|
|
347
345
|
* # Errors
|
|
348
346
|
* Rejects a `heard` that is not an integer tick.
|
|
@@ -398,8 +396,17 @@ export class RasterizedText {
|
|
|
398
396
|
}
|
|
399
397
|
}
|
|
400
398
|
/**
|
|
401
|
-
* Copies out the
|
|
402
|
-
*
|
|
399
|
+
* Copies out the background boxes split off by `splitBackground`, packed like the
|
|
400
|
+
* pixels. Empty when not split, or after `takePixels`.
|
|
401
|
+
* @returns {Uint8Array}
|
|
402
|
+
*/
|
|
403
|
+
takeBackground() {
|
|
404
|
+
const ret = wasm.rasterizedtext_takeBackground(this.__wbg_ptr);
|
|
405
|
+
return ret;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Copies out the pixels as tightly packed premultiplied RGBA8 rows and releases them and
|
|
409
|
+
* the background; a second call returns an empty array.
|
|
403
410
|
* @returns {Uint8Array}
|
|
404
411
|
*/
|
|
405
412
|
takePixels() {
|
|
@@ -410,10 +417,8 @@ export class RasterizedText {
|
|
|
410
417
|
if (Symbol.dispose) RasterizedText.prototype[Symbol.dispose] = RasterizedText.prototype.free;
|
|
411
418
|
|
|
412
419
|
/**
|
|
413
|
-
* Measures text generators
|
|
414
|
-
*
|
|
415
|
-
* a renderer draws with, in the same order, it answers for that
|
|
416
|
-
* renderer's frames.
|
|
420
|
+
* Measures where text generators draw on the canvas, without a GPU. Given the same fonts in
|
|
421
|
+
* the same order as a renderer, it answers for that renderer's frames.
|
|
417
422
|
*/
|
|
418
423
|
export class WasmTextMeasurer {
|
|
419
424
|
__destroy_into_raw() {
|
|
@@ -427,12 +432,11 @@ export class WasmTextMeasurer {
|
|
|
427
432
|
wasm.__wbg_wasmtextmeasurer_free(ptr, 0);
|
|
428
433
|
}
|
|
429
434
|
/**
|
|
430
|
-
* Appends every face of an OpenType font file to the fallback
|
|
431
|
-
* in
|
|
432
|
-
* checked before any is added.
|
|
435
|
+
* Appends every face of an OpenType font file (each weight of a `.ttc`) to the fallback
|
|
436
|
+
* stack in file order, all checked before any is added.
|
|
433
437
|
*
|
|
434
438
|
* # Errors
|
|
435
|
-
* Rejects malformed font bytes
|
|
439
|
+
* Rejects malformed font bytes; no face is added.
|
|
436
440
|
* @param {string} family
|
|
437
441
|
* @param {Uint8Array} bytes
|
|
438
442
|
*/
|
|
@@ -472,24 +476,20 @@ export class WasmTextMeasurer {
|
|
|
472
476
|
wasm.wasmtextmeasurer_clearFonts(this.__wbg_ptr);
|
|
473
477
|
}
|
|
474
478
|
/**
|
|
475
|
-
* Where each node of the layout generator `generator_json`
|
|
476
|
-
*
|
|
477
|
-
* `
|
|
478
|
-
*
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
*
|
|
482
|
-
*
|
|
483
|
-
*
|
|
484
|
-
*
|
|
485
|
-
* the picture is drawn at. The layout's `"<n>px"` lengths are pixels
|
|
486
|
-
* of the project canvas, `canvasWidth` by `canvasHeight`: the
|
|
487
|
-
* picture's size when they are omitted.
|
|
479
|
+
* Where each node of the layout generator `generator_json` (`{ "type": "layout",
|
|
480
|
+
* "root" }`) lies on a `width` by `height` picture at `time` (ticks), as JSON
|
|
481
|
+
* `{ nodes }`.
|
|
482
|
+
*
|
|
483
|
+
* Nodes are in preorder as `{ at, border, content, overflow, lineCount, baselines }`,
|
|
484
|
+
* boxes `{ left, top, right, bottom }` in picture fractions before the clip's transform
|
|
485
|
+
* and node visuals. `lineCount` is `null` for a node without text, and `baselines`
|
|
486
|
+
* (`{ first, last }`, fractions of picture height) also for empty text. `"<n>px"`
|
|
487
|
+
* lengths are project canvas pixels (`canvasWidth` by `canvasHeight`, defaulting to the
|
|
488
|
+
* picture size).
|
|
488
489
|
*
|
|
489
490
|
* # Errors
|
|
490
|
-
* Rejects
|
|
491
|
-
*
|
|
492
|
-
* measurer without fonts for a layout with text.
|
|
491
|
+
* Rejects an invalid layout generator, an empty picture or canvas, a time that is not
|
|
492
|
+
* whole ticks, and a measurer without fonts for a layout with text.
|
|
493
493
|
* @param {string} generator_json
|
|
494
494
|
* @param {number} width
|
|
495
495
|
* @param {number} height
|
|
@@ -519,20 +519,17 @@ export class WasmTextMeasurer {
|
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
521
|
/**
|
|
522
|
-
* Where the text generator `generator_json` (`{ "type": "text",
|
|
523
|
-
*
|
|
524
|
-
*
|
|
525
|
-
*
|
|
526
|
-
*
|
|
527
|
-
*
|
|
528
|
-
*
|
|
529
|
-
*
|
|
530
|
-
* canvas height. Measure at the project's canvas size: text laid out
|
|
531
|
-
* at another size can break its lines elsewhere.
|
|
522
|
+
* Where the text generator `generator_json` (`{ "type": "text", "text", "style" }`)
|
|
523
|
+
* lies on a `width` by `height` canvas, as JSON `{ layout, content, ink, lineCount,
|
|
524
|
+
* baselines }`.
|
|
525
|
+
*
|
|
526
|
+
* Rectangles are `{ left, top, right, bottom }` in canvas fractions, before the clip's
|
|
527
|
+
* transform; `ink` is `null` when nothing draws. `baselines` is `{ first, last }`, the
|
|
528
|
+
* first and last alphabetic baselines as fractions of canvas height. Measure at the
|
|
529
|
+
* project canvas size, since another size can break lines elsewhere.
|
|
532
530
|
*
|
|
533
531
|
* # Errors
|
|
534
|
-
* Rejects
|
|
535
|
-
* a measurer without fonts.
|
|
532
|
+
* Rejects an invalid text generator, an empty canvas, and a measurer without fonts.
|
|
536
533
|
* @param {string} generator_json
|
|
537
534
|
* @param {number} width
|
|
538
535
|
* @param {number} height
|
|
@@ -585,12 +582,11 @@ export class WasmTextRasterizer {
|
|
|
585
582
|
wasm.__wbg_wasmtextrasterizer_free(ptr, 0);
|
|
586
583
|
}
|
|
587
584
|
/**
|
|
588
|
-
* Appends every face of an OpenType font file to the fallback
|
|
589
|
-
* in
|
|
590
|
-
* checked before any is added.
|
|
585
|
+
* Appends every face of an OpenType font file (each weight of a `.ttc`) to the fallback
|
|
586
|
+
* stack in file order, all checked before any is added.
|
|
591
587
|
*
|
|
592
588
|
* # Errors
|
|
593
|
-
* Rejects malformed font bytes
|
|
589
|
+
* Rejects malformed font bytes; no face is added.
|
|
594
590
|
* @param {string} family
|
|
595
591
|
* @param {Uint8Array} bytes
|
|
596
592
|
*/
|
|
@@ -654,14 +650,12 @@ export class WasmTextRasterizer {
|
|
|
654
650
|
return this;
|
|
655
651
|
}
|
|
656
652
|
/**
|
|
657
|
-
* Shapes, lays out, and rasterizes one request, or returns the cached
|
|
658
|
-
*
|
|
659
|
-
*
|
|
660
|
-
* least recently used past it.
|
|
653
|
+
* Shapes, lays out, and rasterizes one request, or returns the cached result for its
|
|
654
|
+
* content version. The cache keeps `alpha2_text::DEFAULT_TEXT_CACHE_BYTES` of results,
|
|
655
|
+
* least recently used first out.
|
|
661
656
|
*
|
|
662
657
|
* # Errors
|
|
663
|
-
* Rejects a malformed or out-of-range request, or a rasterizer
|
|
664
|
-
* without fonts.
|
|
658
|
+
* Rejects a malformed or out-of-range request, or a rasterizer without fonts.
|
|
665
659
|
* @param {string} request_json
|
|
666
660
|
* @param {bigint} content_version
|
|
667
661
|
* @returns {RasterizedText}
|
|
@@ -679,8 +673,7 @@ export class WasmTextRasterizer {
|
|
|
679
673
|
if (Symbol.dispose) WasmTextRasterizer.prototype[Symbol.dispose] = WasmTextRasterizer.prototype.free;
|
|
680
674
|
|
|
681
675
|
/**
|
|
682
|
-
* Builds a multi-resolution waveform summary from planar samples streamed in
|
|
683
|
-
* blocks.
|
|
676
|
+
* Builds a multi-resolution waveform summary from planar samples streamed in blocks.
|
|
684
677
|
*/
|
|
685
678
|
export class WaveformBuilder {
|
|
686
679
|
__destroy_into_raw() {
|
|
@@ -708,8 +701,8 @@ export class WaveformBuilder {
|
|
|
708
701
|
return WaveformResult.__wrap(ret[0]);
|
|
709
702
|
}
|
|
710
703
|
/**
|
|
711
|
-
* A builder for `channels` channels, `bucket_samples` samples per finest
|
|
712
|
-
*
|
|
704
|
+
* A builder for `channels` channels, `bucket_samples` samples per finest bucket, and
|
|
705
|
+
* `levels` zoom levels, each four times coarser.
|
|
713
706
|
*
|
|
714
707
|
* # Errors
|
|
715
708
|
* Rejects zero channels, a zero bucket, or 0 or more than 16 levels.
|
|
@@ -727,12 +720,11 @@ export class WaveformBuilder {
|
|
|
727
720
|
return this;
|
|
728
721
|
}
|
|
729
722
|
/**
|
|
730
|
-
* Adds one block
|
|
731
|
-
* channel, all of one length.
|
|
723
|
+
* Adds one block of planar samples, channel after channel, all of one length.
|
|
732
724
|
*
|
|
733
725
|
* # Errors
|
|
734
|
-
* Rejects a block whose length is not a multiple of the channel count,
|
|
735
|
-
*
|
|
726
|
+
* Rejects a block whose length is not a multiple of the channel count, or a finished
|
|
727
|
+
* builder.
|
|
736
728
|
* @param {Float32Array} planar
|
|
737
729
|
*/
|
|
738
730
|
push(planar) {
|
|
@@ -776,8 +768,8 @@ export class WaveformResult {
|
|
|
776
768
|
return ret >>> 0;
|
|
777
769
|
}
|
|
778
770
|
/**
|
|
779
|
-
* One channel's buckets at `level` as `[min, max, rms]` triples; empty
|
|
780
|
-
*
|
|
771
|
+
* One channel's buckets at `level` as `[min, max, rms]` triples; empty past the last level
|
|
772
|
+
* or channel.
|
|
781
773
|
* @param {number} level
|
|
782
774
|
* @param {number} channel
|
|
783
775
|
* @returns {Float32Array}
|
|
@@ -810,9 +802,9 @@ if (Symbol.dispose) WaveformResult.prototype[Symbol.dispose] = WaveformResult.pr
|
|
|
810
802
|
/**
|
|
811
803
|
* The browser renderer that draws on the CPU, for a page with no GPU.
|
|
812
804
|
*
|
|
813
|
-
* It answers the calls `WebEffectRegistry`
|
|
814
|
-
*
|
|
815
|
-
*
|
|
805
|
+
* It answers the same preview, export, text and audio calls as `WebEffectRegistry` and draws
|
|
806
|
+
* byte-identical pictures to the native CPU renderer. Runtime effects register, and a project
|
|
807
|
+
* that draws one is refused, as the native host does on its CPU renderer.
|
|
816
808
|
*/
|
|
817
809
|
export class WebCpuRenderer {
|
|
818
810
|
static __wrap(ptr) {
|
|
@@ -832,12 +824,11 @@ export class WebCpuRenderer {
|
|
|
832
824
|
wasm.__wbg_webcpurenderer_free(ptr, 0);
|
|
833
825
|
}
|
|
834
826
|
/**
|
|
835
|
-
* Appends every face of an OpenType font file to the fallback
|
|
836
|
-
*
|
|
837
|
-
* before any is added, as the export host registers a file.
|
|
827
|
+
* Appends every face of an OpenType font file (each weight of a `.ttc`) to the fallback
|
|
828
|
+
* stack in file order, all checked before any is added.
|
|
838
829
|
*
|
|
839
830
|
* # Errors
|
|
840
|
-
* Returns an error for malformed font bytes
|
|
831
|
+
* Returns an error for malformed font bytes; no face is added.
|
|
841
832
|
* @param {string} family
|
|
842
833
|
* @param {Uint8Array} bytes
|
|
843
834
|
*/
|
|
@@ -874,8 +865,8 @@ export class WebCpuRenderer {
|
|
|
874
865
|
* `WebEffectRegistry.aliasVideoFrame`.
|
|
875
866
|
*
|
|
876
867
|
* # Errors
|
|
877
|
-
* Refuses an alias that would
|
|
878
|
-
*
|
|
868
|
+
* Refuses an alias that would push the export frame's sources over the uploaded-frame
|
|
869
|
+
* budget.
|
|
879
870
|
* @param {string} source_id
|
|
880
871
|
* @param {bigint} existing_media_time_ticks
|
|
881
872
|
* @param {bigint} requested_media_time_ticks
|
|
@@ -980,15 +971,16 @@ export class WebCpuRenderer {
|
|
|
980
971
|
* # Errors
|
|
981
972
|
* Returns an error if the windows cannot be serialized.
|
|
982
973
|
* @param {string} source_id
|
|
974
|
+
* @param {number | null} [stream]
|
|
983
975
|
* @returns {string}
|
|
984
976
|
*/
|
|
985
|
-
audioRetainedWindows(source_id) {
|
|
977
|
+
audioRetainedWindows(source_id, stream) {
|
|
986
978
|
let deferred3_0;
|
|
987
979
|
let deferred3_1;
|
|
988
980
|
try {
|
|
989
981
|
const ptr0 = passStringToWasm0(source_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
990
982
|
const len0 = WASM_VECTOR_LEN;
|
|
991
|
-
const ret = wasm.webcpurenderer_audioRetainedWindows(this.__wbg_ptr, ptr0, len0);
|
|
983
|
+
const ret = wasm.webcpurenderer_audioRetainedWindows(this.__wbg_ptr, ptr0, len0, isLikeNone(stream) ? Number.MAX_SAFE_INTEGER : (stream) >>> 0);
|
|
992
984
|
var ptr2 = ret[0];
|
|
993
985
|
var len2 = ret[1];
|
|
994
986
|
if (ret[3]) {
|
|
@@ -1011,29 +1003,30 @@ export class WebCpuRenderer {
|
|
|
1011
1003
|
return ret >>> 0;
|
|
1012
1004
|
}
|
|
1013
1005
|
/**
|
|
1014
|
-
* `WebEffectRegistry.beginExportAt`: one exact timeline timestamp at
|
|
1015
|
-
*
|
|
1006
|
+
* `WebEffectRegistry.beginExportAt`: one exact timeline timestamp at export quality, with
|
|
1007
|
+
* `readback` already settled.
|
|
1016
1008
|
*
|
|
1017
1009
|
* # Errors
|
|
1018
|
-
* Returns an error without a loaded project, for an unknown codec or an
|
|
1019
|
-
*
|
|
1020
|
-
* or when the frame cannot be drawn.
|
|
1010
|
+
* Returns an error without a loaded project, for an unknown codec or odd size, an effect
|
|
1011
|
+
* that does not draw on the CPU (`EFFECT_ERROR`), or when the frame cannot be drawn.
|
|
1021
1012
|
* @param {bigint} time_ticks
|
|
1022
1013
|
* @param {string} codec
|
|
1014
|
+
* @param {string | null} [pixels]
|
|
1023
1015
|
* @returns {any}
|
|
1024
1016
|
*/
|
|
1025
|
-
beginExportAt(time_ticks, codec) {
|
|
1017
|
+
beginExportAt(time_ticks, codec, pixels) {
|
|
1026
1018
|
const ptr0 = passStringToWasm0(codec, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1027
1019
|
const len0 = WASM_VECTOR_LEN;
|
|
1028
|
-
|
|
1020
|
+
var ptr1 = isLikeNone(pixels) ? 0 : passStringToWasm0(pixels, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1021
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1022
|
+
const ret = wasm.webcpurenderer_beginExportAt(this.__wbg_ptr, time_ticks, ptr0, len0, ptr1, len1);
|
|
1029
1023
|
if (ret[2]) {
|
|
1030
1024
|
throw takeFromExternrefTable0(ret[1]);
|
|
1031
1025
|
}
|
|
1032
1026
|
return takeFromExternrefTable0(ret[0]);
|
|
1033
1027
|
}
|
|
1034
1028
|
/**
|
|
1035
|
-
* `WebEffectRegistry.beginExportFrame
|
|
1036
|
-
* settled.
|
|
1029
|
+
* `WebEffectRegistry.beginExportFrame`, with `readback` already settled.
|
|
1037
1030
|
*
|
|
1038
1031
|
* # Errors
|
|
1039
1032
|
* As [`Self::export_frame`].
|
|
@@ -1050,8 +1043,8 @@ export class WebCpuRenderer {
|
|
|
1050
1043
|
* `WebEffectRegistry.beginExport`, drawing on the CPU.
|
|
1051
1044
|
*
|
|
1052
1045
|
* # Errors
|
|
1053
|
-
* Returns an error without a loaded project, for an empty range, an
|
|
1054
|
-
*
|
|
1046
|
+
* Returns an error without a loaded project, for an empty range, an invalid frame rate, or
|
|
1047
|
+
* an unknown codec.
|
|
1055
1048
|
* @param {bigint} start_ticks
|
|
1056
1049
|
* @param {bigint} end_ticks
|
|
1057
1050
|
* @param {number} rate_num
|
|
@@ -1067,8 +1060,7 @@ export class WebCpuRenderer {
|
|
|
1067
1060
|
}
|
|
1068
1061
|
}
|
|
1069
1062
|
/**
|
|
1070
|
-
* The engine's effect and transition authoring catalog
|
|
1071
|
-
* draws on the CPU.
|
|
1063
|
+
* The engine's effect and transition authoring catalog; every built-in draws on the CPU.
|
|
1072
1064
|
* @returns {string}
|
|
1073
1065
|
*/
|
|
1074
1066
|
builtinCatalog() {
|
|
@@ -1084,10 +1076,8 @@ export class WebCpuRenderer {
|
|
|
1084
1076
|
}
|
|
1085
1077
|
}
|
|
1086
1078
|
/**
|
|
1087
|
-
*
|
|
1088
|
-
*
|
|
1089
|
-
* `features` says `renderer.cpu` is available, `renderer.gpu` is not,
|
|
1090
|
-
* and runtime effects (`effects.runtime`) do not run.
|
|
1079
|
+
* The shared capability report JSON with runtime `browser`: backend `cpu`,
|
|
1080
|
+
* `renderer.cpu` available, `renderer.gpu` and `effects.runtime` not.
|
|
1091
1081
|
*
|
|
1092
1082
|
* # Errors
|
|
1093
1083
|
* Returns an error if the report cannot be serialized.
|
|
@@ -1124,7 +1114,7 @@ export class WebCpuRenderer {
|
|
|
1124
1114
|
wasm.webcpurenderer_clearEffectResources(this.__wbg_ptr);
|
|
1125
1115
|
}
|
|
1126
1116
|
/**
|
|
1127
|
-
*
|
|
1117
|
+
* Removes every recorded runtime effect.
|
|
1128
1118
|
*/
|
|
1129
1119
|
clearEffects() {
|
|
1130
1120
|
wasm.webcpurenderer_clearEffects(this.__wbg_ptr);
|
|
@@ -1142,10 +1132,12 @@ export class WebCpuRenderer {
|
|
|
1142
1132
|
wasm.webcpurenderer_clearFrames(this.__wbg_ptr);
|
|
1143
1133
|
}
|
|
1144
1134
|
/**
|
|
1145
|
-
*
|
|
1135
|
+
* Validates one JSON effect definition and resolves to an entry for
|
|
1136
|
+
* [`Self::register_compiled_effect`]. No shader is compiled, since this renderer cannot draw
|
|
1137
|
+
* runtime effects; a project that draws one is refused when it renders or exports.
|
|
1146
1138
|
*
|
|
1147
1139
|
* # Errors
|
|
1148
|
-
*
|
|
1140
|
+
* Throws `EFFECT_ERROR` for a definition the engine refuses.
|
|
1149
1141
|
* @param {string} json
|
|
1150
1142
|
* @returns {Promise<any>}
|
|
1151
1143
|
*/
|
|
@@ -1167,8 +1159,8 @@ export class WebCpuRenderer {
|
|
|
1167
1159
|
return ret !== 0;
|
|
1168
1160
|
}
|
|
1169
1161
|
/**
|
|
1170
|
-
* A JSON snapshot for developer tooling: what the CPU renderer drew,
|
|
1171
|
-
*
|
|
1162
|
+
* A JSON snapshot for developer tooling: what the CPU renderer drew, its result cache, and
|
|
1163
|
+
* the frames it holds.
|
|
1172
1164
|
*
|
|
1173
1165
|
* # Errors
|
|
1174
1166
|
* Returns an error if the snapshot cannot be serialized.
|
|
@@ -1199,12 +1191,11 @@ export class WebCpuRenderer {
|
|
|
1199
1191
|
wasm.webcpurenderer_endExport(this.__wbg_ptr);
|
|
1200
1192
|
}
|
|
1201
1193
|
/**
|
|
1202
|
-
* `WebEffectRegistry.exportFrame`: the next export frame, drawn
|
|
1203
|
-
* CPU before the call returns.
|
|
1194
|
+
* `WebEffectRegistry.exportFrame`: the next export frame, drawn before the call returns.
|
|
1204
1195
|
*
|
|
1205
1196
|
* # Errors
|
|
1206
|
-
* Returns an error without a running export or
|
|
1207
|
-
*
|
|
1197
|
+
* Returns an error without a running export or loaded project, or when the frame cannot
|
|
1198
|
+
* be drawn.
|
|
1208
1199
|
* @returns {Promise<any>}
|
|
1209
1200
|
*/
|
|
1210
1201
|
exportFrame() {
|
|
@@ -1289,8 +1280,8 @@ export class WebCpuRenderer {
|
|
|
1289
1280
|
return ret !== 0;
|
|
1290
1281
|
}
|
|
1291
1282
|
/**
|
|
1292
|
-
* Loads and validates a versioned project document, keeping uploads
|
|
1293
|
-
*
|
|
1283
|
+
* Loads and validates a versioned project document, keeping uploads as
|
|
1284
|
+
* `WebEffectRegistry.loadProject` does, and ends a running export.
|
|
1294
1285
|
*
|
|
1295
1286
|
* # Errors
|
|
1296
1287
|
* Rejects a document the engine refuses.
|
|
@@ -1337,10 +1328,21 @@ export class WebCpuRenderer {
|
|
|
1337
1328
|
return v1;
|
|
1338
1329
|
}
|
|
1339
1330
|
/**
|
|
1340
|
-
*
|
|
1331
|
+
* `WebEffectRegistry.projectRuntimeEffects`: the recorded runtime effects the loaded project
|
|
1332
|
+
* can draw. Any of them makes rendering and export refuse.
|
|
1333
|
+
* @returns {string[]}
|
|
1334
|
+
*/
|
|
1335
|
+
projectRuntimeEffects() {
|
|
1336
|
+
const ret = wasm.webcpurenderer_projectRuntimeEffects(this.__wbg_ptr);
|
|
1337
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]);
|
|
1338
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1339
|
+
return v1;
|
|
1340
|
+
}
|
|
1341
|
+
/**
|
|
1342
|
+
* Records an effect [`Self::compile_effect`] validated and returns its `id@version`.
|
|
1341
1343
|
*
|
|
1342
1344
|
* # Errors
|
|
1343
|
-
*
|
|
1345
|
+
* Throws `EFFECT_ERROR` for an effect a GPU renderer compiled or one already registered.
|
|
1344
1346
|
* @param {CompiledEffect} compiled
|
|
1345
1347
|
* @returns {string}
|
|
1346
1348
|
*/
|
|
@@ -1383,7 +1385,7 @@ export class WebCpuRenderer {
|
|
|
1383
1385
|
}
|
|
1384
1386
|
}
|
|
1385
1387
|
/**
|
|
1386
|
-
* Drops one source's retained audio.
|
|
1388
|
+
* Drops one source's retained audio, every stream of it.
|
|
1387
1389
|
* @param {string} source_id
|
|
1388
1390
|
* @returns {boolean}
|
|
1389
1391
|
*/
|
|
@@ -1434,10 +1436,9 @@ export class WebCpuRenderer {
|
|
|
1434
1436
|
return ret !== 0;
|
|
1435
1437
|
}
|
|
1436
1438
|
/**
|
|
1437
|
-
* Draws one project frame at
|
|
1438
|
-
*
|
|
1439
|
-
* `
|
|
1440
|
-
* is neither drawn nor put (`unchanged`).
|
|
1439
|
+
* Draws one project frame at preview quality onto the canvas's 2D context, scaled to fit,
|
|
1440
|
+
* and returns the JSON `WebEffectRegistry.renderAt` returns. A frame equal to the one
|
|
1441
|
+
* shown is skipped (`unchanged`).
|
|
1441
1442
|
*
|
|
1442
1443
|
* # Errors
|
|
1443
1444
|
* Fails without a project, or when the frame cannot be drawn.
|
|
@@ -1510,8 +1511,8 @@ export class WebCpuRenderer {
|
|
|
1510
1511
|
wasm.webcpurenderer_resetPlayer(this.__wbg_ptr);
|
|
1511
1512
|
}
|
|
1512
1513
|
/**
|
|
1513
|
-
* Sizes the canvas to `width` by `height`, which preview frames are
|
|
1514
|
-
*
|
|
1514
|
+
* Sizes the canvas to `width` by `height`, which preview frames are scaled to fill, and
|
|
1515
|
+
* drops the held frame.
|
|
1515
1516
|
*
|
|
1516
1517
|
* # Errors
|
|
1517
1518
|
* Fails without a canvas, or for a zero or oversized dimension.
|
|
@@ -1581,8 +1582,7 @@ export class WebCpuRenderer {
|
|
|
1581
1582
|
wasm.webcpurenderer_setPassTiming(this.__wbg_ptr, _enabled);
|
|
1582
1583
|
}
|
|
1583
1584
|
/**
|
|
1584
|
-
* Renders preview frames at `scale` times the project
|
|
1585
|
-
* on (0.5 until set).
|
|
1585
|
+
* Renders preview frames at `scale` times the project size from now on (default 0.5).
|
|
1586
1586
|
*
|
|
1587
1587
|
* # Errors
|
|
1588
1588
|
* Rejects a scale that is not finite, above 0 and at most 8.
|
|
@@ -1595,8 +1595,8 @@ export class WebCpuRenderer {
|
|
|
1595
1595
|
}
|
|
1596
1596
|
}
|
|
1597
1597
|
/**
|
|
1598
|
-
* Lets drawn results
|
|
1599
|
-
*
|
|
1598
|
+
* Lets drawn results use up to `bytes` of wasm memory for reuse when a frame repeats; zero
|
|
1599
|
+
* (the default) disables it.
|
|
1600
1600
|
*
|
|
1601
1601
|
* # Errors
|
|
1602
1602
|
* Rejects a negative or non-finite budget.
|
|
@@ -1609,8 +1609,7 @@ export class WebCpuRenderer {
|
|
|
1609
1609
|
}
|
|
1610
1610
|
}
|
|
1611
1611
|
/**
|
|
1612
|
-
* Sets the byte budget
|
|
1613
|
-
* memory), as `WebEffectRegistry.setUploadedFrameBudget` does.
|
|
1612
|
+
* Sets the uploaded-frame byte budget (default 256 MiB of wasm memory).
|
|
1614
1613
|
*
|
|
1615
1614
|
* # Errors
|
|
1616
1615
|
* Rejects a negative or non-finite budget.
|
|
@@ -1639,8 +1638,7 @@ export class WebCpuRenderer {
|
|
|
1639
1638
|
return v2;
|
|
1640
1639
|
}
|
|
1641
1640
|
/**
|
|
1642
|
-
*
|
|
1643
|
-
* its call returns.
|
|
1641
|
+
* Resolves at once, since CPU work is done when its call returns.
|
|
1644
1642
|
* @returns {Promise<any>}
|
|
1645
1643
|
*/
|
|
1646
1644
|
submittedWorkDone() {
|
|
@@ -1648,8 +1646,8 @@ export class WebCpuRenderer {
|
|
|
1648
1646
|
return ret;
|
|
1649
1647
|
}
|
|
1650
1648
|
/**
|
|
1651
|
-
* `true`: decoded `VideoFrame`s are taken
|
|
1652
|
-
*
|
|
1649
|
+
* `true`: decoded `VideoFrame`s are taken as planes (`uploadYuvFrame`) or through a 2D
|
|
1650
|
+
* canvas.
|
|
1653
1651
|
* @returns {boolean}
|
|
1654
1652
|
*/
|
|
1655
1653
|
get supportsExternalVideoFrame() {
|
|
@@ -1688,15 +1686,15 @@ export class WebCpuRenderer {
|
|
|
1688
1686
|
return ret !== 0;
|
|
1689
1687
|
}
|
|
1690
1688
|
/**
|
|
1691
|
-
*
|
|
1692
|
-
* @param {string}
|
|
1693
|
-
* @param {number}
|
|
1689
|
+
* Removes one recorded runtime effect.
|
|
1690
|
+
* @param {string} id
|
|
1691
|
+
* @param {number} version
|
|
1694
1692
|
* @returns {boolean}
|
|
1695
1693
|
*/
|
|
1696
|
-
unregisterEffect(
|
|
1697
|
-
const ptr0 = passStringToWasm0(
|
|
1694
|
+
unregisterEffect(id, version) {
|
|
1695
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1698
1696
|
const len0 = WASM_VECTOR_LEN;
|
|
1699
|
-
const ret = wasm.webcpurenderer_unregisterEffect(this.__wbg_ptr, ptr0, len0,
|
|
1697
|
+
const ret = wasm.webcpurenderer_unregisterEffect(this.__wbg_ptr, ptr0, len0, version);
|
|
1700
1698
|
return ret !== 0;
|
|
1701
1699
|
}
|
|
1702
1700
|
/**
|
|
@@ -1710,18 +1708,19 @@ export class WebCpuRenderer {
|
|
|
1710
1708
|
* @param {any} layout
|
|
1711
1709
|
* @param {Float32Array} samples
|
|
1712
1710
|
* @param {boolean | null} [ends_source]
|
|
1711
|
+
* @param {number | null} [stream]
|
|
1713
1712
|
*/
|
|
1714
|
-
uploadAudioBlock(source_id, start_sample, sample_rate, layout, samples, ends_source) {
|
|
1713
|
+
uploadAudioBlock(source_id, start_sample, sample_rate, layout, samples, ends_source, stream) {
|
|
1715
1714
|
const ptr0 = passStringToWasm0(source_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1716
1715
|
const len0 = WASM_VECTOR_LEN;
|
|
1717
|
-
const ret = wasm.webcpurenderer_uploadAudioBlock(this.__wbg_ptr, ptr0, len0, start_sample, sample_rate, layout, samples, isLikeNone(ends_source) ? 0xFFFFFF : ends_source ? 1 : 0);
|
|
1716
|
+
const ret = wasm.webcpurenderer_uploadAudioBlock(this.__wbg_ptr, ptr0, len0, start_sample, sample_rate, layout, samples, isLikeNone(ends_source) ? 0xFFFFFF : ends_source ? 1 : 0, isLikeNone(stream) ? Number.MAX_SAFE_INTEGER : (stream) >>> 0);
|
|
1718
1717
|
if (ret[1]) {
|
|
1719
1718
|
throw takeFromExternrefTable0(ret[0]);
|
|
1720
1719
|
}
|
|
1721
1720
|
}
|
|
1722
1721
|
/**
|
|
1723
|
-
* [`Self::upload_presented_video_frame`] for a bitmap made with
|
|
1724
|
-
*
|
|
1722
|
+
* [`Self::upload_presented_video_frame`] for a bitmap made with `premultiplyAlpha: "none"`.
|
|
1723
|
+
* Always closes `bitmap`.
|
|
1725
1724
|
*
|
|
1726
1725
|
* # Errors
|
|
1727
1726
|
* As [`Self::upload_presented_video_frame`].
|
|
@@ -1844,13 +1843,11 @@ export class WebCpuRenderer {
|
|
|
1844
1843
|
return takeFromExternrefTable0(ret[0]);
|
|
1845
1844
|
}
|
|
1846
1845
|
/**
|
|
1847
|
-
* `WebEffectRegistry.uploadPresentedVideoFrame
|
|
1848
|
-
*
|
|
1849
|
-
* `frame`; an HDR source's frame is refused (`uploadYuvFrame` takes it).
|
|
1846
|
+
* `WebEffectRegistry.uploadPresentedVideoFrame`: the frame read through a 2D canvas (the
|
|
1847
|
+
* browser's conversion). Always closes `frame`. HDR sources must use `uploadYuvFrame`.
|
|
1850
1848
|
*
|
|
1851
1849
|
* # Errors
|
|
1852
|
-
* Rejects an HDR source's frame, a bad placement, and a frame the
|
|
1853
|
-
* browser cannot read.
|
|
1850
|
+
* Rejects an HDR source's frame, a bad placement, and a frame the browser cannot read.
|
|
1854
1851
|
* @param {string} source_id
|
|
1855
1852
|
* @param {bigint} media_time_ticks
|
|
1856
1853
|
* @param {VideoFrame} frame
|
|
@@ -1870,8 +1867,7 @@ export class WebCpuRenderer {
|
|
|
1870
1867
|
return takeFromExternrefTable0(ret[0]);
|
|
1871
1868
|
}
|
|
1872
1869
|
/**
|
|
1873
|
-
* `WebEffectRegistry.uploadRgbaFrame`: premultiplied RGBA8 kept at its
|
|
1874
|
-
* own size.
|
|
1870
|
+
* `WebEffectRegistry.uploadRgbaFrame`: premultiplied RGBA8 kept at its own size.
|
|
1875
1871
|
*
|
|
1876
1872
|
* # Errors
|
|
1877
1873
|
* Rejects pixels that do not hold the size.
|
|
@@ -1894,8 +1890,7 @@ export class WebCpuRenderer {
|
|
|
1894
1890
|
return takeFromExternrefTable0(ret[0]);
|
|
1895
1891
|
}
|
|
1896
1892
|
/**
|
|
1897
|
-
* `WebEffectRegistry.uploadRgbaImage`: a
|
|
1898
|
-
* at its own size.
|
|
1893
|
+
* `WebEffectRegistry.uploadRgbaImage`: a premultiplied RGBA8 still kept at its own size.
|
|
1899
1894
|
*
|
|
1900
1895
|
* # Errors
|
|
1901
1896
|
* Rejects pixels that do not hold the size.
|
|
@@ -1917,8 +1912,8 @@ export class WebCpuRenderer {
|
|
|
1917
1912
|
return takeFromExternrefTable0(ret[0]);
|
|
1918
1913
|
}
|
|
1919
1914
|
/**
|
|
1920
|
-
* `WebEffectRegistry.uploadVideoFrame`: the frame read through a 2D
|
|
1921
|
-
*
|
|
1915
|
+
* `WebEffectRegistry.uploadVideoFrame`: the frame read through a 2D canvas and fitted to
|
|
1916
|
+
* the loaded project. Always closes `frame`.
|
|
1922
1917
|
*
|
|
1923
1918
|
* # Errors
|
|
1924
1919
|
* Rejects an HDR source's frame and a frame the browser cannot read.
|
|
@@ -1937,14 +1932,13 @@ export class WebCpuRenderer {
|
|
|
1937
1932
|
return takeFromExternrefTable0(ret[0]);
|
|
1938
1933
|
}
|
|
1939
1934
|
/**
|
|
1940
|
-
* `WebEffectRegistry.uploadYuvFrame`: a decoded frame's planes
|
|
1941
|
-
*
|
|
1942
|
-
* the project's color pipeline when a frame first draws them.
|
|
1935
|
+
* `WebEffectRegistry.uploadYuvFrame`: a decoded frame's planes as `VideoFrame.copyTo`
|
|
1936
|
+
* writes them, converted under the project's color pipeline when first drawn.
|
|
1943
1937
|
*
|
|
1944
1938
|
* # Errors
|
|
1945
|
-
* Rejects (`INVALID_INPUT`) an unknown format or chroma siting, a layout
|
|
1946
|
-
*
|
|
1947
|
-
*
|
|
1939
|
+
* Rejects (`INVALID_INPUT`) an unknown format or chroma siting, a layout or plane that does
|
|
1940
|
+
* not fit the data, a bad size or rotation, and an HDR frame the project's color pipeline
|
|
1941
|
+
* refuses.
|
|
1948
1942
|
* @param {string} source_id
|
|
1949
1943
|
* @param {bigint} media_time_ticks
|
|
1950
1944
|
* @param {string} format
|
|
@@ -2001,8 +1995,7 @@ export class WebCpuRenderer {
|
|
|
2001
1995
|
return ret >>> 0;
|
|
2002
1996
|
}
|
|
2003
1997
|
/**
|
|
2004
|
-
* `"canvas"`:
|
|
2005
|
-
* canvas.
|
|
1998
|
+
* `"canvas"`: `VideoFrame`s are read through a 2D canvas.
|
|
2006
1999
|
* @returns {string}
|
|
2007
2000
|
*/
|
|
2008
2001
|
get videoFrameCopy() {
|
|
@@ -2021,7 +2014,7 @@ export class WebCpuRenderer {
|
|
|
2021
2014
|
if (Symbol.dispose) WebCpuRenderer.prototype[Symbol.dispose] = WebCpuRenderer.prototype.free;
|
|
2022
2015
|
|
|
2023
2016
|
/**
|
|
2024
|
-
* WebGPU
|
|
2017
|
+
* The browser GPU renderer (WebGPU or WebGL2), with its runtime effect registry.
|
|
2025
2018
|
*/
|
|
2026
2019
|
export class WebEffectRegistry {
|
|
2027
2020
|
static __wrap(ptr) {
|
|
@@ -2041,12 +2034,28 @@ export class WebEffectRegistry {
|
|
|
2041
2034
|
wasm.__wbg_webeffectregistry_free(ptr, 0);
|
|
2042
2035
|
}
|
|
2043
2036
|
/**
|
|
2044
|
-
*
|
|
2045
|
-
*
|
|
2046
|
-
*
|
|
2037
|
+
* The adapter as the browser names it: wgpu's name (the unmasked WebGL renderer or a
|
|
2038
|
+
* WebGPU adapter's description), else `<vendor> <architecture>`; empty when unnamed.
|
|
2039
|
+
* @returns {string}
|
|
2040
|
+
*/
|
|
2041
|
+
get adapter() {
|
|
2042
|
+
let deferred1_0;
|
|
2043
|
+
let deferred1_1;
|
|
2044
|
+
try {
|
|
2045
|
+
const ret = wasm.webeffectregistry_adapter(this.__wbg_ptr);
|
|
2046
|
+
deferred1_0 = ret[0];
|
|
2047
|
+
deferred1_1 = ret[1];
|
|
2048
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2049
|
+
} finally {
|
|
2050
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2051
|
+
}
|
|
2052
|
+
}
|
|
2053
|
+
/**
|
|
2054
|
+
* Appends every face of an OpenType font file (each weight of a `.ttc`) to the fallback
|
|
2055
|
+
* stack in file order, all checked before any is added.
|
|
2047
2056
|
*
|
|
2048
2057
|
* # Errors
|
|
2049
|
-
* Returns an error for malformed font bytes
|
|
2058
|
+
* Returns an error for malformed font bytes; no face is added.
|
|
2050
2059
|
* @param {string} family
|
|
2051
2060
|
* @param {Uint8Array} bytes
|
|
2052
2061
|
*/
|
|
@@ -2061,10 +2070,9 @@ export class WebEffectRegistry {
|
|
|
2061
2070
|
}
|
|
2062
2071
|
}
|
|
2063
2072
|
/**
|
|
2064
|
-
* Appends an OpenType font to the fallback stack
|
|
2065
|
-
*
|
|
2066
|
-
*
|
|
2067
|
-
* for pixel.
|
|
2073
|
+
* Appends an OpenType font to the fallback stack for captions, text generators and
|
|
2074
|
+
* layouts. With the same fonts as the export host, preview text matches exported text
|
|
2075
|
+
* pixel for pixel.
|
|
2068
2076
|
*
|
|
2069
2077
|
* # Errors
|
|
2070
2078
|
* Returns an error for malformed font bytes.
|
|
@@ -2083,12 +2091,12 @@ export class WebEffectRegistry {
|
|
|
2083
2091
|
}
|
|
2084
2092
|
}
|
|
2085
2093
|
/**
|
|
2086
|
-
* Aliases a new exact source-time request to an already uploaded
|
|
2087
|
-
*
|
|
2094
|
+
* Aliases a new exact source-time request to an already uploaded frame. Returns `false`
|
|
2095
|
+
* when no frame is stored at the existing time.
|
|
2088
2096
|
*
|
|
2089
2097
|
* # Errors
|
|
2090
|
-
* Refuses with `RESOURCE_LIMIT
|
|
2091
|
-
* the
|
|
2098
|
+
* Refuses with `RESOURCE_LIMIT` an alias that would push the export frame's sources over
|
|
2099
|
+
* the uploaded-frame budget.
|
|
2092
2100
|
* @param {string} source_id
|
|
2093
2101
|
* @param {bigint} existing_media_time_ticks
|
|
2094
2102
|
* @param {bigint} requested_media_time_ticks
|
|
@@ -2120,8 +2128,7 @@ export class WebEffectRegistry {
|
|
|
2120
2128
|
return ret >>> 0;
|
|
2121
2129
|
}
|
|
2122
2130
|
/**
|
|
2123
|
-
*
|
|
2124
|
-
* JSON array of source IDs.
|
|
2131
|
+
* Source IDs the most recent `renderAudio` call could not mix, as a JSON array.
|
|
2125
2132
|
* @returns {string}
|
|
2126
2133
|
*/
|
|
2127
2134
|
audioMissingSources() {
|
|
@@ -2143,12 +2150,11 @@ export class WebEffectRegistry {
|
|
|
2143
2150
|
}
|
|
2144
2151
|
}
|
|
2145
2152
|
/**
|
|
2146
|
-
* Source intervals a host must decode before mixing a sample range
|
|
2147
|
-
*
|
|
2148
|
-
*
|
|
2149
|
-
*
|
|
2150
|
-
*
|
|
2151
|
-
* Tick values are strings so JavaScript preserves the full i64 range.
|
|
2153
|
+
* Source intervals a host must decode before mixing a sample range, including
|
|
2154
|
+
* interpolation neighbours, read-ahead, delay lines, and after a seek the settling history
|
|
2155
|
+
* effect stages replay, as JSON `[{sourceId, stream?, startTicks, endTicks}]`. `stream` is
|
|
2156
|
+
* set when clips play another audio stream than the default one (`audio.stream`). Tick values
|
|
2157
|
+
* are strings to preserve the full i64 range.
|
|
2152
2158
|
* @param {bigint} start_sample
|
|
2153
2159
|
* @param {number} frames
|
|
2154
2160
|
* @returns {string}
|
|
@@ -2172,7 +2178,7 @@ export class WebEffectRegistry {
|
|
|
2172
2178
|
}
|
|
2173
2179
|
}
|
|
2174
2180
|
/**
|
|
2175
|
-
* Allocated audio sample bytes, including spare capacity
|
|
2181
|
+
* Allocated audio sample bytes, including spare capacity.
|
|
2176
2182
|
* @returns {number}
|
|
2177
2183
|
*/
|
|
2178
2184
|
audioRetainedBytes() {
|
|
@@ -2188,22 +2194,20 @@ export class WebEffectRegistry {
|
|
|
2188
2194
|
return ret >>> 0;
|
|
2189
2195
|
}
|
|
2190
2196
|
/**
|
|
2191
|
-
* Half-open project-rate sample intervals of one source's
|
|
2192
|
-
*
|
|
2193
|
-
*
|
|
2194
|
-
*
|
|
2195
|
-
* A host decodes only what these do not cover: the store may have
|
|
2196
|
-
* extended, replaced or dropped a window since the host uploaded it.
|
|
2197
|
+
* Half-open project-rate sample intervals of the windows of one source's `stream` (absent for
|
|
2198
|
+
* the default one), most recently uploaded first, as JSON `[{startSample, endSample}]`. A host decodes only what these do not
|
|
2199
|
+
* cover, since the store may have extended, replaced or dropped windows.
|
|
2197
2200
|
* @param {string} source_id
|
|
2201
|
+
* @param {number | null} [stream]
|
|
2198
2202
|
* @returns {string}
|
|
2199
2203
|
*/
|
|
2200
|
-
audioRetainedWindows(source_id) {
|
|
2204
|
+
audioRetainedWindows(source_id, stream) {
|
|
2201
2205
|
let deferred3_0;
|
|
2202
2206
|
let deferred3_1;
|
|
2203
2207
|
try {
|
|
2204
2208
|
const ptr0 = passStringToWasm0(source_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2205
2209
|
const len0 = WASM_VECTOR_LEN;
|
|
2206
|
-
const ret = wasm.webeffectregistry_audioRetainedWindows(this.__wbg_ptr, ptr0, len0);
|
|
2210
|
+
const ret = wasm.webeffectregistry_audioRetainedWindows(this.__wbg_ptr, ptr0, len0, isLikeNone(stream) ? Number.MAX_SAFE_INTEGER : (stream) >>> 0);
|
|
2207
2211
|
var ptr2 = ret[0];
|
|
2208
2212
|
var len2 = ret[1];
|
|
2209
2213
|
if (ret[3]) {
|
|
@@ -2226,28 +2230,45 @@ export class WebEffectRegistry {
|
|
|
2226
2230
|
return ret >>> 0;
|
|
2227
2231
|
}
|
|
2228
2232
|
/**
|
|
2229
|
-
*
|
|
2230
|
-
*
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2233
|
+
* The graphics API this renderer draws through: `"webgpu"` or `"webgl2"`.
|
|
2234
|
+
* @returns {string}
|
|
2235
|
+
*/
|
|
2236
|
+
get backend() {
|
|
2237
|
+
let deferred1_0;
|
|
2238
|
+
let deferred1_1;
|
|
2239
|
+
try {
|
|
2240
|
+
const ret = wasm.webeffectregistry_backend(this.__wbg_ptr);
|
|
2241
|
+
deferred1_0 = ret[0];
|
|
2242
|
+
deferred1_1 = ret[1];
|
|
2243
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2244
|
+
} finally {
|
|
2245
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
/**
|
|
2249
|
+
* Starts one exact timeline timestamp offscreen at export quality: the stateless
|
|
2250
|
+
* counterpart of [`Self::export_frame`] for a JavaScript-scheduled exporter.
|
|
2235
2251
|
*
|
|
2236
|
-
*
|
|
2237
|
-
*
|
|
2238
|
-
*
|
|
2252
|
+
* The readback promise is exposed separately so later frames can be submitted while
|
|
2253
|
+
* earlier mappings are in flight. Frames are packed for `codec` as [`Self::begin_export`]
|
|
2254
|
+
* does, in `pixels` (an `FFmpeg` pixel format: `yuva420p` keeps alpha and draws no
|
|
2255
|
+
* background, `yuv420p10le` is 10-bit; I420 when absent). Non-I420 layouts are packed into
|
|
2256
|
+
* tight planes with the `WebCodecs` `format` (`I420A`, `I420P10`).
|
|
2239
2257
|
*
|
|
2240
2258
|
* # Errors
|
|
2241
|
-
* Returns an error without a loaded project, for an unknown codec, or
|
|
2242
|
-
*
|
|
2259
|
+
* Returns an error without a loaded project, for an unknown codec or pixel format, or when
|
|
2260
|
+
* rendering or submission fails.
|
|
2243
2261
|
* @param {bigint} time_ticks
|
|
2244
2262
|
* @param {string} codec
|
|
2263
|
+
* @param {string | null} [pixels]
|
|
2245
2264
|
* @returns {any}
|
|
2246
2265
|
*/
|
|
2247
|
-
beginExportAt(time_ticks, codec) {
|
|
2266
|
+
beginExportAt(time_ticks, codec, pixels) {
|
|
2248
2267
|
const ptr0 = passStringToWasm0(codec, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2249
2268
|
const len0 = WASM_VECTOR_LEN;
|
|
2250
|
-
|
|
2269
|
+
var ptr1 = isLikeNone(pixels) ? 0 : passStringToWasm0(pixels, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2270
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2271
|
+
const ret = wasm.webeffectregistry_beginExportAt(this.__wbg_ptr, time_ticks, ptr0, len0, ptr1, len1);
|
|
2251
2272
|
if (ret[2]) {
|
|
2252
2273
|
throw takeFromExternrefTable0(ret[1]);
|
|
2253
2274
|
}
|
|
@@ -2256,10 +2277,8 @@ export class WebEffectRegistry {
|
|
|
2256
2277
|
/**
|
|
2257
2278
|
* Starts the next export render and returns before its GPU readback maps.
|
|
2258
2279
|
*
|
|
2259
|
-
* A rendered result
|
|
2260
|
-
*
|
|
2261
|
-
* readbacks to remain in flight. Waiting results still do not advance the
|
|
2262
|
-
* deterministic export cursor.
|
|
2280
|
+
* A rendered result carries a `readback` promise; calling again while it is pending keeps
|
|
2281
|
+
* two or three readbacks in flight. Waiting results do not advance the cursor.
|
|
2263
2282
|
* @returns {any}
|
|
2264
2283
|
*/
|
|
2265
2284
|
beginExportFrame() {
|
|
@@ -2270,20 +2289,17 @@ export class WebEffectRegistry {
|
|
|
2270
2289
|
return takeFromExternrefTable0(ret[0]);
|
|
2271
2290
|
}
|
|
2272
2291
|
/**
|
|
2273
|
-
* Renders the next export frame and presents it on this renderer's
|
|
2274
|
-
*
|
|
2275
|
-
* page captures the canvas with `new VideoFrame(canvas)` and hands that to
|
|
2276
|
-
* its encoder, so no frame is mapped or copied into script.
|
|
2292
|
+
* Renders the next export frame and presents it on this renderer's canvas instead of
|
|
2293
|
+
* reading it back (experimental): the page captures it with `new VideoFrame(canvas)`.
|
|
2277
2294
|
*
|
|
2278
|
-
* The canvas must be sized to the export (`resizeSurface`) and
|
|
2279
|
-
*
|
|
2280
|
-
*
|
|
2281
|
-
* `
|
|
2282
|
-
* results `beginExportFrame` returns.
|
|
2295
|
+
* The canvas must be sized to the export (`resizeSurface`) and serve only this export.
|
|
2296
|
+
* Capture it in the same task, before the next call replaces the drawing buffer. Returns
|
|
2297
|
+
* `{kind: "rendered", index, timeTicks}`, or the `waiting` and `complete` results of
|
|
2298
|
+
* `beginExportFrame`.
|
|
2283
2299
|
*
|
|
2284
2300
|
* # Errors
|
|
2285
|
-
* Returns an error without a loaded project, a running export, or a
|
|
2286
|
-
*
|
|
2301
|
+
* Returns an error without a loaded project, a running export, or a canvas, or when
|
|
2302
|
+
* rendering or presentation fails.
|
|
2287
2303
|
* @returns {any}
|
|
2288
2304
|
*/
|
|
2289
2305
|
beginExportPresent() {
|
|
@@ -2296,25 +2312,18 @@ export class WebEffectRegistry {
|
|
|
2296
2312
|
/**
|
|
2297
2313
|
* Starts a deterministic export over a half-open timeline range.
|
|
2298
2314
|
*
|
|
2299
|
-
* Resets the audio renderer
|
|
2300
|
-
*
|
|
2301
|
-
*
|
|
2302
|
-
*
|
|
2303
|
-
* silence and advances nothing (`audioMissingSources` names the
|
|
2304
|
-
* sources), so rendering it again once they are uploaded continues
|
|
2305
|
-
* exactly as an uninterrupted export does.
|
|
2306
|
-
*
|
|
2307
|
-
* Export renders offscreen at [`QualityProfile::export`] and never touches
|
|
2308
|
-
* the presentation surface, so its output is independent of the canvas,
|
|
2309
|
-
* its size, and whatever the browser compositor is doing.
|
|
2315
|
+
* Resets the audio renderer so export audio inherits no preview DSP state, and keeps it
|
|
2316
|
+
* exact until `endExport`. Until then, an audio block missing a source mixes silence and
|
|
2317
|
+
* advances nothing (`audioMissingSources` names them), so re-rendering it after upload
|
|
2318
|
+
* continues exactly.
|
|
2310
2319
|
*
|
|
2311
|
-
*
|
|
2312
|
-
* `hevc`, `vp9`, `av1
|
|
2313
|
-
*
|
|
2320
|
+
* Renders offscreen at [`QualityProfile::export`], independent of the canvas. Frames are
|
|
2321
|
+
* packed with the chroma siting of `codec` (`h264`, `hevc`, `vp9`, `av1`;
|
|
2322
|
+
* [`alpha2_media::YuvEncoding::export`]).
|
|
2314
2323
|
*
|
|
2315
2324
|
* # Errors
|
|
2316
|
-
* Returns an error without a loaded project, for an empty range, an
|
|
2317
|
-
*
|
|
2325
|
+
* Returns an error without a loaded project, for an empty range, an invalid frame rate, or
|
|
2326
|
+
* an unknown codec.
|
|
2318
2327
|
* @param {bigint} start_ticks
|
|
2319
2328
|
* @param {bigint} end_ticks
|
|
2320
2329
|
* @param {number} rate_num
|
|
@@ -2346,15 +2355,14 @@ export class WebEffectRegistry {
|
|
|
2346
2355
|
}
|
|
2347
2356
|
}
|
|
2348
2357
|
/**
|
|
2349
|
-
*
|
|
2350
|
-
*
|
|
2351
|
-
*
|
|
2352
|
-
* `
|
|
2353
|
-
* (this one), `renderer.cpu` and `effects.runtime`, as the native host
|
|
2354
|
-
* names them.
|
|
2358
|
+
* The shared capability report JSON (`alpha2-capabilities`) with runtime `browser`.
|
|
2359
|
+
* `decode` and `encode` are `null` for the page to fill; `features` names only
|
|
2360
|
+
* `renderer.gpu`, `renderer.cpu`, `effects.runtime`, and on WebGL2
|
|
2361
|
+
* `uploads.webgl2-bitmap` (unavailable where frames upload as CPU pixels).
|
|
2355
2362
|
*
|
|
2356
2363
|
* # Errors
|
|
2357
|
-
* Returns an error if the report cannot be serialized
|
|
2364
|
+
* Returns an error if the report cannot be serialized, or on WebGL2 when the upload probe
|
|
2365
|
+
* throws.
|
|
2358
2366
|
* @returns {string}
|
|
2359
2367
|
*/
|
|
2360
2368
|
capabilityReport() {
|
|
@@ -2406,18 +2414,15 @@ export class WebEffectRegistry {
|
|
|
2406
2414
|
wasm.webeffectregistry_clearFrames(this.__wbg_ptr);
|
|
2407
2415
|
}
|
|
2408
2416
|
/**
|
|
2409
|
-
* Parses one JSON effect definition and compiles it on this binding's
|
|
2410
|
-
*
|
|
2411
|
-
*
|
|
2412
|
-
* with the shader's diagnostics.
|
|
2417
|
+
* Parses one JSON effect definition and compiles it on this binding's device. The promise
|
|
2418
|
+
* resolves to the compiled effect for [`Self::register_compiled_effect`], or rejects with
|
|
2419
|
+
* the shader's diagnostics.
|
|
2413
2420
|
*
|
|
2414
|
-
*
|
|
2415
|
-
*
|
|
2416
|
-
* renders, uploads, compiles other effects, and may be freed meanwhile.
|
|
2421
|
+
* Returns once the shader and pipeline are created; while the browser compiles, the
|
|
2422
|
+
* binding stays fully usable and may be freed.
|
|
2417
2423
|
*
|
|
2418
2424
|
* # Errors
|
|
2419
|
-
* Throws `EFFECT_ERROR` for a definition the engine refuses before
|
|
2420
|
-
* compiling it.
|
|
2425
|
+
* Throws `EFFECT_ERROR` for a definition the engine refuses before compiling.
|
|
2421
2426
|
* @param {string} json
|
|
2422
2427
|
* @returns {Promise<any>}
|
|
2423
2428
|
*/
|
|
@@ -2431,16 +2436,14 @@ export class WebEffectRegistry {
|
|
|
2431
2436
|
return takeFromExternrefTable0(ret[0]);
|
|
2432
2437
|
}
|
|
2433
2438
|
/**
|
|
2434
|
-
* Creates the renderer
|
|
2435
|
-
*
|
|
2436
|
-
*
|
|
2437
|
-
*
|
|
2438
|
-
* packs export frames in wasm, single-threaded, drawing what the native
|
|
2439
|
-
* CPU renderer draws byte for byte. Runtime WGSL effects are refused.
|
|
2439
|
+
* Creates the CPU renderer, for a browser with no WebGPU adapter or WebGL2 context, or on
|
|
2440
|
+
* request. It presents preview frames on `canvas`'s 2D context (`OffscreenCanvas`, page
|
|
2441
|
+
* canvas, or `undefined` for none) and packs export frames in wasm, single-threaded,
|
|
2442
|
+
* byte-identical to the native CPU renderer. Runtime WGSL effects are refused.
|
|
2440
2443
|
*
|
|
2441
2444
|
* # Errors
|
|
2442
|
-
* Rejects (`INVALID_INPUT`) a canvas
|
|
2443
|
-
*
|
|
2445
|
+
* Rejects (`INVALID_INPUT`) a canvas with no 2D context, such as one already holding a
|
|
2446
|
+
* WebGL or WebGPU context.
|
|
2444
2447
|
* @param {any} canvas
|
|
2445
2448
|
* @returns {WebCpuRenderer}
|
|
2446
2449
|
*/
|
|
@@ -2452,25 +2455,38 @@ export class WebEffectRegistry {
|
|
|
2452
2455
|
return WebCpuRenderer.__wrap(ret[0]);
|
|
2453
2456
|
}
|
|
2454
2457
|
/**
|
|
2455
|
-
* Creates a worker-owned renderer
|
|
2458
|
+
* Creates a worker-owned renderer for an `OffscreenCanvas`.
|
|
2459
|
+
*
|
|
2460
|
+
* Tries browser WebGPU first, then WebGL2. On WebGPU the device opens before the canvas is
|
|
2461
|
+
* bound, so a failure leaves the canvas free for another context kind (such as the CPU
|
|
2462
|
+
* renderer's 2D one). `options.softwareAdapter` is `"allow"` (default) or `"refuse"`;
|
|
2463
|
+
* refused, a software adapter (WebGPU fallback, `SwiftShader`, llvmpipe, WARP) is skipped
|
|
2464
|
+
* and the call rejects before binding the canvas if nothing else is offered.
|
|
2456
2465
|
*
|
|
2457
|
-
*
|
|
2458
|
-
*
|
|
2466
|
+
* # Errors
|
|
2467
|
+
* Rejects `GPU_INIT_FAILED` when no device opens or only a refused software adapter is
|
|
2468
|
+
* offered; `GPU_DEVICE_LOST` when the canvas's WebGL context is lost and not restored;
|
|
2469
|
+
* `INVALID_INPUT` for a canvas that takes no GPU surface or bad options.
|
|
2459
2470
|
* @param {OffscreenCanvas} canvas
|
|
2471
|
+
* @param {any | null} [options]
|
|
2460
2472
|
* @returns {Promise<WebEffectRegistry>}
|
|
2461
2473
|
*/
|
|
2462
|
-
static createForCanvas(canvas) {
|
|
2463
|
-
const ret = wasm.webeffectregistry_createForCanvas(canvas);
|
|
2474
|
+
static createForCanvas(canvas, options) {
|
|
2475
|
+
const ret = wasm.webeffectregistry_createForCanvas(canvas, isLikeNone(options) ? 0 : addToExternrefTable0(options));
|
|
2464
2476
|
return ret;
|
|
2465
2477
|
}
|
|
2466
2478
|
/**
|
|
2467
|
-
* Creates a renderer
|
|
2468
|
-
*
|
|
2479
|
+
* Creates a renderer presenting directly to a main-thread HTML canvas, as
|
|
2480
|
+
* [`Self::create_for_canvas`] does for an `OffscreenCanvas`, with the same `options`.
|
|
2481
|
+
*
|
|
2482
|
+
* # Errors
|
|
2483
|
+
* As [`Self::create_for_canvas`].
|
|
2469
2484
|
* @param {HTMLCanvasElement} canvas
|
|
2485
|
+
* @param {any | null} [options]
|
|
2470
2486
|
* @returns {Promise<WebEffectRegistry>}
|
|
2471
2487
|
*/
|
|
2472
|
-
static createForHtmlCanvas(canvas) {
|
|
2473
|
-
const ret = wasm.webeffectregistry_createForHtmlCanvas(canvas);
|
|
2488
|
+
static createForHtmlCanvas(canvas, options) {
|
|
2489
|
+
const ret = wasm.webeffectregistry_createForHtmlCanvas(canvas, isLikeNone(options) ? 0 : addToExternrefTable0(options));
|
|
2474
2490
|
return ret;
|
|
2475
2491
|
}
|
|
2476
2492
|
/**
|
|
@@ -2482,11 +2498,9 @@ export class WebEffectRegistry {
|
|
|
2482
2498
|
return ret;
|
|
2483
2499
|
}
|
|
2484
2500
|
/**
|
|
2485
|
-
*
|
|
2486
|
-
*
|
|
2487
|
-
*
|
|
2488
|
-
* after which it refuses every readback. A frame the GPU rejected for an
|
|
2489
|
-
* error is not that: it failed alone, and the binding renders on.
|
|
2501
|
+
* Whether the owning worker must recreate this binding: its device or context was lost,
|
|
2502
|
+
* or the GPU stopped running work, after which every readback is refused. A frame the GPU
|
|
2503
|
+
* rejected with an error is not a loss; the binding renders on.
|
|
2490
2504
|
* @returns {boolean}
|
|
2491
2505
|
*/
|
|
2492
2506
|
get deviceLost() {
|
|
@@ -2524,20 +2538,15 @@ export class WebEffectRegistry {
|
|
|
2524
2538
|
/**
|
|
2525
2539
|
* Renders the next export frame and resolves with its pixels.
|
|
2526
2540
|
*
|
|
2527
|
-
*
|
|
2528
|
-
* `
|
|
2529
|
-
*
|
|
2530
|
-
*
|
|
2531
|
-
*
|
|
2532
|
-
* width, height, format: "I420", colorSpace, layout, pixels }`, where
|
|
2533
|
-
* `pixels` holds the planes with padded rows at the offsets and strides
|
|
2534
|
-
* `layout` gives. Waiting never advances the cursor, so a retry after
|
|
2535
|
-
* uploading cannot skip a timestamp.
|
|
2541
|
+
* Resolves to `{ kind: "complete" }`; to `{ kind: "waiting", timeTicks, missingSources,
|
|
2542
|
+
* missingFrames }` when a source is missing (`missingFrames` as `renderAt` reports it); or
|
|
2543
|
+
* to `{ kind: "rendered", index, timeTicks, width, height, format: "I420", colorSpace,
|
|
2544
|
+
* layout, pixels }` with padded planes at `layout`'s offsets and strides. Waiting never
|
|
2545
|
+
* advances the cursor.
|
|
2536
2546
|
*
|
|
2537
2547
|
* # Errors
|
|
2538
|
-
* Returns an error without a running export or
|
|
2539
|
-
*
|
|
2540
|
-
* times out, the device is lost, or the mapping fails.
|
|
2548
|
+
* Returns an error without a running export or loaded project. The promise rejects with a
|
|
2549
|
+
* `failure` when the readback times out, the device is lost, or the mapping fails.
|
|
2541
2550
|
* @returns {Promise<any>}
|
|
2542
2551
|
*/
|
|
2543
2552
|
exportFrame() {
|
|
@@ -2548,19 +2557,16 @@ export class WebEffectRegistry {
|
|
|
2548
2557
|
return takeFromExternrefTable0(ret[0]);
|
|
2549
2558
|
}
|
|
2550
2559
|
/**
|
|
2551
|
-
* Completed and total frame counts for the running export
|
|
2552
|
-
*
|
|
2560
|
+
* Completed and total frame counts for the running export and the range it covers, as
|
|
2561
|
+
* JSON.
|
|
2553
2562
|
*
|
|
2554
|
-
* `effectiveRange` is the requested range widened to the frame grid
|
|
2555
|
-
*
|
|
2556
|
-
* `
|
|
2557
|
-
*
|
|
2558
|
-
* output's zero, and `frames` the sample count. Every host takes its
|
|
2559
|
-
* audio from these, never from the request.
|
|
2563
|
+
* `effectiveRange` is the requested range widened to the frame grid; its start is the
|
|
2564
|
+
* output's zero. `audioWindow` is the project-rate samples the export's audio covers:
|
|
2565
|
+
* `startSample` (a decimal string) at the output's zero, and `frames`. Hosts take audio
|
|
2566
|
+
* from these, never from the request.
|
|
2560
2567
|
*
|
|
2561
2568
|
* # Errors
|
|
2562
|
-
* Returns an error when no export is running
|
|
2563
|
-
* not fit in samples.
|
|
2569
|
+
* Returns an error when no export is running or the range does not fit in samples.
|
|
2564
2570
|
* @returns {string}
|
|
2565
2571
|
*/
|
|
2566
2572
|
exportProgress() {
|
|
@@ -2582,9 +2588,8 @@ export class WebEffectRegistry {
|
|
|
2582
2588
|
}
|
|
2583
2589
|
}
|
|
2584
2590
|
/**
|
|
2585
|
-
* Exact clip/source/timestamp requests from the same
|
|
2586
|
-
*
|
|
2587
|
-
* clip IDs. Tick values are strings so JavaScript can preserve i64.
|
|
2591
|
+
* Exact clip/source/timestamp requests from the same snapshot `renderAt` uses. Hosts keep
|
|
2592
|
+
* separate decoder cursors per clip ID. Tick values are strings to preserve i64.
|
|
2588
2593
|
* @param {bigint} time_ticks
|
|
2589
2594
|
* @returns {string}
|
|
2590
2595
|
*/
|
|
@@ -2607,9 +2612,8 @@ export class WebEffectRegistry {
|
|
|
2607
2612
|
}
|
|
2608
2613
|
}
|
|
2609
2614
|
/**
|
|
2610
|
-
* Whether the loaded project declares `source_id` an HDR (PQ or HLG)
|
|
2611
|
-
*
|
|
2612
|
-
* [`Self::upload_yuv_frame`].
|
|
2615
|
+
* Whether the loaded project declares `source_id` an HDR (PQ or HLG) source, whose frames
|
|
2616
|
+
* must go through [`Self::upload_yuv_frame`].
|
|
2613
2617
|
* @param {string} source_id
|
|
2614
2618
|
* @returns {boolean}
|
|
2615
2619
|
*/
|
|
@@ -2620,10 +2624,8 @@ export class WebEffectRegistry {
|
|
|
2620
2624
|
return ret !== 0;
|
|
2621
2625
|
}
|
|
2622
2626
|
/**
|
|
2623
|
-
* Whether the still `sourceId` is still the upload `generation` names.
|
|
2624
|
-
*
|
|
2625
|
-
* limit on how many it keeps), so a host that skips uploading a still it
|
|
2626
|
-
* uploaded before asks here first.
|
|
2627
|
+
* Whether the still `sourceId` is still the upload `generation` names. The store evicts
|
|
2628
|
+
* stills on its own, so a host checks before skipping a re-upload.
|
|
2627
2629
|
* @param {string} source_id
|
|
2628
2630
|
* @param {bigint} generation
|
|
2629
2631
|
* @returns {boolean}
|
|
@@ -2637,20 +2639,13 @@ export class WebEffectRegistry {
|
|
|
2637
2639
|
/**
|
|
2638
2640
|
* Loads and validates a versioned project document.
|
|
2639
2641
|
*
|
|
2640
|
-
*
|
|
2641
|
-
*
|
|
2642
|
-
*
|
|
2643
|
-
*
|
|
2644
|
-
*
|
|
2645
|
-
* all, and a source's new declared color (`color_metadata`) its own.
|
|
2646
|
-
* Raw uploads and audio remain reusable. Sources that are gone or
|
|
2647
|
-
* relocated lose theirs, and all audio goes when the project sample rate
|
|
2648
|
-
* changes. Media that changes under an unchanged locator needs a new
|
|
2649
|
-
* source ID.
|
|
2642
|
+
* Uploaded frames and audio are kept for every source whose ID and locator are unchanged,
|
|
2643
|
+
* so an edit needs no re-decode. Presentation frames are invalidated by a new canvas size
|
|
2644
|
+
* or color pipeline (`settings.color`), or per source by new declared color
|
|
2645
|
+
* (`color_metadata`). All audio is dropped when the project sample rate changes. Media
|
|
2646
|
+
* that changes under an unchanged locator needs a new source ID.
|
|
2650
2647
|
*
|
|
2651
|
-
* Loading ends a running export (`endExport`)
|
|
2652
|
-
* project it began with, so its next step is refused rather than
|
|
2653
|
-
* rendering this one.
|
|
2648
|
+
* Loading ends a running export (`endExport`), so its next step is refused.
|
|
2654
2649
|
* @param {string} json
|
|
2655
2650
|
*/
|
|
2656
2651
|
loadProject(json) {
|
|
@@ -2662,11 +2657,26 @@ export class WebEffectRegistry {
|
|
|
2662
2657
|
}
|
|
2663
2658
|
}
|
|
2664
2659
|
/**
|
|
2665
|
-
*
|
|
2666
|
-
*
|
|
2667
|
-
*
|
|
2668
|
-
*
|
|
2669
|
-
*
|
|
2660
|
+
* After a loss ([`Self::device_lost`]), what the renderer's submission times say about it,
|
|
2661
|
+
* as JSON `{ hung, gpuMs, watchdogMs, timeTicks, frameIndex, effects, predictedMs }`.
|
|
2662
|
+
* `hung` means the longest recent submission ran at least half the GPU watchdog, so the
|
|
2663
|
+
* loss was most likely this work's and rerunning it would stop the GPU again. `undefined`
|
|
2664
|
+
* before any loss.
|
|
2665
|
+
* @returns {string | undefined}
|
|
2666
|
+
*/
|
|
2667
|
+
get lossReport() {
|
|
2668
|
+
const ret = wasm.webeffectregistry_lossReport(this.__wbg_ptr);
|
|
2669
|
+
let v1;
|
|
2670
|
+
if (ret[0] !== 0) {
|
|
2671
|
+
v1 = getStringFromWasm0(ret[0], ret[1]);
|
|
2672
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2673
|
+
}
|
|
2674
|
+
return v1;
|
|
2675
|
+
}
|
|
2676
|
+
/**
|
|
2677
|
+
* The loudness measured since metering started as JSON (`LoudnessReport` in
|
|
2678
|
+
* `alpha2/loudness`), or `null` while off. `limiterThreshold` (or `null`) is the master
|
|
2679
|
+
* limiter it measured in front of, which `planLoudnessNormalization` keeps the mix under.
|
|
2670
2680
|
* @returns {string}
|
|
2671
2681
|
*/
|
|
2672
2682
|
loudnessReport() {
|
|
@@ -2695,8 +2705,8 @@ export class WebEffectRegistry {
|
|
|
2695
2705
|
}
|
|
2696
2706
|
}
|
|
2697
2707
|
/**
|
|
2698
|
-
* The loaded project's render size at the preview scale, `[width,
|
|
2699
|
-
*
|
|
2708
|
+
* The loaded project's render size at the preview scale, `[width, height]`: what
|
|
2709
|
+
* `renderAt` renders and the surface should be.
|
|
2700
2710
|
*
|
|
2701
2711
|
* # Errors
|
|
2702
2712
|
* Fails when no project is loaded.
|
|
@@ -2712,12 +2722,23 @@ export class WebEffectRegistry {
|
|
|
2712
2722
|
return v1;
|
|
2713
2723
|
}
|
|
2714
2724
|
/**
|
|
2715
|
-
*
|
|
2716
|
-
*
|
|
2725
|
+
* The registered runtime effects the loaded project can draw, as `id@version` strings,
|
|
2726
|
+
* sorted; empty without a project. Built-ins are not listed.
|
|
2727
|
+
* @returns {string[]}
|
|
2728
|
+
*/
|
|
2729
|
+
projectRuntimeEffects() {
|
|
2730
|
+
const ret = wasm.webeffectregistry_projectRuntimeEffects(this.__wbg_ptr);
|
|
2731
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]);
|
|
2732
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
2733
|
+
return v1;
|
|
2734
|
+
}
|
|
2735
|
+
/**
|
|
2736
|
+
* Adds an effect [`Self::compile_effect`] compiled on this binding and returns its
|
|
2737
|
+
* `id@version`. The compiled effect is consumed either way.
|
|
2717
2738
|
*
|
|
2718
2739
|
* # Errors
|
|
2719
|
-
* Throws `EFFECT_ERROR` for an effect compiled by another binding, one
|
|
2720
|
-
*
|
|
2740
|
+
* Throws `EFFECT_ERROR` for an effect compiled by another binding, one registered while it
|
|
2741
|
+
* compiled, or a full registry.
|
|
2721
2742
|
* @param {CompiledEffect} compiled
|
|
2722
2743
|
* @returns {string}
|
|
2723
2744
|
*/
|
|
@@ -2757,7 +2778,7 @@ export class WebEffectRegistry {
|
|
|
2757
2778
|
}
|
|
2758
2779
|
}
|
|
2759
2780
|
/**
|
|
2760
|
-
* Drops one source's retained audio.
|
|
2781
|
+
* Drops one source's retained audio, every stream of it.
|
|
2761
2782
|
* @param {string} source_id
|
|
2762
2783
|
* @returns {boolean}
|
|
2763
2784
|
*/
|
|
@@ -2768,8 +2789,8 @@ export class WebEffectRegistry {
|
|
|
2768
2789
|
return ret !== 0;
|
|
2769
2790
|
}
|
|
2770
2791
|
/**
|
|
2771
|
-
* Releases exactly one uploaded generation
|
|
2772
|
-
*
|
|
2792
|
+
* Releases exactly one uploaded generation, leaving any newer texture under the same
|
|
2793
|
+
* source and timestamp.
|
|
2773
2794
|
* @param {bigint} generation
|
|
2774
2795
|
* @returns {boolean}
|
|
2775
2796
|
*/
|
|
@@ -2790,12 +2811,10 @@ export class WebEffectRegistry {
|
|
|
2790
2811
|
return ret !== 0;
|
|
2791
2812
|
}
|
|
2792
2813
|
/**
|
|
2793
|
-
*
|
|
2794
|
-
*
|
|
2795
|
-
*
|
|
2796
|
-
*
|
|
2797
|
-
* is released; later work allocates again what it needs. An export
|
|
2798
|
-
* calls it when its byte budget stops it submitting.
|
|
2814
|
+
* Destroys GPU memory kept only for reuse (idle pooled textures and buffers, kept graph
|
|
2815
|
+
* results) so the browser frees it now rather than at garbage collection, and returns the
|
|
2816
|
+
* bytes destroyed. Nothing a render or readback holds is released. An export calls it
|
|
2817
|
+
* when its byte budget stops it submitting.
|
|
2799
2818
|
* @returns {number}
|
|
2800
2819
|
*/
|
|
2801
2820
|
releaseIdleMemory() {
|
|
@@ -2803,9 +2822,8 @@ export class WebEffectRegistry {
|
|
|
2803
2822
|
return ret;
|
|
2804
2823
|
}
|
|
2805
2824
|
/**
|
|
2806
|
-
* Releases every uploaded frame and the still of one source
|
|
2807
|
-
*
|
|
2808
|
-
* already retired stay until they are released.
|
|
2825
|
+
* Releases every uploaded frame and the still of one source whose media changed under the
|
|
2826
|
+
* same ID and locator. Retired generations stay until released.
|
|
2809
2827
|
* @param {string} source_id
|
|
2810
2828
|
* @returns {boolean}
|
|
2811
2829
|
*/
|
|
@@ -2818,12 +2836,10 @@ export class WebEffectRegistry {
|
|
|
2818
2836
|
/**
|
|
2819
2837
|
* Evaluates and presents one project frame on the worker-owned canvas.
|
|
2820
2838
|
*
|
|
2821
|
-
* Returns JSON `{ requestedTimeTicks, presentedTimeTicks, missingSources,
|
|
2822
|
-
*
|
|
2823
|
-
*
|
|
2824
|
-
*
|
|
2825
|
-
* frame equals the one presented last (see `Player::render_at`): nothing
|
|
2826
|
-
* was rendered or presented, and the canvas still shows it.
|
|
2839
|
+
* Returns JSON `{ requestedTimeTicks, presentedTimeTicks, missingSources, missingFrames,
|
|
2840
|
+
* repeated, unchanged }`. `presentedTimeTicks` is `null` until a frame is presented;
|
|
2841
|
+
* `missingFrames` gives the exact source time each missing source was needed at;
|
|
2842
|
+
* `unchanged` means the frame equals the last one, so nothing was rendered or presented.
|
|
2827
2843
|
* @param {bigint} time_ticks
|
|
2828
2844
|
* @returns {string}
|
|
2829
2845
|
*/
|
|
@@ -2846,16 +2862,12 @@ export class WebEffectRegistry {
|
|
|
2846
2862
|
}
|
|
2847
2863
|
}
|
|
2848
2864
|
/**
|
|
2849
|
-
* Mixes one project audio block of at most `audioMaxBlock` samples per
|
|
2850
|
-
*
|
|
2851
|
-
*
|
|
2852
|
-
*
|
|
2853
|
-
* Channels are returned end to end. Call `audioStatus` for the sources
|
|
2854
|
-
* that were missing from the mix.
|
|
2865
|
+
* Mixes one project audio block of at most `audioMaxBlock` samples per channel and returns
|
|
2866
|
+
* its planar samples, channels end to end. Missing sources are reported by
|
|
2867
|
+
* `audioMissingSources`.
|
|
2855
2868
|
*
|
|
2856
2869
|
* # Errors
|
|
2857
|
-
* Rejects (`INVALID_INPUT`, not fatal) more than `audioMaxBlock` frames
|
|
2858
|
-
* naming the limit.
|
|
2870
|
+
* Rejects (`INVALID_INPUT`, not fatal) more than `audioMaxBlock` frames.
|
|
2859
2871
|
* @param {bigint} start_sample
|
|
2860
2872
|
* @param {number} frames
|
|
2861
2873
|
* @param {boolean} playing
|
|
@@ -2918,18 +2930,14 @@ export class WebEffectRegistry {
|
|
|
2918
2930
|
return ret >>> 0;
|
|
2919
2931
|
}
|
|
2920
2932
|
/**
|
|
2921
|
-
* Chooses what `renderAudio` does, outside an export, with a block that
|
|
2922
|
-
*
|
|
2923
|
-
*
|
|
2924
|
-
*
|
|
2925
|
-
*
|
|
2926
|
-
*
|
|
2927
|
-
*
|
|
2928
|
-
*
|
|
2929
|
-
* not what a fresh renderer mixes, so loudness measurements and other
|
|
2930
|
-
* output that must repeat stay exact. From `beginExport` to `endExport`
|
|
2931
|
-
* the renderer is exact whatever is chosen. Choosing another policy than
|
|
2932
|
-
* the current one resets the audio, as `resetAudio` does.
|
|
2933
|
+
* Chooses what `renderAudio` does, outside an export, with a block that does not start
|
|
2934
|
+
* where the previous one ended.
|
|
2935
|
+
*
|
|
2936
|
+
* `"exact"` (default) resets and replays the settling history, mixing what a fresh
|
|
2937
|
+
* renderer would. `"continue-small-gaps"` is for live preview: a jump of at most
|
|
2938
|
+
* `audioMaxBlock` samples continues from the previous state instead of replaying up to
|
|
2939
|
+
* 30 s, so its output is not reproducible. Exports are always exact. Changing the policy
|
|
2940
|
+
* resets the audio, as `resetAudio` does.
|
|
2933
2941
|
*
|
|
2934
2942
|
* # Errors
|
|
2935
2943
|
* Rejects any other policy name (`INVALID_INPUT`, not fatal).
|
|
@@ -2944,10 +2952,9 @@ export class WebEffectRegistry {
|
|
|
2944
2952
|
}
|
|
2945
2953
|
}
|
|
2946
2954
|
/**
|
|
2947
|
-
* Starts (from empty) or stops measuring
|
|
2948
|
-
*
|
|
2949
|
-
*
|
|
2950
|
-
* authored; a block a source was missing from is not measured.
|
|
2955
|
+
* Starts (from empty) or stops measuring loudness of the mix before the master limiter,
|
|
2956
|
+
* over subsequent `renderAudio` blocks. Starting removes the normalization gain so the mix
|
|
2957
|
+
* is measured as authored; blocks with a missing source are not measured.
|
|
2951
2958
|
*
|
|
2952
2959
|
* # Errors
|
|
2953
2960
|
* Returns an error without an audio renderer.
|
|
@@ -2960,15 +2967,13 @@ export class WebEffectRegistry {
|
|
|
2960
2967
|
}
|
|
2961
2968
|
}
|
|
2962
2969
|
/**
|
|
2963
|
-
* Applies a static gain
|
|
2964
|
-
*
|
|
2965
|
-
*
|
|
2966
|
-
* returns before rendering its audio; the gain stays until it is set
|
|
2967
|
-
* again, so set zero for audio after it that is not normalized.
|
|
2970
|
+
* Applies a static gain in dB after the master gain and before the limiter; zero or
|
|
2971
|
+
* `setLoudnessMetering(true)` removes it. A normalized export sets the gain
|
|
2972
|
+
* `planLoudnessNormalization` returns; it persists until set again.
|
|
2968
2973
|
*
|
|
2969
2974
|
* # Errors
|
|
2970
|
-
* Returns an error without an audio renderer, or for a gain that is not
|
|
2971
|
-
*
|
|
2975
|
+
* Returns an error without an audio renderer, or for a gain that is not finite or whose
|
|
2976
|
+
* factor overflows a 32-bit float (`INVALID_INPUT`).
|
|
2972
2977
|
* @param {number} gain_db
|
|
2973
2978
|
*/
|
|
2974
2979
|
setNormalizationGainDb(gain_db) {
|
|
@@ -2978,21 +2983,17 @@ export class WebEffectRegistry {
|
|
|
2978
2983
|
}
|
|
2979
2984
|
}
|
|
2980
2985
|
/**
|
|
2981
|
-
* Enables or disables per-pass GPU/CPU timing
|
|
2982
|
-
*
|
|
2983
|
-
* Disabled by default: timing reads a clock per pass and allocates GPU
|
|
2984
|
-
* timestamp resources, which is profiling cost rather than rendering work.
|
|
2985
|
-
* Every other field of `diagnostics()` is always available.
|
|
2986
|
+
* Enables or disables per-pass GPU/CPU timing in `diagnostics()`. Off by default because
|
|
2987
|
+
* it reads a clock per pass and allocates GPU timestamp resources.
|
|
2986
2988
|
* @param {boolean} enabled
|
|
2987
2989
|
*/
|
|
2988
2990
|
setPassTiming(enabled) {
|
|
2989
2991
|
wasm.webeffectregistry_setPassTiming(this.__wbg_ptr, enabled);
|
|
2990
2992
|
}
|
|
2991
2993
|
/**
|
|
2992
|
-
* Renders preview frames at `scale` times the project
|
|
2993
|
-
*
|
|
2994
|
-
*
|
|
2995
|
-
* next `renderAt` presents. Size the surface to `previewSize` after it.
|
|
2994
|
+
* Renders preview frames at `scale` times the project size from now on (default 0.5).
|
|
2995
|
+
* Drops the held frame so the next `renderAt` presents; resize the surface to
|
|
2996
|
+
* `previewSize` afterwards.
|
|
2996
2997
|
*
|
|
2997
2998
|
* # Errors
|
|
2998
2999
|
* Rejects a scale that is not finite, above 0 and at most 8.
|
|
@@ -3005,11 +3006,9 @@ export class WebEffectRegistry {
|
|
|
3005
3006
|
}
|
|
3006
3007
|
}
|
|
3007
3008
|
/**
|
|
3008
|
-
* Lets rendered results (each clip's finished picture and the frame)
|
|
3009
|
-
*
|
|
3010
|
-
*
|
|
3011
|
-
* sources whose upload is reused are found again: a still, or a frame the
|
|
3012
|
-
* page uploads once and draws at several times.
|
|
3009
|
+
* Lets rendered results (each clip's finished picture and the frame) use up to `bytes` of
|
|
3010
|
+
* GPU memory for reuse when a frame repeats; zero (the default) disables it. Only results
|
|
3011
|
+
* from reused uploads hit: a still, or a frame uploaded once and drawn at several times.
|
|
3013
3012
|
*
|
|
3014
3013
|
* # Errors
|
|
3015
3014
|
* Rejects a negative or non-finite budget.
|
|
@@ -3022,16 +3021,14 @@ export class WebEffectRegistry {
|
|
|
3022
3021
|
}
|
|
3023
3022
|
}
|
|
3024
3023
|
/**
|
|
3025
|
-
* Sets the cache budget for live, image, and retired generations (default
|
|
3026
|
-
*
|
|
3027
|
-
*
|
|
3028
|
-
*
|
|
3029
|
-
*
|
|
3030
|
-
* or alias that would
|
|
3031
|
-
* `RESOURCE_LIMIT` (`failure.stage` `working-set-over-budget`,
|
|
3032
|
-
* `failure.requestedBytes` the
|
|
3033
|
-
* refill could make the frame fit. Renderer pools and submitted GPU work
|
|
3034
|
-
* have separate lifetime/budget accounting.
|
|
3024
|
+
* Sets the cache budget for live, image, and retired generations (default 1 GiB); aliases
|
|
3025
|
+
* count once and the oldest generations go first. A new frame larger than the budget is
|
|
3026
|
+
* kept alone.
|
|
3027
|
+
*
|
|
3028
|
+
* While an export frame waits for its sources, those it shows are pinned. The budget
|
|
3029
|
+
* evicts everything else first, and an upload or alias that would push them over is
|
|
3030
|
+
* refused with `RESOURCE_LIMIT` (`failure.stage` `working-set-over-budget`,
|
|
3031
|
+
* `failure.requestedBytes` the minimum the frame needs).
|
|
3035
3032
|
* @param {number} bytes
|
|
3036
3033
|
*/
|
|
3037
3034
|
setUploadedFrameBudget(bytes) {
|
|
@@ -3041,8 +3038,7 @@ export class WebEffectRegistry {
|
|
|
3041
3038
|
}
|
|
3042
3039
|
}
|
|
3043
3040
|
/**
|
|
3044
|
-
* The color metadata the loaded project declares for `source_id`, as
|
|
3045
|
-
* JSON, or `undefined` when it declares none.
|
|
3041
|
+
* The color metadata the loaded project declares for `source_id`, as JSON, or `undefined`.
|
|
3046
3042
|
* @param {string} source_id
|
|
3047
3043
|
* @returns {string | undefined}
|
|
3048
3044
|
*/
|
|
@@ -3058,10 +3054,8 @@ export class WebEffectRegistry {
|
|
|
3058
3054
|
return v2;
|
|
3059
3055
|
}
|
|
3060
3056
|
/**
|
|
3061
|
-
*
|
|
3062
|
-
*
|
|
3063
|
-
* releases the wasm object borrow immediately, allowing edits while waiting.
|
|
3064
|
-
* WebGL submits synchronously through wgpu-core and uses its own retention.
|
|
3057
|
+
* Resolves when submitted WebGPU preview work completes, so the host can pace frames. The
|
|
3058
|
+
* returned promise releases the wasm borrow at once, allowing edits while waiting.
|
|
3065
3059
|
* @returns {Promise<any>}
|
|
3066
3060
|
*/
|
|
3067
3061
|
submittedWorkDone() {
|
|
@@ -3069,9 +3063,8 @@ export class WebEffectRegistry {
|
|
|
3069
3063
|
return ret;
|
|
3070
3064
|
}
|
|
3071
3065
|
/**
|
|
3072
|
-
* Whether decoded `VideoFrame`
|
|
3073
|
-
*
|
|
3074
|
-
* `uploadPresentedVideoFrame`.
|
|
3066
|
+
* Whether decoded `VideoFrame`s can be imported without CPU copies. Both backends can,
|
|
3067
|
+
* directly or through a canvas bitmap (see `uploadPresentedVideoFrame`).
|
|
3075
3068
|
* @returns {boolean}
|
|
3076
3069
|
*/
|
|
3077
3070
|
get supportsExternalVideoFrame() {
|
|
@@ -3079,11 +3072,27 @@ export class WebEffectRegistry {
|
|
|
3079
3072
|
return ret !== 0;
|
|
3080
3073
|
}
|
|
3081
3074
|
/**
|
|
3082
|
-
*
|
|
3083
|
-
*
|
|
3084
|
-
*
|
|
3085
|
-
*
|
|
3086
|
-
|
|
3075
|
+
* How frames rendered since the last call were split into GPU submissions to stay under
|
|
3076
|
+
* the watchdog budget, as JSON `{ frames, splitFrames, maxPerFrame, maxPredictedMs }` (the
|
|
3077
|
+
* native host's `performance.gpuSubmissions`). Resets the counts.
|
|
3078
|
+
* @returns {string}
|
|
3079
|
+
*/
|
|
3080
|
+
takeGpuSubmissionStats() {
|
|
3081
|
+
let deferred1_0;
|
|
3082
|
+
let deferred1_1;
|
|
3083
|
+
try {
|
|
3084
|
+
const ret = wasm.webeffectregistry_takeGpuSubmissionStats(this.__wbg_ptr);
|
|
3085
|
+
deferred1_0 = ret[0];
|
|
3086
|
+
deferred1_1 = ret[1];
|
|
3087
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
3088
|
+
} finally {
|
|
3089
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
/**
|
|
3093
|
+
* Discards `source_id`'s audio that ends before `ticks`, a time on that source's own
|
|
3094
|
+
* timeline. A source two clips read at different times is trimmed only below what both
|
|
3095
|
+
* need. Call it as playback moves on, a few seconds behind the earliest time still mixed.
|
|
3087
3096
|
* @param {string} source_id
|
|
3088
3097
|
* @param {bigint} ticks
|
|
3089
3098
|
*/
|
|
@@ -3093,10 +3102,9 @@ export class WebEffectRegistry {
|
|
|
3093
3102
|
wasm.webeffectregistry_trimAudioBefore(this.__wbg_ptr, ptr0, len0, ticks);
|
|
3094
3103
|
}
|
|
3095
3104
|
/**
|
|
3096
|
-
* Releases `source_id`'s
|
|
3097
|
-
*
|
|
3098
|
-
*
|
|
3099
|
-
* is trimmed only below what both still need.
|
|
3105
|
+
* Releases `source_id`'s video frames older than `media_time_ticks`, a time on that
|
|
3106
|
+
* source's own timeline. A source two clips read at different times is trimmed only below
|
|
3107
|
+
* what both need.
|
|
3100
3108
|
* @param {string} source_id
|
|
3101
3109
|
* @param {bigint} media_time_ticks
|
|
3102
3110
|
*/
|
|
@@ -3131,43 +3139,65 @@ export class WebEffectRegistry {
|
|
|
3131
3139
|
/**
|
|
3132
3140
|
* Uploads project-rate planar audio for one source.
|
|
3133
3141
|
*
|
|
3134
|
-
* `start_sample` is the
|
|
3135
|
-
*
|
|
3136
|
-
*
|
|
3137
|
-
*
|
|
3138
|
-
*
|
|
3139
|
-
*
|
|
3140
|
-
*
|
|
3141
|
-
*
|
|
3142
|
-
*
|
|
3143
|
-
* its own.
|
|
3142
|
+
* `start_sample` is the first sample's index in the source at the project rate. `layout`
|
|
3143
|
+
* names each plane's speaker: an array of `FFmpeg` channel names in plane order
|
|
3144
|
+
* (`["FC", "FL", "FR"]`, `"UNK"` for none), or a channel count for `FFmpeg`'s default
|
|
3145
|
+
* layout (3 is 2.1, 4 is 4.0); 1 to 24 planes. `samples` holds the planes end to end. An
|
|
3146
|
+
* upload replaces windows it overlaps and joins same-speaker windows it meets.
|
|
3147
|
+
*
|
|
3148
|
+
* The mixer reads a window only where it holds every sample a block needs, so a host
|
|
3149
|
+
* decoding past a source's end uploads zeros there. Alternatively pass `ends_source` with
|
|
3150
|
+
* an upload that runs to the source's end, so the source is silent after it.
|
|
3144
3151
|
*
|
|
3145
|
-
*
|
|
3146
|
-
*
|
|
3147
|
-
* the supplied decoders do. `ends_source` says instead that this upload
|
|
3148
|
-
* runs to the source's end, so past it the source is silent: pass it
|
|
3149
|
-
* with a whole decoded source, whose clips may end exactly at its end
|
|
3150
|
-
* and read an interpolation sample or two beyond.
|
|
3152
|
+
* `stream` is the audio stream an `audioNeeds` entry names (absent for the default one);
|
|
3153
|
+
* each stream of a source is held apart.
|
|
3151
3154
|
* @param {string} source_id
|
|
3152
3155
|
* @param {bigint} start_sample
|
|
3153
3156
|
* @param {number} sample_rate
|
|
3154
3157
|
* @param {any} layout
|
|
3155
3158
|
* @param {Float32Array} samples
|
|
3156
3159
|
* @param {boolean | null} [ends_source]
|
|
3160
|
+
* @param {number | null} [stream]
|
|
3157
3161
|
*/
|
|
3158
|
-
uploadAudioBlock(source_id, start_sample, sample_rate, layout, samples, ends_source) {
|
|
3162
|
+
uploadAudioBlock(source_id, start_sample, sample_rate, layout, samples, ends_source, stream) {
|
|
3159
3163
|
const ptr0 = passStringToWasm0(source_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3160
3164
|
const len0 = WASM_VECTOR_LEN;
|
|
3161
|
-
const ret = wasm.webeffectregistry_uploadAudioBlock(this.__wbg_ptr, ptr0, len0, start_sample, sample_rate, layout, samples, isLikeNone(ends_source) ? 0xFFFFFF : ends_source ? 1 : 0);
|
|
3165
|
+
const ret = wasm.webeffectregistry_uploadAudioBlock(this.__wbg_ptr, ptr0, len0, start_sample, sample_rate, layout, samples, isLikeNone(ends_source) ? 0xFFFFFF : ends_source ? 1 : 0, isLikeNone(stream) ? Number.MAX_SAFE_INTEGER : (stream) >>> 0);
|
|
3162
3166
|
if (ret[1]) {
|
|
3163
3167
|
throw takeFromExternrefTable0(ret[0]);
|
|
3164
3168
|
}
|
|
3165
3169
|
}
|
|
3166
3170
|
/**
|
|
3167
|
-
* [`Self::upload_presented_video_frame`] for a
|
|
3168
|
-
*
|
|
3169
|
-
*
|
|
3170
|
-
*
|
|
3171
|
+
* [`Self::upload_presented_video_frame`] for a frame the engine should convert from planes
|
|
3172
|
+
* (HDR, or declared color) but the browser decodes only without planes. The browser's
|
|
3173
|
+
* conversion (and tone mapping) imports it, drawn as SDR BT.709.
|
|
3174
|
+
*
|
|
3175
|
+
* The source is then degraded: `renderAt` lists it in `degradedSources`, and any export
|
|
3176
|
+
* frame showing it is refused with `PLANAR_DECODE_UNAVAILABLE`, so browser and native
|
|
3177
|
+
* exports never differ by the browser's conversion. A planar or presented upload of the
|
|
3178
|
+
* source clears this. Always closes `frame`.
|
|
3179
|
+
* @param {string} source_id
|
|
3180
|
+
* @param {bigint} media_time_ticks
|
|
3181
|
+
* @param {VideoFrame} frame
|
|
3182
|
+
* @param {number} output_width
|
|
3183
|
+
* @param {number} output_height
|
|
3184
|
+
* @param {number} rotation_degrees
|
|
3185
|
+
* @param {boolean} mirror
|
|
3186
|
+
* @returns {any}
|
|
3187
|
+
*/
|
|
3188
|
+
uploadDegradedVideoFrame(source_id, media_time_ticks, frame, output_width, output_height, rotation_degrees, mirror) {
|
|
3189
|
+
const ptr0 = passStringToWasm0(source_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3190
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3191
|
+
const ret = wasm.webeffectregistry_uploadDegradedVideoFrame(this.__wbg_ptr, ptr0, len0, media_time_ticks, frame, output_width, output_height, rotation_degrees, mirror);
|
|
3192
|
+
if (ret[2]) {
|
|
3193
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3194
|
+
}
|
|
3195
|
+
return takeFromExternrefTable0(ret[0]);
|
|
3196
|
+
}
|
|
3197
|
+
/**
|
|
3198
|
+
* [`Self::upload_presented_video_frame`] for a bitmap from
|
|
3199
|
+
* `createImageBitmap(frame, { premultiplyAlpha: "none" })`, skipping the canvas draw where
|
|
3200
|
+
* `videoFrameCopy` is `"bitmap"`. Always closes `bitmap`; HDR sources are refused.
|
|
3171
3201
|
* @param {string} source_id
|
|
3172
3202
|
* @param {bigint} media_time_ticks
|
|
3173
3203
|
* @param {ImageBitmap} bitmap
|
|
@@ -3187,10 +3217,9 @@ export class WebEffectRegistry {
|
|
|
3187
3217
|
return takeFromExternrefTable0(ret[0]);
|
|
3188
3218
|
}
|
|
3189
3219
|
/**
|
|
3190
|
-
* Like [`Self::upload_presented_rgba_frame`], for premultiplied
|
|
3191
|
-
*
|
|
3192
|
-
*
|
|
3193
|
-
* as far as the intermediate format holds them.
|
|
3220
|
+
* Like [`Self::upload_presented_rgba_frame`], for premultiplied linear-light RGBA half
|
|
3221
|
+
* floats (as bits) in BT.709 primaries, as `OpenEXR` sources arrive. Values outside
|
|
3222
|
+
* `0.0..=1.0` are kept as far as the intermediate format allows.
|
|
3194
3223
|
* @param {string} source_id
|
|
3195
3224
|
* @param {bigint} media_time_ticks
|
|
3196
3225
|
* @param {number} width
|
|
@@ -3212,8 +3241,7 @@ export class WebEffectRegistry {
|
|
|
3212
3241
|
return takeFromExternrefTable0(ret[0]);
|
|
3213
3242
|
}
|
|
3214
3243
|
/**
|
|
3215
|
-
* Like [`Self::upload_presented_linear_frame`], for a still shown at
|
|
3216
|
-
* every time.
|
|
3244
|
+
* Like [`Self::upload_presented_linear_frame`], for a still shown at every time.
|
|
3217
3245
|
* @param {string} source_id
|
|
3218
3246
|
* @param {number} width
|
|
3219
3247
|
* @param {number} height
|
|
@@ -3234,11 +3262,10 @@ export class WebEffectRegistry {
|
|
|
3234
3262
|
return takeFromExternrefTable0(ret[0]);
|
|
3235
3263
|
}
|
|
3236
3264
|
/**
|
|
3237
|
-
* Uploads
|
|
3238
|
-
*
|
|
3239
|
-
*
|
|
3240
|
-
*
|
|
3241
|
-
* providers' frames arrive this way.
|
|
3265
|
+
* Uploads RGBA8 pixels at their own size and presents them into the output as the engine
|
|
3266
|
+
* presents every source (contained, on the GPU), so a page never scales a source itself.
|
|
3267
|
+
* `premultiplied` says whether color is already multiplied by alpha. Extension providers'
|
|
3268
|
+
* frames arrive this way.
|
|
3242
3269
|
* @param {string} source_id
|
|
3243
3270
|
* @param {bigint} media_time_ticks
|
|
3244
3271
|
* @param {number} width
|
|
@@ -3261,8 +3288,7 @@ export class WebEffectRegistry {
|
|
|
3261
3288
|
return takeFromExternrefTable0(ret[0]);
|
|
3262
3289
|
}
|
|
3263
3290
|
/**
|
|
3264
|
-
* Like [`Self::upload_presented_rgba_frame`], for a still shown at every
|
|
3265
|
-
* time.
|
|
3291
|
+
* Like [`Self::upload_presented_rgba_frame`], for a still shown at every time.
|
|
3266
3292
|
* @param {string} source_id
|
|
3267
3293
|
* @param {number} width
|
|
3268
3294
|
* @param {number} height
|
|
@@ -3284,22 +3310,17 @@ export class WebEffectRegistry {
|
|
|
3284
3310
|
return takeFromExternrefTable0(ret[0]);
|
|
3285
3311
|
}
|
|
3286
3312
|
/**
|
|
3287
|
-
* Imports a decoded `VideoFrame` without
|
|
3288
|
-
*
|
|
3289
|
-
*
|
|
3290
|
-
* mirrored left to right when `mirror` is set, then turned clockwise by
|
|
3291
|
-
* `rotation_degrees`: how its stream says it is shown upright.
|
|
3313
|
+
* Imports a decoded `VideoFrame` without a CPU readback, then applies contain placement,
|
|
3314
|
+
* rotation, filtering, and alpha premultiplication in a GPU pass. The frame is mirrored
|
|
3315
|
+
* left to right when `mirror` is set, then turned clockwise by `rotation_degrees`.
|
|
3292
3316
|
*
|
|
3293
|
-
* Browser WebGPU copies the frame
|
|
3294
|
-
* browser does not take a `VideoFrame` (Firefox)
|
|
3295
|
-
* reused 2D canvas's bitmap. WebGL2 always uploads that bitmap.
|
|
3317
|
+
* Browser WebGPU copies the frame directly, or through a reused 2D canvas bitmap where the
|
|
3318
|
+
* browser does not take a `VideoFrame` (Firefox). WebGL2 always uploads the bitmap.
|
|
3296
3319
|
* `videoFrameCopy` says which.
|
|
3297
3320
|
*
|
|
3298
|
-
* Both
|
|
3299
|
-
*
|
|
3300
|
-
*
|
|
3301
|
-
* whatever the project's HDR policy: its planes go to
|
|
3302
|
-
* [`Self::upload_yuv_frame`], which converts them as the project says.
|
|
3321
|
+
* Both paths use the page's own color conversion, so an HDR frame (PQ or HLG, by the
|
|
3322
|
+
* project's declared color for the source, else the frame's `colorSpace`) is refused with
|
|
3323
|
+
* `INVALID_INPUT`; send its planes to [`Self::upload_yuv_frame`] instead.
|
|
3303
3324
|
* @param {string} source_id
|
|
3304
3325
|
* @param {bigint} media_time_ticks
|
|
3305
3326
|
* @param {VideoFrame} frame
|
|
@@ -3319,10 +3340,8 @@ export class WebEffectRegistry {
|
|
|
3319
3340
|
return takeFromExternrefTable0(ret[0]);
|
|
3320
3341
|
}
|
|
3321
3342
|
/**
|
|
3322
|
-
* Uploads tightly packed premultiplied RGBA8 pixels.
|
|
3323
|
-
*
|
|
3324
|
-
* This compatibility path is used by WebGL2, whose wgpu backend cannot
|
|
3325
|
-
* import a browser `VideoFrame` directly.
|
|
3343
|
+
* Uploads tightly packed premultiplied RGBA8 pixels. Used by WebGL2, whose wgpu backend
|
|
3344
|
+
* cannot import a `VideoFrame` directly.
|
|
3326
3345
|
* @param {string} source_id
|
|
3327
3346
|
* @param {bigint} media_time_ticks
|
|
3328
3347
|
* @param {number} width
|
|
@@ -3342,8 +3361,7 @@ export class WebEffectRegistry {
|
|
|
3342
3361
|
return takeFromExternrefTable0(ret[0]);
|
|
3343
3362
|
}
|
|
3344
3363
|
/**
|
|
3345
|
-
* Uploads one time-independent still image,
|
|
3346
|
-
* is released. Video uploads continue to require an exact timestamp.
|
|
3364
|
+
* Uploads one time-independent still image, kept until its generation is released.
|
|
3347
3365
|
* @param {string} source_id
|
|
3348
3366
|
* @param {number} width
|
|
3349
3367
|
* @param {number} height
|
|
@@ -3362,14 +3380,11 @@ export class WebEffectRegistry {
|
|
|
3362
3380
|
return takeFromExternrefTable0(ret[0]);
|
|
3363
3381
|
}
|
|
3364
3382
|
/**
|
|
3365
|
-
* Uploads a decoded browser frame as [`Self::upload_presented_video_frame`]
|
|
3366
|
-
*
|
|
3367
|
-
* frame's display size when no project is loaded), and stored under
|
|
3383
|
+
* Uploads a decoded browser frame as [`Self::upload_presented_video_frame`] does, upright,
|
|
3384
|
+
* fitted to the loaded project's size (or the frame's display size with no project), under
|
|
3368
3385
|
* `source_id` at `media_time_ticks`.
|
|
3369
3386
|
*
|
|
3370
|
-
*
|
|
3371
|
-
* returning. An HDR frame is refused, as [`Self::upload_presented_video_frame`]
|
|
3372
|
-
* refuses it.
|
|
3387
|
+
* Takes ownership of `frame` and always closes it. HDR frames are refused.
|
|
3373
3388
|
* @param {string} source_id
|
|
3374
3389
|
* @param {bigint} media_time_ticks
|
|
3375
3390
|
* @param {VideoFrame} frame
|
|
@@ -3385,31 +3400,25 @@ export class WebEffectRegistry {
|
|
|
3385
3400
|
return takeFromExternrefTable0(ret[0]);
|
|
3386
3401
|
}
|
|
3387
3402
|
/**
|
|
3388
|
-
* Uploads a decoded frame's planar YCbCr samples
|
|
3389
|
-
*
|
|
3390
|
-
*
|
|
3403
|
+
* Uploads a decoded frame's planar YCbCr samples as `VideoFrame.copyTo` writes them and
|
|
3404
|
+
* converts them with the engine's shader under the project's color pipeline. This is how
|
|
3405
|
+
* HDR (PQ or HLG) frames reach the engine, since texture copies go through the page's
|
|
3406
|
+
* color conversion.
|
|
3391
3407
|
*
|
|
3392
|
-
*
|
|
3393
|
-
* `
|
|
3394
|
-
*
|
|
3395
|
-
* `
|
|
3396
|
-
*
|
|
3397
|
-
*
|
|
3398
|
-
* `
|
|
3399
|
-
*
|
|
3400
|
-
* metadata as project JSON. `chroma_siting` (`left`, `center`,
|
|
3401
|
-
* `top-left`, or `unspecified`) is where the stream puts its chroma
|
|
3402
|
-
* samples, which `WebCodecs` leaves to the demuxer to know.
|
|
3403
|
-
* `display_width` by `display_height` is the size the visible rectangle
|
|
3404
|
-
* is shown at before it is turned (a `VideoFrame`'s `displayWidth` and
|
|
3405
|
-
* `displayHeight`), which gives the pixel aspect ratio. The frame is
|
|
3406
|
-
* shown mirrored left to right when `mirror` is set, then turned
|
|
3408
|
+
* `format` is a `WebCodecs` pixel format: `I420`, `I422`, or `I444` at 8, 10 (`P10`), or
|
|
3409
|
+
* 12 bits (`P12`), the same with alpha (`I420A`, `I420AP10`, ...), or `NV12`. Samples
|
|
3410
|
+
* above eight bits are 16-bit words with the value in the low bits. `layout` is
|
|
3411
|
+
* `[offset, stride]` per plane, `visible` is `[x, y, width, height]`, and `color` is the
|
|
3412
|
+
* frame's color metadata as project JSON. `chroma_siting` is `left`, `center`, `top-left`,
|
|
3413
|
+
* or `unspecified` (`WebCodecs` leaves it to the demuxer). `display_width` by
|
|
3414
|
+
* `display_height` is the visible rectangle's display size before rotation, which gives
|
|
3415
|
+
* the pixel aspect ratio. The frame is mirrored when `mirror` is set, then turned
|
|
3407
3416
|
* clockwise by `rotation_degrees`.
|
|
3408
3417
|
*
|
|
3409
3418
|
* # Errors
|
|
3410
|
-
* Rejects (`INVALID_INPUT`) an unknown format or chroma siting, a layout
|
|
3411
|
-
*
|
|
3412
|
-
*
|
|
3419
|
+
* Rejects (`INVALID_INPUT`) an unknown format or chroma siting, a layout or plane that does
|
|
3420
|
+
* not fit the data, a bad size or rotation, and an HDR frame the project's color pipeline
|
|
3421
|
+
* refuses.
|
|
3413
3422
|
* @param {string} source_id
|
|
3414
3423
|
* @param {bigint} media_time_ticks
|
|
3415
3424
|
* @param {string} format
|
|
@@ -3466,9 +3475,8 @@ export class WebEffectRegistry {
|
|
|
3466
3475
|
return ret >>> 0;
|
|
3467
3476
|
}
|
|
3468
3477
|
/**
|
|
3469
|
-
* How [`Self::upload_presented_video_frame`] copies a frame: `"direct"`,
|
|
3470
|
-
*
|
|
3471
|
-
* or `"canvas"` on WebGL2.
|
|
3478
|
+
* How [`Self::upload_presented_video_frame`] copies a frame: `"direct"`, `"bitmap"` (once
|
|
3479
|
+
* WebGPU refused a frame), `"untried"`, or `"canvas"` on WebGL2.
|
|
3472
3480
|
* @returns {string}
|
|
3473
3481
|
*/
|
|
3474
3482
|
get videoFrameCopy() {
|
|
@@ -3487,12 +3495,12 @@ export class WebEffectRegistry {
|
|
|
3487
3495
|
if (Symbol.dispose) WebEffectRegistry.prototype[Symbol.dispose] = WebEffectRegistry.prototype.free;
|
|
3488
3496
|
|
|
3489
3497
|
/**
|
|
3490
|
-
* Checks that `bytes` hold face `face_index` of a font the engine
|
|
3491
|
-
*
|
|
3498
|
+
* Checks that `bytes` hold face `face_index` of a font the engine can draw with, as
|
|
3499
|
+
* registering it would.
|
|
3492
3500
|
*
|
|
3493
3501
|
* # Errors
|
|
3494
|
-
* Rejects bytes the
|
|
3495
|
-
*
|
|
3502
|
+
* Rejects bytes the font parser refuses, with its reason (for example a WOFF container named
|
|
3503
|
+
* `.ttf`).
|
|
3496
3504
|
* @param {Uint8Array} bytes
|
|
3497
3505
|
* @param {number} face_index
|
|
3498
3506
|
*/
|
|
@@ -3506,13 +3514,11 @@ export function checkFont(bytes, face_index) {
|
|
|
3506
3514
|
}
|
|
3507
3515
|
|
|
3508
3516
|
/**
|
|
3509
|
-
* Checks that `cube` is a `.cube` 3D LUT the engine
|
|
3510
|
-
*
|
|
3511
|
-
* it is imported rather than at every load.
|
|
3517
|
+
* Checks that `cube` is a `.cube` 3D LUT the engine accepts, as `registerLut3d` parses it,
|
|
3518
|
+
* without a renderer, so a host can refuse a file at import time.
|
|
3512
3519
|
*
|
|
3513
3520
|
* # Errors
|
|
3514
|
-
* Rejects text the
|
|
3515
|
-
* one-dimensional table, an unsupported directive, a missing sample).
|
|
3521
|
+
* Rejects text the parser refuses, with its line and reason.
|
|
3516
3522
|
* @param {string} cube
|
|
3517
3523
|
*/
|
|
3518
3524
|
export function checkLut3d(cube) {
|
|
@@ -3525,8 +3531,8 @@ export function checkLut3d(cube) {
|
|
|
3525
3531
|
}
|
|
3526
3532
|
|
|
3527
3533
|
/**
|
|
3528
|
-
* Returns a color pipeline's identity (JSON `ColorPipeline`)
|
|
3529
|
-
*
|
|
3534
|
+
* Returns a color pipeline's identity (JSON `ColorPipeline`) as a proxy that bakes it in
|
|
3535
|
+
* records it.
|
|
3530
3536
|
*
|
|
3531
3537
|
* # Errors
|
|
3532
3538
|
* Rejects JSON that is not a color pipeline.
|
|
@@ -3555,14 +3561,13 @@ export function colorPipelineFingerprint(pipeline) {
|
|
|
3555
3561
|
}
|
|
3556
3562
|
|
|
3557
3563
|
/**
|
|
3558
|
-
* Compares a found fingerprint with a recorded one (both JSON
|
|
3559
|
-
*
|
|
3560
|
-
* `
|
|
3564
|
+
* Compares a found fingerprint with a recorded one (both JSON `MediaFingerprint`s), returning
|
|
3565
|
+
* a JSON `FingerprintMatch`: `identical`, `consistent`, `mismatch` with its fields, or
|
|
3566
|
+
* `unverified`.
|
|
3561
3567
|
*
|
|
3562
3568
|
* # Errors
|
|
3563
|
-
* Rejects JSON that is not a fingerprint, or
|
|
3564
|
-
*
|
|
3565
|
-
* in uppercase: that is an input error, not other media.
|
|
3569
|
+
* Rejects JSON that is not a fingerprint, or one with a malformed part (such as an uppercase
|
|
3570
|
+
* hash).
|
|
3566
3571
|
* @param {string} recorded
|
|
3567
3572
|
* @param {string} found
|
|
3568
3573
|
* @returns {string}
|
|
@@ -3591,13 +3596,12 @@ export function compareFingerprints(recorded, found) {
|
|
|
3591
3596
|
}
|
|
3592
3597
|
|
|
3593
3598
|
/**
|
|
3594
|
-
* Whether `project`'s media, as `catalog` describes it, is ready for
|
|
3595
|
-
* `
|
|
3596
|
-
*
|
|
3599
|
+
* Whether `project`'s media, as `catalog` describes it, is ready for `purpose` (`preview`,
|
|
3600
|
+
* `preview_proxy`, `thumbnail`, `remote_edit`, `export_original`, or `export_proxy`), as a
|
|
3601
|
+
* JSON `ConformReport`.
|
|
3597
3602
|
*
|
|
3598
3603
|
* # Errors
|
|
3599
|
-
* Rejects an invalid project, catalog (
|
|
3600
|
-
* formed among them), or purpose.
|
|
3604
|
+
* Rejects an invalid project, catalog (including malformed fingerprints), or purpose.
|
|
3601
3605
|
* @param {string} project
|
|
3602
3606
|
* @param {string} catalog
|
|
3603
3607
|
* @param {string} purpose
|
|
@@ -3629,8 +3633,7 @@ export function conformProject(project, catalog, purpose) {
|
|
|
3629
3633
|
}
|
|
3630
3634
|
|
|
3631
3635
|
/**
|
|
3632
|
-
* How many faces the font file `bytes` holds: a
|
|
3633
|
-
* count, else 1. `addFontFile` registers each.
|
|
3636
|
+
* How many faces the font file `bytes` holds: a collection's count, else 1.
|
|
3634
3637
|
* @param {Uint8Array} bytes
|
|
3635
3638
|
* @returns {number}
|
|
3636
3639
|
*/
|
|
@@ -3642,10 +3645,9 @@ export function fontFaceCount(bytes) {
|
|
|
3642
3645
|
}
|
|
3643
3646
|
|
|
3644
3647
|
/**
|
|
3645
|
-
* Returns the family name a caption style's `font_family` must
|
|
3646
|
-
*
|
|
3647
|
-
*
|
|
3648
|
-
* font or the face names no family.
|
|
3648
|
+
* Returns the family name a caption style's `font_family` must use to select face
|
|
3649
|
+
* `face_index` of the font `bytes`, or `undefined` when the bytes are not a font or the face
|
|
3650
|
+
* names no family.
|
|
3649
3651
|
* @param {Uint8Array} bytes
|
|
3650
3652
|
* @param {number} face_index
|
|
3651
3653
|
* @returns {string | undefined}
|
|
@@ -3663,8 +3665,7 @@ export function fontFamily(bytes, face_index) {
|
|
|
3663
3665
|
}
|
|
3664
3666
|
|
|
3665
3667
|
/**
|
|
3666
|
-
*
|
|
3667
|
-
* (`tests/golden/geometry_queries.json`), computed by this module.
|
|
3668
|
+
* Answers to the geometry queries the native tests pin (`tests/golden/geometry_queries.json`).
|
|
3668
3669
|
* @returns {string}
|
|
3669
3670
|
*/
|
|
3670
3671
|
export function geometryParityAnswers() {
|
|
@@ -3709,8 +3710,7 @@ export function hitTest(items_json, time, width, height, x, y) {
|
|
|
3709
3710
|
}
|
|
3710
3711
|
|
|
3711
3712
|
/**
|
|
3712
|
-
* A project's non-fatal diagnostics
|
|
3713
|
-
* issues (`alpha2/project`'s `LintIssue`).
|
|
3713
|
+
* A project's non-fatal diagnostics as a JSON array of `LintIssue`s.
|
|
3714
3714
|
*
|
|
3715
3715
|
* # Errors
|
|
3716
3716
|
* Rejects a document that does not load as a valid project.
|
|
@@ -3803,17 +3803,17 @@ export function nearestPoint(path_json, width, height, x, y) {
|
|
|
3803
3803
|
}
|
|
3804
3804
|
|
|
3805
3805
|
/**
|
|
3806
|
-
* Reads a subtitle file (`format` is `srt` or `webvtt`) into caption cues,
|
|
3807
|
-
*
|
|
3806
|
+
* Reads a subtitle file (`format` is `srt` or `webvtt`) into caption cues, returned as JSON
|
|
3807
|
+
* `{ rows, skipped, notes }`.
|
|
3808
3808
|
*
|
|
3809
|
-
* `rows` holds one caption track's
|
|
3810
|
-
*
|
|
3811
|
-
*
|
|
3812
|
-
*
|
|
3809
|
+
* `rows` holds one caption track's `CaptionCue`s per row, split so no cues overlap within a
|
|
3810
|
+
* row and no row exceeds a caption track's cue limit. `skipped` counts blocks that were not
|
|
3811
|
+
* cues; `notes` counts markup read but not kept (`extraVoices`, `droppedTimestamps`,
|
|
3812
|
+
* `droppedClasses`, `flattened`).
|
|
3813
3813
|
*
|
|
3814
3814
|
* # Errors
|
|
3815
|
-
* Rejects an unknown format, a WebVTT file without its header, and cues that
|
|
3816
|
-
*
|
|
3815
|
+
* Rejects an unknown format, a WebVTT file without its header, and cues that need more
|
|
3816
|
+
* caption tracks than a project holds.
|
|
3817
3817
|
* @param {string} text
|
|
3818
3818
|
* @param {string} format
|
|
3819
3819
|
* @returns {string}
|
|
@@ -3873,15 +3873,14 @@ export function pathLength(path_json, width, height) {
|
|
|
3873
3873
|
}
|
|
3874
3874
|
|
|
3875
3875
|
/**
|
|
3876
|
-
* The gain that brings a measured mix (a `loudnessReport` JSON) to
|
|
3877
|
-
*
|
|
3878
|
-
*
|
|
3879
|
-
* as JSON `{ gainDb, integratedLufs, truePeakDbtp, peakLimited,
|
|
3876
|
+
* The gain that brings a measured mix (a `loudnessReport` JSON) to `target_lufs` without its
|
|
3877
|
+
* true peak passing `ceiling_dbtp` or its sample peak reaching the report's
|
|
3878
|
+
* `limiterThreshold`. Returns JSON `{ gainDb, integratedLufs, truePeakDbtp, peakLimited,
|
|
3880
3879
|
* limiterLimited }`, or `null` for a mix silent below the absolute gate.
|
|
3881
3880
|
*
|
|
3882
3881
|
* # Errors
|
|
3883
|
-
* Rejects a report that is not a JSON object with
|
|
3884
|
-
*
|
|
3882
|
+
* Rejects a report that is not a JSON object with `frames`, or whose `limiterThreshold` is
|
|
3883
|
+
* neither a positive number nor `null`.
|
|
3885
3884
|
* @param {string} report_json
|
|
3886
3885
|
* @param {number} target_lufs
|
|
3887
3886
|
* @param {number} ceiling_dbtp
|
|
@@ -3909,13 +3908,11 @@ export function planLoudnessNormalization(report_json, target_lufs, ceiling_dbtp
|
|
|
3909
3908
|
}
|
|
3910
3909
|
|
|
3911
3910
|
/**
|
|
3912
|
-
* How
|
|
3913
|
-
*
|
|
3914
|
-
*
|
|
3915
|
-
*
|
|
3916
|
-
*
|
|
3917
|
-
* adapters allow past a requested time before they take the last frame at
|
|
3918
|
-
* or before it, as the native host does.
|
|
3911
|
+
* How many ticks after a source time a decoded frame's timestamp may fall and still be the
|
|
3912
|
+
* frame shown there ([`alpha2_time::presentation_slack`]). The stream's timestamps are whole
|
|
3913
|
+
* multiples of `num / den` seconds rounded to `quantum` units (0 for no rounding); an unknown
|
|
3914
|
+
* time base gives zero. Decoder adapters allow this much past a requested time before taking
|
|
3915
|
+
* the last frame at or before it, as the native host does.
|
|
3919
3916
|
* @param {bigint} num
|
|
3920
3917
|
* @param {bigint} den
|
|
3921
3918
|
* @param {bigint} quantum
|
|
@@ -3928,9 +3925,6 @@ export function presentationSlackTicks(num, den, quantum) {
|
|
|
3928
3925
|
|
|
3929
3926
|
/**
|
|
3930
3927
|
* The engine's quality level names, lowest first, as a JSON array.
|
|
3931
|
-
*
|
|
3932
|
-
* An app builds its quality control from this rather than from a list of its
|
|
3933
|
-
* own, so the names a browser offers are the ones the engine resolves.
|
|
3934
3928
|
* @returns {string}
|
|
3935
3929
|
*/
|
|
3936
3930
|
export function qualityLevels() {
|
|
@@ -3981,9 +3975,8 @@ export function resamplePath(path_json, width, height, counts) {
|
|
|
3981
3975
|
}
|
|
3982
3976
|
|
|
3983
3977
|
/**
|
|
3984
|
-
* Resolves a quality level into a stereo audio bitrate in bits per second.
|
|
3985
|
-
*
|
|
3986
|
-
* `codec` is `aac` or `opus`. The native host reads the same engine table.
|
|
3978
|
+
* Resolves a quality level into a stereo audio bitrate in bits per second. `codec` is `aac`
|
|
3979
|
+
* or `opus`.
|
|
3987
3980
|
* @param {string} codec
|
|
3988
3981
|
* @param {string} level
|
|
3989
3982
|
* @returns {number}
|
|
@@ -4001,11 +3994,8 @@ export function resolveAudioBitrate(codec, level) {
|
|
|
4001
3994
|
}
|
|
4002
3995
|
|
|
4003
3996
|
/**
|
|
4004
|
-
* Resolves a quality level into the rate control every sink encodes with
|
|
4005
|
-
*
|
|
4006
|
-
* Returns JSON: `{ "bitrate", "mode", "quantizer" }`. The native host calls
|
|
4007
|
-
* the same engine function, so a browser export and a native export at the
|
|
4008
|
-
* same level and output receive the same numbers.
|
|
3997
|
+
* Resolves a quality level into the rate control every sink encodes with, as JSON
|
|
3998
|
+
* `{ "bitrate", "mode", "quantizer" }`. The native host calls the same engine function.
|
|
4009
3999
|
* @param {string} codec
|
|
4010
4000
|
* @param {number} width
|
|
4011
4001
|
* @param {number} height
|
|
@@ -4038,8 +4028,8 @@ export function resolveRateControl(codec, width, height, frame_rate_num, frame_r
|
|
|
4038
4028
|
}
|
|
4039
4029
|
|
|
4040
4030
|
/**
|
|
4041
|
-
* The unit a stream's first timestamps (in
|
|
4042
|
-
*
|
|
4031
|
+
* The unit a stream's first timestamps (in time base units) are rounded to, or 0 for none
|
|
4032
|
+
* ([`alpha2_time::rounding_quantum`]).
|
|
4043
4033
|
* @param {BigInt64Array} timestamps
|
|
4044
4034
|
* @returns {bigint}
|
|
4045
4035
|
*/
|
|
@@ -4051,7 +4041,16 @@ export function roundingQuantum(timestamps) {
|
|
|
4051
4041
|
}
|
|
4052
4042
|
|
|
4053
4043
|
/**
|
|
4054
|
-
*
|
|
4044
|
+
* Replaces the GPU watchdog, in milliseconds, that losses are classified against (zero
|
|
4045
|
+
* restores the default of 2000). A page has no environment, so tests set it here.
|
|
4046
|
+
* @param {number} milliseconds
|
|
4047
|
+
*/
|
|
4048
|
+
export function setGpuWatchdogMs(milliseconds) {
|
|
4049
|
+
wasm.setGpuWatchdogMs(milliseconds);
|
|
4050
|
+
}
|
|
4051
|
+
|
|
4052
|
+
/**
|
|
4053
|
+
* Each item's normalized bounds as JSON `[{ at, bounds }]`.
|
|
4055
4054
|
*
|
|
4056
4055
|
* # Errors
|
|
4057
4056
|
* Rejects items that are not a valid content tree, or a bad size or time.
|
|
@@ -4083,10 +4082,8 @@ export function shapeBounds(items_json, time, width, height) {
|
|
|
4083
4082
|
}
|
|
4084
4083
|
|
|
4085
4084
|
/**
|
|
4086
|
-
* Installs the panic reporter
|
|
4087
|
-
*
|
|
4088
|
-
* `wasm-bindgen` calls this from the generated initializer, so every entry
|
|
4089
|
-
* point is covered without the host opting in.
|
|
4085
|
+
* Installs the panic reporter when the module is instantiated, so every entry point is
|
|
4086
|
+
* covered without the host opting in.
|
|
4090
4087
|
*/
|
|
4091
4088
|
export function start() {
|
|
4092
4089
|
wasm.start();
|
|
@@ -4160,7 +4157,7 @@ export function trimPath(path_json, width, height, start, end, offset) {
|
|
|
4160
4157
|
|
|
4161
4158
|
/**
|
|
4162
4159
|
* The vector coverage and scene hashes the native tests pin
|
|
4163
|
-
* (`tests/golden/vector_coverage.json`)
|
|
4160
|
+
* (`tests/golden/vector_coverage.json`).
|
|
4164
4161
|
* @returns {string}
|
|
4165
4162
|
*/
|
|
4166
4163
|
export function vectorParityHashes() {
|
|
@@ -4252,40 +4249,48 @@ function __wbg_get_imports() {
|
|
|
4252
4249
|
__wbg_addEventListener_9534e2dc12044ee4: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4253
4250
|
arg0.addEventListener(getStringFromWasm0(arg1, arg2), arg3);
|
|
4254
4251
|
}, arguments); },
|
|
4255
|
-
|
|
4256
|
-
const ret =
|
|
4252
|
+
__wbg_alpha2BitmapUploadProbe_7976d3b0c6827a6d: function() { return handleError(function () {
|
|
4253
|
+
const ret = alpha2BitmapUploadProbe();
|
|
4257
4254
|
return ret;
|
|
4258
4255
|
}, arguments); },
|
|
4259
|
-
|
|
4256
|
+
__wbg_alpha2Canvas2d_3668c19c96b4f15a: function() { return handleError(function (arg0) {
|
|
4260
4257
|
const ret = alpha2Canvas2d(arg0);
|
|
4261
4258
|
return ret;
|
|
4262
4259
|
}, arguments); },
|
|
4263
|
-
|
|
4260
|
+
__wbg_alpha2CopyExternalImage_95762c9cc634ab12: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
4264
4261
|
alpha2CopyExternalImage(arg0, arg1, arg2, arg3 >>> 0, arg4 >>> 0);
|
|
4265
4262
|
}, arguments); },
|
|
4266
|
-
|
|
4263
|
+
__wbg_alpha2FrameBitmap_8069b59f1799565d: function() { return handleError(function (arg0, arg1, arg2) {
|
|
4267
4264
|
const ret = alpha2FrameBitmap(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
4268
4265
|
return ret;
|
|
4269
4266
|
}, arguments); },
|
|
4270
|
-
|
|
4267
|
+
__wbg_alpha2ImagePixels_9eb4ad6c54e9fbe6: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4271
4268
|
const ret = alpha2ImagePixels(arg1, arg2 >>> 0, arg3 >>> 0);
|
|
4272
4269
|
const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
|
|
4273
4270
|
const len1 = WASM_VECTOR_LEN;
|
|
4274
4271
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
4275
4272
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
4276
4273
|
}, arguments); },
|
|
4277
|
-
|
|
4274
|
+
__wbg_alpha2PutRgba_247946e76f6cb738: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
4278
4275
|
alpha2PutRgba(arg0, getArrayU8FromWasm0(arg1, arg2), arg3 >>> 0, arg4 >>> 0);
|
|
4279
4276
|
}, arguments); },
|
|
4280
|
-
|
|
4277
|
+
__wbg_alpha2ResizeCanvas_02815dfd2db7efe1: function() { return handleError(function (arg0, arg1, arg2) {
|
|
4281
4278
|
alpha2ResizeCanvas(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
4282
4279
|
}, arguments); },
|
|
4280
|
+
__wbg_apply_5d9aa7604c2490a8: function() { return handleError(function (arg0, arg1, arg2) {
|
|
4281
|
+
const ret = arg0.apply(arg1, arg2);
|
|
4282
|
+
return ret;
|
|
4283
|
+
}, arguments); },
|
|
4283
4284
|
__wbg_attachShader_74ecf95efc73ee58: function(arg0, arg1, arg2) {
|
|
4284
4285
|
arg0.attachShader(arg1, arg2);
|
|
4285
4286
|
},
|
|
4286
4287
|
__wbg_attachShader_bfb57af27e3c4a25: function(arg0, arg1, arg2) {
|
|
4287
4288
|
arg0.attachShader(arg1, arg2);
|
|
4288
4289
|
},
|
|
4290
|
+
__wbg_beginComputePass_b9a325184985e6ff: function(arg0, arg1) {
|
|
4291
|
+
const ret = arg0.beginComputePass(arg1);
|
|
4292
|
+
return ret;
|
|
4293
|
+
},
|
|
4289
4294
|
__wbg_beginQuery_8c123fa7e7aec2a4: function(arg0, arg1, arg2) {
|
|
4290
4295
|
arg0.beginQuery(arg1 >>> 0, arg2);
|
|
4291
4296
|
},
|
|
@@ -4768,6 +4773,9 @@ function __wbg_get_imports() {
|
|
|
4768
4773
|
__wbg_endQuery_4eea0267f103b625: function(arg0, arg1) {
|
|
4769
4774
|
arg0.endQuery(arg1 >>> 0);
|
|
4770
4775
|
},
|
|
4776
|
+
__wbg_end_82fd0c12ba185009: function(arg0) {
|
|
4777
|
+
arg0.end();
|
|
4778
|
+
},
|
|
4771
4779
|
__wbg_end_b57473834b877409: function(arg0) {
|
|
4772
4780
|
arg0.end();
|
|
4773
4781
|
},
|
|
@@ -5043,6 +5051,16 @@ function __wbg_get_imports() {
|
|
|
5043
5051
|
const ret = result;
|
|
5044
5052
|
return ret;
|
|
5045
5053
|
},
|
|
5054
|
+
__wbg_instanceof_Promise_f6320f682f582ddf: function(arg0) {
|
|
5055
|
+
let result;
|
|
5056
|
+
try {
|
|
5057
|
+
result = arg0 instanceof Promise;
|
|
5058
|
+
} catch (_) {
|
|
5059
|
+
result = false;
|
|
5060
|
+
}
|
|
5061
|
+
const ret = result;
|
|
5062
|
+
return ret;
|
|
5063
|
+
},
|
|
5046
5064
|
__wbg_instanceof_TypeError_2784cf59ac94d11e: function(arg0) {
|
|
5047
5065
|
let result;
|
|
5048
5066
|
try {
|
|
@@ -5586,6 +5604,9 @@ function __wbg_get_imports() {
|
|
|
5586
5604
|
__wbg_set_beginning_of_pass_write_index_e552c5e8b8bbf52f: function(arg0, arg1) {
|
|
5587
5605
|
arg0.beginningOfPassWriteIndex = arg1 >>> 0;
|
|
5588
5606
|
},
|
|
5607
|
+
__wbg_set_beginning_of_pass_write_index_fa9ae10d5d2804ce: function(arg0, arg1) {
|
|
5608
|
+
arg0.beginningOfPassWriteIndex = arg1 >>> 0;
|
|
5609
|
+
},
|
|
5589
5610
|
__wbg_set_bind_group_layouts_458c44ba55100b82: function(arg0, arg1, arg2) {
|
|
5590
5611
|
arg0.bindGroupLayouts = getArrayJsValueViewFromWasm0(arg1, arg2);
|
|
5591
5612
|
},
|
|
@@ -5697,6 +5718,9 @@ function __wbg_get_imports() {
|
|
|
5697
5718
|
__wbg_set_end_of_pass_write_index_8f164f9e60d4ad16: function(arg0, arg1) {
|
|
5698
5719
|
arg0.endOfPassWriteIndex = arg1 >>> 0;
|
|
5699
5720
|
},
|
|
5721
|
+
__wbg_set_end_of_pass_write_index_b54a8e3802b9ae0d: function(arg0, arg1) {
|
|
5722
|
+
arg0.endOfPassWriteIndex = arg1 >>> 0;
|
|
5723
|
+
},
|
|
5700
5724
|
__wbg_set_entries_6f866302103b81e9: function(arg0, arg1, arg2) {
|
|
5701
5725
|
arg0.entries = getArrayJsValueViewFromWasm0(arg1, arg2);
|
|
5702
5726
|
},
|
|
@@ -5763,6 +5787,9 @@ function __wbg_get_imports() {
|
|
|
5763
5787
|
__wbg_set_label_17202740051e9722: function(arg0, arg1, arg2) {
|
|
5764
5788
|
arg0.label = getStringFromWasm0(arg1, arg2);
|
|
5765
5789
|
},
|
|
5790
|
+
__wbg_set_label_17b4858e1eef23dd: function(arg0, arg1, arg2) {
|
|
5791
|
+
arg0.label = getStringFromWasm0(arg1, arg2);
|
|
5792
|
+
},
|
|
5766
5793
|
__wbg_set_label_2fefb39c0e0dbbe8: function(arg0, arg1, arg2) {
|
|
5767
5794
|
arg0.label = getStringFromWasm0(arg1, arg2);
|
|
5768
5795
|
},
|
|
@@ -5913,6 +5940,9 @@ function __wbg_get_imports() {
|
|
|
5913
5940
|
__wbg_set_query_set_f030702f1b69199f: function(arg0, arg1) {
|
|
5914
5941
|
arg0.querySet = arg1;
|
|
5915
5942
|
},
|
|
5943
|
+
__wbg_set_query_set_f9a94586851fdba2: function(arg0, arg1) {
|
|
5944
|
+
arg0.querySet = arg1;
|
|
5945
|
+
},
|
|
5916
5946
|
__wbg_set_r_6ece4d74af63364f: function(arg0, arg1) {
|
|
5917
5947
|
arg0.r = arg1;
|
|
5918
5948
|
},
|
|
@@ -6033,6 +6063,9 @@ function __wbg_get_imports() {
|
|
|
6033
6063
|
__wbg_set_texture_a33be3fe02ac6264: function(arg0, arg1) {
|
|
6034
6064
|
arg0.texture = arg1;
|
|
6035
6065
|
},
|
|
6066
|
+
__wbg_set_timestamp_writes_5f240bbaad97fcaf: function(arg0, arg1) {
|
|
6067
|
+
arg0.timestampWrites = arg1;
|
|
6068
|
+
},
|
|
6036
6069
|
__wbg_set_timestamp_writes_de6a09f299b71b76: function(arg0, arg1) {
|
|
6037
6070
|
arg0.timestampWrites = arg1;
|
|
6038
6071
|
},
|
|
@@ -6466,47 +6499,47 @@ function __wbg_get_imports() {
|
|
|
6466
6499
|
arg0.writeTexture(arg1, getArrayU8FromWasm0(arg2, arg3), arg4, arg5);
|
|
6467
6500
|
}, arguments); },
|
|
6468
6501
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
6469
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
6502
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 3927, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
6470
6503
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true_);
|
|
6471
6504
|
return ret;
|
|
6472
6505
|
},
|
|
6473
6506
|
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
6474
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx:
|
|
6507
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 312, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
6475
6508
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___web_sys_9e2ae0ace5131457___features__gen_Event__Event______true_);
|
|
6476
6509
|
return ret;
|
|
6477
6510
|
},
|
|
6478
6511
|
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
6479
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUCompilationInfo")], shim_idx:
|
|
6512
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUCompilationInfo")], shim_idx: 1703, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
6480
6513
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___sys__JsNullable_wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true_);
|
|
6481
6514
|
return ret;
|
|
6482
6515
|
},
|
|
6483
6516
|
__wbindgen_generic_0000000000000004: function(arg0, arg1) {
|
|
6484
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx:
|
|
6485
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
6517
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 1703, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
6518
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___sys__JsNullable_wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true__234);
|
|
6486
6519
|
return ret;
|
|
6487
6520
|
},
|
|
6488
6521
|
__wbindgen_generic_0000000000000005: function(arg0, arg1) {
|
|
6489
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx:
|
|
6522
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx: 1706, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
6490
6523
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true_);
|
|
6491
6524
|
return ret;
|
|
6492
6525
|
},
|
|
6493
6526
|
__wbindgen_generic_0000000000000006: function(arg0, arg1) {
|
|
6494
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx:
|
|
6495
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
6527
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 1706, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
6528
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__236);
|
|
6496
6529
|
return ret;
|
|
6497
6530
|
},
|
|
6498
6531
|
__wbindgen_generic_0000000000000007: function(arg0, arg1) {
|
|
6499
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx:
|
|
6500
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
6532
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 1703, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
6533
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___sys__JsNullable_wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true__237);
|
|
6501
6534
|
return ret;
|
|
6502
6535
|
},
|
|
6503
6536
|
__wbindgen_generic_0000000000000008: function(arg0, arg1) {
|
|
6504
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx:
|
|
6505
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
6537
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 1703, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
6538
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___sys__JsNullable_wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true__238);
|
|
6506
6539
|
return ret;
|
|
6507
6540
|
},
|
|
6508
6541
|
__wbindgen_generic_0000000000000009: function(arg0, arg1) {
|
|
6509
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
6542
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 314, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
6510
6543
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke_______true_);
|
|
6511
6544
|
return ret;
|
|
6512
6545
|
},
|
|
@@ -6573,8 +6606,9 @@ function __wbg_get_imports() {
|
|
|
6573
6606
|
return {
|
|
6574
6607
|
__proto__: null,
|
|
6575
6608
|
"./alpha2_wasm_bg.js": import0,
|
|
6576
|
-
"./snippets/alpha2-wasm-
|
|
6577
|
-
"./snippets/alpha2-wasm-
|
|
6609
|
+
"./snippets/alpha2-wasm-070d94113471ef0a/inline1.js": import1,
|
|
6610
|
+
"./snippets/alpha2-wasm-070d94113471ef0a/inline1.js": import2,
|
|
6611
|
+
"./snippets/alpha2-wasm-070d94113471ef0a/inline1.js": import3,
|
|
6578
6612
|
};
|
|
6579
6613
|
}
|
|
6580
6614
|
|
|
@@ -6590,8 +6624,8 @@ function wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46
|
|
|
6590
6624
|
wasm.wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true_(arg0, arg1, arg2);
|
|
6591
6625
|
}
|
|
6592
6626
|
|
|
6593
|
-
function
|
|
6594
|
-
wasm.
|
|
6627
|
+
function wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__236(arg0, arg1, arg2) {
|
|
6628
|
+
wasm.wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__236(arg0, arg1, arg2);
|
|
6595
6629
|
}
|
|
6596
6630
|
|
|
6597
6631
|
function wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true_(arg0, arg1, arg2) {
|
|
@@ -6608,22 +6642,22 @@ function wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bin
|
|
|
6608
6642
|
}
|
|
6609
6643
|
}
|
|
6610
6644
|
|
|
6611
|
-
function
|
|
6612
|
-
const ret = wasm.
|
|
6645
|
+
function wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___sys__JsNullable_wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true__234(arg0, arg1, arg2) {
|
|
6646
|
+
const ret = wasm.wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___sys__JsNullable_wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true__234(arg0, arg1, arg2);
|
|
6613
6647
|
if (ret[1]) {
|
|
6614
6648
|
throw takeFromExternrefTable0(ret[0]);
|
|
6615
6649
|
}
|
|
6616
6650
|
}
|
|
6617
6651
|
|
|
6618
|
-
function
|
|
6619
|
-
const ret = wasm.
|
|
6652
|
+
function wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___sys__JsNullable_wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true__237(arg0, arg1, arg2) {
|
|
6653
|
+
const ret = wasm.wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___sys__JsNullable_wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true__237(arg0, arg1, arg2);
|
|
6620
6654
|
if (ret[1]) {
|
|
6621
6655
|
throw takeFromExternrefTable0(ret[0]);
|
|
6622
6656
|
}
|
|
6623
6657
|
}
|
|
6624
6658
|
|
|
6625
|
-
function
|
|
6626
|
-
const ret = wasm.
|
|
6659
|
+
function wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___sys__JsNullable_wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true__238(arg0, arg1, arg2) {
|
|
6660
|
+
const ret = wasm.wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___sys__JsNullable_wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true__238(arg0, arg1, arg2);
|
|
6627
6661
|
if (ret[1]) {
|
|
6628
6662
|
throw takeFromExternrefTable0(ret[0]);
|
|
6629
6663
|
}
|
|
@@ -6866,6 +6900,17 @@ function getArrayI8FromWasm0(ptr, len) {
|
|
|
6866
6900
|
return getInt8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
6867
6901
|
}
|
|
6868
6902
|
|
|
6903
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
6904
|
+
ptr = ptr >>> 0;
|
|
6905
|
+
const mem = getDataViewMemory0();
|
|
6906
|
+
const result = [];
|
|
6907
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
6908
|
+
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
6909
|
+
}
|
|
6910
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
6911
|
+
return result;
|
|
6912
|
+
}
|
|
6913
|
+
|
|
6869
6914
|
function getArrayJsValueViewFromWasm0(ptr, len) {
|
|
6870
6915
|
ptr = ptr >>> 0;
|
|
6871
6916
|
const mem = getDataViewMemory0();
|