alpha2 0.4.5 → 0.5.0

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.
Files changed (119) hide show
  1. package/README.md +5 -4
  2. package/THIRD_PARTY_NOTICES.md +4 -0
  3. package/dist/abort.d.ts +12 -0
  4. package/dist/abort.js +48 -0
  5. package/dist/active-clock.d.ts +35 -0
  6. package/dist/active-clock.js +99 -0
  7. package/dist/assets.d.ts +28 -22
  8. package/dist/assets.js +8 -12
  9. package/dist/audio-layout.d.ts +52 -74
  10. package/dist/audio-layout.js +114 -148
  11. package/dist/audio-timeline.d.ts +89 -117
  12. package/dist/audio-timeline.js +102 -118
  13. package/dist/audio-worker.d.ts +12 -21
  14. package/dist/audio-worker.js +8 -13
  15. package/dist/audio-worklet-processor.js +45 -58
  16. package/dist/audio-worklet.d.ts +45 -76
  17. package/dist/audio-worklet.js +44 -79
  18. package/dist/audio.d.ts +15 -23
  19. package/dist/audio.js +9 -13
  20. package/dist/builder.d.ts +45 -63
  21. package/dist/builder.js +49 -45
  22. package/dist/capabilities.d.ts +99 -16
  23. package/dist/capabilities.js +2 -2
  24. package/dist/captions.d.ts +45 -22
  25. package/dist/captions.js +60 -15
  26. package/dist/chroma-siting.d.ts +24 -41
  27. package/dist/chroma-siting.js +38 -71
  28. package/dist/containers.d.ts +41 -30
  29. package/dist/containers.js +59 -27
  30. package/dist/decoder-fallback.d.ts +13 -0
  31. package/dist/decoder-fallback.js +38 -0
  32. package/dist/decoder-order.d.ts +24 -39
  33. package/dist/decoder-order.js +28 -42
  34. package/dist/edit.d.ts +77 -154
  35. package/dist/edit.js +98 -180
  36. package/dist/effects.d.ts +109 -173
  37. package/dist/effects.js +7 -9
  38. package/dist/export-destination.d.ts +25 -41
  39. package/dist/export-destination.js +20 -32
  40. package/dist/export-failure.d.ts +34 -59
  41. package/dist/export-failure.js +54 -48
  42. package/dist/export-metrics.d.ts +116 -0
  43. package/dist/export-metrics.js +74 -0
  44. package/dist/export-retry.d.ts +46 -29
  45. package/dist/export-retry.js +86 -51
  46. package/dist/exporter.d.ts +67 -116
  47. package/dist/exporter.js +133 -133
  48. package/dist/extensions.d.ts +69 -115
  49. package/dist/extensions.js +55 -82
  50. package/dist/frame-intake.d.ts +92 -0
  51. package/dist/frame-intake.js +114 -0
  52. package/dist/frame-supply.d.ts +98 -157
  53. package/dist/frame-supply.js +191 -162
  54. package/dist/generated/project-schema.d.ts +742 -464
  55. package/dist/generated/project-schema.js +63 -2
  56. package/dist/generated/project-shape.js +663 -118
  57. package/dist/geometry.d.ts +28 -34
  58. package/dist/geometry.js +18 -23
  59. package/dist/gpu-recovery.d.ts +92 -0
  60. package/dist/gpu-recovery.js +135 -0
  61. package/dist/hdr-frames.d.ts +88 -62
  62. package/dist/hdr-frames.js +123 -46
  63. package/dist/index.d.ts +4 -0
  64. package/dist/index.js +4 -0
  65. package/dist/json-text.d.ts +13 -23
  66. package/dist/json-text.js +10 -20
  67. package/dist/layout-values.d.ts +14 -22
  68. package/dist/layout-values.js +18 -21
  69. package/dist/layout.d.ts +55 -55
  70. package/dist/layout.js +37 -36
  71. package/dist/loudness.d.ts +27 -32
  72. package/dist/loudness.js +19 -23
  73. package/dist/media.d.ts +85 -237
  74. package/dist/media.js +133 -287
  75. package/dist/mediabunny.d.ts +173 -237
  76. package/dist/mediabunny.js +943 -518
  77. package/dist/physical-frames.d.ts +5 -17
  78. package/dist/physical-frames.js +4 -11
  79. package/dist/player.d.ts +56 -47
  80. package/dist/player.js +155 -40
  81. package/dist/presented-frames.d.ts +2 -7
  82. package/dist/presented-frames.js +3 -8
  83. package/dist/project.d.ts +83 -110
  84. package/dist/project.js +421 -447
  85. package/dist/rate-control.d.ts +9 -23
  86. package/dist/rate-control.js +7 -18
  87. package/dist/renderer-choice.d.ts +41 -0
  88. package/dist/renderer-choice.js +82 -0
  89. package/dist/repacked-bytes.d.ts +0 -2
  90. package/dist/repacked-bytes.js +2 -5
  91. package/dist/robustness.d.ts +25 -37
  92. package/dist/robustness.js +71 -54
  93. package/dist/sha256.d.ts +5 -13
  94. package/dist/sha256.js +9 -24
  95. package/dist/text.d.ts +106 -63
  96. package/dist/text.js +44 -69
  97. package/dist/video-frames.d.ts +7 -25
  98. package/dist/video-frames.js +12 -29
  99. package/dist/waveform.d.ts +5 -11
  100. package/dist/waveform.js +4 -9
  101. package/dist/worker-error.d.ts +5 -20
  102. package/dist/worker-error.js +8 -25
  103. package/dist/worker.d.ts +82 -92
  104. package/dist/worker.js +239 -144
  105. package/package.json +26 -2
  106. package/wasm/alpha2_audio_worklet.wasm +0 -0
  107. package/wasm/alpha2_extensions.d.ts +26 -47
  108. package/wasm/alpha2_extensions.js +26 -47
  109. package/wasm/alpha2_extensions_bg.wasm +0 -0
  110. package/wasm/alpha2_wasm.d.ts +487 -543
  111. package/wasm/alpha2_wasm.js +669 -572
  112. package/wasm/alpha2_wasm_bg.wasm +0 -0
  113. package/wasm/alpha2_wasm_bg.wasm.d.ts +20 -8
  114. package/wasm/rust-crate-licenses.md +2 -2
  115. package/wasm/snippets/{alpha2-wasm-57b04ecc6db57e1f → alpha2-wasm-1313375d424845c0}/inline1.js +1 -0
  116. package/wasm/snippets/alpha2-wasm-1313375d424845c0/inline2.js +82 -0
  117. package/wasm/snippets/alpha2-wasm-57b04ecc6db57e1f/inline2.js +0 -52
  118. /package/wasm/snippets/{alpha2-wasm-57b04ecc6db57e1f → alpha2-wasm-1313375d424845c0}/inline0.js +0 -0
  119. /package/wasm/snippets/{alpha2-wasm-57b04ecc6db57e1f → alpha2-wasm-1313375d424845c0}/inline3.js +0 -0
@@ -1,14 +1,15 @@
1
1
  /* @ts-self-types="./alpha2_wasm.d.ts" */
2
- import { alpha2Canvas2d, alpha2ImagePixels, alpha2PutRgba, alpha2ResizeCanvas } from './snippets/alpha2-wasm-57b04ecc6db57e1f/inline0.js';
3
- import { alpha2BitmapUploadsPremultiplied, alpha2FrameBitmap } from './snippets/alpha2-wasm-57b04ecc6db57e1f/inline2.js';
4
- import { alpha2CopyExternalImage } from './snippets/alpha2-wasm-57b04ecc6db57e1f/inline3.js';
5
- import * as import1 from "./snippets/alpha2-wasm-57b04ecc6db57e1f/inline1.js"
6
- import * as import2 from "./snippets/alpha2-wasm-57b04ecc6db57e1f/inline1.js"
2
+ import { alpha2Canvas2d, alpha2ImagePixels, alpha2PutRgba, alpha2ResizeCanvas } from './snippets/alpha2-wasm-1313375d424845c0/inline0.js';
3
+ import { alpha2BitmapUploadProbe, alpha2FrameBitmap } from './snippets/alpha2-wasm-1313375d424845c0/inline2.js';
4
+ import { alpha2CopyExternalImage } from './snippets/alpha2-wasm-1313375d424845c0/inline3.js';
5
+ import * as import1 from "./snippets/alpha2-wasm-1313375d424845c0/inline1.js"
6
+ import * as import2 from "./snippets/alpha2-wasm-1313375d424845c0/inline1.js"
7
+ import * as import3 from "./snippets/alpha2-wasm-1313375d424845c0/inline1.js"
7
8
 
8
9
 
