@osmo.inc/cli 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DEPLOY.md +87 -0
- package/README.md +243 -0
- package/RELEASE.md +164 -0
- package/SETUP.md +60 -0
- package/THIRD_PARTY_NOTICES.md +18 -0
- package/bin/osmo.mjs +12 -0
- package/dist/osmo.js +7817 -0
- package/node_modules/@esbuild/darwin-arm64/README.md +3 -0
- package/node_modules/@esbuild/darwin-arm64/bin/esbuild +0 -0
- package/node_modules/@esbuild/darwin-arm64/package.json +20 -0
- package/node_modules/esbuild/LICENSE.md +21 -0
- package/node_modules/esbuild/README.md +3 -0
- package/node_modules/esbuild/bin/esbuild +223 -0
- package/node_modules/esbuild/install.js +289 -0
- package/node_modules/esbuild/lib/main.d.ts +716 -0
- package/node_modules/esbuild/lib/main.js +2532 -0
- package/node_modules/esbuild/package.json +49 -0
- package/node_modules/fflate/LICENSE +21 -0
- package/node_modules/fflate/esm/index.mjs +2710 -0
- package/node_modules/fflate/package.json +128 -0
- package/node_modules/typescript/LICENSE.txt +55 -0
- package/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
- package/node_modules/typescript/lib/lib.d.ts +22 -0
- package/node_modules/typescript/lib/lib.decorators.d.ts +384 -0
- package/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
- package/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
- package/node_modules/typescript/lib/lib.dom.d.ts +39429 -0
- package/node_modules/typescript/lib/lib.dom.iterable.d.ts +571 -0
- package/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
- package/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
- package/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
- package/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
- package/node_modules/typescript/lib/lib.es2015.iterable.d.ts +605 -0
- package/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
- package/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
- package/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
- package/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
- package/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
- package/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
- package/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
- package/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
- package/node_modules/typescript/lib/lib.es2017.d.ts +26 -0
- package/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
- package/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
- package/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
- package/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
- package/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
- package/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
- package/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
- package/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
- package/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
- package/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
- package/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
- package/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
- package/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
- package/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
- package/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2020.bigint.d.ts +765 -0
- package/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
- package/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
- package/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
- package/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
- package/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
- package/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +99 -0
- package/node_modules/typescript/lib/lib.es2020.string.d.ts +44 -0
- package/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
- package/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
- package/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
- package/node_modules/typescript/lib/lib.es2021.weakref.d.ts +78 -0
- package/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
- package/node_modules/typescript/lib/lib.es2022.d.ts +25 -0
- package/node_modules/typescript/lib/lib.es2022.error.d.ts +75 -0
- package/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2022.intl.d.ts +145 -0
- package/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
- package/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
- package/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
- package/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
- package/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
- package/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
- package/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
- package/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
- package/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
- package/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
- package/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2024.object.d.ts +29 -0
- package/node_modules/typescript/lib/lib.es2024.promise.d.ts +35 -0
- package/node_modules/typescript/lib/lib.es2024.regexp.d.ts +25 -0
- package/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +68 -0
- package/node_modules/typescript/lib/lib.es2024.string.d.ts +29 -0
- package/node_modules/typescript/lib/lib.es5.d.ts +4601 -0
- package/node_modules/typescript/lib/lib.es6.d.ts +23 -0
- package/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
- package/node_modules/typescript/lib/lib.esnext.collection.d.ts +96 -0
- package/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
- package/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
- package/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
- package/node_modules/typescript/lib/lib.esnext.error.d.ts +24 -0
- package/node_modules/typescript/lib/lib.esnext.float16.d.ts +445 -0
- package/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
- package/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
- package/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
- package/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +25 -0
- package/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
- package/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
- package/node_modules/typescript/lib/lib.webworker.d.ts +13150 -0
- package/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
- package/node_modules/typescript/lib/lib.webworker.iterable.d.ts +340 -0
- package/node_modules/typescript/lib/typescript.js +382 -0
- package/node_modules/typescript/package.json +57 -0
- package/package.json +54 -0
- package/release.json +136 -0
- package/runtime/apps/native/tools/compile.mjs +217 -0
- package/runtime/packages/scene/scripts/validate-strict.mjs +246 -0
- package/runtime/packages/scene/src/clip.d.mts +14 -0
- package/runtime/packages/scene/src/clip.mjs +15 -0
- package/runtime/packages/scene/src/color-value.d.mts +5 -0
- package/runtime/packages/scene/src/color-value.mjs +19 -0
- package/runtime/packages/scene/src/color.ts +1 -0
- package/runtime/packages/scene/src/effects.ts +213 -0
- package/runtime/packages/scene/src/elements.ts +491 -0
- package/runtime/packages/scene/src/evaluate.ts +919 -0
- package/runtime/packages/scene/src/index.ts +69 -0
- package/runtime/packages/scene/src/jsx-runtime.ts +73 -0
- package/runtime/packages/scene/src/knob-schema.ts +115 -0
- package/runtime/packages/scene/src/knobs.ts +118 -0
- package/runtime/packages/scene/src/mask.d.mts +6 -0
- package/runtime/packages/scene/src/mask.mjs +17 -0
- package/runtime/packages/scene/src/metadata.d.mts +23 -0
- package/runtime/packages/scene/src/metadata.mjs +44 -0
- package/runtime/packages/scene/src/motion-sampling.d.mts +2 -0
- package/runtime/packages/scene/src/motion-sampling.mjs +50 -0
- package/runtime/packages/scene/src/motion.ts +121 -0
- package/runtime/packages/scene/src/shader.ts +57 -0
- package/src/resource-examples/example-image/landscape.svg +7 -0
- package/src/resource-examples/example-image/resource.json +8 -0
- package/src/resource-examples/example-model/gem.glb +0 -0
- package/src/resource-examples/example-model/preview.svg +1 -0
- package/src/resource-examples/example-model/resource.json +7 -0
- package/src/resource-examples/example-scene/resource.json +1 -0
- package/src/resource-examples/example-scene/scene.tsx +8 -0
- package/src/resource-examples/example-shader/effect.wgsl +7 -0
- package/src/resource-examples/example-shader/preview.svg +1 -0
- package/src/resource-examples/example-shader/resource.json +27 -0
- package/src/resource-examples/example-shader/tint.wgsl +7 -0
- package/src/resource-examples/example-video/ambient.mp4 +0 -0
- package/src/resource-examples/example-video/resource.json +9 -0
- package/src/starter/scene.tsx +20 -0
- package/studio/index.html +2 -0
- package/studio/public/check-circle-filled.svg +3 -0
- package/studio/public/comment-cursor/active-outer.svg +3 -0
- package/studio/public/comment-cursor/default.svg +6 -0
- package/studio/public/osmo-studio-logo.svg +12 -0
- package/studio/public/pencil-simple.svg +5 -0
- package/studio/src/active-outer-TVYUEURE.svg +3 -0
- package/studio/src/app.css +4 -0
- package/studio/src/app.js +705 -0
- package/studio/src/default-6CTRH4V5.svg +6 -0
- package/studio/src/engine_bg.wasm +0 -0
- package/studio/src/inter-cyrillic-ext-wght-normal-IYF56FF6.woff2 +0 -0
- package/studio/src/inter-cyrillic-wght-normal-JEOLYBOO.woff2 +0 -0
- package/studio/src/inter-greek-ext-wght-normal-EOVOK2B5.woff2 +0 -0
- package/studio/src/inter-greek-wght-normal-IRE366VL.woff2 +0 -0
- package/studio/src/inter-latin-ext-wght-normal-HA22NDSG.woff2 +0 -0
- package/studio/src/inter-latin-wght-normal-NRMW37G5.woff2 +0 -0
- package/studio/src/inter-vietnamese-wght-normal-CE5GGD3W.woff2 +0 -0
- package/studio/src/osmo-studio-logo-D5R2V77B.svg +12 -0
- package/third-party/cargo/adler2@2.0.1/Cargo.toml +91 -0
- package/third-party/cargo/adler2@2.0.1/LICENSE-0BSD +12 -0
- package/third-party/cargo/adler2@2.0.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/adler2@2.0.1/LICENSE-MIT +23 -0
- package/third-party/cargo/allocator-api2@0.2.21/Cargo.toml +48 -0
- package/third-party/cargo/allocator-api2@0.2.21/LICENSE-APACHE +176 -0
- package/third-party/cargo/allocator-api2@0.2.21/LICENSE-MIT +23 -0
- package/third-party/cargo/arrayref@0.3.9/Cargo.toml +23 -0
- package/third-party/cargo/arrayref@0.3.9/LICENSE +26 -0
- package/third-party/cargo/arrayvec@0.7.8/Cargo.toml +112 -0
- package/third-party/cargo/arrayvec@0.7.8/LICENSE-APACHE +201 -0
- package/third-party/cargo/arrayvec@0.7.8/LICENSE-MIT +25 -0
- package/third-party/cargo/ascii@1.1.0/Cargo.toml +41 -0
- package/third-party/cargo/ascii@1.1.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/ascii@1.1.0/LICENSE-MIT +22 -0
- package/third-party/cargo/ash@0.38.0+1.3.281/Cargo.toml +66 -0
- package/third-party/cargo/ash@0.38.0+1.3.281/LICENSE-APACHE +67 -0
- package/third-party/cargo/ash@0.38.0+1.3.281/LICENSE-MIT +25 -0
- package/third-party/cargo/autocfg@1.5.1/Cargo.toml +75 -0
- package/third-party/cargo/autocfg@1.5.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/autocfg@1.5.1/LICENSE-MIT +25 -0
- package/third-party/cargo/base64@0.13.1/Cargo.toml +53 -0
- package/third-party/cargo/base64@0.13.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/base64@0.13.1/LICENSE-MIT +21 -0
- package/third-party/cargo/base64@0.22.1/Cargo.toml +85 -0
- package/third-party/cargo/base64@0.22.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/base64@0.22.1/LICENSE-MIT +21 -0
- package/third-party/cargo/bit-set@0.10.0/Cargo.toml +108 -0
- package/third-party/cargo/bit-set@0.10.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/bit-set@0.10.0/LICENSE-MIT +25 -0
- package/third-party/cargo/bit-vec@0.9.1/Cargo.toml +94 -0
- package/third-party/cargo/bit-vec@0.9.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/bit-vec@0.9.1/LICENSE-MIT +25 -0
- package/third-party/cargo/bitflags@2.13.0/Cargo.toml +120 -0
- package/third-party/cargo/bitflags@2.13.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/bitflags@2.13.0/LICENSE-MIT +25 -0
- package/third-party/cargo/block2@0.6.2/Cargo.toml +115 -0
- package/third-party/cargo/block2@0.6.2/MIT-terms.txt +22 -0
- package/third-party/cargo/block2@0.6.2/madsmtm-objc2-b4167b582b2f-LICENSE.md +34 -0
- package/third-party/cargo/bumpalo@3.20.3/Cargo.toml +99 -0
- package/third-party/cargo/bumpalo@3.20.3/LICENSE-APACHE +201 -0
- package/third-party/cargo/bumpalo@3.20.3/LICENSE-MIT +25 -0
- package/third-party/cargo/bytemuck@1.25.1/Cargo.toml +153 -0
- package/third-party/cargo/bytemuck@1.25.1/LICENSE-APACHE +61 -0
- package/third-party/cargo/bytemuck@1.25.1/LICENSE-MIT +9 -0
- package/third-party/cargo/bytemuck@1.25.1/LICENSE-ZLIB +11 -0
- package/third-party/cargo/bytemuck_derive@1.11.0/Cargo.toml +60 -0
- package/third-party/cargo/bytemuck_derive@1.11.0/LICENSE-APACHE +61 -0
- package/third-party/cargo/bytemuck_derive@1.11.0/LICENSE-MIT +9 -0
- package/third-party/cargo/bytemuck_derive@1.11.0/LICENSE-ZLIB +11 -0
- package/third-party/cargo/byteorder-lite@0.1.0/Cargo.toml +57 -0
- package/third-party/cargo/byteorder-lite@0.1.0/LICENSE-MIT +21 -0
- package/third-party/cargo/byteorder-lite@0.1.0/UNLICENSE +24 -0
- package/third-party/cargo/byteorder@1.5.0/COPYING +3 -0
- package/third-party/cargo/byteorder@1.5.0/Cargo.toml +54 -0
- package/third-party/cargo/byteorder@1.5.0/LICENSE-MIT +21 -0
- package/third-party/cargo/byteorder@1.5.0/UNLICENSE +24 -0
- package/third-party/cargo/cfg-if@1.0.4/Cargo.toml +47 -0
- package/third-party/cargo/cfg-if@1.0.4/LICENSE-APACHE +201 -0
- package/third-party/cargo/cfg-if@1.0.4/LICENSE-MIT +25 -0
- package/third-party/cargo/cfg_aliases@0.2.1/Cargo.toml +43 -0
- package/third-party/cargo/cfg_aliases@0.2.1/LICENSE +9 -0
- package/third-party/cargo/chunked_transfer@1.5.0/Cargo.toml +27 -0
- package/third-party/cargo/chunked_transfer@1.5.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/chunked_transfer@1.5.0/LICENSE-MIT +22 -0
- package/third-party/cargo/codespan-reporting@0.13.1/Cargo.toml +115 -0
- package/third-party/cargo/codespan-reporting@0.13.1/LICENSE +201 -0
- package/third-party/cargo/color_quant@1.1.0/Cargo.toml +20 -0
- package/third-party/cargo/color_quant@1.1.0/LICENSE +21 -0
- package/third-party/cargo/console_error_panic_hook@0.1.7/Cargo.toml +27 -0
- package/third-party/cargo/console_error_panic_hook@0.1.7/LICENSE-APACHE +201 -0
- package/third-party/cargo/console_error_panic_hook@0.1.7/LICENSE-MIT +25 -0
- package/third-party/cargo/core_maths@0.1.1/Cargo.toml +37 -0
- package/third-party/cargo/core_maths@0.1.1/LICENSE +21 -0
- package/third-party/cargo/cosmic-text@0.19.0/Cargo.toml +214 -0
- package/third-party/cargo/cosmic-text@0.19.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/cosmic-text@0.19.0/LICENSE-MIT +21 -0
- package/third-party/cargo/crc32fast@1.5.0/Cargo.toml +68 -0
- package/third-party/cargo/crc32fast@1.5.0/LICENSE-APACHE +202 -0
- package/third-party/cargo/crc32fast@1.5.0/LICENSE-MIT +21 -0
- package/third-party/cargo/data-url@0.3.2/Cargo.toml +63 -0
- package/third-party/cargo/data-url@0.3.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/data-url@0.3.2/LICENSE-MIT +25 -0
- package/third-party/cargo/dispatch2@0.3.1/Cargo.toml +122 -0
- package/third-party/cargo/dispatch2@0.3.1/MIT-terms.txt +22 -0
- package/third-party/cargo/dispatch2@0.3.1/madsmtm-objc2-8852b424193c-LICENSE.md +34 -0
- package/third-party/cargo/dlib@0.5.3/Cargo.toml +43 -0
- package/third-party/cargo/dlib@0.5.3/LICENSE.txt +19 -0
- package/third-party/cargo/document-features@0.2.12/Cargo.toml +51 -0
- package/third-party/cargo/document-features@0.2.12/LICENSE-APACHE +73 -0
- package/third-party/cargo/document-features@0.2.12/LICENSE-MIT +19 -0
- package/third-party/cargo/equivalent@1.0.2/Cargo.toml +37 -0
- package/third-party/cargo/equivalent@1.0.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/equivalent@1.0.2/LICENSE-MIT +25 -0
- package/third-party/cargo/errno@0.3.14/Cargo.toml +67 -0
- package/third-party/cargo/errno@0.3.14/LICENSE-APACHE +201 -0
- package/third-party/cargo/errno@0.3.14/LICENSE-MIT +25 -0
- package/third-party/cargo/etagere@0.3.0/Cargo.toml +57 -0
- package/third-party/cargo/etagere@0.3.0/LICENSE-APACHE +13 -0
- package/third-party/cargo/etagere@0.3.0/LICENSE-MIT +20 -0
- package/third-party/cargo/euclid@0.22.14/COPYRIGHT +5 -0
- package/third-party/cargo/euclid@0.22.14/Cargo.toml +66 -0
- package/third-party/cargo/euclid@0.22.14/LICENSE-APACHE +201 -0
- package/third-party/cargo/euclid@0.22.14/LICENSE-MIT +25 -0
- package/third-party/cargo/fastrand@2.5.0/Cargo.toml +89 -0
- package/third-party/cargo/fastrand@2.5.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/fastrand@2.5.0/LICENSE-MIT +23 -0
- package/third-party/cargo/fdeflate@0.3.7/Cargo.toml +55 -0
- package/third-party/cargo/fdeflate@0.3.7/LICENSE-APACHE +177 -0
- package/third-party/cargo/fdeflate@0.3.7/LICENSE-MIT +25 -0
- package/third-party/cargo/flate2@1.1.9/Cargo.toml +274 -0
- package/third-party/cargo/flate2@1.1.9/LICENSE-APACHE +201 -0
- package/third-party/cargo/flate2@1.1.9/LICENSE-MIT +25 -0
- package/third-party/cargo/float-cmp@0.9.0/Cargo.toml +39 -0
- package/third-party/cargo/float-cmp@0.9.0/LICENSE +19 -0
- package/third-party/cargo/float_next_after@1.0.0/Cargo.toml +43 -0
- package/third-party/cargo/float_next_after@1.0.0/LICENSE +23 -0
- package/third-party/cargo/foldhash@0.2.0/Cargo.toml +80 -0
- package/third-party/cargo/foldhash@0.2.0/LICENSE +19 -0
- package/third-party/cargo/font-types@0.11.3/Cargo.toml +55 -0
- package/third-party/cargo/font-types@0.11.3/LICENSE-APACHE +67 -0
- package/third-party/cargo/font-types@0.11.3/LICENSE-MIT +25 -0
- package/third-party/cargo/fontdb@0.23.0/Cargo.toml +83 -0
- package/third-party/cargo/fontdb@0.23.0/LICENSE +21 -0
- package/third-party/cargo/futures-core@0.3.32/Cargo.toml +66 -0
- package/third-party/cargo/futures-core@0.3.32/LICENSE-APACHE +202 -0
- package/third-party/cargo/futures-core@0.3.32/LICENSE-MIT +26 -0
- package/third-party/cargo/futures-task@0.3.32/Cargo.toml +58 -0
- package/third-party/cargo/futures-task@0.3.32/LICENSE-APACHE +202 -0
- package/third-party/cargo/futures-task@0.3.32/LICENSE-MIT +26 -0
- package/third-party/cargo/futures-util@0.3.32/Cargo.toml +181 -0
- package/third-party/cargo/futures-util@0.3.32/LICENSE-APACHE +202 -0
- package/third-party/cargo/futures-util@0.3.32/LICENSE-MIT +26 -0
- package/third-party/cargo/getrandom@0.4.3/Cargo.toml +165 -0
- package/third-party/cargo/getrandom@0.4.3/LICENSE-APACHE +201 -0
- package/third-party/cargo/getrandom@0.4.3/LICENSE-MIT +26 -0
- package/third-party/cargo/gif@0.14.2/Cargo.toml +84 -0
- package/third-party/cargo/gif@0.14.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/gif@0.14.2/LICENSE-MIT +21 -0
- package/third-party/cargo/glam@0.33.2/Cargo.toml +354 -0
- package/third-party/cargo/glam@0.33.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/glam@0.33.2/LICENSE-MIT +23 -0
- package/third-party/cargo/glow@0.17.0/Cargo.toml +122 -0
- package/third-party/cargo/glow@0.17.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/glow@0.17.0/LICENSE-MIT +23 -0
- package/third-party/cargo/glow@0.17.0/LICENSE-ZLIB +15 -0
- package/third-party/cargo/gltf-derive@1.4.1/Cargo.toml +34 -0
- package/third-party/cargo/gltf-derive@1.4.1/LICENSE-APACHE +202 -0
- package/third-party/cargo/gltf-derive@1.4.1/LICENSE-MIT +26 -0
- package/third-party/cargo/gltf-json@1.4.1/Cargo.toml +50 -0
- package/third-party/cargo/gltf-json@1.4.1/LICENSE-APACHE +202 -0
- package/third-party/cargo/gltf-json@1.4.1/LICENSE-MIT +26 -0
- package/third-party/cargo/gltf@1.4.1/Cargo.toml +122 -0
- package/third-party/cargo/gltf@1.4.1/LICENSE-APACHE +202 -0
- package/third-party/cargo/gltf@1.4.1/LICENSE-MIT +26 -0
- package/third-party/cargo/glyphon@0.12.0/Cargo.toml +35 -0
- package/third-party/cargo/glyphon@0.12.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/glyphon@0.12.0/LICENSE-MIT +23 -0
- package/third-party/cargo/glyphon@0.12.0/LICENSE-ZLIB +15 -0
- package/third-party/cargo/gpu-allocator@0.28.0/Cargo.toml +180 -0
- package/third-party/cargo/gpu-allocator@0.28.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/gpu-allocator@0.28.0/LICENSE-MIT +7 -0
- package/third-party/cargo/grid@1.0.1/Cargo.toml +77 -0
- package/third-party/cargo/grid@1.0.1/LICENSE +21 -0
- package/third-party/cargo/half@2.7.1/Cargo.toml +137 -0
- package/third-party/cargo/half@2.7.1/LICENSE-APACHE +176 -0
- package/third-party/cargo/half@2.7.1/LICENSE-MIT +19 -0
- package/third-party/cargo/harfrust@0.5.2/Cargo.toml +115 -0
- package/third-party/cargo/harfrust@0.5.2/harfbuzz-harfrust-efdae3142ab7-LICENSE +22 -0
- package/third-party/cargo/hashbrown@0.16.1/Cargo.toml +180 -0
- package/third-party/cargo/hashbrown@0.16.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/hashbrown@0.16.1/LICENSE-MIT +25 -0
- package/third-party/cargo/hashbrown@0.17.1/Cargo.toml +201 -0
- package/third-party/cargo/hashbrown@0.17.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/hashbrown@0.17.1/LICENSE-MIT +25 -0
- package/third-party/cargo/httpdate@1.0.3/Cargo.toml +35 -0
- package/third-party/cargo/httpdate@1.0.3/LICENSE-APACHE +201 -0
- package/third-party/cargo/httpdate@1.0.3/LICENSE-MIT +19 -0
- package/third-party/cargo/image-webp@0.2.4/Cargo.toml +63 -0
- package/third-party/cargo/image-webp@0.2.4/LICENSE-APACHE +177 -0
- package/third-party/cargo/image-webp@0.2.4/LICENSE-MIT +25 -0
- package/third-party/cargo/image@0.25.10/Cargo.toml +248 -0
- package/third-party/cargo/image@0.25.10/LICENSE-APACHE +177 -0
- package/third-party/cargo/image@0.25.10/LICENSE-MIT +25 -0
- package/third-party/cargo/imagesize@0.14.0/Cargo.toml +104 -0
- package/third-party/cargo/imagesize@0.14.0/LICENSE +21 -0
- package/third-party/cargo/indexmap@2.14.0/Cargo.toml +167 -0
- package/third-party/cargo/indexmap@2.14.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/indexmap@2.14.0/LICENSE-MIT +25 -0
- package/third-party/cargo/inflections@1.1.1/Cargo.toml +21 -0
- package/third-party/cargo/inflections@1.1.1/LICENSE +20 -0
- package/third-party/cargo/itoa@1.0.18/Cargo.toml +66 -0
- package/third-party/cargo/itoa@1.0.18/LICENSE-APACHE +176 -0
- package/third-party/cargo/itoa@1.0.18/LICENSE-MIT +23 -0
- package/third-party/cargo/js-sys@0.3.103/Cargo.toml +98 -0
- package/third-party/cargo/js-sys@0.3.103/LICENSE-APACHE +201 -0
- package/third-party/cargo/js-sys@0.3.103/LICENSE-MIT +25 -0
- package/third-party/cargo/khronos-egl@6.0.0/Cargo.toml +82 -0
- package/third-party/cargo/khronos-egl@6.0.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/khronos-egl@6.0.0/LICENSE-MIT +23 -0
- package/third-party/cargo/kurbo@0.13.1/Cargo.toml +230 -0
- package/third-party/cargo/kurbo@0.13.1/LICENSE-APACHE +202 -0
- package/third-party/cargo/kurbo@0.13.1/LICENSE-MIT +25 -0
- package/third-party/cargo/lazy_static@1.5.0/Cargo.toml +46 -0
- package/third-party/cargo/lazy_static@1.5.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/lazy_static@1.5.0/LICENSE-MIT +25 -0
- package/third-party/cargo/libc@0.2.186/Cargo.toml +229 -0
- package/third-party/cargo/libc@0.2.186/LICENSE-APACHE +176 -0
- package/third-party/cargo/libc@0.2.186/LICENSE-MIT +25 -0
- package/third-party/cargo/libloading@0.8.9/Cargo.toml +90 -0
- package/third-party/cargo/libloading@0.8.9/LICENSE +12 -0
- package/third-party/cargo/libm@0.2.16/Cargo.toml +61 -0
- package/third-party/cargo/libm@0.2.16/LICENSE.txt +258 -0
- package/third-party/cargo/linebender_resource_handle@0.1.1/Cargo.toml +107 -0
- package/third-party/cargo/linebender_resource_handle@0.1.1/LICENSE-APACHE +176 -0
- package/third-party/cargo/linebender_resource_handle@0.1.1/LICENSE-MIT +19 -0
- package/third-party/cargo/litrs@1.0.0/Cargo.toml +63 -0
- package/third-party/cargo/litrs@1.0.0/LICENSE-APACHE +176 -0
- package/third-party/cargo/litrs@1.0.0/LICENSE-MIT +25 -0
- package/third-party/cargo/lock_api@0.4.14/Cargo.toml +68 -0
- package/third-party/cargo/lock_api@0.4.14/LICENSE-APACHE +201 -0
- package/third-party/cargo/lock_api@0.4.14/LICENSE-MIT +25 -0
- package/third-party/cargo/log@0.4.33/Cargo.toml +152 -0
- package/third-party/cargo/log@0.4.33/LICENSE-APACHE +201 -0
- package/third-party/cargo/log@0.4.33/LICENSE-MIT +25 -0
- package/third-party/cargo/lru@0.16.4/Cargo.toml +47 -0
- package/third-party/cargo/lru@0.16.4/LICENSE +21 -0
- package/third-party/cargo/lyon_geom@1.0.19/Cargo.toml +69 -0
- package/third-party/cargo/lyon_geom@1.0.19/nical-lyon-56219c95c658-LICENSE-APACHE +13 -0
- package/third-party/cargo/lyon_geom@1.0.19/nical-lyon-56219c95c658-LICENSE-MIT +20 -0
- package/third-party/cargo/lyon_path@1.0.19/Cargo.toml +58 -0
- package/third-party/cargo/lyon_path@1.0.19/nical-lyon-56219c95c658-LICENSE-APACHE +13 -0
- package/third-party/cargo/lyon_path@1.0.19/nical-lyon-56219c95c658-LICENSE-MIT +20 -0
- package/third-party/cargo/lyon_tessellation@1.0.20/Cargo.toml +71 -0
- package/third-party/cargo/lyon_tessellation@1.0.20/nical-lyon-7fa75ea8eea3-LICENSE-APACHE +13 -0
- package/third-party/cargo/lyon_tessellation@1.0.20/nical-lyon-7fa75ea8eea3-LICENSE-MIT +20 -0
- package/third-party/cargo/memchr@2.8.3/COPYING +3 -0
- package/third-party/cargo/memchr@2.8.3/Cargo.toml +89 -0
- package/third-party/cargo/memchr@2.8.3/LICENSE-MIT +21 -0
- package/third-party/cargo/memchr@2.8.3/UNLICENSE +24 -0
- package/third-party/cargo/memmap2@0.9.11/Cargo.toml +59 -0
- package/third-party/cargo/memmap2@0.9.11/LICENSE-APACHE +201 -0
- package/third-party/cargo/memmap2@0.9.11/LICENSE-MIT +26 -0
- package/third-party/cargo/miniz_oxide@0.8.9/Cargo.toml +91 -0
- package/third-party/cargo/miniz_oxide@0.8.9/LICENSE +25 -0
- package/third-party/cargo/miniz_oxide@0.8.9/LICENSE-APACHE.md +177 -0
- package/third-party/cargo/miniz_oxide@0.8.9/LICENSE-MIT.md +24 -0
- package/third-party/cargo/miniz_oxide@0.8.9/LICENSE-ZLIB.md +14 -0
- package/third-party/cargo/moxcms@0.8.1/Cargo.toml +113 -0
- package/third-party/cargo/moxcms@0.8.1/LICENSE-APACHE.md +201 -0
- package/third-party/cargo/moxcms@0.8.1/LICENSE.md +26 -0
- package/third-party/cargo/naga-types@30.0.0/Cargo.toml +94 -0
- package/third-party/cargo/naga-types@30.0.0/LICENSE.APACHE +176 -0
- package/third-party/cargo/naga-types@30.0.0/LICENSE.MIT +21 -0
- package/third-party/cargo/naga@30.0.0/Cargo.toml +246 -0
- package/third-party/cargo/naga@30.0.0/LICENSE.APACHE +176 -0
- package/third-party/cargo/naga@30.0.0/LICENSE.MIT +21 -0
- package/third-party/cargo/num-traits@0.2.19/Cargo.toml +54 -0
- package/third-party/cargo/num-traits@0.2.19/LICENSE-APACHE +201 -0
- package/third-party/cargo/num-traits@0.2.19/LICENSE-MIT +25 -0
- package/third-party/cargo/objc2-core-foundation@0.3.2/Cargo.toml +221 -0
- package/third-party/cargo/objc2-core-foundation@0.3.2/MIT-terms.txt +22 -0
- package/third-party/cargo/objc2-core-foundation@0.3.2/madsmtm-objc2-7b1abfd750a2-LICENSE.md +34 -0
- package/third-party/cargo/objc2-core-graphics@0.3.2/Cargo.toml +331 -0
- package/third-party/cargo/objc2-core-graphics@0.3.2/MIT-terms.txt +22 -0
- package/third-party/cargo/objc2-core-graphics@0.3.2/madsmtm-objc2-7b1abfd750a2-LICENSE.md +34 -0
- package/third-party/cargo/objc2-encode@4.1.0/Cargo.toml +81 -0
- package/third-party/cargo/objc2-encode@4.1.0/MIT-terms.txt +22 -0
- package/third-party/cargo/objc2-encode@4.1.0/madsmtm-objc2-8d214f547736-LICENSE.md +34 -0
- package/third-party/cargo/objc2-foundation@0.3.2/Cargo.toml +529 -0
- package/third-party/cargo/objc2-foundation@0.3.2/MIT-terms.txt +22 -0
- package/third-party/cargo/objc2-foundation@0.3.2/madsmtm-objc2-7b1abfd750a2-LICENSE.md +34 -0
- package/third-party/cargo/objc2-io-surface@0.3.2/Cargo.toml +139 -0
- package/third-party/cargo/objc2-io-surface@0.3.2/MIT-terms.txt +22 -0
- package/third-party/cargo/objc2-io-surface@0.3.2/madsmtm-objc2-7b1abfd750a2-LICENSE.md +34 -0
- package/third-party/cargo/objc2-metal@0.3.2/Cargo.toml +601 -0
- package/third-party/cargo/objc2-metal@0.3.2/MIT-terms.txt +22 -0
- package/third-party/cargo/objc2-metal@0.3.2/madsmtm-objc2-7b1abfd750a2-LICENSE.md +34 -0
- package/third-party/cargo/objc2-quartz-core@0.3.2/Cargo.toml +302 -0
- package/third-party/cargo/objc2-quartz-core@0.3.2/MIT-terms.txt +22 -0
- package/third-party/cargo/objc2-quartz-core@0.3.2/madsmtm-objc2-7b1abfd750a2-LICENSE.md +34 -0
- package/third-party/cargo/objc2@0.6.4/Cargo.toml +232 -0
- package/third-party/cargo/objc2@0.6.4/MIT-terms.txt +22 -0
- package/third-party/cargo/objc2@0.6.4/madsmtm-objc2-8852b424193c-LICENSE.md +34 -0
- package/third-party/cargo/once_cell@1.21.4/Cargo.toml +119 -0
- package/third-party/cargo/once_cell@1.21.4/LICENSE-APACHE +201 -0
- package/third-party/cargo/once_cell@1.21.4/LICENSE-MIT +23 -0
- package/third-party/cargo/ordered-float@5.3.0/Cargo.toml +162 -0
- package/third-party/cargo/ordered-float@5.3.0/LICENSE-MIT +25 -0
- package/third-party/cargo/parking_lot@0.12.5/Cargo.toml +87 -0
- package/third-party/cargo/parking_lot@0.12.5/LICENSE-APACHE +201 -0
- package/third-party/cargo/parking_lot@0.12.5/LICENSE-MIT +25 -0
- package/third-party/cargo/parking_lot_core@0.9.12/Cargo.toml +72 -0
- package/third-party/cargo/parking_lot_core@0.9.12/LICENSE-APACHE +201 -0
- package/third-party/cargo/parking_lot_core@0.9.12/LICENSE-MIT +25 -0
- package/third-party/cargo/pico-args@0.5.0/Cargo.toml +32 -0
- package/third-party/cargo/pico-args@0.5.0/LICENSE +20 -0
- package/third-party/cargo/pin-project-lite@0.2.17/Cargo.toml +198 -0
- package/third-party/cargo/pin-project-lite@0.2.17/LICENSE-APACHE +177 -0
- package/third-party/cargo/pin-project-lite@0.2.17/LICENSE-MIT +23 -0
- package/third-party/cargo/pkg-config@0.3.33/Cargo.toml +43 -0
- package/third-party/cargo/pkg-config@0.3.33/LICENSE-APACHE +201 -0
- package/third-party/cargo/pkg-config@0.3.33/LICENSE-MIT +25 -0
- package/third-party/cargo/png@0.18.1/Cargo.toml +130 -0
- package/third-party/cargo/png@0.18.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/png@0.18.1/LICENSE-MIT +25 -0
- package/third-party/cargo/pollster@0.4.0/Cargo.toml +53 -0
- package/third-party/cargo/pollster@0.4.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/pollster@0.4.0/LICENSE-MIT +25 -0
- package/third-party/cargo/polycool@0.4.0/Cargo.toml +83 -0
- package/third-party/cargo/polycool@0.4.0/LICENSE-APACHE +202 -0
- package/third-party/cargo/polycool@0.4.0/LICENSE-MIT +25 -0
- package/third-party/cargo/pp-rs@0.2.1/Cargo.toml +23 -0
- package/third-party/cargo/pp-rs@0.2.1/LICENSE +29 -0
- package/third-party/cargo/presser@0.3.1/Cargo.toml +58 -0
- package/third-party/cargo/presser@0.3.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/presser@0.3.1/LICENSE-MIT +25 -0
- package/third-party/cargo/proc-macro2@1.0.106/Cargo.toml +105 -0
- package/third-party/cargo/proc-macro2@1.0.106/LICENSE-APACHE +176 -0
- package/third-party/cargo/proc-macro2@1.0.106/LICENSE-MIT +23 -0
- package/third-party/cargo/profiling@1.0.18/Cargo.toml +96 -0
- package/third-party/cargo/profiling@1.0.18/aclysma-profiling-8271551172eb-LICENSE-APACHE +201 -0
- package/third-party/cargo/profiling@1.0.18/aclysma-profiling-8271551172eb-LICENSE-MIT +21 -0
- package/third-party/cargo/pxfm@0.1.30/Cargo.toml +53 -0
- package/third-party/cargo/pxfm@0.1.30/LICENSE-APACHE.md +201 -0
- package/third-party/cargo/pxfm@0.1.30/LICENSE.md +26 -0
- package/third-party/cargo/quick-error@2.0.1/Cargo.toml +24 -0
- package/third-party/cargo/quick-error@2.0.1/LICENSE-APACHE +202 -0
- package/third-party/cargo/quick-error@2.0.1/LICENSE-MIT +19 -0
- package/third-party/cargo/quote@1.0.46/Cargo.toml +70 -0
- package/third-party/cargo/quote@1.0.46/LICENSE-APACHE +176 -0
- package/third-party/cargo/quote@1.0.46/LICENSE-MIT +23 -0
- package/third-party/cargo/rangemap@1.7.1/Cargo.toml +91 -0
- package/third-party/cargo/rangemap@1.7.1/LICENSE-APACHE +191 -0
- package/third-party/cargo/rangemap@1.7.1/LICENSE-MIT +7 -0
- package/third-party/cargo/raw-window-handle@0.6.2/Cargo.toml +56 -0
- package/third-party/cargo/raw-window-handle@0.6.2/LICENSE-APACHE.md +177 -0
- package/third-party/cargo/raw-window-handle@0.6.2/LICENSE-MIT.md +21 -0
- package/third-party/cargo/raw-window-handle@0.6.2/LICENSE-ZLIB.md +11 -0
- package/third-party/cargo/raw-window-metal@1.1.0/Cargo.toml +111 -0
- package/third-party/cargo/raw-window-metal@1.1.0/LICENSE-APACHE +202 -0
- package/third-party/cargo/raw-window-metal@1.1.0/LICENSE-MIT +17 -0
- package/third-party/cargo/read-fonts@0.37.0/Cargo.toml +95 -0
- package/third-party/cargo/read-fonts@0.37.0/LICENSE-APACHE +67 -0
- package/third-party/cargo/read-fonts@0.37.0/LICENSE-MIT +25 -0
- package/third-party/cargo/read-fonts@0.39.2/Cargo.toml +96 -0
- package/third-party/cargo/read-fonts@0.39.2/LICENSE-APACHE +67 -0
- package/third-party/cargo/read-fonts@0.39.2/LICENSE-MIT +25 -0
- package/third-party/cargo/renderdoc-sys@1.1.0/Cargo.toml +39 -0
- package/third-party/cargo/renderdoc-sys@1.1.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/renderdoc-sys@1.1.0/LICENSE-MIT +25 -0
- package/third-party/cargo/resvg@0.47.0/Cargo.toml +112 -0
- package/third-party/cargo/resvg@0.47.0/LICENSE-APACHE +176 -0
- package/third-party/cargo/resvg@0.47.0/LICENSE-MIT +25 -0
- package/third-party/cargo/rgb@0.8.53/Cargo.toml +110 -0
- package/third-party/cargo/rgb@0.8.53/LICENSE +21 -0
- package/third-party/cargo/roxmltree@0.21.1/Cargo.toml +75 -0
- package/third-party/cargo/roxmltree@0.21.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/roxmltree@0.21.1/LICENSE-MIT +21 -0
- package/third-party/cargo/rustc-hash@1.1.0/Cargo.toml +25 -0
- package/third-party/cargo/rustc-hash@1.1.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/rustc-hash@1.1.0/LICENSE-MIT +23 -0
- package/third-party/cargo/rustc-hash@2.1.3/Cargo.toml +50 -0
- package/third-party/cargo/rustc-hash@2.1.3/LICENSE-APACHE +176 -0
- package/third-party/cargo/rustc-hash@2.1.3/LICENSE-MIT +23 -0
- package/third-party/cargo/rustix@1.1.4/COPYRIGHT +29 -0
- package/third-party/cargo/rustix@1.1.4/Cargo.toml +292 -0
- package/third-party/cargo/rustix@1.1.4/LICENSE-APACHE +201 -0
- package/third-party/cargo/rustix@1.1.4/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- package/third-party/cargo/rustix@1.1.4/LICENSE-MIT +23 -0
- package/third-party/cargo/rustversion@1.0.23/Cargo.toml +69 -0
- package/third-party/cargo/rustversion@1.0.23/LICENSE-APACHE +176 -0
- package/third-party/cargo/rustversion@1.0.23/LICENSE-MIT +23 -0
- package/third-party/cargo/rustybuzz@0.20.1/Cargo.toml +110 -0
- package/third-party/cargo/rustybuzz@0.20.1/LICENSE +22 -0
- package/third-party/cargo/scopeguard@1.2.0/Cargo.toml +43 -0
- package/third-party/cargo/scopeguard@1.2.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/scopeguard@1.2.0/LICENSE-MIT +25 -0
- package/third-party/cargo/self_cell@1.2.2/Cargo.toml +33 -0
- package/third-party/cargo/self_cell@1.2.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/self_cell@1.2.2/LICENSE-GPLv2 +339 -0
- package/third-party/cargo/self_cell@1.3.0/Cargo.toml +33 -0
- package/third-party/cargo/self_cell@1.3.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/self_cell@1.3.0/LICENSE-GPLv2 +339 -0
- package/third-party/cargo/serde@1.0.228/Cargo.toml +84 -0
- package/third-party/cargo/serde@1.0.228/LICENSE-APACHE +176 -0
- package/third-party/cargo/serde@1.0.228/LICENSE-MIT +23 -0
- package/third-party/cargo/serde_core@1.0.228/Cargo.toml +87 -0
- package/third-party/cargo/serde_core@1.0.228/LICENSE-APACHE +176 -0
- package/third-party/cargo/serde_core@1.0.228/LICENSE-MIT +23 -0
- package/third-party/cargo/serde_derive@1.0.228/Cargo.toml +87 -0
- package/third-party/cargo/serde_derive@1.0.228/LICENSE-APACHE +176 -0
- package/third-party/cargo/serde_derive@1.0.228/LICENSE-MIT +23 -0
- package/third-party/cargo/serde_json@1.0.150/Cargo.toml +162 -0
- package/third-party/cargo/serde_json@1.0.150/LICENSE-APACHE +176 -0
- package/third-party/cargo/serde_json@1.0.150/LICENSE-MIT +23 -0
- package/third-party/cargo/simd-adler32@0.3.10/Cargo.toml +68 -0
- package/third-party/cargo/simd-adler32@0.3.10/LICENSE.md +21 -0
- package/third-party/cargo/simplecss@0.2.2/Cargo.toml +146 -0
- package/third-party/cargo/simplecss@0.2.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/simplecss@0.2.2/LICENSE-MIT +21 -0
- package/third-party/cargo/siphasher@1.0.3/COPYING +7 -0
- package/third-party/cargo/siphasher@1.0.3/Cargo.toml +64 -0
- package/third-party/cargo/skrifa@0.40.0/Cargo.toml +86 -0
- package/third-party/cargo/skrifa@0.40.0/LICENSE-APACHE +67 -0
- package/third-party/cargo/skrifa@0.40.0/LICENSE-MIT +25 -0
- package/third-party/cargo/skrifa@0.42.1/Cargo.toml +86 -0
- package/third-party/cargo/skrifa@0.42.1/LICENSE-APACHE +67 -0
- package/third-party/cargo/skrifa@0.42.1/LICENSE-MIT +25 -0
- package/third-party/cargo/slab@0.4.12/Cargo.toml +67 -0
- package/third-party/cargo/slab@0.4.12/LICENSE +25 -0
- package/third-party/cargo/slotmap@1.1.1/Cargo.toml +83 -0
- package/third-party/cargo/slotmap@1.1.1/LICENSE +19 -0
- package/third-party/cargo/smallvec@1.15.2/Cargo.toml +103 -0
- package/third-party/cargo/smallvec@1.15.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/smallvec@1.15.2/LICENSE-MIT +25 -0
- package/third-party/cargo/smol_str@0.3.6/Cargo.toml +155 -0
- package/third-party/cargo/smol_str@0.3.6/LICENSE-APACHE +201 -0
- package/third-party/cargo/smol_str@0.3.6/LICENSE-MIT +23 -0
- package/third-party/cargo/spirv@0.4.0+sdk-1.4.341.0/Cargo.toml +56 -0
- package/third-party/cargo/spirv@0.4.0+sdk-1.4.341.0/gfx-rs-rspirv-8afc3d0ac8e1-LICENSE +202 -0
- package/third-party/cargo/static_assertions@1.1.0/Cargo.toml +39 -0
- package/third-party/cargo/static_assertions@1.1.0/LICENSE-APACHE +202 -0
- package/third-party/cargo/static_assertions@1.1.0/LICENSE-MIT +21 -0
- package/third-party/cargo/strict-num@0.1.1/Cargo.toml +35 -0
- package/third-party/cargo/strict-num@0.1.1/LICENSE +19 -0
- package/third-party/cargo/svgtypes@0.16.1/Cargo.toml +57 -0
- package/third-party/cargo/svgtypes@0.16.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/svgtypes@0.16.1/LICENSE-MIT +20 -0
- package/third-party/cargo/swash@0.2.9/Cargo.toml +93 -0
- package/third-party/cargo/swash@0.2.9/LICENSE-APACHE +201 -0
- package/third-party/cargo/swash@0.2.9/LICENSE-MIT +25 -0
- package/third-party/cargo/syn@2.0.118/Cargo.toml +272 -0
- package/third-party/cargo/syn@2.0.118/LICENSE-APACHE +176 -0
- package/third-party/cargo/syn@2.0.118/LICENSE-MIT +23 -0
- package/third-party/cargo/sys-locale@0.3.2/Cargo.toml +73 -0
- package/third-party/cargo/sys-locale@0.3.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/sys-locale@0.3.2/LICENSE-MIT +21 -0
- package/third-party/cargo/taffy@0.12.1/Cargo.toml +171 -0
- package/third-party/cargo/taffy@0.12.1/DioxusLabs-taffy-1c9e37a0a1cf-LICENSE.md +25 -0
- package/third-party/cargo/tempfile@3.27.0/Cargo.toml +105 -0
- package/third-party/cargo/tempfile@3.27.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/tempfile@3.27.0/LICENSE-MIT +25 -0
- package/third-party/cargo/termcolor@1.4.1/COPYING +3 -0
- package/third-party/cargo/termcolor@1.4.1/Cargo.toml +40 -0
- package/third-party/cargo/termcolor@1.4.1/LICENSE-MIT +21 -0
- package/third-party/cargo/termcolor@1.4.1/UNLICENSE +24 -0
- package/third-party/cargo/thiserror-impl@2.0.18/Cargo.toml +52 -0
- package/third-party/cargo/thiserror-impl@2.0.18/LICENSE-APACHE +176 -0
- package/third-party/cargo/thiserror-impl@2.0.18/LICENSE-MIT +23 -0
- package/third-party/cargo/thiserror@2.0.18/Cargo.toml +119 -0
- package/third-party/cargo/thiserror@2.0.18/LICENSE-APACHE +176 -0
- package/third-party/cargo/thiserror@2.0.18/LICENSE-MIT +23 -0
- package/third-party/cargo/tiny-skia-path@0.12.0/Cargo.toml +58 -0
- package/third-party/cargo/tiny-skia-path@0.12.0/LICENSE +30 -0
- package/third-party/cargo/tiny-skia@0.12.0/Cargo.toml +116 -0
- package/third-party/cargo/tiny-skia@0.12.0/LICENSE +30 -0
- package/third-party/cargo/tiny_http@0.12.0/Cargo.toml +82 -0
- package/third-party/cargo/tiny_http@0.12.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/tiny_http@0.12.0/LICENSE-MIT +25 -0
- package/third-party/cargo/tinyvec@1.12.0/Cargo.toml +184 -0
- package/third-party/cargo/tinyvec@1.12.0/LICENSE-APACHE.md +202 -0
- package/third-party/cargo/tinyvec@1.12.0/LICENSE-MIT.md +5 -0
- package/third-party/cargo/tinyvec@1.12.0/LICENSE-ZLIB.md +11 -0
- package/third-party/cargo/tinyvec_macros@0.1.1/Cargo.toml +19 -0
- package/third-party/cargo/tinyvec_macros@0.1.1/LICENSE-APACHE.md +202 -0
- package/third-party/cargo/tinyvec_macros@0.1.1/LICENSE-MIT.md +21 -0
- package/third-party/cargo/tinyvec_macros@0.1.1/LICENSE-ZLIB.md +20 -0
- package/third-party/cargo/ttf-parser@0.25.1/Cargo.toml +101 -0
- package/third-party/cargo/ttf-parser@0.25.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/ttf-parser@0.25.1/LICENSE-MIT +20 -0
- package/third-party/cargo/unicode-bidi-mirroring@0.4.0/Cargo.toml +22 -0
- package/third-party/cargo/unicode-bidi-mirroring@0.4.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-bidi-mirroring@0.4.0/LICENSE-MIT +21 -0
- package/third-party/cargo/unicode-bidi@0.3.18/COPYRIGHT +8 -0
- package/third-party/cargo/unicode-bidi@0.3.18/Cargo.toml +90 -0
- package/third-party/cargo/unicode-bidi@0.3.18/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-bidi@0.3.18/LICENSE-MIT +25 -0
- package/third-party/cargo/unicode-ccc@0.4.0/Cargo.toml +22 -0
- package/third-party/cargo/unicode-ccc@0.4.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-ccc@0.4.0/LICENSE-MIT +21 -0
- package/third-party/cargo/unicode-ident@1.0.24/Cargo.toml +84 -0
- package/third-party/cargo/unicode-ident@1.0.24/LICENSE-APACHE +176 -0
- package/third-party/cargo/unicode-ident@1.0.24/LICENSE-MIT +23 -0
- package/third-party/cargo/unicode-ident@1.0.24/LICENSE-UNICODE +39 -0
- package/third-party/cargo/unicode-linebreak@0.1.5/Cargo.toml +32 -0
- package/third-party/cargo/unicode-linebreak@0.1.5/LICENSE +201 -0
- package/third-party/cargo/unicode-properties@0.1.4/COPYRIGHT +7 -0
- package/third-party/cargo/unicode-properties@0.1.4/Cargo.toml +65 -0
- package/third-party/cargo/unicode-properties@0.1.4/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-properties@0.1.4/LICENSE-MIT +25 -0
- package/third-party/cargo/unicode-script@0.5.8/Cargo.toml +63 -0
- package/third-party/cargo/unicode-script@0.5.8/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-script@0.5.8/LICENSE-MIT +27 -0
- package/third-party/cargo/unicode-segmentation@1.13.3/COPYRIGHT +7 -0
- package/third-party/cargo/unicode-segmentation@1.13.3/Cargo.toml +91 -0
- package/third-party/cargo/unicode-segmentation@1.13.3/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-segmentation@1.13.3/LICENSE-MIT +25 -0
- package/third-party/cargo/unicode-vo@0.1.0/Cargo.toml +22 -0
- package/third-party/cargo/unicode-vo@0.1.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-vo@0.1.0/LICENSE-MIT +21 -0
- package/third-party/cargo/unicode-width@0.2.2/COPYRIGHT +7 -0
- package/third-party/cargo/unicode-width@0.2.2/Cargo.toml +77 -0
- package/third-party/cargo/unicode-width@0.2.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-width@0.2.2/LICENSE-MIT +25 -0
- package/third-party/cargo/unicode-xid@0.2.6/COPYRIGHT +7 -0
- package/third-party/cargo/unicode-xid@0.2.6/Cargo.toml +65 -0
- package/third-party/cargo/unicode-xid@0.2.6/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-xid@0.2.6/LICENSE-MIT +25 -0
- package/third-party/cargo/urlencoding@2.1.3/Cargo.toml +41 -0
- package/third-party/cargo/urlencoding@2.1.3/LICENSE +20 -0
- package/third-party/cargo/usvg@0.47.0/Cargo.toml +138 -0
- package/third-party/cargo/usvg@0.47.0/LICENSE-APACHE +176 -0
- package/third-party/cargo/usvg@0.47.0/LICENSE-MIT +25 -0
- package/third-party/cargo/version_check@0.9.5/Cargo.toml +38 -0
- package/third-party/cargo/version_check@0.9.5/LICENSE-APACHE +201 -0
- package/third-party/cargo/version_check@0.9.5/LICENSE-MIT +19 -0
- package/third-party/cargo/wasm-bindgen-futures@0.4.76/Cargo.toml +88 -0
- package/third-party/cargo/wasm-bindgen-futures@0.4.76/LICENSE-APACHE +201 -0
- package/third-party/cargo/wasm-bindgen-futures@0.4.76/LICENSE-MIT +25 -0
- package/third-party/cargo/wasm-bindgen-macro-support@0.2.126/Cargo.toml +83 -0
- package/third-party/cargo/wasm-bindgen-macro-support@0.2.126/LICENSE-APACHE +201 -0
- package/third-party/cargo/wasm-bindgen-macro-support@0.2.126/LICENSE-MIT +25 -0
- package/third-party/cargo/wasm-bindgen-macro@0.2.126/Cargo.toml +73 -0
- package/third-party/cargo/wasm-bindgen-macro@0.2.126/LICENSE-APACHE +201 -0
- package/third-party/cargo/wasm-bindgen-macro@0.2.126/LICENSE-MIT +25 -0
- package/third-party/cargo/wasm-bindgen-shared@0.2.126/Cargo.toml +66 -0
- package/third-party/cargo/wasm-bindgen-shared@0.2.126/LICENSE-APACHE +201 -0
- package/third-party/cargo/wasm-bindgen-shared@0.2.126/LICENSE-MIT +25 -0
- package/third-party/cargo/wasm-bindgen@0.2.126/Cargo.toml +122 -0
- package/third-party/cargo/wasm-bindgen@0.2.126/LICENSE-APACHE +201 -0
- package/third-party/cargo/wasm-bindgen@0.2.126/LICENSE-MIT +25 -0
- package/third-party/cargo/wayland-sys@0.31.11/Cargo.toml +81 -0
- package/third-party/cargo/wayland-sys@0.31.11/LICENSE.txt +19 -0
- package/third-party/cargo/web-sys@0.3.103/Cargo.toml +2823 -0
- package/third-party/cargo/web-sys@0.3.103/LICENSE-APACHE +201 -0
- package/third-party/cargo/web-sys@0.3.103/LICENSE-MIT +25 -0
- package/third-party/cargo/weezl@0.1.12/Cargo.toml +120 -0
- package/third-party/cargo/weezl@0.1.12/LICENSE-APACHE +201 -0
- package/third-party/cargo/weezl@0.1.12/LICENSE-MIT +22 -0
- package/third-party/cargo/wgpu-core-deps-apple@30.0.0/Cargo.toml +53 -0
- package/third-party/cargo/wgpu-core-deps-apple@30.0.0/LICENSE.APACHE +176 -0
- package/third-party/cargo/wgpu-core-deps-apple@30.0.0/LICENSE.MIT +21 -0
- package/third-party/cargo/wgpu-core@30.0.0/Cargo.toml +237 -0
- package/third-party/cargo/wgpu-core@30.0.0/LICENSE.APACHE +176 -0
- package/third-party/cargo/wgpu-core@30.0.0/LICENSE.MIT +21 -0
- package/third-party/cargo/wgpu-hal@30.0.0/Cargo.toml +541 -0
- package/third-party/cargo/wgpu-hal@30.0.0/LICENSE.APACHE +176 -0
- package/third-party/cargo/wgpu-hal@30.0.0/LICENSE.MIT +21 -0
- package/third-party/cargo/wgpu-naga-bridge@30.0.0/Cargo.toml +46 -0
- package/third-party/cargo/wgpu-naga-bridge@30.0.0/LICENSE.APACHE +176 -0
- package/third-party/cargo/wgpu-naga-bridge@30.0.0/LICENSE.MIT +21 -0
- package/third-party/cargo/wgpu-types@30.0.0/Cargo.toml +161 -0
- package/third-party/cargo/wgpu-types@30.0.0/LICENSE.APACHE +176 -0
- package/third-party/cargo/wgpu-types@30.0.0/LICENSE.MIT +21 -0
- package/third-party/cargo/wgpu@30.0.0/Cargo.toml +278 -0
- package/third-party/cargo/wgpu@30.0.0/LICENSE.APACHE +176 -0
- package/third-party/cargo/wgpu@30.0.0/LICENSE.MIT +21 -0
- package/third-party/cargo/xmlwriter@0.1.0/Cargo.toml +23 -0
- package/third-party/cargo/xmlwriter@0.1.0/LICENSE +21 -0
- package/third-party/cargo/yazi@0.2.1/Cargo.toml +45 -0
- package/third-party/cargo/yazi@0.2.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/yazi@0.2.1/LICENSE-MIT +19 -0
- package/third-party/cargo/zeno@0.3.3/Cargo.toml +65 -0
- package/third-party/cargo/zeno@0.3.3/LICENSE-APACHE +201 -0
- package/third-party/cargo/zeno@0.3.3/LICENSE-MIT +25 -0
- package/third-party/cargo/zerocopy-derive@0.8.54/Cargo.toml +209 -0
- package/third-party/cargo/zerocopy-derive@0.8.54/LICENSE-APACHE +202 -0
- package/third-party/cargo/zerocopy-derive@0.8.54/LICENSE-BSD +24 -0
- package/third-party/cargo/zerocopy-derive@0.8.54/LICENSE-MIT +26 -0
- package/third-party/cargo/zerocopy@0.8.54/Cargo.toml +419 -0
- package/third-party/cargo/zerocopy@0.8.54/LICENSE-APACHE +202 -0
- package/third-party/cargo/zerocopy@0.8.54/LICENSE-BSD +24 -0
- package/third-party/cargo/zerocopy@0.8.54/LICENSE-MIT +26 -0
- package/third-party/cargo/zmij@1.0.23/Cargo.toml +90 -0
- package/third-party/cargo/zmij@1.0.23/LICENSE-MIT +23 -0
- package/third-party/cargo/zune-core@0.5.1/Cargo.toml +47 -0
- package/third-party/cargo/zune-core@0.5.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/zune-core@0.5.1/LICENSE-MIT +21 -0
- package/third-party/cargo/zune-core@0.5.1/LICENSE-ZLIB +19 -0
- package/third-party/cargo/zune-jpeg@0.5.15/Cargo.toml +67 -0
- package/third-party/cargo/zune-jpeg@0.5.15/LICENSE-APACHE +201 -0
- package/third-party/cargo/zune-jpeg@0.5.15/LICENSE-MIT +21 -0
- package/third-party/cargo/zune-jpeg@0.5.15/LICENSE-ZLIB +19 -0
- package/third-party/inventory.json +3614 -0
- package/third-party/npm/@esbuild__darwin-arm64@0.27.4/esbuild-0.27.4-LICENSE.md +21 -0
- package/third-party/npm/@esbuild__darwin-arm64@0.27.4/go-LICENSE +27 -0
- package/third-party/npm/@esbuild__darwin-arm64@0.27.4/golang-x-sys-c0bba94af5f8-LICENSE +27 -0
- package/third-party/npm/@esbuild__darwin-arm64@0.27.4/package.json +20 -0
- package/third-party/npm/@floating-ui__core@1.7.5/LICENSE +20 -0
- package/third-party/npm/@floating-ui__core@1.7.5/package.json +63 -0
- package/third-party/npm/@floating-ui__dom@1.7.6/LICENSE +20 -0
- package/third-party/npm/@floating-ui__dom@1.7.6/package.json +71 -0
- package/third-party/npm/@floating-ui__react-dom@2.1.8/LICENSE +20 -0
- package/third-party/npm/@floating-ui__react-dom@2.1.8/package.json +76 -0
- package/third-party/npm/@floating-ui__utils@0.2.11/LICENSE +20 -0
- package/third-party/npm/@floating-ui__utils@0.2.11/package.json +70 -0
- package/third-party/npm/@radix-ui__primitive@1.1.7/LICENSE +21 -0
- package/third-party/npm/@radix-ui__primitive@1.1.7/package.json +79 -0
- package/third-party/npm/@radix-ui__react-arrow@1.1.15/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-arrow@1.1.15/package.json +68 -0
- package/third-party/npm/@radix-ui__react-collection@1.1.15/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-collection@1.1.15/package.json +71 -0
- package/third-party/npm/@radix-ui__react-compose-refs@1.1.5/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-compose-refs@1.1.5/package.json +60 -0
- package/third-party/npm/@radix-ui__react-context-menu@2.3.7/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-context-menu@2.3.7/package.json +73 -0
- package/third-party/npm/@radix-ui__react-context@1.2.2/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-context@1.2.2/package.json +60 -0
- package/third-party/npm/@radix-ui__react-direction@1.1.4/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-direction@1.1.4/package.json +60 -0
- package/third-party/npm/@radix-ui__react-dismissable-layer@1.1.19/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-dismissable-layer@1.1.19/package.json +74 -0
- package/third-party/npm/@radix-ui__react-focus-guards@1.1.6/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-focus-guards@1.1.6/package.json +60 -0
- package/third-party/npm/@radix-ui__react-focus-scope@1.1.16/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-focus-scope@1.1.16/package.json +71 -0
- package/third-party/npm/@radix-ui__react-id@1.1.4/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-id@1.1.4/package.json +63 -0
- package/third-party/npm/@radix-ui__react-menu@2.1.24/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-menu@2.1.24/package.json +86 -0
- package/third-party/npm/@radix-ui__react-popper@1.3.7/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-popper@1.3.7/package.json +78 -0
- package/third-party/npm/@radix-ui__react-portal@1.1.17/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-portal@1.1.17/package.json +69 -0
- package/third-party/npm/@radix-ui__react-presence@1.1.10/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-presence@1.1.10/package.json +68 -0
- package/third-party/npm/@radix-ui__react-primitive@2.1.10/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-primitive@2.1.10/package.json +68 -0
- package/third-party/npm/@radix-ui__react-roving-focus@1.1.19/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-roving-focus@1.1.19/package.json +78 -0
- package/third-party/npm/@radix-ui__react-slot@1.3.3/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-slot@1.3.3/package.json +63 -0
- package/third-party/npm/@radix-ui__react-use-callback-ref@1.1.4/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-use-callback-ref@1.1.4/package.json +60 -0
- package/third-party/npm/@radix-ui__react-use-controllable-state@1.2.6/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-use-controllable-state@1.2.6/package.json +65 -0
- package/third-party/npm/@radix-ui__react-use-effect-event@0.0.5/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-use-effect-event@0.0.5/package.json +65 -0
- package/third-party/npm/@radix-ui__react-use-is-hydrated@0.1.3/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-use-is-hydrated@0.1.3/package.json +61 -0
- package/third-party/npm/@radix-ui__react-use-layout-effect@1.1.4/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-use-layout-effect@1.1.4/package.json +60 -0
- package/third-party/npm/@radix-ui__react-use-size@1.1.4/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-use-size@1.1.4/package.json +63 -0
- package/third-party/npm/aria-hidden@1.2.6/LICENSE +21 -0
- package/third-party/npm/aria-hidden@1.2.6/package.json +71 -0
- package/third-party/npm/detect-node-es@1.1.0/LICENSE +21 -0
- package/third-party/npm/detect-node-es@1.1.0/package.json +29 -0
- package/third-party/npm/esbuild@0.27.4/LICENSE.md +21 -0
- package/third-party/npm/esbuild@0.27.4/package.json +49 -0
- package/third-party/npm/fflate@0.8.3/LICENSE +21 -0
- package/third-party/npm/fflate@0.8.3/package.json +128 -0
- package/third-party/npm/get-nonce@1.0.1/LICENSE +21 -0
- package/third-party/npm/get-nonce@1.0.1/package.json +68 -0
- package/third-party/npm/mediabunny@1.52.2/LICENSE +373 -0
- package/third-party/npm/mediabunny@1.52.2/package.json +136 -0
- package/third-party/npm/mediabunny@1.52.2/source/LICENSE +373 -0
- package/third-party/npm/mediabunny@1.52.2/source/package.json +136 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/adts/adts-demuxer.ts +400 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/adts/adts-muxer.ts +124 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/adts/adts-reader.ts +85 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/aes.ts +307 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/codec-data.ts +3178 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/codec.ts +1154 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/conversion.ts +2042 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/custom-coder.ts +212 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/decode.ts +263 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/demuxer.ts +43 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/encode.ts +1412 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/flac/flac-demuxer.ts +813 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/flac/flac-misc.ts +165 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/flac/flac-muxer.ts +350 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/hls/hls-demuxer.ts +995 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/hls/hls-misc.ts +81 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/hls/hls-muxer.ts +1529 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/hls/hls-segmented-input.ts +772 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/id3.ts +972 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/index.ts +319 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/input-format.ts +819 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/input-track.ts +1141 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/input.ts +571 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/isobmff/isobmff-boxes.ts +1911 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/isobmff/isobmff-demuxer.ts +3953 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/isobmff/isobmff-misc.ts +90 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/isobmff/isobmff-muxer.ts +1595 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/isobmff/isobmff-reader.ts +91 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/logging.ts +120 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/matroska/ebml.ts +770 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/matroska/matroska-demuxer.ts +2598 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/matroska/matroska-misc.ts +29 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/matroska/matroska-muxer.ts +1360 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/media-sink.ts +2589 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/media-source.ts +3041 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/metadata.ts +335 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/misc.ts +1336 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/mp3/mp3-demuxer.ts +469 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/mp3/mp3-muxer.ts +169 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/mp3/mp3-reader.ts +61 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/mp3/mp3-writer.ts +121 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/mpeg-ts/mpeg-ts-demuxer.ts +2519 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/mpeg-ts/mpeg-ts-misc.ts +32 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/mpeg-ts/mpeg-ts-muxer.ts +842 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/muxer.ts +80 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/node.ts +11 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/ogg/ogg-demuxer.ts +1087 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/ogg/ogg-misc.ts +116 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/ogg/ogg-muxer.ts +527 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/ogg/ogg-reader.ts +93 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/output-format.ts +1425 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/output.ts +940 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/packet.ts +287 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/pcm.ts +112 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/reader.ts +391 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/resample.ts +287 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/sample.ts +3231 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/segmented-input.ts +575 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/source.ts +2588 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/subtitles.ts +131 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/target.ts +871 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/tsconfig.json +16 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/wave/riff-writer.ts +36 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/wave/wave-demuxer.ts +583 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/wave/wave-muxer.ts +375 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/writer.ts +128 -0
- package/third-party/npm/react-dom@19.3.0/LICENSE +21 -0
- package/third-party/npm/react-dom@19.3.0/package.json +117 -0
- package/third-party/npm/react-remove-scroll-bar@2.3.8/package.json +85 -0
- package/third-party/npm/react-remove-scroll-bar@2.3.8/react-remove-scroll-bar-LICENSE +21 -0
- package/third-party/npm/react-remove-scroll@2.7.2/LICENSE +21 -0
- package/third-party/npm/react-remove-scroll@2.7.2/package.json +98 -0
- package/third-party/npm/react-style-singleton@2.2.3/LICENSE +21 -0
- package/third-party/npm/react-style-singleton@2.2.3/package.json +90 -0
- package/third-party/npm/react@19.3.0/LICENSE +21 -0
- package/third-party/npm/react@19.3.0/package.json +51 -0
- package/third-party/npm/scheduler@0.28.0/LICENSE +21 -0
- package/third-party/npm/scheduler@0.28.0/package.json +27 -0
- package/third-party/npm/tslib@2.8.1/LICENSE.txt +12 -0
- package/third-party/npm/tslib@2.8.1/package.json +47 -0
- package/third-party/npm/typescript@5.9.3/LICENSE.txt +55 -0
- package/third-party/npm/typescript@5.9.3/ThirdPartyNoticeText.txt +193 -0
- package/third-party/npm/typescript@5.9.3/package.json +120 -0
- package/third-party/npm/use-callback-ref@1.3.3/LICENSE +21 -0
- package/third-party/npm/use-callback-ref@1.3.3/package.json +85 -0
- package/third-party/npm/use-sidecar@1.1.3/LICENSE +21 -0
- package/third-party/npm/use-sidecar@1.1.3/package.json +93 -0
- package/third-party/packages/render-engine/assets/OFL.txt +93 -0
- package/third-party/packages/studio/public/fonts/OFL.txt +93 -0
- package/third-party/packages/studio/vendor/osmo-icons/LICENSE +21 -0
- package/third-party/packages/studio/vendor/shadcn/LICENSE +21 -0
- package/third-party/repository-notices.md +41 -0
- package/third-party/rust-standard-library/COPYRIGHT-library.html +5556 -0
- package/third-party/rust-standard-library/licenses/Apache-2.0.txt +73 -0
- package/third-party/rust-standard-library/licenses/BSD-2-Clause.txt +9 -0
- package/third-party/rust-standard-library/licenses/CC-BY-SA-4.0.txt +427 -0
- package/third-party/rust-standard-library/licenses/GCC-exception-3.1.txt +30 -0
- package/third-party/rust-standard-library/licenses/GPL-2.0-only.txt +133 -0
- package/third-party/rust-standard-library/licenses/GPL-3.0-or-later.txt +202 -0
- package/third-party/rust-standard-library/licenses/ISC.txt +7 -0
- package/third-party/rust-standard-library/licenses/LLVM-exception.txt +15 -0
- package/third-party/rust-standard-library/licenses/MIT.txt +9 -0
- package/third-party/rust-standard-library/licenses/NCSA.txt +29 -0
- package/third-party/rust-standard-library/licenses/OFL-1.1.txt +43 -0
- package/third-party/rust-standard-library/licenses/Unicode-3.0.txt +39 -0
- package/third-party/rust-standard-library/version.txt +1 -0
- package/vendor/osmo-lite +0 -0
- package/vendor/osmo-scene-0.1.0.tgz +0 -0
- package/vendor/platform.json +1 -0
|
@@ -0,0 +1,1412 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026-present, Vanilagy and contributors
|
|
3
|
+
*
|
|
4
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
5
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
AUDIO_CODECS,
|
|
11
|
+
AudioCodec,
|
|
12
|
+
buildAudioCodecString,
|
|
13
|
+
buildVideoCodecString,
|
|
14
|
+
getAudioEncoderConfigExtension,
|
|
15
|
+
getVideoEncoderConfigExtension,
|
|
16
|
+
inferCodecFromCodecString,
|
|
17
|
+
MediaCodec,
|
|
18
|
+
PCM_AUDIO_CODECS,
|
|
19
|
+
SUBTITLE_CODECS,
|
|
20
|
+
SubtitleCodec,
|
|
21
|
+
VIDEO_CODECS,
|
|
22
|
+
VideoCodec,
|
|
23
|
+
} from './codec';
|
|
24
|
+
import { customAudioEncoders, customVideoEncoders } from './custom-coder';
|
|
25
|
+
import { assert, clamp, isFirefox, lerp, MaybePromise, Rotation } from './misc';
|
|
26
|
+
import { EncodedPacket } from './packet';
|
|
27
|
+
import { AudioSample, CropRectangle, validateCropRectangle, VideoSample, VideoSampleResource } from './sample';
|
|
28
|
+
|
|
29
|
+
export const canEncodeVideoMemo = new Map<string, Promise<boolean>>();
|
|
30
|
+
export const canEncodeAudioMemo = new Map<string, Promise<boolean>>();
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Configuration object that controls video encoding. Can be used to set codec, quality, and more.
|
|
34
|
+
* @group Encoding
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
export type VideoEncodingConfig = {
|
|
38
|
+
/** The video codec that should be used for encoding the video samples (frames). */
|
|
39
|
+
codec: VideoCodec;
|
|
40
|
+
/** The desired quality of the encoded video. */
|
|
41
|
+
quality?: Quality;
|
|
42
|
+
/**
|
|
43
|
+
* The target bitrate for the encoded video, in bits per second. Alternatively, a {@link Quality} can be provided.
|
|
44
|
+
* @deprecated Use `quality` instead.
|
|
45
|
+
*/
|
|
46
|
+
bitrate?: number | Quality;
|
|
47
|
+
/**
|
|
48
|
+
* The interval, in seconds, of how often frames are encoded as a key frame. The default is 2 seconds. Frequent key
|
|
49
|
+
* frames improve seeking behavior but increase file size. When using multiple video tracks, you should give them
|
|
50
|
+
* all the same key frame interval.
|
|
51
|
+
*/
|
|
52
|
+
keyFrameInterval?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Video frames may change size over time. This field controls the behavior in case this happens.
|
|
55
|
+
*
|
|
56
|
+
* - `'deny'` (default) will throw an error, requiring all frames to have the exact same dimensions.
|
|
57
|
+
* - `'passThrough'` will allow the change and directly pass the frame to the encoder.
|
|
58
|
+
* - `'fill'` will stretch the image to fill the entire original box, potentially altering aspect ratio.
|
|
59
|
+
* - `'contain'` will contain the entire image within the original box while preserving aspect ratio. This may lead
|
|
60
|
+
* to letterboxing.
|
|
61
|
+
* - `'cover'` will scale the image until the entire original box is filled, while preserving aspect ratio.
|
|
62
|
+
*
|
|
63
|
+
* The "original box" refers to the dimensions of the first encoded frame.
|
|
64
|
+
*/
|
|
65
|
+
sizeChangeBehavior?: 'deny' | 'passThrough' | 'fill' | 'contain' | 'cover';
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Optional transformations to apply to the video frames before they are passed to the encoder.
|
|
69
|
+
*/
|
|
70
|
+
transform?: VideoTransformOptions;
|
|
71
|
+
|
|
72
|
+
/** Called for each successfully encoded packet. Both the packet and the encoding metadata are passed. */
|
|
73
|
+
onEncodedPacket?: (packet: EncodedPacket, meta: EncodedVideoChunkMetadata | undefined) => unknown;
|
|
74
|
+
/**
|
|
75
|
+
* Called when the internal [encoder config](https://www.w3.org/TR/webcodecs/#video-encoder-config), as used by the
|
|
76
|
+
* WebCodecs API, is created.
|
|
77
|
+
*/
|
|
78
|
+
onEncoderConfig?: (config: VideoEncoderConfig) => unknown;
|
|
79
|
+
/** Called right before a sample is passed to the encoder. */
|
|
80
|
+
onEncodedSample?: (sample: VideoSample) => unknown;
|
|
81
|
+
} & VideoEncodingAdditionalOptions;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Options for transforming video frames before encoding.
|
|
85
|
+
* @group Encoding
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
export type VideoTransformOptions = {
|
|
89
|
+
/**
|
|
90
|
+
* The width in pixels to resize the frames to. If height is not set, it will be deduced
|
|
91
|
+
* automatically based on aspect ratio.
|
|
92
|
+
*/
|
|
93
|
+
width?: number;
|
|
94
|
+
/**
|
|
95
|
+
* The height in pixels to resize the frames to. If width is not set, it will be deduced
|
|
96
|
+
* automatically based on aspect ratio.
|
|
97
|
+
*/
|
|
98
|
+
height?: number;
|
|
99
|
+
/**
|
|
100
|
+
* The fitting algorithm in case both width and height are set.
|
|
101
|
+
*
|
|
102
|
+
* - `'fill'` will stretch the image to fill the entire box, potentially altering aspect ratio.
|
|
103
|
+
* - `'contain'` will contain the entire image within the box while preserving aspect ratio. This may lead to
|
|
104
|
+
* letterboxing.
|
|
105
|
+
* - `'cover'` will scale the image until the entire box is filled, while preserving aspect ratio.
|
|
106
|
+
*
|
|
107
|
+
* To avoid ambiguity, this field must not be set when `sizeChangeBehavior` is `'fill'`, `'contain'` or
|
|
108
|
+
* `'deny'`, since `sizeChangeBehavior` already determines the fitting algorithm.
|
|
109
|
+
*/
|
|
110
|
+
fit?: 'fill' | 'contain' | 'cover';
|
|
111
|
+
/**
|
|
112
|
+
* The clockwise rotation by which to rotate the frames. Rotation is applied before resizing.
|
|
113
|
+
*/
|
|
114
|
+
rotate?: Rotation;
|
|
115
|
+
/**
|
|
116
|
+
* Specifies the rectangular region of the frames to crop to. The crop region will automatically be
|
|
117
|
+
* clamped to the dimensions of the frame. Cropping is performed after rotation but before resizing.
|
|
118
|
+
*/
|
|
119
|
+
crop?: CropRectangle;
|
|
120
|
+
/**
|
|
121
|
+
* Whether to discard or keep the transparency information of the video samples. The default is `'keep'`.
|
|
122
|
+
*/
|
|
123
|
+
alpha?: 'keep' | 'discard';
|
|
124
|
+
/**
|
|
125
|
+
* The frame rate in hertz to normalize the video frame stream to.
|
|
126
|
+
*/
|
|
127
|
+
frameRate?: number;
|
|
128
|
+
/**
|
|
129
|
+
* Allows for custom user-defined processing of video frames, e.g. for applying overlays, color transformations,
|
|
130
|
+
* or timestamp modifications. Will be called for each video frame after transformations and frame rate
|
|
131
|
+
* corrections.
|
|
132
|
+
*
|
|
133
|
+
* Must return a {@link VideoSample}, a {@link VideoSampleResource} or a `CanvasImageSource`, an array of them, or
|
|
134
|
+
* `null` for dropping the frame. When non-timestamped data is returned, the timestamp and duration from the input
|
|
135
|
+
* sample will be used.
|
|
136
|
+
*/
|
|
137
|
+
process?: (sample: VideoSample) => MaybePromise<
|
|
138
|
+
CanvasImageSource | VideoSample | VideoSampleResource
|
|
139
|
+
| (CanvasImageSource | VideoSample | VideoSampleResource)[] | null
|
|
140
|
+
>;
|
|
141
|
+
/**
|
|
142
|
+
* Forces every video frame through the transformation step even if no transformation properties are defined.
|
|
143
|
+
* This can be used, for example, to bake rotation into the encoded video frames.
|
|
144
|
+
*/
|
|
145
|
+
force?: boolean;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export const validateVideoEncodingConfig = (config: VideoEncodingConfig) => {
|
|
149
|
+
if (!config || typeof config !== 'object') {
|
|
150
|
+
throw new TypeError('Encoding config must be an object.');
|
|
151
|
+
}
|
|
152
|
+
if (!VIDEO_CODECS.includes(config.codec)) {
|
|
153
|
+
throw new TypeError(`Invalid video codec '${config.codec}'. Must be one of: ${VIDEO_CODECS.join(', ')}.`);
|
|
154
|
+
}
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
156
|
+
const bitrate = config.bitrate;
|
|
157
|
+
if (config.quality === undefined && bitrate === undefined) {
|
|
158
|
+
throw new TypeError('config.quality must be provided.');
|
|
159
|
+
}
|
|
160
|
+
if (config.quality !== undefined && bitrate !== undefined) {
|
|
161
|
+
throw new TypeError('config.quality and config.bitrate cannot both be provided.');
|
|
162
|
+
}
|
|
163
|
+
if (config.quality !== undefined && !(config.quality instanceof Quality)) {
|
|
164
|
+
throw new TypeError('config.quality, when provided, must be a Quality.');
|
|
165
|
+
}
|
|
166
|
+
if (bitrate !== undefined && !(bitrate instanceof Quality) && (!Number.isInteger(bitrate) || bitrate <= 0)) {
|
|
167
|
+
throw new TypeError('config.bitrate, when provided, must be a positive integer or a quality.');
|
|
168
|
+
}
|
|
169
|
+
if (
|
|
170
|
+
config.keyFrameInterval !== undefined
|
|
171
|
+
&& (!Number.isFinite(config.keyFrameInterval) || config.keyFrameInterval < 0)
|
|
172
|
+
) {
|
|
173
|
+
throw new TypeError('config.keyFrameInterval, when provided, must be a non-negative number.');
|
|
174
|
+
}
|
|
175
|
+
if (
|
|
176
|
+
config.sizeChangeBehavior !== undefined
|
|
177
|
+
&& !['deny', 'passThrough', 'fill', 'contain', 'cover'].includes(config.sizeChangeBehavior)
|
|
178
|
+
) {
|
|
179
|
+
throw new TypeError(
|
|
180
|
+
'config.sizeChangeBehavior, when provided, must be \'deny\', \'passThrough\', \'fill\', \'contain\''
|
|
181
|
+
+ ' or \'cover\'.',
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
if (config.transform !== undefined) {
|
|
185
|
+
if (typeof config.transform !== 'object' || !config.transform) {
|
|
186
|
+
throw new TypeError('config.transform, when provided, must be an object.');
|
|
187
|
+
}
|
|
188
|
+
if (
|
|
189
|
+
config.transform.width !== undefined
|
|
190
|
+
&& (!Number.isInteger(config.transform.width) || config.transform.width <= 0)
|
|
191
|
+
) {
|
|
192
|
+
throw new TypeError('config.transform.width, when provided, must be a positive integer.');
|
|
193
|
+
}
|
|
194
|
+
if (
|
|
195
|
+
config.transform.height !== undefined
|
|
196
|
+
&& (!Number.isInteger(config.transform.height) || config.transform.height <= 0)
|
|
197
|
+
) {
|
|
198
|
+
throw new TypeError('config.transform.height, when provided, must be a positive integer.');
|
|
199
|
+
}
|
|
200
|
+
if (config.transform.fit !== undefined && !['fill', 'contain', 'cover'].includes(config.transform.fit)) {
|
|
201
|
+
throw new TypeError('config.transform.fit, when provided, must be one of "fill", "contain", or "cover".');
|
|
202
|
+
}
|
|
203
|
+
if (
|
|
204
|
+
config.transform.width !== undefined
|
|
205
|
+
&& config.transform.height !== undefined
|
|
206
|
+
&& config.transform.fit === undefined
|
|
207
|
+
&& !['fill', 'contain', 'cover'].includes(config.sizeChangeBehavior!)
|
|
208
|
+
) {
|
|
209
|
+
throw new TypeError(
|
|
210
|
+
'When both config.transform.width and config.transform.height are provided, config.transform.fit'
|
|
211
|
+
+ ' must also be provided.',
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
if (
|
|
215
|
+
config.transform.fit !== undefined
|
|
216
|
+
&& ['fill', 'contain', 'cover'].includes(config.sizeChangeBehavior!)
|
|
217
|
+
&& config.transform.fit !== config.sizeChangeBehavior
|
|
218
|
+
) {
|
|
219
|
+
throw new TypeError(
|
|
220
|
+
'config.transform.fit, when provided, cannot differ from config.sizeChangeBehavior when'
|
|
221
|
+
+ ' config.sizeChangeBehavior is \'fill\', \'contain\' or \'cover\', as sizeChangeBehavior already'
|
|
222
|
+
+ ' determines the fitting algorithm.',
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
if (config.transform.rotate !== undefined && ![0, 90, 180, 270].includes(config.transform.rotate)) {
|
|
226
|
+
throw new TypeError('config.transform.rotate, when provided, must be 0, 90, 180 or 270.');
|
|
227
|
+
}
|
|
228
|
+
if (config.transform.crop !== undefined) {
|
|
229
|
+
validateCropRectangle(config.transform.crop, 'config.transform.');
|
|
230
|
+
}
|
|
231
|
+
if (config.transform.process !== undefined && typeof config.transform.process !== 'function') {
|
|
232
|
+
throw new TypeError('config.transform.process, when provided, must be a function.');
|
|
233
|
+
}
|
|
234
|
+
if (
|
|
235
|
+
config.transform.frameRate !== undefined
|
|
236
|
+
&& (!Number.isFinite(config.transform.frameRate) || config.transform.frameRate <= 0)
|
|
237
|
+
) {
|
|
238
|
+
throw new TypeError('config.transform.frameRate, when provided, must be a finite positive number.');
|
|
239
|
+
}
|
|
240
|
+
if (config.transform.force !== undefined && typeof config.transform.force !== 'boolean') {
|
|
241
|
+
throw new TypeError('config.transform.force, when provided, must be a boolean.');
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (config.onEncodedPacket !== undefined && typeof config.onEncodedPacket !== 'function') {
|
|
245
|
+
throw new TypeError('config.onEncodedPacket, when provided, must be a function.');
|
|
246
|
+
}
|
|
247
|
+
if (config.onEncoderConfig !== undefined && typeof config.onEncoderConfig !== 'function') {
|
|
248
|
+
throw new TypeError('config.onEncoderConfig, when provided, must be a function.');
|
|
249
|
+
}
|
|
250
|
+
if (config.onEncodedSample !== undefined && typeof config.onEncodedSample !== 'function') {
|
|
251
|
+
throw new TypeError('config.onEncodedSample, when provided, must be a function.');
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
validateVideoEncodingAdditionalOptions(config.codec, config);
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Additional options that control video encoding.
|
|
259
|
+
* @group Encoding
|
|
260
|
+
* @public
|
|
261
|
+
*/
|
|
262
|
+
export type VideoEncodingAdditionalOptions = {
|
|
263
|
+
/**
|
|
264
|
+
* What to do with alpha data contained in the video samples.
|
|
265
|
+
*
|
|
266
|
+
* - `'discard'` (default): Only the samples' color data is kept; the video is opaque.
|
|
267
|
+
* - `'keep'`: The samples' alpha data is also encoded. Depending on the codec, the alpha may be emitted as packet
|
|
268
|
+
* side data or in-band alongside the main packet. For codecs that emit alpha side data, such as VP9, make sure to
|
|
269
|
+
* pair this mode with a container format that supports transparency (such as WebM or Matroska).
|
|
270
|
+
*/
|
|
271
|
+
alpha?: 'discard' | 'keep';
|
|
272
|
+
/**
|
|
273
|
+
* Configures the bitrate mode used for bitrate-based encoding; defaults to `'variable'`. A bitrate mode set
|
|
274
|
+
* directly on a {@link Quality} takes precedence over this field.
|
|
275
|
+
* @deprecated Specify the bitrate mode in the {@link Quality} instead.
|
|
276
|
+
*/
|
|
277
|
+
bitrateMode?: 'constant' | 'variable';
|
|
278
|
+
/**
|
|
279
|
+
* The latency mode used by the encoder; controls the performance-quality tradeoff.
|
|
280
|
+
*
|
|
281
|
+
* - `'quality'` (default): The encoder prioritizes quality over latency, and no frames can be dropped.
|
|
282
|
+
* - `'realtime'`: The encoder prioritizes low latency over quality, and may drop frames if the encoder becomes
|
|
283
|
+
* overloaded to keep up with real-time requirements.
|
|
284
|
+
*/
|
|
285
|
+
latencyMode?: 'quality' | 'realtime';
|
|
286
|
+
/**
|
|
287
|
+
* The full codec string as specified in the Mediabunny Codec Registry. This string must match the codec
|
|
288
|
+
* specified in `codec`. When not set, a fitting codec string will be constructed automatically by the library.
|
|
289
|
+
*/
|
|
290
|
+
fullCodecString?: string;
|
|
291
|
+
/**
|
|
292
|
+
* A hint that configures the hardware acceleration method of this codec. This is best left on `'no-preference'`,
|
|
293
|
+
* the default.
|
|
294
|
+
*/
|
|
295
|
+
hardwareAcceleration?: 'no-preference' | 'prefer-hardware' | 'prefer-software';
|
|
296
|
+
/**
|
|
297
|
+
* An encoding scalability mode identifier as defined by
|
|
298
|
+
* [WebRTC-SVC](https://w3c.github.io/webrtc-svc/#scalabilitymodes*).
|
|
299
|
+
*/
|
|
300
|
+
scalabilityMode?: string;
|
|
301
|
+
/**
|
|
302
|
+
* An encoding video content hint as defined by
|
|
303
|
+
* [mst-content-hint](https://w3c.github.io/mst-content-hint/#video-content-hints).
|
|
304
|
+
*/
|
|
305
|
+
contentHint?: string;
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
export const validateVideoEncodingAdditionalOptions = (codec: VideoCodec, options: VideoEncodingAdditionalOptions) => {
|
|
309
|
+
if (!options || typeof options !== 'object') {
|
|
310
|
+
throw new TypeError('Encoding options must be an object.');
|
|
311
|
+
}
|
|
312
|
+
if (options.alpha !== undefined && !['discard', 'keep'].includes(options.alpha)) {
|
|
313
|
+
throw new TypeError('options.alpha, when provided, must be \'discard\' or \'keep\'.');
|
|
314
|
+
}
|
|
315
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
316
|
+
const bitrateMode = options.bitrateMode;
|
|
317
|
+
if (bitrateMode !== undefined && !['constant', 'variable'].includes(bitrateMode)) {
|
|
318
|
+
throw new TypeError('bitrateMode, when provided, must be \'constant\' or \'variable\'.');
|
|
319
|
+
}
|
|
320
|
+
if (options.latencyMode !== undefined && !['quality', 'realtime'].includes(options.latencyMode)) {
|
|
321
|
+
throw new TypeError('latencyMode, when provided, must be \'quality\' or \'realtime\'.');
|
|
322
|
+
}
|
|
323
|
+
if (options.fullCodecString !== undefined && typeof options.fullCodecString !== 'string') {
|
|
324
|
+
throw new TypeError('fullCodecString, when provided, must be a string.');
|
|
325
|
+
}
|
|
326
|
+
if (options.fullCodecString !== undefined && inferCodecFromCodecString(options.fullCodecString) !== codec) {
|
|
327
|
+
throw new TypeError(
|
|
328
|
+
`fullCodecString, when provided, must be a string that matches the specified codec (${codec}).`,
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
if (
|
|
332
|
+
options.hardwareAcceleration !== undefined
|
|
333
|
+
&& !['no-preference', 'prefer-hardware', 'prefer-software'].includes(options.hardwareAcceleration)
|
|
334
|
+
) {
|
|
335
|
+
throw new TypeError(
|
|
336
|
+
'hardwareAcceleration, when provided, must be \'no-preference\', \'prefer-hardware\' or'
|
|
337
|
+
+ ' \'prefer-software\'.',
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
if (options.scalabilityMode !== undefined && typeof options.scalabilityMode !== 'string') {
|
|
341
|
+
throw new TypeError('scalabilityMode, when provided, must be a string.');
|
|
342
|
+
}
|
|
343
|
+
if (options.contentHint !== undefined && typeof options.contentHint !== 'string') {
|
|
344
|
+
throw new TypeError('contentHint, when provided, must be a string.');
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
export type VideoEncoderConfigCandidate = {
|
|
349
|
+
config: VideoEncoderConfig;
|
|
350
|
+
quantizer: number | null; // Since the actual config doesn't contain the quantizer
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
export type VideoRateControl = {
|
|
354
|
+
quantizer: number | null;
|
|
355
|
+
bitrate: number;
|
|
356
|
+
bitrateMode: 'constant' | 'variable' | 'quantizer';
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Builds the encoder configs to attempt, in order of preference. Multiple configs are returned when a Quality can be
|
|
361
|
+
* satisfied by multiple rate control methods (quantizer-based encoding with a bitrate-based fallback).
|
|
362
|
+
*/
|
|
363
|
+
export const buildVideoEncoderConfigs = (options: {
|
|
364
|
+
codec: VideoCodec;
|
|
365
|
+
width: number;
|
|
366
|
+
height: number;
|
|
367
|
+
quality: Quality;
|
|
368
|
+
framerate: number | undefined;
|
|
369
|
+
squarePixelWidth?: number;
|
|
370
|
+
squarePixelHeight?: number;
|
|
371
|
+
} & VideoEncodingAdditionalOptions): VideoEncoderConfigCandidate[] => {
|
|
372
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
373
|
+
const fallbackBitrateMode = options.bitrateMode;
|
|
374
|
+
|
|
375
|
+
const rateControl = options.quality._toVideoRateControl(
|
|
376
|
+
options.codec,
|
|
377
|
+
options.width,
|
|
378
|
+
options.height,
|
|
379
|
+
fallbackBitrateMode,
|
|
380
|
+
);
|
|
381
|
+
|
|
382
|
+
const buildConfig = (
|
|
383
|
+
bitrate: number | undefined,
|
|
384
|
+
bitrateMode: 'constant' | 'variable' | 'quantizer',
|
|
385
|
+
bitrateEstimate: number,
|
|
386
|
+
): VideoEncoderConfig => ({
|
|
387
|
+
codec: options.fullCodecString ?? buildVideoCodecString(
|
|
388
|
+
options.codec,
|
|
389
|
+
options.width,
|
|
390
|
+
options.height,
|
|
391
|
+
bitrateEstimate,
|
|
392
|
+
options.alpha === 'keep',
|
|
393
|
+
),
|
|
394
|
+
width: options.width,
|
|
395
|
+
height: options.height,
|
|
396
|
+
displayWidth: options.squarePixelWidth,
|
|
397
|
+
displayHeight: options.squarePixelHeight,
|
|
398
|
+
bitrate,
|
|
399
|
+
bitrateMode,
|
|
400
|
+
alpha: options.alpha ?? 'discard',
|
|
401
|
+
framerate: options.framerate,
|
|
402
|
+
latencyMode: options.latencyMode,
|
|
403
|
+
hardwareAcceleration: options.hardwareAcceleration,
|
|
404
|
+
scalabilityMode: options.scalabilityMode,
|
|
405
|
+
contentHint: options.contentHint,
|
|
406
|
+
...getVideoEncoderConfigExtension(options.codec),
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
const candidates: VideoEncoderConfigCandidate[] = [];
|
|
410
|
+
|
|
411
|
+
if (rateControl.quantizer !== null) {
|
|
412
|
+
candidates.push({
|
|
413
|
+
config: buildConfig(undefined, 'quantizer', rateControl.bitrate),
|
|
414
|
+
quantizer: rateControl.quantizer,
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
if (rateControl.bitrateMode !== 'quantizer') {
|
|
419
|
+
candidates.push({
|
|
420
|
+
config: buildConfig(rateControl.bitrate, rateControl.bitrateMode, rateControl.bitrate),
|
|
421
|
+
quantizer: null,
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
assert(candidates.length > 0);
|
|
426
|
+
|
|
427
|
+
return candidates;
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Configuration object that controls audio encoding. Can be used to set codec, quality, and more.
|
|
432
|
+
* @group Encoding
|
|
433
|
+
* @public
|
|
434
|
+
*/
|
|
435
|
+
export type AudioEncodingConfig = {
|
|
436
|
+
/** The audio codec that should be used for encoding the audio samples. */
|
|
437
|
+
codec: AudioCodec;
|
|
438
|
+
/**
|
|
439
|
+
* The desired quality of the encoded audio. Required for compressed audio codecs, unused for PCM codecs.
|
|
440
|
+
*/
|
|
441
|
+
quality?: Quality;
|
|
442
|
+
/**
|
|
443
|
+
* The target bitrate for the encoded audio, in bits per second. Alternatively, a {@link Quality} can be provided.
|
|
444
|
+
* @deprecated Use `quality` instead.
|
|
445
|
+
*/
|
|
446
|
+
bitrate?: number | Quality;
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Optional transformations to apply to the audio samples before they are passed to the encoder.
|
|
450
|
+
*/
|
|
451
|
+
transform?: AudioTransformOptions;
|
|
452
|
+
|
|
453
|
+
/** Called for each successfully encoded packet. Both the packet and the encoding metadata are passed. */
|
|
454
|
+
onEncodedPacket?: (packet: EncodedPacket, meta: EncodedAudioChunkMetadata | undefined) => unknown;
|
|
455
|
+
/**
|
|
456
|
+
* Called when the internal [encoder config](https://www.w3.org/TR/webcodecs/#audio-encoder-config), as used by the
|
|
457
|
+
* WebCodecs API, is created.
|
|
458
|
+
*/
|
|
459
|
+
onEncoderConfig?: (config: AudioEncoderConfig) => unknown;
|
|
460
|
+
/** Called right before a sample is passed to the encoder. */
|
|
461
|
+
onEncodedSample?: (sample: AudioSample) => unknown;
|
|
462
|
+
} & AudioEncodingAdditionalOptions;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Options for transforming audio samples before encoding.
|
|
466
|
+
* @group Encoding
|
|
467
|
+
* @public
|
|
468
|
+
*/
|
|
469
|
+
export type AudioTransformOptions = {
|
|
470
|
+
/** The desired number of output channels to up/downmix to. */
|
|
471
|
+
numberOfChannels?: number;
|
|
472
|
+
/** The desired output sample rate in hertz to resample to. */
|
|
473
|
+
sampleRate?: number;
|
|
474
|
+
/**
|
|
475
|
+
* The desired sample format (and therefore bit depth) of the audio samples before they are passed to the encoder.
|
|
476
|
+
* Can be used to control bit depth with certain output codecs such as FLAC.
|
|
477
|
+
*/
|
|
478
|
+
sampleFormat?: 'u8' | 's16' | 's32' | 'f32';
|
|
479
|
+
/**
|
|
480
|
+
* Allows for custom user-defined processing of audio samples, e.g. for applying audio effects or timestamp
|
|
481
|
+
* modifications. Called for each audio sample after resampling and remixing.
|
|
482
|
+
*
|
|
483
|
+
* Must return an {@link AudioSample}, an array of them, or `null` for dropping the sample.
|
|
484
|
+
*/
|
|
485
|
+
process?: (sample: AudioSample) => MaybePromise<
|
|
486
|
+
AudioSample | AudioSample[] | null
|
|
487
|
+
>;
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
export const validateAudioEncodingConfig = (config: AudioEncodingConfig) => {
|
|
491
|
+
if (!config || typeof config !== 'object') {
|
|
492
|
+
throw new TypeError('Encoding config must be an object.');
|
|
493
|
+
}
|
|
494
|
+
if (!AUDIO_CODECS.includes(config.codec)) {
|
|
495
|
+
throw new TypeError(`Invalid audio codec '${config.codec}'. Must be one of: ${AUDIO_CODECS.join(', ')}.`);
|
|
496
|
+
}
|
|
497
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
498
|
+
const bitrate = config.bitrate;
|
|
499
|
+
if (
|
|
500
|
+
config.quality === undefined
|
|
501
|
+
&& bitrate === undefined
|
|
502
|
+
&& !((PCM_AUDIO_CODECS as readonly string[]).includes(config.codec) || config.codec === 'flac')
|
|
503
|
+
) {
|
|
504
|
+
throw new TypeError('config.quality must be provided for compressed audio codecs.');
|
|
505
|
+
}
|
|
506
|
+
if (config.quality !== undefined && bitrate !== undefined) {
|
|
507
|
+
throw new TypeError('config.quality and config.bitrate cannot both be provided.');
|
|
508
|
+
}
|
|
509
|
+
if (config.quality !== undefined && !(config.quality instanceof Quality)) {
|
|
510
|
+
throw new TypeError('config.quality, when provided, must be a Quality.');
|
|
511
|
+
}
|
|
512
|
+
if (bitrate !== undefined && !(bitrate instanceof Quality) && (!Number.isInteger(bitrate) || bitrate <= 0)) {
|
|
513
|
+
throw new TypeError('config.bitrate, when provided, must be a positive integer or a quality.');
|
|
514
|
+
}
|
|
515
|
+
if (config.transform !== undefined) {
|
|
516
|
+
if (typeof config.transform !== 'object' || !config.transform) {
|
|
517
|
+
throw new TypeError('config.transform, when provided, must be an object.');
|
|
518
|
+
}
|
|
519
|
+
if (
|
|
520
|
+
config.transform.numberOfChannels !== undefined
|
|
521
|
+
&& (!Number.isInteger(config.transform.numberOfChannels) || config.transform.numberOfChannels <= 0)
|
|
522
|
+
) {
|
|
523
|
+
throw new TypeError('config.transform.numberOfChannels, when provided, must be a positive integer.');
|
|
524
|
+
}
|
|
525
|
+
if (
|
|
526
|
+
config.transform.sampleRate !== undefined
|
|
527
|
+
&& (!Number.isInteger(config.transform.sampleRate) || config.transform.sampleRate <= 0)
|
|
528
|
+
) {
|
|
529
|
+
throw new TypeError('config.transform.sampleRate, when provided, must be a positive integer.');
|
|
530
|
+
}
|
|
531
|
+
if (
|
|
532
|
+
config.transform.sampleFormat !== undefined
|
|
533
|
+
&& !['u8', 's16', 's32', 'f32'].includes(config.transform.sampleFormat)
|
|
534
|
+
) {
|
|
535
|
+
throw new TypeError('config.transform.sampleFormat, when provided, must be one of: u8, s16, s32, f32.');
|
|
536
|
+
}
|
|
537
|
+
if (config.transform.process !== undefined && typeof config.transform.process !== 'function') {
|
|
538
|
+
throw new TypeError('config.transform.process, when provided, must be a function.');
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
if (config.onEncodedPacket !== undefined && typeof config.onEncodedPacket !== 'function') {
|
|
542
|
+
throw new TypeError('config.onEncodedPacket, when provided, must be a function.');
|
|
543
|
+
}
|
|
544
|
+
if (config.onEncoderConfig !== undefined && typeof config.onEncoderConfig !== 'function') {
|
|
545
|
+
throw new TypeError('config.onEncoderConfig, when provided, must be a function.');
|
|
546
|
+
}
|
|
547
|
+
if (config.onEncodedSample !== undefined && typeof config.onEncodedSample !== 'function') {
|
|
548
|
+
throw new TypeError('config.onEncodedSample, when provided, must be a function.');
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
validateAudioEncodingAdditionalOptions(config.codec, config);
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Additional options that control audio encoding.
|
|
556
|
+
* @group Encoding
|
|
557
|
+
* @public
|
|
558
|
+
*/
|
|
559
|
+
export type AudioEncodingAdditionalOptions = {
|
|
560
|
+
/**
|
|
561
|
+
* Configures the bitrate mode. A bitrate mode set directly on a {@link Quality} takes precedence over this field.
|
|
562
|
+
* @deprecated Specify the bitrate mode in the {@link Quality} instead.
|
|
563
|
+
*/
|
|
564
|
+
bitrateMode?: 'constant' | 'variable';
|
|
565
|
+
/**
|
|
566
|
+
* The full codec string as specified in the Mediabunny Codec Registry. This string must match the codec
|
|
567
|
+
* specified in `codec`. When not set, a fitting codec string will be constructed automatically by the library.
|
|
568
|
+
*/
|
|
569
|
+
fullCodecString?: string;
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
export const validateAudioEncodingAdditionalOptions = (codec: AudioCodec, options: AudioEncodingAdditionalOptions) => {
|
|
573
|
+
if (!options || typeof options !== 'object') {
|
|
574
|
+
throw new TypeError('Encoding options must be an object.');
|
|
575
|
+
}
|
|
576
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
577
|
+
const bitrateMode = options.bitrateMode;
|
|
578
|
+
if (bitrateMode !== undefined && !['constant', 'variable'].includes(bitrateMode)) {
|
|
579
|
+
throw new TypeError('bitrateMode, when provided, must be \'constant\' or \'variable\'.');
|
|
580
|
+
}
|
|
581
|
+
if (options.fullCodecString !== undefined && typeof options.fullCodecString !== 'string') {
|
|
582
|
+
throw new TypeError('fullCodecString, when provided, must be a string.');
|
|
583
|
+
}
|
|
584
|
+
if (options.fullCodecString !== undefined && inferCodecFromCodecString(options.fullCodecString) !== codec) {
|
|
585
|
+
throw new TypeError(
|
|
586
|
+
`fullCodecString, when provided, must be a string that matches the specified codec (${codec}).`,
|
|
587
|
+
);
|
|
588
|
+
}
|
|
589
|
+
};
|
|
590
|
+
|
|
591
|
+
export const buildAudioEncoderConfig = (options: {
|
|
592
|
+
codec: AudioCodec;
|
|
593
|
+
numberOfChannels: number;
|
|
594
|
+
sampleRate: number;
|
|
595
|
+
quality?: Quality;
|
|
596
|
+
} & AudioEncodingAdditionalOptions): AudioEncoderConfig => {
|
|
597
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
598
|
+
const fallbackBitrateMode = options.bitrateMode;
|
|
599
|
+
|
|
600
|
+
return {
|
|
601
|
+
codec: options.fullCodecString ?? buildAudioCodecString(
|
|
602
|
+
options.codec,
|
|
603
|
+
options.numberOfChannels,
|
|
604
|
+
options.sampleRate,
|
|
605
|
+
),
|
|
606
|
+
numberOfChannels: options.numberOfChannels,
|
|
607
|
+
sampleRate: options.sampleRate,
|
|
608
|
+
bitrate: options.quality?._toAudioBitrate(options.codec),
|
|
609
|
+
bitrateMode: options.quality?._bitrateMode ?? fallbackBitrateMode,
|
|
610
|
+
...getAudioEncoderConfigExtension(options.codec),
|
|
611
|
+
};
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* A named qualitative quality level.
|
|
616
|
+
* @group Encoding
|
|
617
|
+
* @public
|
|
618
|
+
*/
|
|
619
|
+
export type QualityLevel = 'very-low' | 'low' | 'medium' | 'high' | 'very-high';
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* Quality options expressing a qualitative (subjective) quality level.
|
|
623
|
+
* @group Encoding
|
|
624
|
+
* @public
|
|
625
|
+
*/
|
|
626
|
+
export type QualitativeQualityOptions = {
|
|
627
|
+
/**
|
|
628
|
+
* A qualitative quality level. Either a number ranging from 0 to 1, where 0 means worst and 1 means best quality,
|
|
629
|
+
* or one of five named levels ('very-low', 'low', 'medium', 'high', 'very-high'), which map to 0, 0.25, 0.5, 0.75
|
|
630
|
+
* and 1, respectively.
|
|
631
|
+
*
|
|
632
|
+
* Values outside the [0, 1] range are also allowed for extreme behavior, but might break on certain systems.
|
|
633
|
+
*
|
|
634
|
+
* Internally, either bitrate- or quantizer-driven encoding will be used, depending on availability and settings.
|
|
635
|
+
*/
|
|
636
|
+
quality: number | QualityLevel;
|
|
637
|
+
/**
|
|
638
|
+
* When true, the quality level always maps to a bitrate, even if quantizer-based encoding is available. Useful
|
|
639
|
+
* when a predictable output size matters more than constant quality.
|
|
640
|
+
*/
|
|
641
|
+
preferBitrate?: boolean;
|
|
642
|
+
/** The bitrate mode to use when encoding resolves to bitrate-based encoding. */
|
|
643
|
+
bitrateMode?: 'constant' | 'variable';
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Quality options expressing quantitative rate control: an explicit bitrate, an explicit quantizer, or both.
|
|
648
|
+
* @group Encoding
|
|
649
|
+
* @public
|
|
650
|
+
*/
|
|
651
|
+
export type QuantitativeQualityOptions = {
|
|
652
|
+
/**
|
|
653
|
+
* An explicit bitrate in bits per second. When set, this bitrate is used for encoding. It also acts as the
|
|
654
|
+
* fallback in case a specified quantizer cannot be used.
|
|
655
|
+
*/
|
|
656
|
+
bitrate?: number;
|
|
657
|
+
/** The bitrate mode to use when encoding resolves to bitrate-based encoding. */
|
|
658
|
+
bitrateMode?: 'constant' | 'variable';
|
|
659
|
+
/**
|
|
660
|
+
* An explicit quantizer value used for quantizer-based video encoding; lower values mean higher quality. The valid
|
|
661
|
+
* range depends on the codec and is defined in the
|
|
662
|
+
* [Mediabunny Codec Registry](https://mediabunny.dev/codec-registry/overview). This option is like FFmpeg's
|
|
663
|
+
* constant-rate factor (CRF).
|
|
664
|
+
*
|
|
665
|
+
* If the quantizer cannot be used due to missing support, then it will throw, unless `bitrate` is defined as a
|
|
666
|
+
* fallback.
|
|
667
|
+
*/
|
|
668
|
+
quantizer?: number;
|
|
669
|
+
};
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* Options describing a desired encoding quality.
|
|
673
|
+
* @group Encoding
|
|
674
|
+
* @public
|
|
675
|
+
*/
|
|
676
|
+
export type QualityOptions = QualitativeQualityOptions | QuantitativeQualityOptions;
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* Represents a desired encoding quality. Can express a qualitative quality level, an explicit bitrate, an explicit
|
|
680
|
+
* quantizer value, or a combination thereof.
|
|
681
|
+
* @group Encoding
|
|
682
|
+
* @public
|
|
683
|
+
*/
|
|
684
|
+
export class Quality {
|
|
685
|
+
/** @internal */
|
|
686
|
+
_quality: number | undefined;
|
|
687
|
+
/** @internal */
|
|
688
|
+
_preferBitrate: boolean;
|
|
689
|
+
/** @internal */
|
|
690
|
+
_bitrate: number | undefined;
|
|
691
|
+
/** @internal */
|
|
692
|
+
_quantizer: number | undefined;
|
|
693
|
+
/** @internal */
|
|
694
|
+
_bitrateMode: 'constant' | 'variable' | undefined;
|
|
695
|
+
|
|
696
|
+
constructor(options: QualityOptions | number | QualityLevel) {
|
|
697
|
+
if (typeof options === 'number' || typeof options === 'string') {
|
|
698
|
+
// Shorthand for directly specifying a qualitative quality level
|
|
699
|
+
options = { quality: options };
|
|
700
|
+
}
|
|
701
|
+
if (!options || typeof options !== 'object') {
|
|
702
|
+
throw new TypeError('options must be an object.');
|
|
703
|
+
}
|
|
704
|
+
if (options.bitrateMode !== undefined && !['constant', 'variable'].includes(options.bitrateMode)) {
|
|
705
|
+
throw new TypeError('options.bitrateMode, when provided, must be \'constant\' or \'variable\'.');
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
if ('quality' in options) {
|
|
709
|
+
if (
|
|
710
|
+
typeof options.quality === 'string'
|
|
711
|
+
? !(options.quality in QUALITY_LEVELS)
|
|
712
|
+
: (typeof options.quality !== 'number' || Number.isNaN(options.quality))
|
|
713
|
+
) {
|
|
714
|
+
throw new TypeError(
|
|
715
|
+
'options.quality must be a number, or one of \'very-low\', \'low\', \'medium\', \'high\''
|
|
716
|
+
+ ' or \'very-high\'.',
|
|
717
|
+
);
|
|
718
|
+
}
|
|
719
|
+
if (options.preferBitrate !== undefined && typeof options.preferBitrate !== 'boolean') {
|
|
720
|
+
throw new TypeError('options.preferBitrate, when provided, must be a boolean.');
|
|
721
|
+
}
|
|
722
|
+
if ('bitrate' in options || 'quantizer' in options) {
|
|
723
|
+
throw new TypeError('options.quality cannot be combined with options.bitrate or options.quantizer.');
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
this._quality = typeof options.quality === 'string'
|
|
727
|
+
? QUALITY_LEVELS[options.quality]
|
|
728
|
+
: options.quality;
|
|
729
|
+
this._preferBitrate = options.preferBitrate ?? false;
|
|
730
|
+
this._bitrate = undefined;
|
|
731
|
+
this._quantizer = undefined;
|
|
732
|
+
} else {
|
|
733
|
+
if (options.bitrate !== undefined && (!Number.isInteger(options.bitrate) || options.bitrate <= 0)) {
|
|
734
|
+
throw new TypeError('options.bitrate, when provided, must be a positive integer.');
|
|
735
|
+
}
|
|
736
|
+
if (options.quantizer !== undefined && (!Number.isInteger(options.quantizer) || options.quantizer < 0)) {
|
|
737
|
+
throw new TypeError('options.quantizer, when provided, must be a non-negative integer.');
|
|
738
|
+
}
|
|
739
|
+
if (options.bitrate === undefined && options.quantizer === undefined) {
|
|
740
|
+
throw new TypeError('At least one of options.bitrate or options.quantizer must be set.');
|
|
741
|
+
}
|
|
742
|
+
if ('preferBitrate' in options) {
|
|
743
|
+
throw new TypeError('options.preferBitrate can only be combined with options.quality.');
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
this._quality = undefined;
|
|
747
|
+
this._preferBitrate = false;
|
|
748
|
+
this._bitrate = options.bitrate;
|
|
749
|
+
this._quantizer = options.quantizer;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
this._bitrateMode = options.bitrateMode;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Determines the rate control methods usable for the given codec.
|
|
757
|
+
* @internal
|
|
758
|
+
*/
|
|
759
|
+
_toVideoRateControl(
|
|
760
|
+
codec: VideoCodec,
|
|
761
|
+
width: number,
|
|
762
|
+
height: number,
|
|
763
|
+
fallbackBitrateMode: 'constant' | 'variable' | undefined,
|
|
764
|
+
): VideoRateControl {
|
|
765
|
+
const quantizerSupport = VIDEO_CODEC_QUANTIZER_SUPPORT[codec];
|
|
766
|
+
|
|
767
|
+
let quantizer: number | null = null;
|
|
768
|
+
let bitrateMode: 'constant' | 'variable' | 'quantizer' = this._bitrateMode ?? fallbackBitrateMode ?? 'variable';
|
|
769
|
+
|
|
770
|
+
if (this._quantizer !== undefined) {
|
|
771
|
+
// An explicit quantizer demands quantizer-based encoding, with an explicit bitrate (if any) being the
|
|
772
|
+
// only permitted fallback
|
|
773
|
+
if (!quantizerSupport) {
|
|
774
|
+
if (this._bitrate === undefined) {
|
|
775
|
+
throw new Error(
|
|
776
|
+
`Codec '${codec}' does not support quantizer-based encoding. Provide a bitrate in the Quality`
|
|
777
|
+
+ ` to define a fallback.`,
|
|
778
|
+
);
|
|
779
|
+
}
|
|
780
|
+
} else if (this._quantizer < quantizerSupport.min || this._quantizer > quantizerSupport.max) {
|
|
781
|
+
if (this._bitrate === undefined) {
|
|
782
|
+
throw new Error(
|
|
783
|
+
`Quantizer ${this._quantizer} is out of range for codec '${codec}'; must be between`
|
|
784
|
+
+ ` ${quantizerSupport.min} and ${quantizerSupport.max}.`,
|
|
785
|
+
);
|
|
786
|
+
}
|
|
787
|
+
} else {
|
|
788
|
+
quantizer = this._quantizer;
|
|
789
|
+
if (this._bitrate === undefined) {
|
|
790
|
+
bitrateMode = 'quantizer';
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
} else if (this._bitrate === undefined && quantizerSupport && !this._preferBitrate) {
|
|
794
|
+
// A qualitative quality level is set; offer quantizer-based encoding since the codec supports it. Since
|
|
795
|
+
// the quality may lie outside the 0-1 range, we clamp the result to the codec's legal quantizer range.
|
|
796
|
+
assert(this._quality !== undefined);
|
|
797
|
+
quantizer = clamp(
|
|
798
|
+
Math.round(lerp(quantizerSupport.worst, quantizerSupport.best, this._quality)),
|
|
799
|
+
quantizerSupport.min,
|
|
800
|
+
quantizerSupport.max,
|
|
801
|
+
);
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
let bitrate: number;
|
|
805
|
+
if (this._bitrate !== undefined) {
|
|
806
|
+
bitrate = this._bitrate;
|
|
807
|
+
} else {
|
|
808
|
+
let quality = this._quality;
|
|
809
|
+
if (quality === undefined) {
|
|
810
|
+
// Map the quantizer back onto the quality scale to derive a fitting bitrate estimate
|
|
811
|
+
assert(quantizer !== null && quantizerSupport);
|
|
812
|
+
quality = clamp(
|
|
813
|
+
(quantizer - quantizerSupport.worst) / (quantizerSupport.best - quantizerSupport.worst),
|
|
814
|
+
0,
|
|
815
|
+
1,
|
|
816
|
+
);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
bitrate = computeVideoBitrate(codec, width, height, qualityToBitrateFactor(quality));
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
return { quantizer, bitrate, bitrateMode };
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
/** @internal */
|
|
826
|
+
_toVideoBitrate(codec: VideoCodec, width: number, height: number) {
|
|
827
|
+
if (this._bitrate !== undefined) {
|
|
828
|
+
return this._bitrate;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
assert(this._quality !== undefined);
|
|
832
|
+
return computeVideoBitrate(codec, width, height, qualityToBitrateFactor(this._quality));
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
/** @internal */
|
|
836
|
+
_toAudioBitrate(codec: AudioCodec) {
|
|
837
|
+
if ((PCM_AUDIO_CODECS as readonly string[]).includes(codec) || codec === 'flac') {
|
|
838
|
+
return undefined;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
if (this._bitrate !== undefined) {
|
|
842
|
+
return this._bitrate;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
if (this._quality === undefined) {
|
|
846
|
+
throw new Error(
|
|
847
|
+
'This Quality defines neither a quality level nor a bitrate and therefore cannot be used for audio'
|
|
848
|
+
+ ' encoding.',
|
|
849
|
+
);
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
const factor = qualityToBitrateFactor(this._quality);
|
|
853
|
+
|
|
854
|
+
const baseRates = {
|
|
855
|
+
aac: 128000, // 128kbps base for AAC
|
|
856
|
+
opus: 64000, // 64kbps base for Opus
|
|
857
|
+
mp3: 160000, // 160kbps base for MP3
|
|
858
|
+
vorbis: 64000, // 64kbps base for Vorbis
|
|
859
|
+
ac3: 384000, // 384kbps base for AC-3
|
|
860
|
+
eac3: 192000, // 192kbps base for E-AC-3
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
const baseBitrate = baseRates[codec as keyof typeof baseRates];
|
|
864
|
+
if (!baseBitrate) {
|
|
865
|
+
throw new Error(`Unhandled codec: ${codec}`);
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
let finalBitrate = baseBitrate * factor;
|
|
869
|
+
|
|
870
|
+
if (codec === 'aac') {
|
|
871
|
+
// AAC only works with specific bitrates, let's find the closest
|
|
872
|
+
const validRates = [96000, 128000, 160000, 192000];
|
|
873
|
+
finalBitrate = validRates.reduce((prev, curr) =>
|
|
874
|
+
Math.abs(curr - finalBitrate) < Math.abs(prev - finalBitrate) ? curr : prev,
|
|
875
|
+
);
|
|
876
|
+
} else if (codec === 'opus' || codec === 'vorbis') {
|
|
877
|
+
finalBitrate = Math.max(6000, finalBitrate);
|
|
878
|
+
} else if (codec === 'mp3') {
|
|
879
|
+
const validRates = [
|
|
880
|
+
8000, 16000, 24000, 32000, 40000, 48000, 64000, 80000,
|
|
881
|
+
96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000,
|
|
882
|
+
];
|
|
883
|
+
finalBitrate = validRates.reduce((prev, curr) =>
|
|
884
|
+
Math.abs(curr - finalBitrate) < Math.abs(prev - finalBitrate) ? curr : prev,
|
|
885
|
+
);
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
return Math.round(finalBitrate / 1000) * 1000;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
const QUALITY_LEVELS: Record<QualityLevel, number> = {
|
|
893
|
+
'very-low': 0,
|
|
894
|
+
'low': 0.25,
|
|
895
|
+
'medium': 0.5,
|
|
896
|
+
'high': 0.75,
|
|
897
|
+
'very-high': 1,
|
|
898
|
+
};
|
|
899
|
+
|
|
900
|
+
// best and worse define the reasonable range
|
|
901
|
+
const VIDEO_CODEC_QUANTIZER_SUPPORT: Partial<Record<VideoCodec, {
|
|
902
|
+
min: number;
|
|
903
|
+
max: number;
|
|
904
|
+
worst: number;
|
|
905
|
+
best: number;
|
|
906
|
+
}>> = {
|
|
907
|
+
avc: { min: 0, max: 51, worst: 41, best: 16 },
|
|
908
|
+
hevc: { min: 0, max: 51, worst: 41, best: 16 },
|
|
909
|
+
vp9: { min: 0, max: 63, worst: 52, best: 20 },
|
|
910
|
+
av1: { min: 0, max: 255, worst: 208, best: 80 },
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
/**
|
|
914
|
+
* Maps the qualitative 0-1 quality scale to a bitrate multiplier. The curve is a least-squares exponential fit through
|
|
915
|
+
* the multipliers historically used by the predefined quality levels (0.3, 0.6, 1, 2, 4).
|
|
916
|
+
*/
|
|
917
|
+
const qualityToBitrateFactor = (quality: number) => 0.3 * Math.exp(2.5538 * quality);
|
|
918
|
+
|
|
919
|
+
const computeVideoBitrate = (codec: VideoCodec, width: number, height: number, factor: number) => {
|
|
920
|
+
const pixels = width * height;
|
|
921
|
+
const referencePixels = 1920 * 1080;
|
|
922
|
+
const referenceBitrate = 3_000_000;
|
|
923
|
+
const scaleFactor = Math.pow(pixels / referencePixels, 0.95); // Slight non-linear scaling
|
|
924
|
+
const baseBitrate = referenceBitrate * scaleFactor;
|
|
925
|
+
|
|
926
|
+
const codecEfficiencyFactors: Record<VideoCodec, number> = {
|
|
927
|
+
avc: 1.0, // H.264/AVC (baseline)
|
|
928
|
+
hevc: 0.6, // H.265/HEVC (~40% more efficient than AVC)
|
|
929
|
+
vp9: 0.6, // Similar to HEVC
|
|
930
|
+
av1: 0.4, // ~60% more efficient than AVC
|
|
931
|
+
vp8: 1.2, // Slightly less efficient than AVC
|
|
932
|
+
prores: 220_000_000 / referenceBitrate, // Apple ProRes white paper claims 220 Mbps for 1080p 422 HQ @30Hz
|
|
933
|
+
};
|
|
934
|
+
|
|
935
|
+
const codecAdjustedBitrate = baseBitrate * codecEfficiencyFactors[codec];
|
|
936
|
+
const finalBitrate = codecAdjustedBitrate * factor;
|
|
937
|
+
|
|
938
|
+
return Math.ceil(finalBitrate / 1000) * 1000;
|
|
939
|
+
};
|
|
940
|
+
|
|
941
|
+
/** Builds the per-frame encode options that carry the quantizer value for the given codec. */
|
|
942
|
+
export const buildQuantizerEncodeOptions = (codec: VideoCodec, quantizer: number): VideoEncoderEncodeOptions => {
|
|
943
|
+
if (codec === 'avc') {
|
|
944
|
+
return { avc: { quantizer } };
|
|
945
|
+
} else if (codec === 'hevc') {
|
|
946
|
+
return { hevc: { quantizer } };
|
|
947
|
+
} else if (codec === 'vp9') {
|
|
948
|
+
return { vp9: { quantizer } };
|
|
949
|
+
} else if (codec === 'av1') {
|
|
950
|
+
return { av1: { quantizer } };
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
assert(false);
|
|
954
|
+
};
|
|
955
|
+
|
|
956
|
+
// Adds missing per-frame encode options
|
|
957
|
+
declare global {
|
|
958
|
+
interface VideoEncoderEncodeOptions {
|
|
959
|
+
hevc?: VideoEncoderEncodeOptionsForHevc;
|
|
960
|
+
vp9?: VideoEncoderEncodeOptionsForVp9;
|
|
961
|
+
av1?: VideoEncoderEncodeOptionsForAv1;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
interface VideoEncoderEncodeOptionsForHevc {
|
|
965
|
+
quantizer?: number | null;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
interface VideoEncoderEncodeOptionsForVp9 {
|
|
969
|
+
quantizer?: number | null;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
interface VideoEncoderEncodeOptionsForAv1 {
|
|
973
|
+
quantizer?: number | null;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
/**
|
|
978
|
+
* Represents a very low media quality.
|
|
979
|
+
* @deprecated Use `new Quality('very-low')` instead.
|
|
980
|
+
* @group Encoding
|
|
981
|
+
* @public
|
|
982
|
+
*/
|
|
983
|
+
export const QUALITY_VERY_LOW = /* #__PURE__ */ new Quality('very-low');
|
|
984
|
+
/**
|
|
985
|
+
* Represents a low media quality.
|
|
986
|
+
* @deprecated Use `new Quality('low')` instead.
|
|
987
|
+
* @group Encoding
|
|
988
|
+
* @public
|
|
989
|
+
*/
|
|
990
|
+
export const QUALITY_LOW = /* #__PURE__ */ new Quality('low');
|
|
991
|
+
/**
|
|
992
|
+
* Represents a medium media quality.
|
|
993
|
+
* @deprecated Use `new Quality('medium')` instead.
|
|
994
|
+
* @group Encoding
|
|
995
|
+
* @public
|
|
996
|
+
*/
|
|
997
|
+
export const QUALITY_MEDIUM = /* #__PURE__ */ new Quality('medium');
|
|
998
|
+
/**
|
|
999
|
+
* Represents a high media quality.
|
|
1000
|
+
* @deprecated Use `new Quality('high')` instead.
|
|
1001
|
+
* @group Encoding
|
|
1002
|
+
* @public
|
|
1003
|
+
*/
|
|
1004
|
+
export const QUALITY_HIGH = /* #__PURE__ */ new Quality('high');
|
|
1005
|
+
/**
|
|
1006
|
+
* Represents a very high media quality.
|
|
1007
|
+
* @deprecated Use `new Quality('very-high')` instead.
|
|
1008
|
+
* @group Encoding
|
|
1009
|
+
* @public
|
|
1010
|
+
*/
|
|
1011
|
+
export const QUALITY_VERY_HIGH = /* #__PURE__ */ new Quality('very-high');
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* Checks if the browser is able to encode the given codec.
|
|
1015
|
+
* @group Encoding
|
|
1016
|
+
* @public
|
|
1017
|
+
*/
|
|
1018
|
+
export const canEncode = (codec: MediaCodec) => {
|
|
1019
|
+
if ((VIDEO_CODECS as readonly string[]).includes(codec)) {
|
|
1020
|
+
return canEncodeVideo(codec as VideoCodec);
|
|
1021
|
+
} else if ((AUDIO_CODECS as readonly string[]).includes(codec)) {
|
|
1022
|
+
return canEncodeAudio(codec as AudioCodec);
|
|
1023
|
+
} else if ((SUBTITLE_CODECS as readonly string[]).includes(codec)) {
|
|
1024
|
+
return canEncodeSubtitles(codec as SubtitleCodec);
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
throw new TypeError(`Unknown codec '${codec}'.`);
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* Checks if the browser is able to encode the given video codec with the given parameters.
|
|
1032
|
+
* @group Encoding
|
|
1033
|
+
* @public
|
|
1034
|
+
*/
|
|
1035
|
+
export const canEncodeVideo = async (
|
|
1036
|
+
codec: VideoCodec,
|
|
1037
|
+
options: {
|
|
1038
|
+
width?: number;
|
|
1039
|
+
height?: number;
|
|
1040
|
+
quality?: Quality;
|
|
1041
|
+
/** @deprecated Use `quality` instead. */
|
|
1042
|
+
bitrate?: number | Quality;
|
|
1043
|
+
} & VideoEncodingAdditionalOptions = {},
|
|
1044
|
+
) => {
|
|
1045
|
+
const {
|
|
1046
|
+
width = 1280,
|
|
1047
|
+
height = 720,
|
|
1048
|
+
quality,
|
|
1049
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1050
|
+
bitrate,
|
|
1051
|
+
...restOptions
|
|
1052
|
+
} = options;
|
|
1053
|
+
|
|
1054
|
+
if (!VIDEO_CODECS.includes(codec)) {
|
|
1055
|
+
return false;
|
|
1056
|
+
}
|
|
1057
|
+
if (!Number.isInteger(width) || width <= 0) {
|
|
1058
|
+
throw new TypeError('width must be a positive integer.');
|
|
1059
|
+
}
|
|
1060
|
+
if (!Number.isInteger(height) || height <= 0) {
|
|
1061
|
+
throw new TypeError('height must be a positive integer.');
|
|
1062
|
+
}
|
|
1063
|
+
if (quality !== undefined && !(quality instanceof Quality)) {
|
|
1064
|
+
throw new TypeError('quality, when provided, must be a Quality.');
|
|
1065
|
+
}
|
|
1066
|
+
if (quality !== undefined && bitrate !== undefined) {
|
|
1067
|
+
throw new TypeError('quality and bitrate cannot both be provided.');
|
|
1068
|
+
}
|
|
1069
|
+
if (bitrate !== undefined && !(bitrate instanceof Quality) && (!Number.isInteger(bitrate) || bitrate <= 0)) {
|
|
1070
|
+
throw new TypeError('bitrate must be a positive integer or a quality.');
|
|
1071
|
+
}
|
|
1072
|
+
validateVideoEncodingAdditionalOptions(codec, restOptions);
|
|
1073
|
+
|
|
1074
|
+
const resolvedQuality = resolveQuality(quality, bitrate) ?? new Quality({ bitrate: 1e6 });
|
|
1075
|
+
|
|
1076
|
+
let candidates: VideoEncoderConfigCandidate[];
|
|
1077
|
+
try {
|
|
1078
|
+
candidates = buildVideoEncoderConfigs({
|
|
1079
|
+
codec,
|
|
1080
|
+
width,
|
|
1081
|
+
height,
|
|
1082
|
+
quality: resolvedQuality,
|
|
1083
|
+
framerate: undefined,
|
|
1084
|
+
...restOptions,
|
|
1085
|
+
alpha: 'discard', // Since we handle alpha ourselves
|
|
1086
|
+
});
|
|
1087
|
+
} catch {
|
|
1088
|
+
// The requested rate control cannot be used with this codec (e.g. a quantizer with no fallback bitrate on a
|
|
1089
|
+
// codec without quantizer support)
|
|
1090
|
+
return false;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
const key = JSON.stringify(candidates);
|
|
1094
|
+
const memoized = canEncodeVideoMemo.get(key);
|
|
1095
|
+
if (memoized) {
|
|
1096
|
+
return memoized;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
const promise = (async () => {
|
|
1100
|
+
for (const { config } of candidates) {
|
|
1101
|
+
if (customVideoEncoders.some(x => x.supports(codec, config))) {
|
|
1102
|
+
// There's a custom encoder
|
|
1103
|
+
return true;
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
if (typeof VideoEncoder === 'undefined') {
|
|
1107
|
+
return false;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
const hasOddDimension = width % 2 === 1 || height % 2 === 1;
|
|
1111
|
+
if (
|
|
1112
|
+
hasOddDimension
|
|
1113
|
+
&& (codec === 'avc' || codec === 'hevc')
|
|
1114
|
+
) {
|
|
1115
|
+
// Disallow odd dimensions for certain codecs
|
|
1116
|
+
return false;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
for (const { config, quantizer } of candidates) {
|
|
1120
|
+
const support = await VideoEncoder.isConfigSupported(config);
|
|
1121
|
+
if (!support.supported) {
|
|
1122
|
+
continue;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
if (!isFirefox()) {
|
|
1126
|
+
return true;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
// isConfigSupported on Firefox appears to unreliably indicate if encoding will actually succeed. Therefore,
|
|
1130
|
+
// we just try encoding a frame to see if it actually works.
|
|
1131
|
+
// https://github.com/Vanilagy/mediabunny/issues/222
|
|
1132
|
+
|
|
1133
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises, no-async-promise-executor
|
|
1134
|
+
const success = await new Promise<boolean>(async (resolve) => {
|
|
1135
|
+
try {
|
|
1136
|
+
const encoder = new VideoEncoder({
|
|
1137
|
+
output: () => {},
|
|
1138
|
+
error: () => resolve(false),
|
|
1139
|
+
});
|
|
1140
|
+
encoder.configure(config);
|
|
1141
|
+
|
|
1142
|
+
const frameData = new Uint8Array(width * height * 4);
|
|
1143
|
+
const frame = new VideoFrame(frameData, {
|
|
1144
|
+
format: 'RGBA',
|
|
1145
|
+
codedWidth: width,
|
|
1146
|
+
codedHeight: height,
|
|
1147
|
+
timestamp: 0,
|
|
1148
|
+
});
|
|
1149
|
+
|
|
1150
|
+
encoder.encode(
|
|
1151
|
+
frame,
|
|
1152
|
+
quantizer !== null ? buildQuantizerEncodeOptions(codec, quantizer) : undefined,
|
|
1153
|
+
);
|
|
1154
|
+
frame.close();
|
|
1155
|
+
|
|
1156
|
+
await encoder.flush();
|
|
1157
|
+
|
|
1158
|
+
resolve(true);
|
|
1159
|
+
} catch {
|
|
1160
|
+
resolve(false);
|
|
1161
|
+
}
|
|
1162
|
+
});
|
|
1163
|
+
|
|
1164
|
+
if (success) {
|
|
1165
|
+
return true;
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
return false;
|
|
1170
|
+
})();
|
|
1171
|
+
canEncodeVideoMemo.set(key, promise);
|
|
1172
|
+
|
|
1173
|
+
return promise;
|
|
1174
|
+
};
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* Checks if the browser is able to encode the given audio codec with the given parameters.
|
|
1178
|
+
* @group Encoding
|
|
1179
|
+
* @public
|
|
1180
|
+
*/
|
|
1181
|
+
export const canEncodeAudio = async (
|
|
1182
|
+
codec: AudioCodec,
|
|
1183
|
+
options: {
|
|
1184
|
+
numberOfChannels?: number;
|
|
1185
|
+
sampleRate?: number;
|
|
1186
|
+
quality?: Quality;
|
|
1187
|
+
/** @deprecated Use `quality` instead. */
|
|
1188
|
+
bitrate?: number | Quality;
|
|
1189
|
+
} & AudioEncodingAdditionalOptions = {},
|
|
1190
|
+
) => {
|
|
1191
|
+
const {
|
|
1192
|
+
numberOfChannels = 2,
|
|
1193
|
+
sampleRate = 48000,
|
|
1194
|
+
quality,
|
|
1195
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
1196
|
+
bitrate,
|
|
1197
|
+
...restOptions
|
|
1198
|
+
} = options;
|
|
1199
|
+
|
|
1200
|
+
if (!AUDIO_CODECS.includes(codec)) {
|
|
1201
|
+
return false;
|
|
1202
|
+
}
|
|
1203
|
+
if (!Number.isInteger(numberOfChannels) || numberOfChannels <= 0) {
|
|
1204
|
+
throw new TypeError('numberOfChannels must be a positive integer.');
|
|
1205
|
+
}
|
|
1206
|
+
if (!Number.isInteger(sampleRate) || sampleRate <= 0) {
|
|
1207
|
+
throw new TypeError('sampleRate must be a positive integer.');
|
|
1208
|
+
}
|
|
1209
|
+
if (quality !== undefined && !(quality instanceof Quality)) {
|
|
1210
|
+
throw new TypeError('quality, when provided, must be a Quality.');
|
|
1211
|
+
}
|
|
1212
|
+
if (quality !== undefined && bitrate !== undefined) {
|
|
1213
|
+
throw new TypeError('quality and bitrate cannot both be provided.');
|
|
1214
|
+
}
|
|
1215
|
+
if (bitrate !== undefined && !(bitrate instanceof Quality) && (!Number.isInteger(bitrate) || bitrate <= 0)) {
|
|
1216
|
+
throw new TypeError('bitrate must be a positive integer.');
|
|
1217
|
+
}
|
|
1218
|
+
validateAudioEncodingAdditionalOptions(codec, restOptions);
|
|
1219
|
+
|
|
1220
|
+
const resolvedQuality = resolveQuality(quality, bitrate) ?? new Quality({ bitrate: 128e3 });
|
|
1221
|
+
|
|
1222
|
+
const encoderConfig = buildAudioEncoderConfig({
|
|
1223
|
+
codec,
|
|
1224
|
+
numberOfChannels,
|
|
1225
|
+
sampleRate,
|
|
1226
|
+
quality: resolvedQuality,
|
|
1227
|
+
...restOptions,
|
|
1228
|
+
});
|
|
1229
|
+
|
|
1230
|
+
const key = JSON.stringify(encoderConfig);
|
|
1231
|
+
const memoized = canEncodeAudioMemo.get(key);
|
|
1232
|
+
if (memoized) {
|
|
1233
|
+
return memoized;
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
const promise = (async () => {
|
|
1237
|
+
if (customAudioEncoders.some(x => x.supports(codec, encoderConfig))) {
|
|
1238
|
+
// There's a custom encoder
|
|
1239
|
+
return true;
|
|
1240
|
+
}
|
|
1241
|
+
if ((PCM_AUDIO_CODECS as readonly string[]).includes(codec)) {
|
|
1242
|
+
return true; // Because we encode these ourselves
|
|
1243
|
+
}
|
|
1244
|
+
if (typeof AudioEncoder === 'undefined') {
|
|
1245
|
+
return false;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
const support = await AudioEncoder.isConfigSupported(encoderConfig);
|
|
1249
|
+
return support.supported === true;
|
|
1250
|
+
})();
|
|
1251
|
+
canEncodeAudioMemo.set(key, promise);
|
|
1252
|
+
|
|
1253
|
+
return promise;
|
|
1254
|
+
};
|
|
1255
|
+
|
|
1256
|
+
/**
|
|
1257
|
+
* Resolves the `quality` and deprecated `bitrate` fields from the public API into a {@link Quality}, the norm used
|
|
1258
|
+
* internally.
|
|
1259
|
+
*/
|
|
1260
|
+
export const resolveQuality = (quality: Quality | undefined, bitrate: number | Quality | undefined) => {
|
|
1261
|
+
if (quality !== undefined) {
|
|
1262
|
+
return quality;
|
|
1263
|
+
}
|
|
1264
|
+
if (bitrate === undefined) {
|
|
1265
|
+
return undefined;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
return bitrate instanceof Quality ? bitrate : new Quality({ bitrate });
|
|
1269
|
+
};
|
|
1270
|
+
|
|
1271
|
+
/**
|
|
1272
|
+
* Checks if the browser is able to encode the given subtitle codec.
|
|
1273
|
+
* @group Encoding
|
|
1274
|
+
* @public
|
|
1275
|
+
*/
|
|
1276
|
+
export const canEncodeSubtitles = async (codec: SubtitleCodec) => {
|
|
1277
|
+
if (!SUBTITLE_CODECS.includes(codec)) {
|
|
1278
|
+
return false;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
return true;
|
|
1282
|
+
};
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* Returns the list of all media codecs that can be encoded by the browser.
|
|
1286
|
+
* @group Encoding
|
|
1287
|
+
* @public
|
|
1288
|
+
*/
|
|
1289
|
+
export const getEncodableCodecs = async (): Promise<MediaCodec[]> => {
|
|
1290
|
+
const [videoCodecs, audioCodecs, subtitleCodecs] = await Promise.all([
|
|
1291
|
+
getEncodableVideoCodecs(),
|
|
1292
|
+
getEncodableAudioCodecs(),
|
|
1293
|
+
getEncodableSubtitleCodecs(),
|
|
1294
|
+
]);
|
|
1295
|
+
|
|
1296
|
+
return [...videoCodecs, ...audioCodecs, ...subtitleCodecs];
|
|
1297
|
+
};
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* Returns the list of all video codecs that can be encoded by the browser.
|
|
1301
|
+
* @group Encoding
|
|
1302
|
+
* @public
|
|
1303
|
+
*/
|
|
1304
|
+
export const getEncodableVideoCodecs = async (
|
|
1305
|
+
checkedCodecs: VideoCodec[] = VIDEO_CODECS as unknown as VideoCodec[],
|
|
1306
|
+
options?: {
|
|
1307
|
+
width?: number;
|
|
1308
|
+
height?: number;
|
|
1309
|
+
quality?: Quality;
|
|
1310
|
+
/** @deprecated Use `quality` instead. */
|
|
1311
|
+
bitrate?: number | Quality;
|
|
1312
|
+
},
|
|
1313
|
+
): Promise<VideoCodec[]> => {
|
|
1314
|
+
const bools = await Promise.all(checkedCodecs.map(codec => canEncodeVideo(codec, options)));
|
|
1315
|
+
return checkedCodecs.filter((_, i) => bools[i]);
|
|
1316
|
+
};
|
|
1317
|
+
|
|
1318
|
+
/**
|
|
1319
|
+
* Returns the list of all audio codecs that can be encoded by the browser.
|
|
1320
|
+
* @group Encoding
|
|
1321
|
+
* @public
|
|
1322
|
+
*/
|
|
1323
|
+
export const getEncodableAudioCodecs = async (
|
|
1324
|
+
checkedCodecs: AudioCodec[] = AUDIO_CODECS as unknown as AudioCodec[],
|
|
1325
|
+
options?: {
|
|
1326
|
+
numberOfChannels?: number;
|
|
1327
|
+
sampleRate?: number;
|
|
1328
|
+
quality?: Quality;
|
|
1329
|
+
/** @deprecated Use `quality` instead. */
|
|
1330
|
+
bitrate?: number | Quality;
|
|
1331
|
+
},
|
|
1332
|
+
): Promise<AudioCodec[]> => {
|
|
1333
|
+
const bools = await Promise.all(checkedCodecs.map(codec => canEncodeAudio(codec, options)));
|
|
1334
|
+
return checkedCodecs.filter((_, i) => bools[i]);
|
|
1335
|
+
};
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* Returns the list of all subtitle codecs that can be encoded by the browser.
|
|
1339
|
+
* @group Encoding
|
|
1340
|
+
* @public
|
|
1341
|
+
*/
|
|
1342
|
+
export const getEncodableSubtitleCodecs = async (
|
|
1343
|
+
checkedCodecs: SubtitleCodec[] = SUBTITLE_CODECS as unknown as SubtitleCodec[],
|
|
1344
|
+
): Promise<SubtitleCodec[]> => {
|
|
1345
|
+
const bools = await Promise.all(checkedCodecs.map(canEncodeSubtitles));
|
|
1346
|
+
return checkedCodecs.filter((_, i) => bools[i]);
|
|
1347
|
+
};
|
|
1348
|
+
|
|
1349
|
+
/**
|
|
1350
|
+
* Returns the first video codec from the given list that can be encoded by the browser.
|
|
1351
|
+
* @group Encoding
|
|
1352
|
+
* @public
|
|
1353
|
+
*/
|
|
1354
|
+
export const getFirstEncodableVideoCodec = async (
|
|
1355
|
+
checkedCodecs: VideoCodec[],
|
|
1356
|
+
options?: {
|
|
1357
|
+
width?: number;
|
|
1358
|
+
height?: number;
|
|
1359
|
+
quality?: Quality;
|
|
1360
|
+
/** @deprecated Use `quality` instead. */
|
|
1361
|
+
bitrate?: number | Quality;
|
|
1362
|
+
},
|
|
1363
|
+
): Promise<VideoCodec | null> => {
|
|
1364
|
+
for (const codec of checkedCodecs) {
|
|
1365
|
+
if (await canEncodeVideo(codec, options)) {
|
|
1366
|
+
return codec;
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
return null;
|
|
1371
|
+
};
|
|
1372
|
+
|
|
1373
|
+
/**
|
|
1374
|
+
* Returns the first audio codec from the given list that can be encoded by the browser.
|
|
1375
|
+
* @group Encoding
|
|
1376
|
+
* @public
|
|
1377
|
+
*/
|
|
1378
|
+
export const getFirstEncodableAudioCodec = async (
|
|
1379
|
+
checkedCodecs: AudioCodec[],
|
|
1380
|
+
options?: {
|
|
1381
|
+
numberOfChannels?: number;
|
|
1382
|
+
sampleRate?: number;
|
|
1383
|
+
quality?: Quality;
|
|
1384
|
+
/** @deprecated Use `quality` instead. */
|
|
1385
|
+
bitrate?: number | Quality;
|
|
1386
|
+
},
|
|
1387
|
+
): Promise<AudioCodec | null> => {
|
|
1388
|
+
for (const codec of checkedCodecs) {
|
|
1389
|
+
if (await canEncodeAudio(codec, options)) {
|
|
1390
|
+
return codec;
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
return null;
|
|
1395
|
+
};
|
|
1396
|
+
|
|
1397
|
+
/**
|
|
1398
|
+
* Returns the first subtitle codec from the given list that can be encoded by the browser.
|
|
1399
|
+
* @group Encoding
|
|
1400
|
+
* @public
|
|
1401
|
+
*/
|
|
1402
|
+
export const getFirstEncodableSubtitleCodec = async (
|
|
1403
|
+
checkedCodecs: SubtitleCodec[],
|
|
1404
|
+
): Promise<SubtitleCodec | null> => {
|
|
1405
|
+
for (const codec of checkedCodecs) {
|
|
1406
|
+
if (await canEncodeSubtitles(codec)) {
|
|
1407
|
+
return codec;
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
return null;
|
|
1412
|
+
};
|