9
10
  /**
10
- * Converts one source's audio to the project rate. Positions are sample
11
- * indexes: of the source at its own rate, of the output at the project's.
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
- * 8192 times the target rate, whose filter would not fit the table.
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
- * is source sample `input_start`. The source is silent outside `input`.
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.
@@ -237,9 +238,8 @@ export class LoudnessMeter {
237
238
  return this;
238
239
  }
239
240
  /**
240
- * Adds one block: the channels' samples concatenated, channel after
241
- * channel, all of one length. A NaN or infinite sample measures as
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
- * under `policy` (`drop_video_keep_audio`, `preserve_every_video_frame`,
318
- * `silent_scrub`, or `offline_exact`).
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
- * position in ticks while it runs, else `undefined` (a position before
344
- * the clock's start is its start); `presented` says whether the frame
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 pixels, tightly packed premultiplied RGBA8 rows,
402
- * and lets go of them; a second call returns an empty array.
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 with caller-supplied fonts, without a GPU:
414
- * where the engine draws each one's text on the canvas. Given the fonts
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() {
@@ -426,6 +431,25 @@ export class WasmTextMeasurer {
426
431
  const ptr = this.__destroy_into_raw();
427
432
  wasm.__wbg_wasmtextmeasurer_free(ptr, 0);
428
433
  }
434
+ /**
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.
437
+ *
438
+ * # Errors
439
+ * Rejects malformed font bytes; no face is added.
440
+ * @param {string} family
441
+ * @param {Uint8Array} bytes
442
+ */
443
+ addFontFile(family, bytes) {
444
+ const ptr0 = passStringToWasm0(family, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
445
+ const len0 = WASM_VECTOR_LEN;
446
+ const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
447
+ const len1 = WASM_VECTOR_LEN;
448
+ const ret = wasm.wasmtextmeasurer_addFontFile(this.__wbg_ptr, ptr0, len0, ptr1, len1);
449
+ if (ret[1]) {
450
+ throw takeFromExternrefTable0(ret[0]);
451
+ }
452
+ }
429
453
  /**
430
454
  * Appends an OpenType font to the fallback stack.
431
455
  *
@@ -452,22 +476,20 @@ export class WasmTextMeasurer {
452
476
  wasm.wasmtextmeasurer_clearFonts(this.__wbg_ptr);
453
477
  }
454
478
  /**
455
- * Where each node of the layout generator `generator_json`
456
- * (`{ "type": "layout", "root" }`, as a project holds it) lies on a
457
- * `width` by `height` picture at picture time `time` (ticks), laid
458
- * out with these fonts as a frame lays it out, as JSON `{ nodes }`:
459
- * each node in preorder as `{ at, border, content, overflow,
460
- * lineCount }`, its boxes `{ left, top, right, bottom }` in fractions
461
- * of the picture, before its clip's transform and node visuals.
462
- * `lineCount` is `null` for a node without text. Measure at the size
463
- * the picture is drawn at. The layout's `"<n>px"` lengths are pixels
464
- * of the project canvas, `canvasWidth` by `canvasHeight`: the
465
- * 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).
466
489
  *
467
490
  * # Errors
468
- * Rejects JSON that is no valid layout generator (on that canvas),
469
- * an empty picture or canvas, a time that is not whole ticks, and a
470
- * 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.
471
493
  * @param {string} generator_json
472
494
  * @param {number} width
473
495
  * @param {number} height
@@ -497,18 +519,17 @@ export class WasmTextMeasurer {
497
519
  }
498
520
  }
499
521
  /**
500
- * Where the text generator `generator_json` (`{ "type": "text",
501
- * "text", "style" }`, as a project holds it) lies on a `width` by
502
- * `height` canvas, as JSON `{ layout, content, ink, lineCount }`:
503
- * each a `{ left, top, right, bottom }` rectangle in fractions of the
504
- * canvas, as the style's position is, on the picture the generator
505
- * draws before its clip's transform; `ink` is `null` when the text
506
- * draws nothing. Measure at the project's canvas size: text laid out
507
- * 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.
508
530
  *
509
531
  * # Errors
510
- * Rejects JSON that is no valid text generator, an empty canvas, and
511
- * a measurer without fonts.
532
+ * Rejects an invalid text generator, an empty canvas, and a measurer without fonts.
512
533
  * @param {string} generator_json
513
534
  * @param {number} width
514
535
  * @param {number} height
@@ -560,6 +581,25 @@ export class WasmTextRasterizer {
560
581
  const ptr = this.__destroy_into_raw();
561
582
  wasm.__wbg_wasmtextrasterizer_free(ptr, 0);
562
583
  }
584
+ /**
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.
587
+ *
588
+ * # Errors
589
+ * Rejects malformed font bytes; no face is added.
590
+ * @param {string} family
591
+ * @param {Uint8Array} bytes
592
+ */
593
+ addFontFile(family, bytes) {
594
+ const ptr0 = passStringToWasm0(family, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
595
+ const len0 = WASM_VECTOR_LEN;
596
+ const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
597
+ const len1 = WASM_VECTOR_LEN;
598
+ const ret = wasm.wasmtextrasterizer_addFontFile(this.__wbg_ptr, ptr0, len0, ptr1, len1);
599
+ if (ret[1]) {
600
+ throw takeFromExternrefTable0(ret[0]);
601
+ }
602
+ }
563
603
  /**
564
604
  * Appends an OpenType font to the fallback stack.
565
605
  *
@@ -610,14 +650,12 @@ export class WasmTextRasterizer {
610
650
  return this;
611
651
  }
612
652
  /**
613
- * Shapes, lays out, and rasterizes one request, or returns the cached
614
- * result of its content version. The cache keeps the default budget
615
- * of results (`alpha2_text::DEFAULT_TEXT_CACHE_BYTES`), dropping the
616
- * 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.
617
656
  *
618
657
  * # Errors
619
- * Rejects a malformed or out-of-range request, or a rasterizer
620
- * without fonts.
658
+ * Rejects a malformed or out-of-range request, or a rasterizer without fonts.
621
659
  * @param {string} request_json
622
660
  * @param {bigint} content_version
623
661
  * @returns {RasterizedText}
@@ -635,8 +673,7 @@ export class WasmTextRasterizer {
635
673
  if (Symbol.dispose) WasmTextRasterizer.prototype[Symbol.dispose] = WasmTextRasterizer.prototype.free;
636
674
 
637
675
  /**
638
- * Builds a multi-resolution waveform summary from planar samples streamed in
639
- * blocks.
676
+ * Builds a multi-resolution waveform summary from planar samples streamed in blocks.
640
677
  */
641
678
  export class WaveformBuilder {
642
679
  __destroy_into_raw() {
@@ -664,8 +701,8 @@ export class WaveformBuilder {
664
701
  return WaveformResult.__wrap(ret[0]);
665
702
  }
666
703
  /**
667
- * A builder for `channels` channels, `bucket_samples` samples per finest
668
- * bucket, and `levels` zoom levels, each four times coarser.
704
+ * A builder for `channels` channels, `bucket_samples` samples per finest bucket, and
705
+ * `levels` zoom levels, each four times coarser.
669
706
  *
670
707
  * # Errors
671
708
  * Rejects zero channels, a zero bucket, or 0 or more than 16 levels.
@@ -683,12 +720,11 @@ export class WaveformBuilder {
683
720
  return this;
684
721
  }
685
722
  /**
686
- * Adds one block: the channels' samples concatenated, channel after
687
- * channel, all of one length.
723
+ * Adds one block of planar samples, channel after channel, all of one length.
688
724
  *
689
725
  * # Errors
690
- * Rejects a block whose length is not a multiple of the channel count,
691
- * or a builder already finished.
726
+ * Rejects a block whose length is not a multiple of the channel count, or a finished
727
+ * builder.
692
728
  * @param {Float32Array} planar
693
729
  */
694
730
  push(planar) {
@@ -732,8 +768,8 @@ export class WaveformResult {
732
768
  return ret >>> 0;
733
769
  }
734
770
  /**
735
- * One channel's buckets at `level` as `[min, max, rms]` triples; empty
736
- * past the last level or channel.
771
+ * One channel's buckets at `level` as `[min, max, rms]` triples; empty past the last level
772
+ * or channel.
737
773
  * @param {number} level
738
774
  * @param {number} channel
739
775
  * @returns {Float32Array}
@@ -766,9 +802,8 @@ if (Symbol.dispose) WaveformResult.prototype[Symbol.dispose] = WaveformResult.pr
766
802
  /**
767
803
  * The browser renderer that draws on the CPU, for a page with no GPU.
768
804
  *
769
- * It answers the calls `WebEffectRegistry` answers for preview, export,
770
- * text and audio, and draws the same pictures as the engine's native CPU
771
- * renderer, byte for byte. Effects registered at run time are refused.
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 are refused.
772
807
  */
773
808
  export class WebCpuRenderer {
774
809
  static __wrap(ptr) {
@@ -787,6 +822,25 @@ export class WebCpuRenderer {
787
822
  const ptr = this.__destroy_into_raw();
788
823
  wasm.__wbg_webcpurenderer_free(ptr, 0);
789
824
  }
825
+ /**
826
+ * Appends every face of an OpenType font file (each weight of a `.ttc`) to the fallback
827
+ * stack in file order, all checked before any is added.
828
+ *
829
+ * # Errors
830
+ * Returns an error for malformed font bytes; no face is added.
831
+ * @param {string} family
832
+ * @param {Uint8Array} bytes
833
+ */
834
+ addFontFile(family, bytes) {
835
+ const ptr0 = passStringToWasm0(family, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
836
+ const len0 = WASM_VECTOR_LEN;
837
+ const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
838
+ const len1 = WASM_VECTOR_LEN;
839
+ const ret = wasm.webcpurenderer_addFontFile(this.__wbg_ptr, ptr0, len0, ptr1, len1);
840
+ if (ret[1]) {
841
+ throw takeFromExternrefTable0(ret[0]);
842
+ }
843
+ }
790
844
  /**
791
845
  * Appends an OpenType font to the fallback stack text draws with.
792
846
  *
@@ -810,8 +864,8 @@ export class WebCpuRenderer {
810
864
  * `WebEffectRegistry.aliasVideoFrame`.
811
865
  *
812
866
  * # Errors
813
- * Refuses an alias that would make the export frame's sources outgrow
814
- * the uploaded-frame budget.
867
+ * Refuses an alias that would push the export frame's sources over the uploaded-frame
868
+ * budget.
815
869
  * @param {string} source_id
816
870
  * @param {bigint} existing_media_time_ticks
817
871
  * @param {bigint} requested_media_time_ticks
@@ -947,29 +1001,30 @@ export class WebCpuRenderer {
947
1001
  return ret >>> 0;
948
1002
  }
949
1003
  /**
950
- * `WebEffectRegistry.beginExportAt`: one exact timeline timestamp at
951
- * export quality, drawn on the CPU, its `readback` already settled.
1004
+ * `WebEffectRegistry.beginExportAt`: one exact timeline timestamp at export quality, with
1005
+ * `readback` already settled.
952
1006
  *
953
1007
  * # Errors
954
- * Returns an error without a loaded project, for an unknown codec or an
955
- * odd size, an effect that does not draw on the CPU (`EFFECT_ERROR`),
956
- * or when the frame cannot be drawn.
1008
+ * Returns an error without a loaded project, for an unknown codec or odd size, an effect
1009
+ * that does not draw on the CPU (`EFFECT_ERROR`), or when the frame cannot be drawn.
957
1010
  * @param {bigint} time_ticks
958
1011
  * @param {string} codec
1012
+ * @param {string | null} [pixels]
959
1013
  * @returns {any}
960
1014
  */
961
- beginExportAt(time_ticks, codec) {
1015
+ beginExportAt(time_ticks, codec, pixels) {
962
1016
  const ptr0 = passStringToWasm0(codec, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
963
1017
  const len0 = WASM_VECTOR_LEN;
964
- const ret = wasm.webcpurenderer_beginExportAt(this.__wbg_ptr, time_ticks, ptr0, len0);
1018
+ var ptr1 = isLikeNone(pixels) ? 0 : passStringToWasm0(pixels, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1019
+ var len1 = WASM_VECTOR_LEN;
1020
+ const ret = wasm.webcpurenderer_beginExportAt(this.__wbg_ptr, time_ticks, ptr0, len0, ptr1, len1);
965
1021
  if (ret[2]) {
966
1022
  throw takeFromExternrefTable0(ret[1]);
967
1023
  }
968
1024
  return takeFromExternrefTable0(ret[0]);
969
1025
  }
970
1026
  /**
971
- * `WebEffectRegistry.beginExportFrame`: its `readback` is already
972
- * settled.
1027
+ * `WebEffectRegistry.beginExportFrame`, with `readback` already settled.
973
1028
  *
974
1029
  * # Errors
975
1030
  * As [`Self::export_frame`].
@@ -986,8 +1041,8 @@ export class WebCpuRenderer {
986
1041
  * `WebEffectRegistry.beginExport`, drawing on the CPU.
987
1042
  *
988
1043
  * # Errors
989
- * Returns an error without a loaded project, for an empty range, an
990
- * invalid frame rate, or an unknown codec.
1044
+ * Returns an error without a loaded project, for an empty range, an invalid frame rate, or
1045
+ * an unknown codec.
991
1046
  * @param {bigint} start_ticks
992
1047
  * @param {bigint} end_ticks
993
1048
  * @param {number} rate_num
@@ -1003,8 +1058,7 @@ export class WebCpuRenderer {
1003
1058
  }
1004
1059
  }
1005
1060
  /**
1006
- * The engine's effect and transition authoring catalog: every built-in
1007
- * draws on the CPU.
1061
+ * The engine's effect and transition authoring catalog; every built-in draws on the CPU.
1008
1062
  * @returns {string}
1009
1063
  */
1010
1064
  builtinCatalog() {
@@ -1020,10 +1074,8 @@ export class WebCpuRenderer {
1020
1074
  }
1021
1075
  }
1022
1076
  /**
1023
- * What this renderer can do, in the shared capability report's JSON
1024
- * with runtime `browser`: its "GPU" is the CPU (backend `cpu`),
1025
- * `features` says `renderer.cpu` is available, `renderer.gpu` is not,
1026
- * and runtime effects (`effects.runtime`) do not run.
1077
+ * The shared capability report JSON with runtime `browser`: backend `cpu`,
1078
+ * `renderer.cpu` available, `renderer.gpu` and `effects.runtime` not.
1027
1079
  *
1028
1080
  * # Errors
1029
1081
  * Returns an error if the report cannot be serialized.
@@ -1078,7 +1130,7 @@ export class WebCpuRenderer {
1078
1130
  wasm.webcpurenderer_clearFrames(this.__wbg_ptr);
1079
1131
  }
1080
1132
  /**
1081
- * Refused: a runtime effect is WGSL, which only a GPU runs.
1133
+ * Refused: runtime effects are WGSL, which only a GPU runs.
1082
1134
  *
1083
1135
  * # Errors
1084
1136
  * Always rejects with `EFFECT_ERROR`.
@@ -1103,8 +1155,8 @@ export class WebCpuRenderer {
1103
1155
  return ret !== 0;
1104
1156
  }
1105
1157
  /**
1106
- * A JSON snapshot for developer tooling: what the CPU renderer drew,
1107
- * its result cache, and the frames it holds.
1158
+ * A JSON snapshot for developer tooling: what the CPU renderer drew, its result cache, and
1159
+ * the frames it holds.
1108
1160
  *
1109
1161
  * # Errors
1110
1162
  * Returns an error if the snapshot cannot be serialized.
@@ -1135,12 +1187,11 @@ export class WebCpuRenderer {
1135
1187
  wasm.webcpurenderer_endExport(this.__wbg_ptr);
1136
1188
  }
1137
1189
  /**
1138
- * `WebEffectRegistry.exportFrame`: the next export frame, drawn on the
1139
- * CPU before the call returns.
1190
+ * `WebEffectRegistry.exportFrame`: the next export frame, drawn before the call returns.
1140
1191
  *
1141
1192
  * # Errors
1142
- * Returns an error without a running export or a loaded project, or
1143
- * when the frame cannot be drawn.
1193
+ * Returns an error without a running export or loaded project, or when the frame cannot
1194
+ * be drawn.
1144
1195
  * @returns {Promise<any>}
1145
1196
  */
1146
1197
  exportFrame() {
@@ -1225,8 +1276,8 @@ export class WebCpuRenderer {
1225
1276
  return ret !== 0;
1226
1277
  }
1227
1278
  /**
1228
- * Loads and validates a versioned project document, keeping uploads
1229
- * as `WebEffectRegistry.loadProject` does, and ends a running export.
1279
+ * Loads and validates a versioned project document, keeping uploads as
1280
+ * `WebEffectRegistry.loadProject` does, and ends a running export.
1230
1281
  *
1231
1282
  * # Errors
1232
1283
  * Rejects a document the engine refuses.
@@ -1370,10 +1421,9 @@ export class WebCpuRenderer {
1370
1421
  return ret !== 0;
1371
1422
  }
1372
1423
  /**
1373
- * Draws one project frame at the preview quality and puts it on the
1374
- * canvas's 2D context, scaled to the canvas, answering the JSON
1375
- * `WebEffectRegistry.renderAt` answers. A frame equal to the one shown
1376
- * is neither drawn nor put (`unchanged`).
1424
+ * Draws one project frame at preview quality onto the canvas's 2D context, scaled to fit,
1425
+ * and returns the JSON `WebEffectRegistry.renderAt` returns. A frame equal to the one
1426
+ * shown is skipped (`unchanged`).
1377
1427
  *
1378
1428
  * # Errors
1379
1429
  * Fails without a project, or when the frame cannot be drawn.
@@ -1446,8 +1496,8 @@ export class WebCpuRenderer {
1446
1496
  wasm.webcpurenderer_resetPlayer(this.__wbg_ptr);
1447
1497
  }
1448
1498
  /**
1449
- * Sizes the canvas to `width` by `height`, which preview frames are
1450
- * scaled to fill, and drops the held frame.
1499
+ * Sizes the canvas to `width` by `height`, which preview frames are scaled to fill, and
1500
+ * drops the held frame.
1451
1501
  *
1452
1502
  * # Errors
1453
1503
  * Fails without a canvas, or for a zero or oversized dimension.
@@ -1517,8 +1567,7 @@ export class WebCpuRenderer {
1517
1567
  wasm.webcpurenderer_setPassTiming(this.__wbg_ptr, _enabled);
1518
1568
  }
1519
1569
  /**
1520
- * Renders preview frames at `scale` times the project's size from now
1521
- * on (0.5 until set).
1570
+ * Renders preview frames at `scale` times the project size from now on (default 0.5).
1522
1571
  *
1523
1572
  * # Errors
1524
1573
  * Rejects a scale that is not finite, above 0 and at most 8.
@@ -1531,8 +1580,8 @@ export class WebCpuRenderer {
1531
1580
  }
1532
1581
  }
1533
1582
  /**
1534
- * Lets drawn results occupy up to `bytes` of wasm memory to be found
1535
- * again when a frame repeats; zero, the default, turns that off.
1583
+ * Lets drawn results use up to `bytes` of wasm memory for reuse when a frame repeats; zero
1584
+ * (the default) disables it.
1536
1585
  *
1537
1586
  * # Errors
1538
1587
  * Rejects a negative or non-finite budget.
@@ -1545,8 +1594,7 @@ export class WebCpuRenderer {
1545
1594
  }
1546
1595
  }
1547
1596
  /**
1548
- * Sets the byte budget of uploaded frames (default 256 MiB, wasm
1549
- * memory), as `WebEffectRegistry.setUploadedFrameBudget` does.
1597
+ * Sets the uploaded-frame byte budget (default 256 MiB of wasm memory).
1550
1598
  *
1551
1599
  * # Errors
1552
1600
  * Rejects a negative or non-finite budget.
@@ -1575,8 +1623,7 @@ export class WebCpuRenderer {
1575
1623
  return v2;
1576
1624
  }
1577
1625
  /**
1578
- * A promise that resolves at once: the CPU renderer's work is done when
1579
- * its call returns.
1626
+ * Resolves at once, since CPU work is done when its call returns.
1580
1627
  * @returns {Promise<any>}
1581
1628
  */
1582
1629
  submittedWorkDone() {
@@ -1584,8 +1631,8 @@ export class WebCpuRenderer {
1584
1631
  return ret;
1585
1632
  }
1586
1633
  /**
1587
- * `true`: decoded `VideoFrame`s are taken, as planes (`uploadYuvFrame`)
1588
- * or through a 2D canvas.
1634
+ * `true`: decoded `VideoFrame`s are taken as planes (`uploadYuvFrame`) or through a 2D
1635
+ * canvas.
1589
1636
  * @returns {boolean}
1590
1637
  */
1591
1638
  get supportsExternalVideoFrame() {
@@ -1656,8 +1703,8 @@ export class WebCpuRenderer {
1656
1703
  }
1657
1704
  }
1658
1705
  /**
1659
- * [`Self::upload_presented_video_frame`] for a bitmap made with
1660
- * `premultiplyAlpha: "none"`. Always closes `bitmap`.
1706
+ * [`Self::upload_presented_video_frame`] for a bitmap made with `premultiplyAlpha: "none"`.
1707
+ * Always closes `bitmap`.
1661
1708
  *
1662
1709
  * # Errors
1663
1710
  * As [`Self::upload_presented_video_frame`].
@@ -1780,13 +1827,11 @@ export class WebCpuRenderer {
1780
1827
  return takeFromExternrefTable0(ret[0]);
1781
1828
  }
1782
1829
  /**
1783
- * `WebEffectRegistry.uploadPresentedVideoFrame`, the frame read through
1784
- * a 2D canvas (the browser's conversion, as WebGL2's is). Always closes
1785
- * `frame`; an HDR source's frame is refused (`uploadYuvFrame` takes it).
1830
+ * `WebEffectRegistry.uploadPresentedVideoFrame`: the frame read through a 2D canvas (the
1831
+ * browser's conversion). Always closes `frame`. HDR sources must use `uploadYuvFrame`.
1786
1832
  *
1787
1833
  * # Errors
1788
- * Rejects an HDR source's frame, a bad placement, and a frame the
1789
- * browser cannot read.
1834
+ * Rejects an HDR source's frame, a bad placement, and a frame the browser cannot read.
1790
1835
  * @param {string} source_id
1791
1836
  * @param {bigint} media_time_ticks
1792
1837
  * @param {VideoFrame} frame
@@ -1806,8 +1851,7 @@ export class WebCpuRenderer {
1806
1851
  return takeFromExternrefTable0(ret[0]);
1807
1852
  }
1808
1853
  /**
1809
- * `WebEffectRegistry.uploadRgbaFrame`: premultiplied RGBA8 kept at its
1810
- * own size.
1854
+ * `WebEffectRegistry.uploadRgbaFrame`: premultiplied RGBA8 kept at its own size.
1811
1855
  *
1812
1856
  * # Errors
1813
1857
  * Rejects pixels that do not hold the size.
@@ -1830,8 +1874,7 @@ export class WebCpuRenderer {
1830
1874
  return takeFromExternrefTable0(ret[0]);
1831
1875
  }
1832
1876
  /**
1833
- * `WebEffectRegistry.uploadRgbaImage`: a still, premultiplied RGBA8 kept
1834
- * at its own size.
1877
+ * `WebEffectRegistry.uploadRgbaImage`: a premultiplied RGBA8 still kept at its own size.
1835
1878
  *
1836
1879
  * # Errors
1837
1880
  * Rejects pixels that do not hold the size.
@@ -1853,8 +1896,8 @@ export class WebCpuRenderer {
1853
1896
  return takeFromExternrefTable0(ret[0]);
1854
1897
  }
1855
1898
  /**
1856
- * `WebEffectRegistry.uploadVideoFrame`: the frame read through a 2D
1857
- * canvas, fitted to the loaded project. Always closes `frame`.
1899
+ * `WebEffectRegistry.uploadVideoFrame`: the frame read through a 2D canvas and fitted to
1900
+ * the loaded project. Always closes `frame`.
1858
1901
  *
1859
1902
  * # Errors
1860
1903
  * Rejects an HDR source's frame and a frame the browser cannot read.
@@ -1873,14 +1916,13 @@ export class WebCpuRenderer {
1873
1916
  return takeFromExternrefTable0(ret[0]);
1874
1917
  }
1875
1918
  /**
1876
- * `WebEffectRegistry.uploadYuvFrame`: a decoded frame's planes, as
1877
- * `VideoFrame.copyTo` writes them, kept as they are and converted under
1878
- * the project's color pipeline when a frame first draws them.
1919
+ * `WebEffectRegistry.uploadYuvFrame`: a decoded frame's planes as `VideoFrame.copyTo`
1920
+ * writes them, converted under the project's color pipeline when first drawn.
1879
1921
  *
1880
1922
  * # Errors
1881
- * Rejects (`INVALID_INPUT`) an unknown format or chroma siting, a layout
1882
- * or plane that does not fit the data, a bad size or rotation, and an
1883
- * HDR frame when the project's color pipeline refuses HDR sources.
1923
+ * Rejects (`INVALID_INPUT`) an unknown format or chroma siting, a layout or plane that does
1924
+ * not fit the data, a bad size or rotation, and an HDR frame the project's color pipeline
1925
+ * refuses.
1884
1926
  * @param {string} source_id
1885
1927
  * @param {bigint} media_time_ticks
1886
1928
  * @param {string} format
@@ -1937,8 +1979,7 @@ export class WebCpuRenderer {
1937
1979
  return ret >>> 0;
1938
1980
  }
1939
1981
  /**
1940
- * `"canvas"`: frames passed as `VideoFrame`s are read through a 2D
1941
- * canvas.
1982
+ * `"canvas"`: `VideoFrame`s are read through a 2D canvas.
1942
1983
  * @returns {string}
1943
1984
  */
1944
1985
  get videoFrameCopy() {
@@ -1957,7 +1998,7 @@ export class WebCpuRenderer {
1957
1998
  if (Symbol.dispose) WebCpuRenderer.prototype[Symbol.dispose] = WebCpuRenderer.prototype.free;
1958
1999
 
1959
2000
  /**
1960
- * WebGPU-owned runtime effect registry for worker hosts.
2001
+ * The browser GPU renderer (WebGPU or WebGL2), with its runtime effect registry.
1961
2002
  */
1962
2003
  export class WebEffectRegistry {
1963
2004
  static __wrap(ptr) {
@@ -1977,10 +2018,45 @@ export class WebEffectRegistry {
1977
2018
  wasm.__wbg_webeffectregistry_free(ptr, 0);
1978
2019
  }
1979
2020
  /**
1980
- * Appends an OpenType font to the fallback stack caption tracks, text
1981
- * generators and layouts draw and lay out with. Give it the same font
1982
- * files as the export host, and preview text matches exported text pixel
1983
- * for pixel.
2021
+ * The adapter as the browser names it: wgpu's name (the unmasked WebGL renderer or a
2022
+ * WebGPU adapter's description), else `<vendor> <architecture>`; empty when unnamed.
2023
+ * @returns {string}
2024
+ */
2025
+ get adapter() {
2026
+ let deferred1_0;
2027
+ let deferred1_1;
2028
+ try {
2029
+ const ret = wasm.webeffectregistry_adapter(this.__wbg_ptr);
2030
+ deferred1_0 = ret[0];
2031
+ deferred1_1 = ret[1];
2032
+ return getStringFromWasm0(ret[0], ret[1]);
2033
+ } finally {
2034
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2035
+ }
2036
+ }
2037
+ /**
2038
+ * Appends every face of an OpenType font file (each weight of a `.ttc`) to the fallback
2039
+ * stack in file order, all checked before any is added.
2040
+ *
2041
+ * # Errors
2042
+ * Returns an error for malformed font bytes; no face is added.
2043
+ * @param {string} family
2044
+ * @param {Uint8Array} bytes
2045
+ */
2046
+ addFontFile(family, bytes) {
2047
+ const ptr0 = passStringToWasm0(family, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2048
+ const len0 = WASM_VECTOR_LEN;
2049
+ const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
2050
+ const len1 = WASM_VECTOR_LEN;
2051
+ const ret = wasm.webeffectregistry_addFontFile(this.__wbg_ptr, ptr0, len0, ptr1, len1);
2052
+ if (ret[1]) {
2053
+ throw takeFromExternrefTable0(ret[0]);
2054
+ }
2055
+ }
2056
+ /**
2057
+ * Appends an OpenType font to the fallback stack for captions, text generators and
2058
+ * layouts. With the same fonts as the export host, preview text matches exported text
2059
+ * pixel for pixel.
1984
2060
  *
1985
2061
  * # Errors
1986
2062
  * Returns an error for malformed font bytes.
@@ -1999,12 +2075,12 @@ export class WebEffectRegistry {
1999
2075
  }
2000
2076
  }
2001
2077
  /**
2002
- * Aliases a new exact source-time request to an already uploaded physical frame.
2003
- * Returns `false` when no frame is stored at the existing time.
2078
+ * Aliases a new exact source-time request to an already uploaded frame. Returns `false`
2079
+ * when no frame is stored at the existing time.
2004
2080
  *
2005
2081
  * # Errors
2006
- * Refuses with `RESOURCE_LIMIT`, as an upload, an alias that would make
2007
- * the export frame's sources outgrow the uploaded-frame budget.
2082
+ * Refuses with `RESOURCE_LIMIT` an alias that would push the export frame's sources over
2083
+ * the uploaded-frame budget.
2008
2084
  * @param {string} source_id
2009
2085
  * @param {bigint} existing_media_time_ticks
2010
2086
  * @param {bigint} requested_media_time_ticks
@@ -2036,8 +2112,7 @@ export class WebEffectRegistry {
2036
2112
  return ret >>> 0;
2037
2113
  }
2038
2114
  /**
2039
- * Sources that the most recent `renderAudio` call could not mix, as a
2040
- * JSON array of source IDs.
2115
+ * Source IDs the most recent `renderAudio` call could not mix, as a JSON array.
2041
2116
  * @returns {string}
2042
2117
  */
2043
2118
  audioMissingSources() {
@@ -2059,12 +2134,9 @@ export class WebEffectRegistry {
2059
2134
  }
2060
2135
  }
2061
2136
  /**
2062
- * Source intervals a host must decode before mixing a sample range:
2063
- * every sample the mix reads, interpolation neighbours included.
2064
- *
2065
- * They cover read-ahead and, after a seek, the finite state-settling
2066
- * history each clip's effect stages replay, as well as the delay lines.
2067
- * Tick values are strings so JavaScript preserves the full i64 range.
2137
+ * Source intervals a host must decode before mixing a sample range, including
2138
+ * interpolation neighbours, read-ahead, delay lines, and after a seek the settling history
2139
+ * effect stages replay. Tick values are strings to preserve the full i64 range.
2068
2140
  * @param {bigint} start_sample
2069
2141
  * @param {number} frames
2070
2142
  * @returns {string}
@@ -2088,7 +2160,7 @@ export class WebEffectRegistry {
2088
2160
  }
2089
2161
  }
2090
2162
  /**
2091
- * Allocated audio sample bytes, including spare capacity after trimming.
2163
+ * Allocated audio sample bytes, including spare capacity.
2092
2164
  * @returns {number}
2093
2165
  */
2094
2166
  audioRetainedBytes() {
@@ -2104,12 +2176,9 @@ export class WebEffectRegistry {
2104
2176
  return ret >>> 0;
2105
2177
  }
2106
2178
  /**
2107
- * Half-open project-rate sample intervals of one source's retained
2108
- * windows, most recently uploaded first, as JSON
2109
- * `[{startSample, endSample}]`.
2110
- *
2111
- * A host decodes only what these do not cover: the store may have
2112
- * extended, replaced or dropped a window since the host uploaded it.
2179
+ * Half-open project-rate sample intervals of one source's windows, most recently uploaded
2180
+ * first, as JSON `[{startSample, endSample}]`. A host decodes only what these do not
2181
+ * cover, since the store may have extended, replaced or dropped windows.
2113
2182
  * @param {string} source_id
2114
2183
  * @returns {string}
2115
2184
  */
@@ -2142,28 +2211,45 @@ export class WebEffectRegistry {
2142
2211
  return ret >>> 0;
2143
2212
  }
2144
2213
  /**
2145
- * Starts one exact timeline timestamp offscreen at export quality.
2146
- *
2147
- * This is the stateless worker-backend counterpart of [`Self::export_frame`].
2148
- * Scheduling remains with the typed JavaScript exporter, while pixels are
2149
- * still produced by the same full-resolution Rust render path and never by
2150
- * capturing the preview canvas.
2214
+ * The graphics API this renderer draws through: `"webgpu"` or `"webgl2"`.
2215
+ * @returns {string}
2216
+ */
2217
+ get backend() {
2218
+ let deferred1_0;
2219
+ let deferred1_1;
2220
+ try {
2221
+ const ret = wasm.webeffectregistry_backend(this.__wbg_ptr);
2222
+ deferred1_0 = ret[0];
2223
+ deferred1_1 = ret[1];
2224
+ return getStringFromWasm0(ret[0], ret[1]);
2225
+ } finally {
2226
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2227
+ }
2228
+ }
2229
+ /**
2230
+ * Starts one exact timeline timestamp offscreen at export quality: the stateless
2231
+ * counterpart of [`Self::export_frame`] for a JavaScript-scheduled exporter.
2151
2232
  *
2152
- * A rendered result exposes its readback promise separately so the worker
2153
- * can submit later frames while earlier mappings remain in flight. The
2154
- * frame is packed for `codec`, as [`Self::begin_export`] packs it.
2233
+ * The readback promise is exposed separately so later frames can be submitted while
2234
+ * earlier mappings are in flight. Frames are packed for `codec` as [`Self::begin_export`]
2235
+ * does, in `pixels` (an `FFmpeg` pixel format: `yuva420p` keeps alpha and draws no
2236
+ * background, `yuv420p10le` is 10-bit; I420 when absent). Non-I420 layouts are packed into
2237
+ * tight planes with the `WebCodecs` `format` (`I420A`, `I420P10`).
2155
2238
  *
2156
2239
  * # Errors
2157
- * Returns an error without a loaded project, for an unknown codec, or
2158
- * when rendering/submission fails.
2240
+ * Returns an error without a loaded project, for an unknown codec or pixel format, or when
2241
+ * rendering or submission fails.
2159
2242
  * @param {bigint} time_ticks
2160
2243
  * @param {string} codec
2244
+ * @param {string | null} [pixels]
2161
2245
  * @returns {any}
2162
2246
  */
2163
- beginExportAt(time_ticks, codec) {
2247
+ beginExportAt(time_ticks, codec, pixels) {
2164
2248
  const ptr0 = passStringToWasm0(codec, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2165
2249
  const len0 = WASM_VECTOR_LEN;
2166
- const ret = wasm.webeffectregistry_beginExportAt(this.__wbg_ptr, time_ticks, ptr0, len0);
2250
+ var ptr1 = isLikeNone(pixels) ? 0 : passStringToWasm0(pixels, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2251
+ var len1 = WASM_VECTOR_LEN;
2252
+ const ret = wasm.webeffectregistry_beginExportAt(this.__wbg_ptr, time_ticks, ptr0, len0, ptr1, len1);
2167
2253
  if (ret[2]) {
2168
2254
  throw takeFromExternrefTable0(ret[1]);
2169
2255
  }
@@ -2172,10 +2258,8 @@ export class WebEffectRegistry {
2172
2258
  /**
2173
2259
  * Starts the next export render and returns before its GPU readback maps.
2174
2260
  *
2175
- * A rendered result contains a `readback` promise. Calling this method
2176
- * again while that promise is pending allows two or three independent GPU
2177
- * readbacks to remain in flight. Waiting results still do not advance the
2178
- * deterministic export cursor.
2261
+ * A rendered result carries a `readback` promise; calling again while it is pending keeps
2262
+ * two or three readbacks in flight. Waiting results do not advance the cursor.
2179
2263
  * @returns {any}
2180
2264
  */
2181
2265
  beginExportFrame() {
@@ -2186,20 +2270,17 @@ export class WebEffectRegistry {
2186
2270
  return takeFromExternrefTable0(ret[0]);
2187
2271
  }
2188
2272
  /**
2189
- * Renders the next export frame and presents it on this renderer's
2190
- * canvas instead of reading it back: the experimental transport where the
2191
- * page captures the canvas with `new VideoFrame(canvas)` and hands that to
2192
- * its encoder, so no frame is mapped or copied into script.
2273
+ * Renders the next export frame and presents it on this renderer's canvas instead of
2274
+ * reading it back (experimental): the page captures it with `new VideoFrame(canvas)`.
2193
2275
  *
2194
- * The canvas must be sized to the export (`resizeSurface`) and must only
2195
- * serve this export. Capture it before the next call, in the same task:
2196
- * the next frame replaces the canvas's drawing buffer. Returns
2197
- * `{kind: "rendered", index, timeTicks}`, or the `waiting` and `complete`
2198
- * results `beginExportFrame` returns.
2276
+ * The canvas must be sized to the export (`resizeSurface`) and serve only this export.
2277
+ * Capture it in the same task, before the next call replaces the drawing buffer. Returns
2278
+ * `{kind: "rendered", index, timeTicks}`, or the `waiting` and `complete` results of
2279
+ * `beginExportFrame`.
2199
2280
  *
2200
2281
  * # Errors
2201
- * Returns an error without a loaded project, a running export, or a
2202
- * canvas, or when rendering or presentation fails.
2282
+ * Returns an error without a loaded project, a running export, or a canvas, or when
2283
+ * rendering or presentation fails.
2203
2284
  * @returns {any}
2204
2285
  */
2205
2286
  beginExportPresent() {
@@ -2212,25 +2293,18 @@ export class WebEffectRegistry {
2212
2293
  /**
2213
2294
  * Starts a deterministic export over a half-open timeline range.
2214
2295
  *
2215
- * Resets the audio renderer, so `renderAudio` for the export does not
2216
- * inherit preview's reverb tails, compressor envelopes, or ducking, and
2217
- * makes it exact until `endExport` whatever `setAudioContinuity` chose,
2218
- * so any jump replays. Until `endExport`, an audio block a source is missing from mixes
2219
- * silence and advances nothing (`audioMissingSources` names the
2220
- * sources), so rendering it again once they are uploaded continues
2221
- * exactly as an uninterrupted export does.
2222
- *
2223
- * Export renders offscreen at [`QualityProfile::export`] and never touches
2224
- * the presentation surface, so its output is independent of the canvas,
2225
- * its size, and whatever the browser compositor is doing.
2296
+ * Resets the audio renderer so export audio inherits no preview DSP state, and keeps it
2297
+ * exact until `endExport`. Until then, an audio block missing a source mixes silence and
2298
+ * advances nothing (`audioMissingSources` names them), so re-rendering it after upload
2299
+ * continues exactly.
2226
2300
  *
2227
- * The frames are packed for `codec`, an engine codec name (`h264`,
2228
- * `hevc`, `vp9`, `av1`): its chroma siting
2229
- * ([`alpha2_media::YuvEncoding::export`]).
2301
+ * Renders offscreen at [`QualityProfile::export`], independent of the canvas. Frames are
2302
+ * packed with the chroma siting of `codec` (`h264`, `hevc`, `vp9`, `av1`;
2303
+ * [`alpha2_media::YuvEncoding::export`]).
2230
2304
  *
2231
2305
  * # Errors
2232
- * Returns an error without a loaded project, for an empty range, an
2233
- * invalid frame rate, or an unknown codec.
2306
+ * Returns an error without a loaded project, for an empty range, an invalid frame rate, or
2307
+ * an unknown codec.
2234
2308
  * @param {bigint} start_ticks
2235
2309
  * @param {bigint} end_ticks
2236
2310
  * @param {number} rate_num
@@ -2262,15 +2336,14 @@ export class WebEffectRegistry {
2262
2336
  }
2263
2337
  }
2264
2338
  /**
2265
- * What this renderer can do, as the shared capability report's JSON
2266
- * (`alpha2-capabilities`) with runtime `browser`. Decoding, encoding,
2267
- * and page features are the page's to add: `decode` and `encode` are
2268
- * `null`, and `features` names only the renderer's own: `renderer.gpu`
2269
- * (this one), `renderer.cpu` and `effects.runtime`, as the native host
2270
- * names them.
2339
+ * The shared capability report JSON (`alpha2-capabilities`) with runtime `browser`.
2340
+ * `decode` and `encode` are `null` for the page to fill; `features` names only
2341
+ * `renderer.gpu`, `renderer.cpu`, `effects.runtime`, and on WebGL2
2342
+ * `uploads.webgl2-bitmap` (unavailable where frames upload as CPU pixels).
2271
2343
  *
2272
2344
  * # Errors
2273
- * Returns an error if the report cannot be serialized.
2345
+ * Returns an error if the report cannot be serialized, or on WebGL2 when the upload probe
2346
+ * throws.
2274
2347
  * @returns {string}
2275
2348
  */
2276
2349
  capabilityReport() {
@@ -2322,18 +2395,15 @@ export class WebEffectRegistry {
2322
2395
  wasm.webeffectregistry_clearFrames(this.__wbg_ptr);
2323
2396
  }
2324
2397
  /**
2325
- * Parses one JSON effect definition and compiles it on this binding's
2326
- * device, without rebuilding wasm. The promise resolves to the compiled
2327
- * effect, which [`Self::register_compiled_effect`] then adds; it rejects
2328
- * with the shader's diagnostics.
2398
+ * Parses one JSON effect definition and compiles it on this binding's device. The promise
2399
+ * resolves to the compiled effect for [`Self::register_compiled_effect`], or rejects with
2400
+ * the shader's diagnostics.
2329
2401
  *
2330
- * The call returns as soon as the shader and pipeline are created: the
2331
- * wait for the browser's compiler holds nothing of this binding, so it
2332
- * renders, uploads, compiles other effects, and may be freed meanwhile.
2402
+ * Returns once the shader and pipeline are created; while the browser compiles, the
2403
+ * binding stays fully usable and may be freed.
2333
2404
  *
2334
2405
  * # Errors
2335
- * Throws `EFFECT_ERROR` for a definition the engine refuses before
2336
- * compiling it.
2406
+ * Throws `EFFECT_ERROR` for a definition the engine refuses before compiling.
2337
2407
  * @param {string} json
2338
2408
  * @returns {Promise<any>}
2339
2409
  */
@@ -2347,16 +2417,14 @@ export class WebEffectRegistry {
2347
2417
  return takeFromExternrefTable0(ret[0]);
2348
2418
  }
2349
2419
  /**
2350
- * Creates the renderer that draws on the CPU, for a browser that offers
2351
- * no WebGPU adapter and no WebGL2 context, or a page that asks for it.
2352
- * It needs no GPU: it presents preview frames on `canvas`'s 2D context
2353
- * (an `OffscreenCanvas` or a page canvas, `undefined` for none) and
2354
- * packs export frames in wasm, single-threaded, drawing what the native
2355
- * CPU renderer draws byte for byte. Runtime WGSL effects are refused.
2420
+ * Creates the CPU renderer, for a browser with no WebGPU adapter or WebGL2 context, or on
2421
+ * request. It presents preview frames on `canvas`'s 2D context (`OffscreenCanvas`, page
2422
+ * canvas, or `undefined` for none) and packs export frames in wasm, single-threaded,
2423
+ * byte-identical to the native CPU renderer. Runtime WGSL effects are refused.
2356
2424
  *
2357
2425
  * # Errors
2358
- * Rejects (`INVALID_INPUT`) a canvas that has no 2D context, such as
2359
- * one that already holds a WebGL or WebGPU context.
2426
+ * Rejects (`INVALID_INPUT`) a canvas with no 2D context, such as one already holding a
2427
+ * WebGL or WebGPU context.
2360
2428
  * @param {any} canvas
2361
2429
  * @returns {WebCpuRenderer}
2362
2430
  */
@@ -2368,25 +2436,38 @@ export class WebEffectRegistry {
2368
2436
  return WebCpuRenderer.__wrap(ret[0]);
2369
2437
  }
2370
2438
  /**
2371
- * Creates a worker-owned renderer compatible with an `OffscreenCanvas`.
2439
+ * Creates a worker-owned renderer for an `OffscreenCanvas`.
2440
+ *
2441
+ * Tries browser WebGPU first, then WebGL2. On WebGPU the device opens before the canvas is
2442
+ * bound, so a failure leaves the canvas free for another context kind (such as the CPU
2443
+ * renderer's 2D one). `options.softwareAdapter` is `"allow"` (default) or `"refuse"`;
2444
+ * refused, a software adapter (WebGPU fallback, `SwiftShader`, llvmpipe, WARP) is skipped
2445
+ * and the call rejects before binding the canvas if nothing else is offered.
2372
2446
  *
2373
- * Passing the surface during adapter selection enables wgpu's WebGL2
2374
- * fallback as well as browser WebGPU.
2447
+ * # Errors
2448
+ * Rejects `GPU_INIT_FAILED` when no device opens or only a refused software adapter is
2449
+ * offered; `GPU_DEVICE_LOST` when the canvas's WebGL context is lost and not restored;
2450
+ * `INVALID_INPUT` for a canvas that takes no GPU surface or bad options.
2375
2451
  * @param {OffscreenCanvas} canvas
2452
+ * @param {any | null} [options]
2376
2453
  * @returns {Promise<WebEffectRegistry>}
2377
2454
  */
2378
- static createForCanvas(canvas) {
2379
- const ret = wasm.webeffectregistry_createForCanvas(canvas);
2455
+ static createForCanvas(canvas, options) {
2456
+ const ret = wasm.webeffectregistry_createForCanvas(canvas, isLikeNone(options) ? 0 : addToExternrefTable0(options));
2380
2457
  return ret;
2381
2458
  }
2382
2459
  /**
2383
- * Creates a renderer that presents directly to a main-thread HTML canvas.
2384
- * Worker hosts should continue to use `createForCanvas` with an `OffscreenCanvas`.
2460
+ * Creates a renderer presenting directly to a main-thread HTML canvas, as
2461
+ * [`Self::create_for_canvas`] does for an `OffscreenCanvas`, with the same `options`.
2462
+ *
2463
+ * # Errors
2464
+ * As [`Self::create_for_canvas`].
2385
2465
  * @param {HTMLCanvasElement} canvas
2466
+ * @param {any | null} [options]
2386
2467
  * @returns {Promise<WebEffectRegistry>}
2387
2468
  */
2388
- static createForHtmlCanvas(canvas) {
2389
- const ret = wasm.webeffectregistry_createForHtmlCanvas(canvas);
2469
+ static createForHtmlCanvas(canvas, options) {
2470
+ const ret = wasm.webeffectregistry_createForHtmlCanvas(canvas, isLikeNone(options) ? 0 : addToExternrefTable0(options));
2390
2471
  return ret;
2391
2472
  }
2392
2473
  /**
@@ -2398,11 +2479,9 @@ export class WebEffectRegistry {
2398
2479
  return ret;
2399
2480
  }
2400
2481
  /**
2401
- * Reports whether the owning worker must recreate this binding: its
2402
- * device or context was lost, or the renderer found the GPU unable to
2403
- * run work (completing it without running it, or making nothing more),
2404
- * after which it refuses every readback. A frame the GPU rejected for an
2405
- * error is not that: it failed alone, and the binding renders on.
2482
+ * Whether the owning worker must recreate this binding: its device or context was lost,
2483
+ * or the GPU stopped running work, after which every readback is refused. A frame the GPU
2484
+ * rejected with an error is not a loss; the binding renders on.
2406
2485
  * @returns {boolean}
2407
2486
  */
2408
2487
  get deviceLost() {
@@ -2440,20 +2519,15 @@ export class WebEffectRegistry {
2440
2519
  /**
2441
2520
  * Renders the next export frame and resolves with its pixels.
2442
2521
  *
2443
- * The promise resolves to `{ kind: "complete" }`, to
2444
- * `{ kind: "waiting", timeTicks, missingSources, missingFrames }` when the
2445
- * host has not supplied every source (`missingFrames` names the source
2446
- * time each clip needs, as `renderAt` names it), or to
2447
- * `{ kind: "rendered", index, timeTicks,
2448
- * width, height, format: "I420", colorSpace, layout, pixels }`, where
2449
- * `pixels` holds the planes with padded rows at the offsets and strides
2450
- * `layout` gives. Waiting never advances the cursor, so a retry after
2451
- * uploading cannot skip a timestamp.
2522
+ * Resolves to `{ kind: "complete" }`; to `{ kind: "waiting", timeTicks, missingSources,
2523
+ * missingFrames }` when a source is missing (`missingFrames` as `renderAt` reports it); or
2524
+ * to `{ kind: "rendered", index, timeTicks, width, height, format: "I420", colorSpace,
2525
+ * layout, pixels }` with padded planes at `layout`'s offsets and strides. Waiting never
2526
+ * advances the cursor.
2452
2527
  *
2453
2528
  * # Errors
2454
- * Returns an error without a running export or a loaded project. The
2455
- * promise rejects with an error carrying `failure` when the readback
2456
- * times out, the device is lost, or the mapping fails.
2529
+ * Returns an error without a running export or loaded project. The promise rejects with a
2530
+ * `failure` when the readback times out, the device is lost, or the mapping fails.
2457
2531
  * @returns {Promise<any>}
2458
2532
  */
2459
2533
  exportFrame() {
@@ -2464,19 +2538,16 @@ export class WebEffectRegistry {
2464
2538
  return takeFromExternrefTable0(ret[0]);
2465
2539
  }
2466
2540
  /**
2467
- * Completed and total frame counts for the running export, and the
2468
- * timeline range it covers, as JSON.
2541
+ * Completed and total frame counts for the running export and the range it covers, as
2542
+ * JSON.
2469
2543
  *
2470
- * `effectiveRange` is the requested range widened to the frame grid. Its
2471
- * start is the output's zero, which is where the export's audio starts.
2472
- * `audioWindow` is the project-rate samples the export's audio covers:
2473
- * `startSample` (a decimal string) is the mix position written at the
2474
- * output's zero, and `frames` the sample count. Every host takes its
2475
- * audio from these, never from the request.
2544
+ * `effectiveRange` is the requested range widened to the frame grid; its start is the
2545
+ * output's zero. `audioWindow` is the project-rate samples the export's audio covers:
2546
+ * `startSample` (a decimal string) at the output's zero, and `frames`. Hosts take audio
2547
+ * from these, never from the request.
2476
2548
  *
2477
2549
  * # Errors
2478
- * Returns an error when no export is running, or when the range does
2479
- * not fit in samples.
2550
+ * Returns an error when no export is running or the range does not fit in samples.
2480
2551
  * @returns {string}
2481
2552
  */
2482
2553
  exportProgress() {
@@ -2498,9 +2569,8 @@ export class WebEffectRegistry {
2498
2569
  }
2499
2570
  }
2500
2571
  /**
2501
- * Exact clip/source/timestamp requests from the same immutable snapshot
2502
- * used by `renderAt`. Hosts must keep separate decoder cursors for distinct
2503
- * clip IDs. Tick values are strings so JavaScript can preserve i64.
2572
+ * Exact clip/source/timestamp requests from the same snapshot `renderAt` uses. Hosts keep
2573
+ * separate decoder cursors per clip ID. Tick values are strings to preserve i64.
2504
2574
  * @param {bigint} time_ticks
2505
2575
  * @returns {string}
2506
2576
  */
@@ -2523,9 +2593,8 @@ export class WebEffectRegistry {
2523
2593
  }
2524
2594
  }
2525
2595
  /**
2526
- * Whether the loaded project declares `source_id` an HDR (PQ or HLG)
2527
- * source, whose frames must reach the engine through
2528
- * [`Self::upload_yuv_frame`].
2596
+ * Whether the loaded project declares `source_id` an HDR (PQ or HLG) source, whose frames
2597
+ * must go through [`Self::upload_yuv_frame`].
2529
2598
  * @param {string} source_id
2530
2599
  * @returns {boolean}
2531
2600
  */
@@ -2536,10 +2605,8 @@ export class WebEffectRegistry {
2536
2605
  return ret !== 0;
2537
2606
  }
2538
2607
  /**
2539
- * Whether the still `sourceId` is still the upload `generation` names.
2540
- * The store drops stills on its own (the uploaded-frame budget and a
2541
- * limit on how many it keeps), so a host that skips uploading a still it
2542
- * uploaded before asks here first.
2608
+ * Whether the still `sourceId` is still the upload `generation` names. The store evicts
2609
+ * stills on its own, so a host checks before skipping a re-upload.
2543
2610
  * @param {string} source_id
2544
2611
  * @param {bigint} generation
2545
2612
  * @returns {boolean}
@@ -2553,20 +2620,13 @@ export class WebEffectRegistry {
2553
2620
  /**
2554
2621
  * Loads and validates a versioned project document.
2555
2622
  *
2556
- * Replacing a project keeps the audio windows and frames uploaded for
2557
- * every source whose ID and locator are unchanged, so an edit does not
2558
- * mean re-decoding. Frames already prepared for presentation are the
2559
- * picture converted and fitted under the project they were uploaded to:
2560
- * a new canvas size or color pipeline (`settings.color`) invalidates them
2561
- * all, and a source's new declared color (`color_metadata`) its own.
2562
- * Raw uploads and audio remain reusable. Sources that are gone or
2563
- * relocated lose theirs, and all audio goes when the project sample rate
2564
- * changes. Media that changes under an unchanged locator needs a new
2565
- * source ID.
2623
+ * Uploaded frames and audio are kept for every source whose ID and locator are unchanged,
2624
+ * so an edit needs no re-decode. Presentation frames are invalidated by a new canvas size
2625
+ * or color pipeline (`settings.color`), or per source by new declared color
2626
+ * (`color_metadata`). All audio is dropped when the project sample rate changes. Media
2627
+ * that changes under an unchanged locator needs a new source ID.
2566
2628
  *
2567
- * Loading ends a running export (`endExport`): an export renders the
2568
- * project it began with, so its next step is refused rather than
2569
- * rendering this one.
2629
+ * Loading ends a running export (`endExport`), so its next step is refused.
2570
2630
  * @param {string} json
2571
2631
  */
2572
2632
  loadProject(json) {
@@ -2578,11 +2638,26 @@ export class WebEffectRegistry {
2578
2638
  }
2579
2639
  }
2580
2640
  /**
2581
- * The loudness measured since metering started, as JSON (see
2582
- * `LoudnessReport` in `alpha2/loudness`), or `null` while it is off.
2583
- * It states the threshold of the master limiter it measured in front of
2584
- * (`limiterThreshold`, `null` without one), which
2585
- * `planLoudnessNormalization` keeps the normalized mix under.
2641
+ * After a loss ([`Self::device_lost`]), what the renderer's submission times say about it,
2642
+ * as JSON `{ hung, gpuMs, watchdogMs, timeTicks, frameIndex, effects, predictedMs }`.
2643
+ * `hung` means the longest recent submission ran at least half the GPU watchdog, so the
2644
+ * loss was most likely this work's and rerunning it would stop the GPU again. `undefined`
2645
+ * before any loss.
2646
+ * @returns {string | undefined}
2647
+ */
2648
+ get lossReport() {
2649
+ const ret = wasm.webeffectregistry_lossReport(this.__wbg_ptr);
2650
+ let v1;
2651
+ if (ret[0] !== 0) {
2652
+ v1 = getStringFromWasm0(ret[0], ret[1]);
2653
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2654
+ }
2655
+ return v1;
2656
+ }
2657
+ /**
2658
+ * The loudness measured since metering started as JSON (`LoudnessReport` in
2659
+ * `alpha2/loudness`), or `null` while off. `limiterThreshold` (or `null`) is the master
2660
+ * limiter it measured in front of, which `planLoudnessNormalization` keeps the mix under.
2586
2661
  * @returns {string}
2587
2662
  */
2588
2663
  loudnessReport() {
@@ -2611,8 +2686,8 @@ export class WebEffectRegistry {
2611
2686
  }
2612
2687
  }
2613
2688
  /**
2614
- * The loaded project's render size at the preview scale, `[width,
2615
- * height]`: the size `renderAt` renders and the surface should have.
2689
+ * The loaded project's render size at the preview scale, `[width, height]`: what
2690
+ * `renderAt` renders and the surface should be.
2616
2691
  *
2617
2692
  * # Errors
2618
2693
  * Fails when no project is loaded.
@@ -2628,12 +2703,12 @@ export class WebEffectRegistry {
2628
2703
  return v1;
2629
2704
  }
2630
2705
  /**
2631
- * Adds an effect [`Self::compile_effect`] compiled on this binding and
2632
- * returns its `id@version`. The compiled effect is consumed either way.
2706
+ * Adds an effect [`Self::compile_effect`] compiled on this binding and returns its
2707
+ * `id@version`. The compiled effect is consumed either way.
2633
2708
  *
2634
2709
  * # Errors
2635
- * Throws `EFFECT_ERROR` for an effect compiled by another binding, one
2636
- * registered while it compiled, or a full registry.
2710
+ * Throws `EFFECT_ERROR` for an effect compiled by another binding, one registered while it
2711
+ * compiled, or a full registry.
2637
2712
  * @param {CompiledEffect} compiled
2638
2713
  * @returns {string}
2639
2714
  */
@@ -2684,8 +2759,8 @@ export class WebEffectRegistry {
2684
2759
  return ret !== 0;
2685
2760
  }
2686
2761
  /**
2687
- * Releases exactly one uploaded generation without affecting a newer
2688
- * texture stored under the same source and timestamp.
2762
+ * Releases exactly one uploaded generation, leaving any newer texture under the same
2763
+ * source and timestamp.
2689
2764
  * @param {bigint} generation
2690
2765
  * @returns {boolean}
2691
2766
  */
@@ -2706,12 +2781,10 @@ export class WebEffectRegistry {
2706
2781
  return ret !== 0;
2707
2782
  }
2708
2783
  /**
2709
- * Gives back the GPU memory the renderer keeps only for reuse (idle
2710
- * pooled textures and buffers, and kept graph results), destroying each
2711
- * so the browser frees it now rather than at garbage collection, and
2712
- * returns the bytes destroyed. Nothing a render or readback still holds
2713
- * is released; later work allocates again what it needs. An export
2714
- * calls it when its byte budget stops it submitting.
2784
+ * Destroys GPU memory kept only for reuse (idle pooled textures and buffers, kept graph
2785
+ * results) so the browser frees it now rather than at garbage collection, and returns the
2786
+ * bytes destroyed. Nothing a render or readback holds is released. An export calls it
2787
+ * when its byte budget stops it submitting.
2715
2788
  * @returns {number}
2716
2789
  */
2717
2790
  releaseIdleMemory() {
@@ -2719,9 +2792,8 @@ export class WebEffectRegistry {
2719
2792
  return ret;
2720
2793
  }
2721
2794
  /**
2722
- * Releases every uploaded frame and the still of one source, for a host
2723
- * whose media for it changed under the same ID and locator. Generations
2724
- * already retired stay until they are released.
2795
+ * Releases every uploaded frame and the still of one source whose media changed under the
2796
+ * same ID and locator. Retired generations stay until released.
2725
2797
  * @param {string} source_id
2726
2798
  * @returns {boolean}
2727
2799
  */
@@ -2734,12 +2806,10 @@ export class WebEffectRegistry {
2734
2806
  /**
2735
2807
  * Evaluates and presents one project frame on the worker-owned canvas.
2736
2808
  *
2737
- * Returns JSON `{ requestedTimeTicks, presentedTimeTicks, missingSources,
2738
- * missingFrames, repeated, unchanged }`: `presentedTimeTicks` is `null`
2739
- * until a frame has been presented, and `missingFrames` names the exact
2740
- * source time each missing source was needed at. `unchanged` says the
2741
- * frame equals the one presented last (see `Player::render_at`): nothing
2742
- * was rendered or presented, and the canvas still shows it.
2809
+ * Returns JSON `{ requestedTimeTicks, presentedTimeTicks, missingSources, missingFrames,
2810
+ * repeated, unchanged }`. `presentedTimeTicks` is `null` until a frame is presented;
2811
+ * `missingFrames` gives the exact source time each missing source was needed at;
2812
+ * `unchanged` means the frame equals the last one, so nothing was rendered or presented.
2743
2813
  * @param {bigint} time_ticks
2744
2814
  * @returns {string}
2745
2815
  */
@@ -2762,16 +2832,12 @@ export class WebEffectRegistry {
2762
2832
  }
2763
2833
  }
2764
2834
  /**
2765
- * Mixes one project audio block of at most `audioMaxBlock` samples per
2766
- * channel and returns its planar samples. A host mixes a longer span as
2767
- * consecutive blocks.
2768
- *
2769
- * Channels are returned end to end. Call `audioStatus` for the sources
2770
- * that were missing from the mix.
2835
+ * Mixes one project audio block of at most `audioMaxBlock` samples per channel and returns
2836
+ * its planar samples, channels end to end. Missing sources are reported by
2837
+ * `audioMissingSources`.
2771
2838
  *
2772
2839
  * # Errors
2773
- * Rejects (`INVALID_INPUT`, not fatal) more than `audioMaxBlock` frames,
2774
- * naming the limit.
2840
+ * Rejects (`INVALID_INPUT`, not fatal) more than `audioMaxBlock` frames.
2775
2841
  * @param {bigint} start_sample
2776
2842
  * @param {number} frames
2777
2843
  * @param {boolean} playing
@@ -2834,18 +2900,14 @@ export class WebEffectRegistry {
2834
2900
  return ret >>> 0;
2835
2901
  }
2836
2902
  /**
2837
- * Chooses what `renderAudio` does, outside an export, with a block that
2838
- * does not start where the previous one ended. `"exact"` (the default)
2839
- * resets and replays the settling history before it, so it mixes what a
2840
- * fresh renderer would. `"continue-small-gaps"` is for live preview: a
2841
- * block at most `audioMaxBlock` samples before or after where the last
2842
- * one ended continues from the state that one left, costing one block
2843
- * rather than a replay of up to 30 s, and only a longer jump (or the
2844
- * first block after `resetAudio`) replays. Its mix after such a step is
2845
- * not what a fresh renderer mixes, so loudness measurements and other
2846
- * output that must repeat stay exact. From `beginExport` to `endExport`
2847
- * the renderer is exact whatever is chosen. Choosing another policy than
2848
- * the current one resets the audio, as `resetAudio` does.
2903
+ * Chooses what `renderAudio` does, outside an export, with a block that does not start
2904
+ * where the previous one ended.
2905
+ *
2906
+ * `"exact"` (default) resets and replays the settling history, mixing what a fresh
2907
+ * renderer would. `"continue-small-gaps"` is for live preview: a jump of at most
2908
+ * `audioMaxBlock` samples continues from the previous state instead of replaying up to
2909
+ * 30 s, so its output is not reproducible. Exports are always exact. Changing the policy
2910
+ * resets the audio, as `resetAudio` does.
2849
2911
  *
2850
2912
  * # Errors
2851
2913
  * Rejects any other policy name (`INVALID_INPUT`, not fatal).
@@ -2860,10 +2922,9 @@ export class WebEffectRegistry {
2860
2922
  }
2861
2923
  }
2862
2924
  /**
2863
- * Starts (from empty) or stops measuring the loudness of the mix before
2864
- * the master limiter, over the blocks `renderAudio` renders from now on.
2865
- * Starting removes the normalization gain, so it measures the mix as
2866
- * authored; a block a source was missing from is not measured.
2925
+ * Starts (from empty) or stops measuring loudness of the mix before the master limiter,
2926
+ * over subsequent `renderAudio` blocks. Starting removes the normalization gain so the mix
2927
+ * is measured as authored; blocks with a missing source are not measured.
2867
2928
  *
2868
2929
  * # Errors
2869
2930
  * Returns an error without an audio renderer.
@@ -2876,15 +2937,13 @@ export class WebEffectRegistry {
2876
2937
  }
2877
2938
  }
2878
2939
  /**
2879
- * Applies a static gain, in dB, after the master gain and before the
2880
- * limiter; zero removes it, and so does `setLoudnessMetering(true)`. A
2881
- * loudness-normalized export sets the gain `planLoudnessNormalization`
2882
- * returns before rendering its audio; the gain stays until it is set
2883
- * again, so set zero for audio after it that is not normalized.
2940
+ * Applies a static gain in dB after the master gain and before the limiter; zero or
2941
+ * `setLoudnessMetering(true)` removes it. A normalized export sets the gain
2942
+ * `planLoudnessNormalization` returns; it persists until set again.
2884
2943
  *
2885
2944
  * # Errors
2886
- * Returns an error without an audio renderer, or for a gain that is not
2887
- * finite or whose factor a 32-bit float cannot hold (`INVALID_INPUT`).
2945
+ * Returns an error without an audio renderer, or for a gain that is not finite or whose
2946
+ * factor overflows a 32-bit float (`INVALID_INPUT`).
2888
2947
  * @param {number} gain_db
2889
2948
  */
2890
2949
  setNormalizationGainDb(gain_db) {
@@ -2894,21 +2953,17 @@ export class WebEffectRegistry {
2894
2953
  }
2895
2954
  }
2896
2955
  /**
2897
- * Enables or disables per-pass GPU/CPU timing collection.
2898
- *
2899
- * Disabled by default: timing reads a clock per pass and allocates GPU
2900
- * timestamp resources, which is profiling cost rather than rendering work.
2901
- * Every other field of `diagnostics()` is always available.
2956
+ * Enables or disables per-pass GPU/CPU timing in `diagnostics()`. Off by default because
2957
+ * it reads a clock per pass and allocates GPU timestamp resources.
2902
2958
  * @param {boolean} enabled
2903
2959
  */
2904
2960
  setPassTiming(enabled) {
2905
2961
  wasm.webeffectregistry_setPassTiming(this.__wbg_ptr, enabled);
2906
2962
  }
2907
2963
  /**
2908
- * Renders preview frames at `scale` times the project's size from now
2909
- * on (the preview quality profile's resolution scale; 0.5 until set, 1
2910
- * renders at the project's resolution). Drops the held frame, so the
2911
- * next `renderAt` presents. Size the surface to `previewSize` after it.
2964
+ * Renders preview frames at `scale` times the project size from now on (default 0.5).
2965
+ * Drops the held frame so the next `renderAt` presents; resize the surface to
2966
+ * `previewSize` afterwards.
2912
2967
  *
2913
2968
  * # Errors
2914
2969
  * Rejects a scale that is not finite, above 0 and at most 8.
@@ -2921,11 +2976,9 @@ export class WebEffectRegistry {
2921
2976
  }
2922
2977
  }
2923
2978
  /**
2924
- * Lets rendered results (each clip's finished picture and the frame)
2925
- * occupy up to `bytes` of GPU memory, to be found again when a frame
2926
- * repeats; zero, the default, turns that off. Only results drawn from
2927
- * sources whose upload is reused are found again: a still, or a frame the
2928
- * page uploads once and draws at several times.
2979
+ * Lets rendered results (each clip's finished picture and the frame) use up to `bytes` of
2980
+ * GPU memory for reuse when a frame repeats; zero (the default) disables it. Only results
2981
+ * from reused uploads hit: a still, or a frame uploaded once and drawn at several times.
2929
2982
  *
2930
2983
  * # Errors
2931
2984
  * Rejects a negative or non-finite budget.
@@ -2938,16 +2991,14 @@ export class WebEffectRegistry {
2938
2991
  }
2939
2992
  }
2940
2993
  /**
2941
- * Sets the cache budget for live, image, and retired generations (default
2942
- * 1 GiB); aliases count once. The oldest generations are released first.
2943
- * A newly uploaded frame larger than this budget is kept alone. While an
2944
- * export frame waits for its sources, the ones it shows are pinned: the
2945
- * budget releases everything else first and never them, and the upload
2946
- * or alias that would make them outgrow it is refused with
2947
- * `RESOURCE_LIMIT` (`failure.stage` `working-set-over-budget`,
2948
- * `failure.requestedBytes` the bytes the frame needs at least), as no
2949
- * refill could make the frame fit. Renderer pools and submitted GPU work
2950
- * have separate lifetime/budget accounting.
2994
+ * Sets the cache budget for live, image, and retired generations (default 1 GiB); aliases
2995
+ * count once and the oldest generations go first. A new frame larger than the budget is
2996
+ * kept alone.
2997
+ *
2998
+ * While an export frame waits for its sources, those it shows are pinned. The budget
2999
+ * evicts everything else first, and an upload or alias that would push them over is
3000
+ * refused with `RESOURCE_LIMIT` (`failure.stage` `working-set-over-budget`,
3001
+ * `failure.requestedBytes` the minimum the frame needs).
2951
3002
  * @param {number} bytes
2952
3003
  */
2953
3004
  setUploadedFrameBudget(bytes) {
@@ -2957,8 +3008,7 @@ export class WebEffectRegistry {
2957
3008
  }
2958
3009
  }
2959
3010
  /**
2960
- * The color metadata the loaded project declares for `source_id`, as
2961
- * JSON, or `undefined` when it declares none.
3011
+ * The color metadata the loaded project declares for `source_id`, as JSON, or `undefined`.
2962
3012
  * @param {string} source_id
2963
3013
  * @returns {string | undefined}
2964
3014
  */
@@ -2974,10 +3024,8 @@ export class WebEffectRegistry {
2974
3024
  return v2;
2975
3025
  }
2976
3026
  /**
2977
- * Limits WebGPU preview work to a completed submission before the host
2978
- * starts its next frame. Returning a Promise (rather than an async method)
2979
- * releases the wasm object borrow immediately, allowing edits while waiting.
2980
- * WebGL submits synchronously through wgpu-core and uses its own retention.
3027
+ * Resolves when submitted WebGPU preview work completes, so the host can pace frames. The
3028
+ * returned promise releases the wasm borrow at once, allowing edits while waiting.
2981
3029
  * @returns {Promise<any>}
2982
3030
  */
2983
3031
  submittedWorkDone() {
@@ -2985,9 +3033,8 @@ export class WebEffectRegistry {
2985
3033
  return ret;
2986
3034
  }
2987
3035
  /**
2988
- * Whether decoded `VideoFrame` objects can be imported without CPU copies.
2989
- * Both backends can, directly or through a canvas bitmap: see
2990
- * `uploadPresentedVideoFrame`.
3036
+ * Whether decoded `VideoFrame`s can be imported without CPU copies. Both backends can,
3037
+ * directly or through a canvas bitmap (see `uploadPresentedVideoFrame`).
2991
3038
  * @returns {boolean}
2992
3039
  */
2993
3040
  get supportsExternalVideoFrame() {
@@ -2995,11 +3042,27 @@ export class WebEffectRegistry {
2995
3042
  return ret !== 0;
2996
3043
  }
2997
3044
  /**
2998
- * Discards `source_id`'s retained audio that ends before `ticks`, a time
2999
- * on that source's own timeline. Other sources keep theirs; a source
3000
- * that two clips read at different times is trimmed only below what
3001
- * both still need. A host calls it as playback moves on, a few seconds
3002
- * behind the earliest time a mix still reads of the source.
3045
+ * How frames rendered since the last call were split into GPU submissions to stay under
3046
+ * the watchdog budget, as JSON `{ frames, splitFrames, maxPerFrame, maxPredictedMs }` (the
3047
+ * native host's `performance.gpuSubmissions`). Resets the counts.
3048
+ * @returns {string}
3049
+ */
3050
+ takeGpuSubmissionStats() {
3051
+ let deferred1_0;
3052
+ let deferred1_1;
3053
+ try {
3054
+ const ret = wasm.webeffectregistry_takeGpuSubmissionStats(this.__wbg_ptr);
3055
+ deferred1_0 = ret[0];
3056
+ deferred1_1 = ret[1];
3057
+ return getStringFromWasm0(ret[0], ret[1]);
3058
+ } finally {
3059
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
3060
+ }
3061
+ }
3062
+ /**
3063
+ * Discards `source_id`'s audio that ends before `ticks`, a time on that source's own
3064
+ * timeline. A source two clips read at different times is trimmed only below what both
3065
+ * need. Call it as playback moves on, a few seconds behind the earliest time still mixed.
3003
3066
  * @param {string} source_id
3004
3067
  * @param {bigint} ticks
3005
3068
  */
@@ -3009,10 +3072,9 @@ export class WebEffectRegistry {
3009
3072
  wasm.webeffectregistry_trimAudioBefore(this.__wbg_ptr, ptr0, len0, ticks);
3010
3073
  }
3011
3074
  /**
3012
- * Releases `source_id`'s timestamped video frames older than
3013
- * `media_time_ticks`, a time on that source's own timeline. Other
3014
- * sources keep theirs; a source that two clips read at different times
3015
- * is trimmed only below what both still need.
3075
+ * Releases `source_id`'s video frames older than `media_time_ticks`, a time on that
3076
+ * source's own timeline. A source two clips read at different times is trimmed only below
3077
+ * what both need.
3016
3078
  * @param {string} source_id
3017
3079
  * @param {bigint} media_time_ticks
3018
3080
  */
@@ -3047,23 +3109,15 @@ export class WebEffectRegistry {
3047
3109
  /**
3048
3110
  * Uploads project-rate planar audio for one source.
3049
3111
  *
3050
- * `start_sample` is the index of the first sample in the source, at the
3051
- * project rate. `layout` names the speaker each plane feeds: an array of
3052
- * `FFmpeg` channel names in plane order (`["FC", "FL", "FR"]`; `"UNK"`
3053
- * for a plane no speaker names), or a channel count for the count's
3054
- * default layout (`FFmpeg`'s: 3 is 2.1, 4 is 4.0). 1 to 24 planes.
3055
- * `samples` holds each plane end to end; the engine folds them into the
3056
- * project's channels by speaker. An upload replaces the windows it
3057
- * overlaps, which is what a seek needs, and joins the ones of the same
3058
- * speakers it meets at either end into one; any other is a window of
3059
- * its own.
3112
+ * `start_sample` is the first sample's index in the source at the project rate. `layout`
3113
+ * names each plane's speaker: an array of `FFmpeg` channel names in plane order
3114
+ * (`["FC", "FL", "FR"]`, `"UNK"` for none), or a channel count for `FFmpeg`'s default
3115
+ * layout (3 is 2.1, 4 is 4.0); 1 to 24 planes. `samples` holds the planes end to end. An
3116
+ * upload replaces windows it overlaps and joins same-speaker windows it meets.
3060
3117
  *
3061
- * The mixer reads a window only where it holds every sample a block
3062
- * needs, so a host decoding past a source's end uploads zeros there, as
3063
- * the supplied decoders do. `ends_source` says instead that this upload
3064
- * runs to the source's end, so past it the source is silent: pass it
3065
- * with a whole decoded source, whose clips may end exactly at its end
3066
- * and read an interpolation sample or two beyond.
3118
+ * The mixer reads a window only where it holds every sample a block needs, so a host
3119
+ * decoding past a source's end uploads zeros there. Alternatively pass `ends_source` with
3120
+ * an upload that runs to the source's end, so the source is silent after it.
3067
3121
  * @param {string} source_id
3068
3122
  * @param {bigint} start_sample
3069
3123
  * @param {number} sample_rate
@@ -3080,10 +3134,36 @@ export class WebEffectRegistry {
3080
3134
  }
3081
3135
  }
3082
3136
  /**
3083
- * [`Self::upload_presented_video_frame`] for a bitmap made of the frame
3084
- * with `createImageBitmap(frame, { premultiplyAlpha: "none" })`, which
3085
- * skips the canvas draw where `videoFrameCopy` is `"bitmap"`. Always
3086
- * closes `bitmap`; a source the project declares HDR is refused.
3137
+ * [`Self::upload_presented_video_frame`] for a frame the engine should convert from planes
3138
+ * (HDR, or declared color) but the browser decodes only without planes. The browser's
3139
+ * conversion (and tone mapping) imports it, drawn as SDR BT.709.
3140
+ *
3141
+ * The source is then degraded: `renderAt` lists it in `degradedSources`, and any export
3142
+ * frame showing it is refused with `PLANAR_DECODE_UNAVAILABLE`, so browser and native
3143
+ * exports never differ by the browser's conversion. A planar or presented upload of the
3144
+ * source clears this. Always closes `frame`.
3145
+ * @param {string} source_id
3146
+ * @param {bigint} media_time_ticks
3147
+ * @param {VideoFrame} frame
3148
+ * @param {number} output_width
3149
+ * @param {number} output_height
3150
+ * @param {number} rotation_degrees
3151
+ * @param {boolean} mirror
3152
+ * @returns {any}
3153
+ */
3154
+ uploadDegradedVideoFrame(source_id, media_time_ticks, frame, output_width, output_height, rotation_degrees, mirror) {
3155
+ const ptr0 = passStringToWasm0(source_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3156
+ const len0 = WASM_VECTOR_LEN;
3157
+ const ret = wasm.webeffectregistry_uploadDegradedVideoFrame(this.__wbg_ptr, ptr0, len0, media_time_ticks, frame, output_width, output_height, rotation_degrees, mirror);
3158
+ if (ret[2]) {
3159
+ throw takeFromExternrefTable0(ret[1]);
3160
+ }
3161
+ return takeFromExternrefTable0(ret[0]);
3162
+ }
3163
+ /**
3164
+ * [`Self::upload_presented_video_frame`] for a bitmap from
3165
+ * `createImageBitmap(frame, { premultiplyAlpha: "none" })`, skipping the canvas draw where
3166
+ * `videoFrameCopy` is `"bitmap"`. Always closes `bitmap`; HDR sources are refused.
3087
3167
  * @param {string} source_id
3088
3168
  * @param {bigint} media_time_ticks
3089
3169
  * @param {ImageBitmap} bitmap
@@ -3103,10 +3183,9 @@ export class WebEffectRegistry {
3103
3183
  return takeFromExternrefTable0(ret[0]);
3104
3184
  }
3105
3185
  /**
3106
- * Like [`Self::upload_presented_rgba_frame`], for premultiplied
3107
- * linear-light RGBA half floats (their bits) in BT.709 primaries, as
3108
- * OpenEXR sources arrive: values above `1.0` and below `0.0` are kept
3109
- * as far as the intermediate format holds them.
3186
+ * Like [`Self::upload_presented_rgba_frame`], for premultiplied linear-light RGBA half
3187
+ * floats (as bits) in BT.709 primaries, as `OpenEXR` sources arrive. Values outside
3188
+ * `0.0..=1.0` are kept as far as the intermediate format allows.
3110
3189
  * @param {string} source_id
3111
3190
  * @param {bigint} media_time_ticks
3112
3191
  * @param {number} width
@@ -3128,8 +3207,7 @@ export class WebEffectRegistry {
3128
3207
  return takeFromExternrefTable0(ret[0]);
3129
3208
  }
3130
3209
  /**
3131
- * Like [`Self::upload_presented_linear_frame`], for a still shown at
3132
- * every time.
3210
+ * Like [`Self::upload_presented_linear_frame`], for a still shown at every time.
3133
3211
  * @param {string} source_id
3134
3212
  * @param {number} width
3135
3213
  * @param {number} height
@@ -3150,11 +3228,10 @@ export class WebEffectRegistry {
3150
3228
  return takeFromExternrefTable0(ret[0]);
3151
3229
  }
3152
3230
  /**
3153
- * Uploads a frame of RGBA8 pixels at its own size and presents it into
3154
- * the output as the engine presents every source (contained, on the
3155
- * GPU), so a page never scales a source itself. `premultiplied` says
3156
- * whether the color is already multiplied by alpha. Extension
3157
- * providers' frames arrive this way.
3231
+ * Uploads RGBA8 pixels at their own size and presents them into the output as the engine
3232
+ * presents every source (contained, on the GPU), so a page never scales a source itself.
3233
+ * `premultiplied` says whether color is already multiplied by alpha. Extension providers'
3234
+ * frames arrive this way.
3158
3235
  * @param {string} source_id
3159
3236
  * @param {bigint} media_time_ticks
3160
3237
  * @param {number} width
@@ -3177,8 +3254,7 @@ export class WebEffectRegistry {
3177
3254
  return takeFromExternrefTable0(ret[0]);
3178
3255
  }
3179
3256
  /**
3180
- * Like [`Self::upload_presented_rgba_frame`], for a still shown at every
3181
- * time.
3257
+ * Like [`Self::upload_presented_rgba_frame`], for a still shown at every time.
3182
3258
  * @param {string} source_id
3183
3259
  * @param {number} width
3184
3260
  * @param {number} height
@@ -3200,22 +3276,17 @@ export class WebEffectRegistry {
3200
3276
  return takeFromExternrefTable0(ret[0]);
3201
3277
  }
3202
3278
  /**
3203
- * Imports a decoded `VideoFrame` without reading its pixels back to the
3204
- * CPU, then applies contain placement, rotation, filtering, and alpha
3205
- * premultiplication in a GPU presentation pass. The frame is shown
3206
- * mirrored left to right when `mirror` is set, then turned clockwise by
3207
- * `rotation_degrees`: how its stream says it is shown upright.
3279
+ * Imports a decoded `VideoFrame` without a CPU readback, then applies contain placement,
3280
+ * rotation, filtering, and alpha premultiplication in a GPU pass. The frame is mirrored
3281
+ * left to right when `mirror` is set, then turned clockwise by `rotation_degrees`.
3208
3282
  *
3209
- * Browser WebGPU copies the frame into a texture directly, or, where the
3210
- * browser does not take a `VideoFrame` (Firefox), copies it through a
3211
- * reused 2D canvas's bitmap. WebGL2 always uploads that bitmap.
3283
+ * Browser WebGPU copies the frame directly, or through a reused 2D canvas bitmap where the
3284
+ * browser does not take a `VideoFrame` (Firefox). WebGL2 always uploads the bitmap.
3212
3285
  * `videoFrameCopy` says which.
3213
3286
  *
3214
- * Both copies go through the page's own color conversion, so an HDR
3215
- * frame (PQ or HLG, by the color the project declares for the source,
3216
- * else by the frame's `colorSpace`) is refused with `INVALID_INPUT`
3217
- * whatever the project's HDR policy: its planes go to
3218
- * [`Self::upload_yuv_frame`], which converts them as the project says.
3287
+ * Both paths use the page's own color conversion, so an HDR frame (PQ or HLG, by the
3288
+ * project's declared color for the source, else the frame's `colorSpace`) is refused with
3289
+ * `INVALID_INPUT`; send its planes to [`Self::upload_yuv_frame`] instead.
3219
3290
  * @param {string} source_id
3220
3291
  * @param {bigint} media_time_ticks
3221
3292
  * @param {VideoFrame} frame
@@ -3235,10 +3306,8 @@ export class WebEffectRegistry {
3235
3306
  return takeFromExternrefTable0(ret[0]);
3236
3307
  }
3237
3308
  /**
3238
- * Uploads tightly packed premultiplied RGBA8 pixels.
3239
- *
3240
- * This compatibility path is used by WebGL2, whose wgpu backend cannot
3241
- * import a browser `VideoFrame` directly.
3309
+ * Uploads tightly packed premultiplied RGBA8 pixels. Used by WebGL2, whose wgpu backend
3310
+ * cannot import a `VideoFrame` directly.
3242
3311
  * @param {string} source_id
3243
3312
  * @param {bigint} media_time_ticks
3244
3313
  * @param {number} width
@@ -3258,8 +3327,7 @@ export class WebEffectRegistry {
3258
3327
  return takeFromExternrefTable0(ret[0]);
3259
3328
  }
3260
3329
  /**
3261
- * Uploads one time-independent still image, retained until its generation
3262
- * is released. Video uploads continue to require an exact timestamp.
3330
+ * Uploads one time-independent still image, kept until its generation is released.
3263
3331
  * @param {string} source_id
3264
3332
  * @param {number} width
3265
3333
  * @param {number} height
@@ -3278,14 +3346,11 @@ export class WebEffectRegistry {
3278
3346
  return takeFromExternrefTable0(ret[0]);
3279
3347
  }
3280
3348
  /**
3281
- * Uploads a decoded browser frame as [`Self::upload_presented_video_frame`]
3282
- * does, upright, fitted to the loaded project's size (or kept at the
3283
- * frame's display size when no project is loaded), and stored under
3349
+ * Uploads a decoded browser frame as [`Self::upload_presented_video_frame`] does, upright,
3350
+ * fitted to the loaded project's size (or the frame's display size with no project), under
3284
3351
  * `source_id` at `media_time_ticks`.
3285
3352
  *
3286
- * Ownership of `frame` transfers to this call and it is always closed before
3287
- * returning. An HDR frame is refused, as [`Self::upload_presented_video_frame`]
3288
- * refuses it.
3353
+ * Takes ownership of `frame` and always closes it. HDR frames are refused.
3289
3354
  * @param {string} source_id
3290
3355
  * @param {bigint} media_time_ticks
3291
3356
  * @param {VideoFrame} frame
@@ -3301,31 +3366,25 @@ export class WebEffectRegistry {
3301
3366
  return takeFromExternrefTable0(ret[0]);
3302
3367
  }
3303
3368
  /**
3304
- * Uploads a decoded frame's planar YCbCr samples, as
3305
- * `VideoFrame.copyTo` writes them, and converts them with the engine's
3306
- * own shader under the loaded project's color pipeline.
3369
+ * Uploads a decoded frame's planar YCbCr samples as `VideoFrame.copyTo` writes them and
3370
+ * converts them with the engine's shader under the project's color pipeline. This is how
3371
+ * HDR (PQ or HLG) frames reach the engine, since texture copies go through the page's
3372
+ * color conversion.
3307
3373
  *
3308
- * This is how HDR (PQ or HLG) frames reach the engine: copying a
3309
- * `VideoFrame` into a texture goes through the page's color conversion,
3310
- * which does not carry them. `format` is a `WebCodecs` pixel format:
3311
- * `I420`, `I422`, or `I444` at 8, 10 (`P10`), or 12 bits (`P12`), the
3312
- * same with an alpha plane (`I420A`, `I420AP10`, ...), or `NV12`; samples
3313
- * above eight bits are 16-bit words holding the value in their low bits.
3314
- * `layout` is `[offset, stride]` per plane, `visible` the visible
3315
- * rectangle `[x, y, width, height]`, and `color` the frame's color
3316
- * metadata as project JSON. `chroma_siting` (`left`, `center`,
3317
- * `top-left`, or `unspecified`) is where the stream puts its chroma
3318
- * samples, which `WebCodecs` leaves to the demuxer to know.
3319
- * `display_width` by `display_height` is the size the visible rectangle
3320
- * is shown at before it is turned (a `VideoFrame`'s `displayWidth` and
3321
- * `displayHeight`), which gives the pixel aspect ratio. The frame is
3322
- * shown mirrored left to right when `mirror` is set, then turned
3374
+ * `format` is a `WebCodecs` pixel format: `I420`, `I422`, or `I444` at 8, 10 (`P10`), or
3375
+ * 12 bits (`P12`), the same with alpha (`I420A`, `I420AP10`, ...), or `NV12`. Samples
3376
+ * above eight bits are 16-bit words with the value in the low bits. `layout` is
3377
+ * `[offset, stride]` per plane, `visible` is `[x, y, width, height]`, and `color` is the
3378
+ * frame's color metadata as project JSON. `chroma_siting` is `left`, `center`, `top-left`,
3379
+ * or `unspecified` (`WebCodecs` leaves it to the demuxer). `display_width` by
3380
+ * `display_height` is the visible rectangle's display size before rotation, which gives
3381
+ * the pixel aspect ratio. The frame is mirrored when `mirror` is set, then turned
3323
3382
  * clockwise by `rotation_degrees`.
3324
3383
  *
3325
3384
  * # Errors
3326
- * Rejects (`INVALID_INPUT`) an unknown format or chroma siting, a layout
3327
- * or plane that does not fit the data, a bad size or rotation, and an
3328
- * HDR frame when the project's color pipeline refuses HDR sources.
3385
+ * Rejects (`INVALID_INPUT`) an unknown format or chroma siting, a layout or plane that does
3386
+ * not fit the data, a bad size or rotation, and an HDR frame the project's color pipeline
3387
+ * refuses.
3329
3388
  * @param {string} source_id
3330
3389
  * @param {bigint} media_time_ticks
3331
3390
  * @param {string} format
@@ -3382,9 +3441,8 @@ export class WebEffectRegistry {
3382
3441
  return ret >>> 0;
3383
3442
  }
3384
3443
  /**
3385
- * How [`Self::upload_presented_video_frame`] copies a frame: `"direct"`,
3386
- * `"bitmap"` (through a canvas, once WebGPU refused a frame), `"untried"`,
3387
- * or `"canvas"` on WebGL2.
3444
+ * How [`Self::upload_presented_video_frame`] copies a frame: `"direct"`, `"bitmap"` (once
3445
+ * WebGPU refused a frame), `"untried"`, or `"canvas"` on WebGL2.
3388
3446
  * @returns {string}
3389
3447
  */
3390
3448
  get videoFrameCopy() {
@@ -3403,12 +3461,12 @@ export class WebEffectRegistry {
3403
3461
  if (Symbol.dispose) WebEffectRegistry.prototype[Symbol.dispose] = WebEffectRegistry.prototype.free;
3404
3462
 
3405
3463
  /**
3406
- * Checks that `bytes` hold face `face_index` of a font the engine draws
3407
- * captions and SVG text with, as registering it checks it.
3464
+ * Checks that `bytes` hold face `face_index` of a font the engine can draw with, as
3465
+ * registering it would.
3408
3466
  *
3409
3467
  * # Errors
3410
- * Rejects bytes the engine's font parser refuses, with its reason (a WOFF
3411
- * or WOFF2 container named `.ttf`, say).
3468
+ * Rejects bytes the font parser refuses, with its reason (for example a WOFF container named
3469
+ * `.ttf`).
3412
3470
  * @param {Uint8Array} bytes
3413
3471
  * @param {number} face_index
3414
3472
  */
@@ -3422,13 +3480,11 @@ export function checkFont(bytes, face_index) {
3422
3480
  }
3423
3481
 
3424
3482
  /**
3425
- * Checks that `cube` is a `.cube` 3D LUT the engine applies, parsed as
3426
- * `registerLut3d` parses it, without a renderer: a host refuses a file when
3427
- * it is imported rather than at every load.
3483
+ * Checks that `cube` is a `.cube` 3D LUT the engine accepts, as `registerLut3d` parses it,
3484
+ * without a renderer, so a host can refuse a file at import time.
3428
3485
  *
3429
3486
  * # Errors
3430
- * Rejects text the engine's parser refuses, with its line and reason (a
3431
- * one-dimensional table, an unsupported directive, a missing sample).
3487
+ * Rejects text the parser refuses, with its line and reason.
3432
3488
  * @param {string} cube
3433
3489
  */
3434
3490
  export function checkLut3d(cube) {
@@ -3441,8 +3497,8 @@ export function checkLut3d(cube) {
3441
3497
  }
3442
3498
 
3443
3499
  /**
3444
- * Returns a color pipeline's identity (JSON `ColorPipeline`), in the form a
3445
- * proxy that bakes the pipeline in records it.
3500
+ * Returns a color pipeline's identity (JSON `ColorPipeline`) as a proxy that bakes it in
3501
+ * records it.
3446
3502
  *
3447
3503
  * # Errors
3448
3504
  * Rejects JSON that is not a color pipeline.
@@ -3471,14 +3527,13 @@ export function colorPipelineFingerprint(pipeline) {
3471
3527
  }
3472
3528
 
3473
3529
  /**
3474
- * Compares a found fingerprint with a recorded one (both JSON
3475
- * `MediaFingerprint`s), as JSON `FingerprintMatch`: `identical`,
3476
- * `consistent`, `mismatch` with its fields, or `unverified`.
3530
+ * Compares a found fingerprint with a recorded one (both JSON `MediaFingerprint`s), returning
3531
+ * a JSON `FingerprintMatch`: `identical`, `consistent`, `mismatch` with its fields, or
3532
+ * `unverified`.
3477
3533
  *
3478
3534
  * # Errors
3479
- * Rejects JSON that is not a fingerprint, or a fingerprint with a part that
3480
- * is not well formed (`MediaFingerprint::malformed_part`), such as a hash
3481
- * in uppercase: that is an input error, not other media.
3535
+ * Rejects JSON that is not a fingerprint, or one with a malformed part (such as an uppercase
3536
+ * hash).
3482
3537
  * @param {string} recorded
3483
3538
  * @param {string} found
3484
3539
  * @returns {string}
@@ -3507,13 +3562,12 @@ export function compareFingerprints(recorded, found) {
3507
3562
  }
3508
3563
 
3509
3564
  /**
3510
- * Whether `project`'s media, as `catalog` describes it, is ready for
3511
- * `purpose` (`preview`, `preview_proxy`, `thumbnail`, `remote_edit`,
3512
- * `export_original`, or `export_proxy`), as a JSON `ConformReport`.
3565
+ * Whether `project`'s media, as `catalog` describes it, is ready for `purpose` (`preview`,
3566
+ * `preview_proxy`, `thumbnail`, `remote_edit`, `export_original`, or `export_proxy`), as a
3567
+ * JSON `ConformReport`.
3513
3568
  *
3514
3569
  * # Errors
3515
- * Rejects an invalid project, catalog (one whose fingerprints are not well
3516
- * formed among them), or purpose.
3570
+ * Rejects an invalid project, catalog (including malformed fingerprints), or purpose.
3517
3571
  * @param {string} project
3518
3572
  * @param {string} catalog
3519
3573
  * @param {string} purpose
@@ -3545,10 +3599,21 @@ export function conformProject(project, catalog, purpose) {
3545
3599
  }
3546
3600
 
3547
3601
  /**
3548
- * Returns the family name a caption style's `font_family` must give to
3549
- * select face `face_index` of the font file `bytes`, read from the font's
3550
- * name table as the engine reads it; `undefined` when the bytes are not a
3551
- * font or the face names no family.
3602
+ * How many faces the font file `bytes` holds: a collection's count, else 1.
3603
+ * @param {Uint8Array} bytes
3604
+ * @returns {number}
3605
+ */
3606
+ export function fontFaceCount(bytes) {
3607
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
3608
+ const len0 = WASM_VECTOR_LEN;
3609
+ const ret = wasm.fontFaceCount(ptr0, len0);
3610
+ return ret >>> 0;
3611
+ }
3612
+
3613
+ /**
3614
+ * Returns the family name a caption style's `font_family` must use to select face
3615
+ * `face_index` of the font `bytes`, or `undefined` when the bytes are not a font or the face
3616
+ * names no family.
3552
3617
  * @param {Uint8Array} bytes
3553
3618
  * @param {number} face_index
3554
3619
  * @returns {string | undefined}
@@ -3566,8 +3631,7 @@ export function fontFamily(bytes, face_index) {
3566
3631
  }
3567
3632
 
3568
3633
  /**
3569
- * The answers of the geometry queries the native tests pin
3570
- * (`tests/golden/geometry_queries.json`), computed by this module.
3634
+ * Answers to the geometry queries the native tests pin (`tests/golden/geometry_queries.json`).
3571
3635
  * @returns {string}
3572
3636
  */
3573
3637
  export function geometryParityAnswers() {
@@ -3612,8 +3676,7 @@ export function hitTest(items_json, time, width, height, x, y) {
3612
3676
  }
3613
3677
 
3614
3678
  /**
3615
- * A project's non-fatal diagnostics (`Project::lint`), as a JSON array of
3616
- * issues (`alpha2/project`'s `LintIssue`).
3679
+ * A project's non-fatal diagnostics as a JSON array of `LintIssue`s.
3617
3680
  *
3618
3681
  * # Errors
3619
3682
  * Rejects a document that does not load as a valid project.
@@ -3706,17 +3769,17 @@ export function nearestPoint(path_json, width, height, x, y) {
3706
3769
  }
3707
3770
 
3708
3771
  /**
3709
- * Reads a subtitle file (`format` is `srt` or `webvtt`) into caption cues,
3710
- * returned as JSON `{ rows, skipped }`.
3772
+ * Reads a subtitle file (`format` is `srt` or `webvtt`) into caption cues, returned as JSON
3773
+ * `{ rows, skipped, notes }`.
3711
3774
  *
3712
- * `rows` holds one caption track's cues per row, each a project document
3713
- * `CaptionCue`, split so no cue overlaps another in its row and no row holds
3714
- * more cues than a caption track allows. `skipped` counts blocks that were
3715
- * not cues.
3775
+ * `rows` holds one caption track's `CaptionCue`s per row, split so no cues overlap within a
3776
+ * row and no row exceeds a caption track's cue limit. `skipped` counts blocks that were not
3777
+ * cues; `notes` counts markup read but not kept (`extraVoices`, `droppedTimestamps`,
3778
+ * `droppedClasses`, `flattened`).
3716
3779
  *
3717
3780
  * # Errors
3718
- * Rejects an unknown format, a WebVTT file without its header, and cues that
3719
- * need more caption tracks than a project holds.
3781
+ * Rejects an unknown format, a WebVTT file without its header, and cues that need more
3782
+ * caption tracks than a project holds.
3720
3783
  * @param {string} text
3721
3784
  * @param {string} format
3722
3785
  * @returns {string}
@@ -3776,15 +3839,14 @@ export function pathLength(path_json, width, height) {
3776
3839
  }
3777
3840
 
3778
3841
  /**
3779
- * The gain that brings a measured mix (a `loudnessReport` JSON) to
3780
- * `target_lufs` without its true peak passing `ceiling_dbtp`, or its sample
3781
- * peak reaching the master limiter the report states (`limiterThreshold`),
3782
- * as JSON `{ gainDb, integratedLufs, truePeakDbtp, peakLimited,
3842
+ * The gain that brings a measured mix (a `loudnessReport` JSON) to `target_lufs` without its
3843
+ * true peak passing `ceiling_dbtp` or its sample peak reaching the report's
3844
+ * `limiterThreshold`. Returns JSON `{ gainDb, integratedLufs, truePeakDbtp, peakLimited,
3783
3845
  * limiterLimited }`, or `null` for a mix silent below the absolute gate.
3784
3846
  *
3785
3847
  * # Errors
3786
- * Rejects a report that is not a JSON object with its `frames`, or whose
3787
- * `limiterThreshold` is neither a positive number nor `null`.
3848
+ * Rejects a report that is not a JSON object with `frames`, or whose `limiterThreshold` is
3849
+ * neither a positive number nor `null`.
3788
3850
  * @param {string} report_json
3789
3851
  * @param {number} target_lufs
3790
3852
  * @param {number} ceiling_dbtp
@@ -3812,13 +3874,11 @@ export function planLoudnessNormalization(report_json, target_lufs, ceiling_dbtp
3812
3874
  }
3813
3875
 
3814
3876
  /**
3815
- * How much later than a source time a decoded frame's timestamp may be and
3816
- * still be the frame shown there, in ticks, for a stream whose timestamps
3817
- * are whole multiples of `num / den` seconds and rounded to `quantum` of
3818
- * those units ([`alpha2_time::presentation_slack`]; zero for a time base
3819
- * not known, `quantum` 0 for no rounding shown): what a host's decoder
3820
- * adapters allow past a requested time before they take the last frame at
3821
- * or before it, as the native host does.
3877
+ * How many ticks after a source time a decoded frame's timestamp may fall and still be the
3878
+ * frame shown there ([`alpha2_time::presentation_slack`]). The stream's timestamps are whole
3879
+ * multiples of `num / den` seconds rounded to `quantum` units (0 for no rounding); an unknown
3880
+ * time base gives zero. Decoder adapters allow this much past a requested time before taking
3881
+ * the last frame at or before it, as the native host does.
3822
3882
  * @param {bigint} num
3823
3883
  * @param {bigint} den
3824
3884
  * @param {bigint} quantum
@@ -3831,9 +3891,6 @@ export function presentationSlackTicks(num, den, quantum) {
3831
3891
 
3832
3892
  /**
3833
3893
  * The engine's quality level names, lowest first, as a JSON array.
3834
- *
3835
- * An app builds its quality control from this rather than from a list of its
3836
- * own, so the names a browser offers are the ones the engine resolves.
3837
3894
  * @returns {string}
3838
3895
  */
3839
3896
  export function qualityLevels() {
@@ -3884,9 +3941,8 @@ export function resamplePath(path_json, width, height, counts) {
3884
3941
  }
3885
3942
 
3886
3943
  /**
3887
- * Resolves a quality level into a stereo audio bitrate in bits per second.
3888
- *
3889
- * `codec` is `aac` or `opus`. The native host reads the same engine table.
3944
+ * Resolves a quality level into a stereo audio bitrate in bits per second. `codec` is `aac`
3945
+ * or `opus`.
3890
3946
  * @param {string} codec
3891
3947
  * @param {string} level
3892
3948
  * @returns {number}
@@ -3904,11 +3960,8 @@ export function resolveAudioBitrate(codec, level) {
3904
3960
  }
3905
3961
 
3906
3962
  /**
3907
- * Resolves a quality level into the rate control every sink encodes with.
3908
- *
3909
- * Returns JSON: `{ "bitrate", "mode", "quantizer" }`. The native host calls
3910
- * the same engine function, so a browser export and a native export at the
3911
- * same level and output receive the same numbers.
3963
+ * Resolves a quality level into the rate control every sink encodes with, as JSON
3964
+ * `{ "bitrate", "mode", "quantizer" }`. The native host calls the same engine function.
3912
3965
  * @param {string} codec
3913
3966
  * @param {number} width
3914
3967
  * @param {number} height
@@ -3941,8 +3994,8 @@ export function resolveRateControl(codec, width, height, frame_rate_num, frame_r
3941
3994
  }
3942
3995
 
3943
3996
  /**
3944
- * The unit a stream's first timestamps (in its time base's units) show
3945
- * they are rounded to, 0 for none ([`alpha2_time::rounding_quantum`]).
3997
+ * The unit a stream's first timestamps (in time base units) are rounded to, or 0 for none
3998
+ * ([`alpha2_time::rounding_quantum`]).
3946
3999
  * @param {BigInt64Array} timestamps
3947
4000
  * @returns {bigint}
3948
4001
  */
@@ -3954,7 +4007,16 @@ export function roundingQuantum(timestamps) {
3954
4007
  }
3955
4008
 
3956
4009
  /**
3957
- * Each item's normalized bounds; see the geometry module.
4010
+ * Replaces the GPU watchdog, in milliseconds, that losses are classified against (zero
4011
+ * restores the default of 2000). A page has no environment, so tests set it here.
4012
+ * @param {number} milliseconds
4013
+ */
4014
+ export function setGpuWatchdogMs(milliseconds) {
4015
+ wasm.setGpuWatchdogMs(milliseconds);
4016
+ }
4017
+
4018
+ /**
4019
+ * Each item's normalized bounds as JSON `[{ at, bounds }]`.
3958
4020
  *
3959
4021
  * # Errors
3960
4022
  * Rejects items that are not a valid content tree, or a bad size or time.
@@ -3986,10 +4048,8 @@ export function shapeBounds(items_json, time, width, height) {
3986
4048
  }
3987
4049
 
3988
4050
  /**
3989
- * Installs the panic reporter as the module is instantiated.
3990
- *
3991
- * `wasm-bindgen` calls this from the generated initializer, so every entry
3992
- * point is covered without the host opting in.
4051
+ * Installs the panic reporter when the module is instantiated, so every entry point is
4052
+ * covered without the host opting in.
3993
4053
  */
3994
4054
  export function start() {
3995
4055
  wasm.start();
@@ -4063,7 +4123,7 @@ export function trimPath(path_json, width, height, start, end, offset) {
4063
4123
 
4064
4124
  /**
4065
4125
  * The vector coverage and scene hashes the native tests pin
4066
- * (`tests/golden/vector_coverage.json`), computed by this module.
4126
+ * (`tests/golden/vector_coverage.json`).
4067
4127
  * @returns {string}
4068
4128
  */
4069
4129
  export function vectorParityHashes() {
@@ -4155,40 +4215,48 @@ function __wbg_get_imports() {
4155
4215
  __wbg_addEventListener_9534e2dc12044ee4: function() { return handleError(function (arg0, arg1, arg2, arg3) {
4156
4216
  arg0.addEventListener(getStringFromWasm0(arg1, arg2), arg3);
4157
4217
  }, arguments); },
4158
- __wbg_alpha2BitmapUploadsPremultiplied_11d638014bcd9db6: function() { return handleError(function () {
4159
- const ret = alpha2BitmapUploadsPremultiplied();
4218
+ __wbg_alpha2BitmapUploadProbe_e4f6696ad3e468c6: function() { return handleError(function () {
4219
+ const ret = alpha2BitmapUploadProbe();
4160
4220
  return ret;
4161
4221
  }, arguments); },
4162
- __wbg_alpha2Canvas2d_7c53224793d83297: function() { return handleError(function (arg0) {
4222
+ __wbg_alpha2Canvas2d_5c0b7c647c1ef267: function() { return handleError(function (arg0) {
4163
4223
  const ret = alpha2Canvas2d(arg0);
4164
4224
  return ret;
4165
4225
  }, arguments); },
4166
- __wbg_alpha2CopyExternalImage_85d06101809c56a3: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
4226
+ __wbg_alpha2CopyExternalImage_9f7986408170e249: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
4167
4227
  alpha2CopyExternalImage(arg0, arg1, arg2, arg3 >>> 0, arg4 >>> 0);
4168
4228
  }, arguments); },
4169
- __wbg_alpha2FrameBitmap_8b4ad7a0a0c77797: function() { return handleError(function (arg0, arg1, arg2) {
4229
+ __wbg_alpha2FrameBitmap_cd6c6571bdf4400d: function() { return handleError(function (arg0, arg1, arg2) {
4170
4230
  const ret = alpha2FrameBitmap(arg0, arg1 >>> 0, arg2 >>> 0);
4171
4231
  return ret;
4172
4232
  }, arguments); },
4173
- __wbg_alpha2ImagePixels_01c946ed0a5a2aff: function() { return handleError(function (arg0, arg1, arg2, arg3) {
4233
+ __wbg_alpha2ImagePixels_629029b6bd7af4ba: function() { return handleError(function (arg0, arg1, arg2, arg3) {
4174
4234
  const ret = alpha2ImagePixels(arg1, arg2 >>> 0, arg3 >>> 0);
4175
4235
  const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
4176
4236
  const len1 = WASM_VECTOR_LEN;
4177
4237
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
4178
4238
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
4179
4239
  }, arguments); },
4180
- __wbg_alpha2PutRgba_3c12864b6d5b5ea1: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
4240
+ __wbg_alpha2PutRgba_75c2eb5d9053b3ef: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
4181
4241
  alpha2PutRgba(arg0, getArrayU8FromWasm0(arg1, arg2), arg3 >>> 0, arg4 >>> 0);
4182
4242
  }, arguments); },
4183
- __wbg_alpha2ResizeCanvas_48bb58d4d55717f1: function() { return handleError(function (arg0, arg1, arg2) {
4243
+ __wbg_alpha2ResizeCanvas_9677cbececcf952e: function() { return handleError(function (arg0, arg1, arg2) {
4184
4244
  alpha2ResizeCanvas(arg0, arg1 >>> 0, arg2 >>> 0);
4185
4245
  }, arguments); },
4246
+ __wbg_apply_5d9aa7604c2490a8: function() { return handleError(function (arg0, arg1, arg2) {
4247
+ const ret = arg0.apply(arg1, arg2);
4248
+ return ret;
4249
+ }, arguments); },
4186
4250
  __wbg_attachShader_74ecf95efc73ee58: function(arg0, arg1, arg2) {
4187
4251
  arg0.attachShader(arg1, arg2);
4188
4252
  },
4189
4253
  __wbg_attachShader_bfb57af27e3c4a25: function(arg0, arg1, arg2) {
4190
4254
  arg0.attachShader(arg1, arg2);
4191
4255
  },
4256
+ __wbg_beginComputePass_b9a325184985e6ff: function(arg0, arg1) {
4257
+ const ret = arg0.beginComputePass(arg1);
4258
+ return ret;
4259
+ },
4192
4260
  __wbg_beginQuery_8c123fa7e7aec2a4: function(arg0, arg1, arg2) {
4193
4261
  arg0.beginQuery(arg1 >>> 0, arg2);
4194
4262
  },
@@ -4671,6 +4739,9 @@ function __wbg_get_imports() {
4671
4739
  __wbg_endQuery_4eea0267f103b625: function(arg0, arg1) {
4672
4740
  arg0.endQuery(arg1 >>> 0);
4673
4741
  },
4742
+ __wbg_end_82fd0c12ba185009: function(arg0) {
4743
+ arg0.end();
4744
+ },
4674
4745
  __wbg_end_b57473834b877409: function(arg0) {
4675
4746
  arg0.end();
4676
4747
  },
@@ -4946,6 +5017,16 @@ function __wbg_get_imports() {
4946
5017
  const ret = result;
4947
5018
  return ret;
4948
5019
  },
5020
+ __wbg_instanceof_Promise_f6320f682f582ddf: function(arg0) {
5021
+ let result;
5022
+ try {
5023
+ result = arg0 instanceof Promise;
5024
+ } catch (_) {
5025
+ result = false;
5026
+ }
5027
+ const ret = result;
5028
+ return ret;
5029
+ },
4949
5030
  __wbg_instanceof_TypeError_2784cf59ac94d11e: function(arg0) {
4950
5031
  let result;
4951
5032
  try {
@@ -5489,6 +5570,9 @@ function __wbg_get_imports() {
5489
5570
  __wbg_set_beginning_of_pass_write_index_e552c5e8b8bbf52f: function(arg0, arg1) {
5490
5571
  arg0.beginningOfPassWriteIndex = arg1 >>> 0;
5491
5572
  },
5573
+ __wbg_set_beginning_of_pass_write_index_fa9ae10d5d2804ce: function(arg0, arg1) {
5574
+ arg0.beginningOfPassWriteIndex = arg1 >>> 0;
5575
+ },
5492
5576
  __wbg_set_bind_group_layouts_458c44ba55100b82: function(arg0, arg1, arg2) {
5493
5577
  arg0.bindGroupLayouts = getArrayJsValueViewFromWasm0(arg1, arg2);
5494
5578
  },
@@ -5600,6 +5684,9 @@ function __wbg_get_imports() {
5600
5684
  __wbg_set_end_of_pass_write_index_8f164f9e60d4ad16: function(arg0, arg1) {
5601
5685
  arg0.endOfPassWriteIndex = arg1 >>> 0;
5602
5686
  },
5687
+ __wbg_set_end_of_pass_write_index_b54a8e3802b9ae0d: function(arg0, arg1) {
5688
+ arg0.endOfPassWriteIndex = arg1 >>> 0;
5689
+ },
5603
5690
  __wbg_set_entries_6f866302103b81e9: function(arg0, arg1, arg2) {
5604
5691
  arg0.entries = getArrayJsValueViewFromWasm0(arg1, arg2);
5605
5692
  },
@@ -5666,6 +5753,9 @@ function __wbg_get_imports() {
5666
5753
  __wbg_set_label_17202740051e9722: function(arg0, arg1, arg2) {
5667
5754
  arg0.label = getStringFromWasm0(arg1, arg2);
5668
5755
  },
5756
+ __wbg_set_label_17b4858e1eef23dd: function(arg0, arg1, arg2) {
5757
+ arg0.label = getStringFromWasm0(arg1, arg2);
5758
+ },
5669
5759
  __wbg_set_label_2fefb39c0e0dbbe8: function(arg0, arg1, arg2) {
5670
5760
  arg0.label = getStringFromWasm0(arg1, arg2);
5671
5761
  },
@@ -5816,6 +5906,9 @@ function __wbg_get_imports() {
5816
5906
  __wbg_set_query_set_f030702f1b69199f: function(arg0, arg1) {
5817
5907
  arg0.querySet = arg1;
5818
5908
  },
5909
+ __wbg_set_query_set_f9a94586851fdba2: function(arg0, arg1) {
5910
+ arg0.querySet = arg1;
5911
+ },
5819
5912
  __wbg_set_r_6ece4d74af63364f: function(arg0, arg1) {
5820
5913
  arg0.r = arg1;
5821
5914
  },
@@ -5936,6 +6029,9 @@ function __wbg_get_imports() {
5936
6029
  __wbg_set_texture_a33be3fe02ac6264: function(arg0, arg1) {
5937
6030
  arg0.texture = arg1;
5938
6031
  },
6032
+ __wbg_set_timestamp_writes_5f240bbaad97fcaf: function(arg0, arg1) {
6033
+ arg0.timestampWrites = arg1;
6034
+ },
5939
6035
  __wbg_set_timestamp_writes_de6a09f299b71b76: function(arg0, arg1) {
5940
6036
  arg0.timestampWrites = arg1;
5941
6037
  },
@@ -6369,47 +6465,47 @@ function __wbg_get_imports() {
6369
6465
  arg0.writeTexture(arg1, getArrayU8FromWasm0(arg2, arg3), arg4, arg5);
6370
6466
  }, arguments); },
6371
6467
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
6372
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 3759, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
6468
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 3932, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
6373
6469
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true_);
6374
6470
  return ret;
6375
6471
  },
6376
6472
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
6377
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 353, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
6473
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 230, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
6378
6474
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___web_sys_9e2ae0ace5131457___features__gen_Event__Event______true_);
6379
6475
  return ret;
6380
6476
  },
6381
6477
  __wbindgen_generic_0000000000000003: function(arg0, arg1) {
6382
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUCompilationInfo")], shim_idx: 1537, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
6478
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUCompilationInfo")], shim_idx: 1708, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
6383
6479
  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_);
6384
6480
  return ret;
6385
6481
  },
6386
6482
  __wbindgen_generic_0000000000000004: function(arg0, arg1) {
6387
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 1537, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
6388
- 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__220);
6483
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 1708, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
6484
+ 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__232);
6389
6485
  return ret;
6390
6486
  },
6391
6487
  __wbindgen_generic_0000000000000005: function(arg0, arg1) {
6392
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx: 1540, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
6488
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDeviceLostInfo")], shim_idx: 1711, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
6393
6489
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true_);
6394
6490
  return ret;
6395
6491
  },
6396
6492
  __wbindgen_generic_0000000000000006: function(arg0, arg1) {
6397
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 1540, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
6398
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__222);
6493
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 1711, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
6494
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__234);
6399
6495
  return ret;
6400
6496
  },
6401
6497
  __wbindgen_generic_0000000000000007: function(arg0, arg1) {
6402
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 1537, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
6403
- 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__223);
6498
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 1708, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
6499
+ 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__235);
6404
6500
  return ret;
6405
6501
  },
6406
6502
  __wbindgen_generic_0000000000000008: function(arg0, arg1) {
6407
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 1537, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
6408
- 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__224);
6503
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 1708, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
6504
+ 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__236);
6409
6505
  return ret;
6410
6506
  },
6411
6507
  __wbindgen_generic_0000000000000009: function(arg0, arg1) {
6412
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 355, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
6508
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 232, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
6413
6509
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke_______true_);
6414
6510
  return ret;
6415
6511
  },
@@ -6476,8 +6572,9 @@ function __wbg_get_imports() {
6476
6572
  return {
6477
6573
  __proto__: null,
6478
6574
  "./alpha2_wasm_bg.js": import0,
6479
- "./snippets/alpha2-wasm-57b04ecc6db57e1f/inline1.js": import1,
6480
- "./snippets/alpha2-wasm-57b04ecc6db57e1f/inline1.js": import2,
6575
+ "./snippets/alpha2-wasm-1313375d424845c0/inline1.js": import1,
6576
+ "./snippets/alpha2-wasm-1313375d424845c0/inline1.js": import2,
6577
+ "./snippets/alpha2-wasm-1313375d424845c0/inline1.js": import3,
6481
6578
  };
6482
6579
  }
6483
6580
 
@@ -6493,8 +6590,8 @@ function wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46
6493
6590
  wasm.wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true_(arg0, arg1, arg2);
6494
6591
  }
6495
6592
 
6496
- function wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__222(arg0, arg1, arg2) {
6497
- wasm.wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__222(arg0, arg1, arg2);
6593
+ function wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__234(arg0, arg1, arg2) {
6594
+ wasm.wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wgpu_f46556a90412e4d9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true__234(arg0, arg1, arg2);
6498
6595
  }
6499
6596
 
6500
6597
  function wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bindgen_d171202afaeab6f2___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_d171202afaeab6f2___JsError___true_(arg0, arg1, arg2) {
@@ -6511,22 +6608,22 @@ function wasm_bindgen_d171202afaeab6f2___convert__closures_____invoke___wasm_bin
6511
6608
  }
6512
6609
  }
6513
6610
 
6514
- 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__220(arg0, arg1, arg2) {
6515
- 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__220(arg0, arg1, arg2);
6611
+ 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__232(arg0, arg1, arg2) {
6612
+ 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__232(arg0, arg1, arg2);
6516
6613
  if (ret[1]) {
6517
6614
  throw takeFromExternrefTable0(ret[0]);
6518
6615
  }
6519
6616
  }
6520
6617
 
6521
- 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__223(arg0, arg1, arg2) {
6522
- 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__223(arg0, arg1, arg2);
6618
+ 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__235(arg0, arg1, arg2) {
6619
+ 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__235(arg0, arg1, arg2);
6523
6620
  if (ret[1]) {
6524
6621
  throw takeFromExternrefTable0(ret[0]);
6525
6622
  }
6526
6623
  }
6527
6624
 
6528
- 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__224(arg0, arg1, arg2) {
6529
- 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__224(arg0, arg1, arg2);
6625
+ 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__236(arg0, arg1, arg2) {
6626
+ 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__236(arg0, arg1, arg2);
6530
6627
  if (ret[1]) {
6531
6628
  throw takeFromExternrefTable0(ret[0]);
6532
6629
  }