@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,1360 @@
|
|
|
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 { Bitstream } from '../../shared/bitstream';
|
|
10
|
+
import {
|
|
11
|
+
COLOR_PRIMARIES_MAP,
|
|
12
|
+
MATRIX_COEFFICIENTS_MAP,
|
|
13
|
+
TRANSFER_CHARACTERISTICS_MAP,
|
|
14
|
+
UNDETERMINED_LANGUAGE,
|
|
15
|
+
assert,
|
|
16
|
+
assertNever,
|
|
17
|
+
colorSpaceIsComplete,
|
|
18
|
+
imageMimeTypeToExtension,
|
|
19
|
+
keyValueIterator,
|
|
20
|
+
normalizeRotation,
|
|
21
|
+
promiseWithResolvers,
|
|
22
|
+
Rational,
|
|
23
|
+
simplifyRational,
|
|
24
|
+
textEncoder,
|
|
25
|
+
toUint8Array,
|
|
26
|
+
uint8ArraysAreEqual,
|
|
27
|
+
writeBits,
|
|
28
|
+
roundToDivisor,
|
|
29
|
+
} from '../misc';
|
|
30
|
+
import {
|
|
31
|
+
CODEC_STRING_MAP,
|
|
32
|
+
EBML,
|
|
33
|
+
EBMLElement,
|
|
34
|
+
EBMLFloat32,
|
|
35
|
+
EBMLFloat64,
|
|
36
|
+
EBMLId,
|
|
37
|
+
EBMLSignedInt,
|
|
38
|
+
EBMLUnicodeString,
|
|
39
|
+
EBMLWriter,
|
|
40
|
+
} from './ebml';
|
|
41
|
+
import { buildMatroskaMimeType } from './matroska-misc';
|
|
42
|
+
import { MkvOutputFormat, WebMOutputFormat } from '../output-format';
|
|
43
|
+
import { Output, OutputAudioTrack, OutputSubtitleTrack, OutputTrack, OutputVideoTrack } from '../output';
|
|
44
|
+
import {
|
|
45
|
+
SubtitleConfig,
|
|
46
|
+
SubtitleCue,
|
|
47
|
+
SubtitleMetadata,
|
|
48
|
+
formatSubtitleTimestamp,
|
|
49
|
+
inlineTimestampRegex,
|
|
50
|
+
parseSubtitleTimestamp,
|
|
51
|
+
} from '../subtitles';
|
|
52
|
+
import { aacChannelMap, aacFrequencyTable, buildAacAudioSpecificConfig } from '../../shared/aac-misc';
|
|
53
|
+
import {
|
|
54
|
+
OPUS_SAMPLE_RATE,
|
|
55
|
+
PCM_AUDIO_CODECS,
|
|
56
|
+
PcmAudioCodec,
|
|
57
|
+
SubtitleCodec,
|
|
58
|
+
generateAv1CodecConfigurationFromCodecString,
|
|
59
|
+
generateVp9CodecConfigurationFromCodecString,
|
|
60
|
+
parsePcmCodec,
|
|
61
|
+
validateAudioChunkMetadata,
|
|
62
|
+
validateSubtitleMetadata,
|
|
63
|
+
validateVideoChunkMetadata,
|
|
64
|
+
} from '../codec';
|
|
65
|
+
import { MAX_ADTS_FRAME_HEADER_SIZE, MIN_ADTS_FRAME_HEADER_SIZE, readAdtsFrameHeader } from '../adts/adts-reader';
|
|
66
|
+
import { FileSlice } from '../reader';
|
|
67
|
+
import { Muxer } from '../muxer';
|
|
68
|
+
import { Writer } from '../writer';
|
|
69
|
+
import { EncodedPacket } from '../packet';
|
|
70
|
+
import { parseOpusIdentificationHeader } from '../codec-data';
|
|
71
|
+
import { AttachedFile } from '../metadata';
|
|
72
|
+
|
|
73
|
+
const MIN_CLUSTER_TIMESTAMP_MS = -(2 ** 15);
|
|
74
|
+
const MAX_CLUSTER_TIMESTAMP_MS = 2 ** 15 - 1;
|
|
75
|
+
const APP_NAME = 'Mediabunny';
|
|
76
|
+
const SEGMENT_SIZE_BYTES = 6;
|
|
77
|
+
const CLUSTER_SIZE_BYTES = 5;
|
|
78
|
+
|
|
79
|
+
type InternalMediaChunk = {
|
|
80
|
+
data: Uint8Array;
|
|
81
|
+
type: 'key' | 'delta';
|
|
82
|
+
timestamp: number;
|
|
83
|
+
duration: number;
|
|
84
|
+
additions: Uint8Array | null;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
type MatroskaTrackData = {
|
|
88
|
+
chunkQueue: InternalMediaChunk[];
|
|
89
|
+
lastWrittenMsTimestamp: number | null;
|
|
90
|
+
codecPrivate: AllowSharedBufferSource | null;
|
|
91
|
+
closed: boolean;
|
|
92
|
+
} & ({
|
|
93
|
+
track: OutputVideoTrack;
|
|
94
|
+
type: 'video';
|
|
95
|
+
info: {
|
|
96
|
+
width: number;
|
|
97
|
+
height: number;
|
|
98
|
+
aspectRatio: Rational | null;
|
|
99
|
+
decoderConfig: VideoDecoderConfig;
|
|
100
|
+
alphaMode: boolean;
|
|
101
|
+
};
|
|
102
|
+
} | {
|
|
103
|
+
track: OutputAudioTrack;
|
|
104
|
+
type: 'audio';
|
|
105
|
+
info: {
|
|
106
|
+
numberOfChannels: number;
|
|
107
|
+
sampleRate: number;
|
|
108
|
+
decoderConfig: AudioDecoderConfig;
|
|
109
|
+
/**
|
|
110
|
+
* The "ADTS stripping" involves removing the ADTS header from each AAC packet. SOBMFF stores raw AAC data, not
|
|
111
|
+
* ADTS-wrapped data.
|
|
112
|
+
*/
|
|
113
|
+
requiresAdtsStripping: boolean;
|
|
114
|
+
};
|
|
115
|
+
} | {
|
|
116
|
+
track: OutputSubtitleTrack;
|
|
117
|
+
type: 'subtitle';
|
|
118
|
+
info: {
|
|
119
|
+
config: SubtitleConfig;
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
type MatroskaVideoTrackData = MatroskaTrackData & { type: 'video' };
|
|
124
|
+
type MatroskaAudioTrackData = MatroskaTrackData & { type: 'audio' };
|
|
125
|
+
type MatroskaSubtitleTrackData = MatroskaTrackData & { type: 'subtitle' };
|
|
126
|
+
|
|
127
|
+
const TRACK_TYPE_MAP: Record<OutputTrack['type'], number> = {
|
|
128
|
+
video: 1,
|
|
129
|
+
audio: 2,
|
|
130
|
+
subtitle: 17,
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export class MatroskaMuxer extends Muxer {
|
|
134
|
+
private writer!: Writer;
|
|
135
|
+
private ebmlWriter!: EBMLWriter;
|
|
136
|
+
private format: WebMOutputFormat | MkvOutputFormat;
|
|
137
|
+
|
|
138
|
+
private trackDatas: MatroskaTrackData[] = [];
|
|
139
|
+
private allTracksKnown = promiseWithResolvers();
|
|
140
|
+
|
|
141
|
+
private segment: EBMLElement | null = null;
|
|
142
|
+
private segmentInfo: EBMLElement | null = null;
|
|
143
|
+
private seekHead: EBMLElement | null = null;
|
|
144
|
+
private tracksElement: EBMLElement | null = null;
|
|
145
|
+
private tagsElement: EBMLElement | null = null;
|
|
146
|
+
private attachmentsElement: EBMLElement | null = null;
|
|
147
|
+
private segmentDuration: EBMLElement | null = null;
|
|
148
|
+
private cues: EBMLElement | null = null;
|
|
149
|
+
|
|
150
|
+
private currentCluster: EBMLElement | null = null;
|
|
151
|
+
private currentClusterStartMsTimestamp: number | null = null;
|
|
152
|
+
private currentClusterMaxMsTimestamp: number | null = null;
|
|
153
|
+
private trackDatasInCurrentCluster = new Map<MatroskaTrackData, {
|
|
154
|
+
firstMsTimestamp: number;
|
|
155
|
+
}>();
|
|
156
|
+
|
|
157
|
+
private startTimestamp = Infinity;
|
|
158
|
+
private endTimestamp = -Infinity;
|
|
159
|
+
|
|
160
|
+
constructor(output: Output, format: MkvOutputFormat) {
|
|
161
|
+
super(output);
|
|
162
|
+
|
|
163
|
+
this.format = format;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
async start() {
|
|
167
|
+
const release = await this.mutex.acquire();
|
|
168
|
+
|
|
169
|
+
this.writer = await this.output._getRootWriter(!!this.format._options.appendOnly);
|
|
170
|
+
this.ebmlWriter = new EBMLWriter(this.writer);
|
|
171
|
+
|
|
172
|
+
this.writeEBMLHeader();
|
|
173
|
+
|
|
174
|
+
this.createSegmentInfo();
|
|
175
|
+
this.createCues();
|
|
176
|
+
|
|
177
|
+
await this.writer.flush();
|
|
178
|
+
|
|
179
|
+
release();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
private writeEBMLHeader() {
|
|
183
|
+
if (this.format._options.onEbmlHeader) {
|
|
184
|
+
this.writer.startTrackingWrites();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const ebmlHeader: EBML = { id: EBMLId.EBML, data: [
|
|
188
|
+
{ id: EBMLId.EBMLVersion, data: 1 },
|
|
189
|
+
{ id: EBMLId.EBMLReadVersion, data: 1 },
|
|
190
|
+
{ id: EBMLId.EBMLMaxIDLength, data: 4 },
|
|
191
|
+
{ id: EBMLId.EBMLMaxSizeLength, data: 8 },
|
|
192
|
+
{ id: EBMLId.DocType, data: this.format instanceof WebMOutputFormat ? 'webm' : 'matroska' },
|
|
193
|
+
{ id: EBMLId.DocTypeVersion, data: 2 },
|
|
194
|
+
{ id: EBMLId.DocTypeReadVersion, data: 2 },
|
|
195
|
+
] };
|
|
196
|
+
this.ebmlWriter.writeEBML(ebmlHeader);
|
|
197
|
+
|
|
198
|
+
if (this.format._options.onEbmlHeader) {
|
|
199
|
+
const { data, start } = this.writer.stopTrackingWrites(); // start should be 0
|
|
200
|
+
this.format._options.onEbmlHeader(data, start);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Creates a SeekHead element which is positioned near the start of the file and allows the media player to seek to
|
|
206
|
+
* relevant sections more easily. Since we don't know the positions of those sections yet, we'll set them later.
|
|
207
|
+
*/
|
|
208
|
+
private maybeCreateSeekHead(writeOffsets: boolean) {
|
|
209
|
+
if (this.format._options.appendOnly) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const kaxCues = new Uint8Array([0x1c, 0x53, 0xbb, 0x6b]);
|
|
214
|
+
const kaxInfo = new Uint8Array([0x15, 0x49, 0xa9, 0x66]);
|
|
215
|
+
const kaxTracks = new Uint8Array([0x16, 0x54, 0xae, 0x6b]);
|
|
216
|
+
const kaxAttachments = new Uint8Array([0x19, 0x41, 0xa4, 0x69]);
|
|
217
|
+
const kaxTags = new Uint8Array([0x12, 0x54, 0xc3, 0x67]);
|
|
218
|
+
|
|
219
|
+
const seekHead = { id: EBMLId.SeekHead, data: [
|
|
220
|
+
{ id: EBMLId.Seek, data: [
|
|
221
|
+
{ id: EBMLId.SeekID, data: kaxCues },
|
|
222
|
+
{
|
|
223
|
+
id: EBMLId.SeekPosition,
|
|
224
|
+
size: 5,
|
|
225
|
+
data: writeOffsets
|
|
226
|
+
? this.ebmlWriter.offsets.get(this.cues!)! - this.segmentDataOffset
|
|
227
|
+
: 0,
|
|
228
|
+
},
|
|
229
|
+
] },
|
|
230
|
+
{ id: EBMLId.Seek, data: [
|
|
231
|
+
{ id: EBMLId.SeekID, data: kaxInfo },
|
|
232
|
+
{
|
|
233
|
+
id: EBMLId.SeekPosition,
|
|
234
|
+
size: 5,
|
|
235
|
+
data: writeOffsets
|
|
236
|
+
? this.ebmlWriter.offsets.get(this.segmentInfo!)! - this.segmentDataOffset
|
|
237
|
+
: 0,
|
|
238
|
+
},
|
|
239
|
+
] },
|
|
240
|
+
{ id: EBMLId.Seek, data: [
|
|
241
|
+
{ id: EBMLId.SeekID, data: kaxTracks },
|
|
242
|
+
{
|
|
243
|
+
id: EBMLId.SeekPosition,
|
|
244
|
+
size: 5,
|
|
245
|
+
data: writeOffsets
|
|
246
|
+
? this.ebmlWriter.offsets.get(this.tracksElement!)! - this.segmentDataOffset
|
|
247
|
+
: 0,
|
|
248
|
+
},
|
|
249
|
+
] },
|
|
250
|
+
this.attachmentsElement
|
|
251
|
+
? { id: EBMLId.Seek, data: [
|
|
252
|
+
{ id: EBMLId.SeekID, data: kaxAttachments },
|
|
253
|
+
{
|
|
254
|
+
id: EBMLId.SeekPosition,
|
|
255
|
+
size: 5,
|
|
256
|
+
data: writeOffsets
|
|
257
|
+
? this.ebmlWriter.offsets.get(this.attachmentsElement)! - this.segmentDataOffset
|
|
258
|
+
: 0,
|
|
259
|
+
},
|
|
260
|
+
] }
|
|
261
|
+
: null,
|
|
262
|
+
this.tagsElement
|
|
263
|
+
? { id: EBMLId.Seek, data: [
|
|
264
|
+
{ id: EBMLId.SeekID, data: kaxTags },
|
|
265
|
+
{
|
|
266
|
+
id: EBMLId.SeekPosition,
|
|
267
|
+
size: 5,
|
|
268
|
+
data: writeOffsets
|
|
269
|
+
? this.ebmlWriter.offsets.get(this.tagsElement)! - this.segmentDataOffset
|
|
270
|
+
: 0,
|
|
271
|
+
},
|
|
272
|
+
] }
|
|
273
|
+
: null,
|
|
274
|
+
] };
|
|
275
|
+
this.seekHead = seekHead;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
private createSegmentInfo() {
|
|
279
|
+
const segmentDuration: EBML = { id: EBMLId.Duration, data: new EBMLFloat64(0) };
|
|
280
|
+
this.segmentDuration = segmentDuration;
|
|
281
|
+
|
|
282
|
+
const segmentInfo: EBML = { id: EBMLId.Info, data: [
|
|
283
|
+
{ id: EBMLId.TimestampScale, data: 1e6 },
|
|
284
|
+
{ id: EBMLId.MuxingApp, data: APP_NAME },
|
|
285
|
+
{ id: EBMLId.WritingApp, data: APP_NAME },
|
|
286
|
+
!this.format._options.appendOnly ? segmentDuration : null,
|
|
287
|
+
] };
|
|
288
|
+
this.segmentInfo = segmentInfo;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
private createTracks() {
|
|
292
|
+
const tracksElement = { id: EBMLId.Tracks, data: [] as EBML[] };
|
|
293
|
+
this.tracksElement = tracksElement;
|
|
294
|
+
|
|
295
|
+
for (const trackData of this.trackDatas) {
|
|
296
|
+
const codecId = CODEC_STRING_MAP[trackData.track.source._codec];
|
|
297
|
+
assert(codecId);
|
|
298
|
+
|
|
299
|
+
let seekPreRollNs = 0;
|
|
300
|
+
if (trackData.type === 'audio' && trackData.track.source._codec === 'opus') {
|
|
301
|
+
seekPreRollNs = 1e6 * 80; // In "Matroska ticks" (nanoseconds)
|
|
302
|
+
|
|
303
|
+
const description = trackData.info.decoderConfig.description;
|
|
304
|
+
if (description) {
|
|
305
|
+
const bytes = toUint8Array(description);
|
|
306
|
+
const header = parseOpusIdentificationHeader(bytes);
|
|
307
|
+
|
|
308
|
+
// Use the preSkip value from the header
|
|
309
|
+
seekPreRollNs = Math.round(1e9 * (header.preSkip / OPUS_SAMPLE_RATE));
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
tracksElement.data.push({ id: EBMLId.TrackEntry, data: [
|
|
314
|
+
{ id: EBMLId.TrackNumber, data: trackData.track.id },
|
|
315
|
+
{ id: EBMLId.TrackUID, data: trackData.track.id },
|
|
316
|
+
{ id: EBMLId.TrackType, data: TRACK_TYPE_MAP[trackData.type] },
|
|
317
|
+
trackData.track.metadata.disposition?.default === false
|
|
318
|
+
? { id: EBMLId.FlagDefault, data: 0 }
|
|
319
|
+
: null,
|
|
320
|
+
trackData.track.metadata.disposition?.forced
|
|
321
|
+
? { id: EBMLId.FlagForced, data: 1 }
|
|
322
|
+
: null,
|
|
323
|
+
trackData.track.metadata.disposition?.hearingImpaired
|
|
324
|
+
? { id: EBMLId.FlagHearingImpaired, data: 1 }
|
|
325
|
+
: null,
|
|
326
|
+
trackData.track.metadata.disposition?.visuallyImpaired
|
|
327
|
+
? { id: EBMLId.FlagVisualImpaired, data: 1 }
|
|
328
|
+
: null,
|
|
329
|
+
trackData.track.metadata.disposition?.original
|
|
330
|
+
? { id: EBMLId.FlagOriginal, data: 1 }
|
|
331
|
+
: null,
|
|
332
|
+
trackData.track.metadata.disposition?.commentary
|
|
333
|
+
? { id: EBMLId.FlagCommentary, data: 1 }
|
|
334
|
+
: null,
|
|
335
|
+
{ id: EBMLId.FlagLacing, data: 0 },
|
|
336
|
+
{ id: EBMLId.Language, data: trackData.track.metadata.languageCode ?? UNDETERMINED_LANGUAGE },
|
|
337
|
+
{ id: EBMLId.CodecID, data: codecId },
|
|
338
|
+
trackData.codecPrivate
|
|
339
|
+
? { id: EBMLId.CodecPrivate, data: toUint8Array(trackData.codecPrivate) }
|
|
340
|
+
: null,
|
|
341
|
+
{ id: EBMLId.CodecDelay, data: 0 },
|
|
342
|
+
{ id: EBMLId.SeekPreRoll, data: seekPreRollNs },
|
|
343
|
+
trackData.track.metadata.name !== undefined
|
|
344
|
+
? { id: EBMLId.Name, data: new EBMLUnicodeString(trackData.track.metadata.name) }
|
|
345
|
+
: null,
|
|
346
|
+
(trackData.type === 'video' ? this.videoSpecificTrackInfo(trackData) : null),
|
|
347
|
+
(trackData.type === 'audio' ? this.audioSpecificTrackInfo(trackData) : null),
|
|
348
|
+
(trackData.type === 'subtitle' ? this.subtitleSpecificTrackInfo(trackData) : null),
|
|
349
|
+
] });
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
private videoSpecificTrackInfo(trackData: MatroskaVideoTrackData) {
|
|
354
|
+
const { frameRate, rotation } = trackData.track.metadata;
|
|
355
|
+
|
|
356
|
+
const elements: EBMLElement['data'] = [
|
|
357
|
+
(frameRate
|
|
358
|
+
? {
|
|
359
|
+
id: EBMLId.DefaultDuration,
|
|
360
|
+
data: 1e9 / frameRate,
|
|
361
|
+
}
|
|
362
|
+
: null),
|
|
363
|
+
];
|
|
364
|
+
|
|
365
|
+
// Convert from clockwise to counter-clockwise
|
|
366
|
+
const flippedRotation = rotation ? normalizeRotation(-rotation) : 0;
|
|
367
|
+
|
|
368
|
+
const hasNonSquarePixelAspectRatio
|
|
369
|
+
= !!trackData.info.aspectRatio && (
|
|
370
|
+
trackData.info.aspectRatio.num * trackData.info.height
|
|
371
|
+
!== trackData.info.aspectRatio.den * trackData.info.width
|
|
372
|
+
);
|
|
373
|
+
|
|
374
|
+
const colorSpace = trackData.info.decoderConfig.colorSpace;
|
|
375
|
+
const videoElement: EBMLElement = { id: EBMLId.Video, data: [
|
|
376
|
+
{ id: EBMLId.PixelWidth, data: trackData.info.width },
|
|
377
|
+
{ id: EBMLId.PixelHeight, data: trackData.info.height },
|
|
378
|
+
(hasNonSquarePixelAspectRatio ? { id: EBMLId.DisplayWidth, data: trackData.info.aspectRatio!.num } : null),
|
|
379
|
+
(hasNonSquarePixelAspectRatio ? { id: EBMLId.DisplayHeight, data: trackData.info.aspectRatio!.den } : null),
|
|
380
|
+
(hasNonSquarePixelAspectRatio ? { id: EBMLId.DisplayUnit, data: 3 } : null), // 3 = display aspect ratio
|
|
381
|
+
trackData.info.alphaMode ? { id: EBMLId.AlphaMode, data: 1 } : null,
|
|
382
|
+
(colorSpaceIsComplete(colorSpace)
|
|
383
|
+
? {
|
|
384
|
+
id: EBMLId.Colour,
|
|
385
|
+
data: [
|
|
386
|
+
{
|
|
387
|
+
id: EBMLId.MatrixCoefficients,
|
|
388
|
+
data: MATRIX_COEFFICIENTS_MAP[colorSpace.matrix],
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
id: EBMLId.TransferCharacteristics,
|
|
392
|
+
data: TRANSFER_CHARACTERISTICS_MAP[colorSpace.transfer],
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
id: EBMLId.Primaries,
|
|
396
|
+
data: COLOR_PRIMARIES_MAP[colorSpace.primaries],
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
id: EBMLId.Range,
|
|
400
|
+
data: colorSpace.fullRange ? 2 : 1,
|
|
401
|
+
},
|
|
402
|
+
],
|
|
403
|
+
}
|
|
404
|
+
: null),
|
|
405
|
+
(flippedRotation
|
|
406
|
+
? {
|
|
407
|
+
id: EBMLId.Projection,
|
|
408
|
+
data: [
|
|
409
|
+
{
|
|
410
|
+
id: EBMLId.ProjectionType,
|
|
411
|
+
data: 0, // rectangular
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
id: EBMLId.ProjectionPoseRoll,
|
|
415
|
+
data: new EBMLFloat32((flippedRotation + 180) % 360 - 180), // [0, 270] -> [-180, 90]
|
|
416
|
+
},
|
|
417
|
+
],
|
|
418
|
+
}
|
|
419
|
+
: null),
|
|
420
|
+
] };
|
|
421
|
+
|
|
422
|
+
elements.push(videoElement);
|
|
423
|
+
|
|
424
|
+
return elements;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
private audioSpecificTrackInfo(trackData: MatroskaAudioTrackData) {
|
|
428
|
+
const pcmInfo = (PCM_AUDIO_CODECS as readonly string[]).includes(trackData.track.source._codec)
|
|
429
|
+
? parsePcmCodec(trackData.track.source._codec as PcmAudioCodec)
|
|
430
|
+
: null;
|
|
431
|
+
|
|
432
|
+
return [
|
|
433
|
+
{ id: EBMLId.Audio, data: [
|
|
434
|
+
{ id: EBMLId.SamplingFrequency, data: new EBMLFloat32(trackData.info.sampleRate) },
|
|
435
|
+
{ id: EBMLId.Channels, data: trackData.info.numberOfChannels },
|
|
436
|
+
pcmInfo ? { id: EBMLId.BitDepth, data: 8 * pcmInfo.sampleSize } : null,
|
|
437
|
+
] },
|
|
438
|
+
];
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
442
|
+
private subtitleSpecificTrackInfo(trackData: MatroskaSubtitleTrackData) {
|
|
443
|
+
return [];
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
private maybeCreateTags() {
|
|
447
|
+
const simpleTags: EBMLElement[] = [];
|
|
448
|
+
|
|
449
|
+
const addSimpleTag = (key: string, value: string | Uint8Array) => {
|
|
450
|
+
simpleTags.push({ id: EBMLId.SimpleTag, data: [
|
|
451
|
+
{ id: EBMLId.TagName, data: new EBMLUnicodeString(key) },
|
|
452
|
+
typeof value === 'string'
|
|
453
|
+
? { id: EBMLId.TagString, data: new EBMLUnicodeString(value) }
|
|
454
|
+
: { id: EBMLId.TagBinary, data: value },
|
|
455
|
+
] });
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
const metadataTags = this.output._metadataTags;
|
|
459
|
+
const writtenTags = new Set<string>();
|
|
460
|
+
|
|
461
|
+
for (const { key, value } of keyValueIterator(metadataTags)) {
|
|
462
|
+
switch (key) {
|
|
463
|
+
case 'title': {
|
|
464
|
+
addSimpleTag('TITLE', value);
|
|
465
|
+
writtenTags.add('TITLE');
|
|
466
|
+
}; break;
|
|
467
|
+
|
|
468
|
+
case 'description': {
|
|
469
|
+
addSimpleTag('DESCRIPTION', value);
|
|
470
|
+
writtenTags.add('DESCRIPTION');
|
|
471
|
+
}; break;
|
|
472
|
+
|
|
473
|
+
case 'artist': {
|
|
474
|
+
addSimpleTag('ARTIST', value);
|
|
475
|
+
writtenTags.add('ARTIST');
|
|
476
|
+
}; break;
|
|
477
|
+
|
|
478
|
+
case 'album': {
|
|
479
|
+
addSimpleTag('ALBUM', value);
|
|
480
|
+
writtenTags.add('ALBUM');
|
|
481
|
+
}; break;
|
|
482
|
+
|
|
483
|
+
case 'albumArtist': {
|
|
484
|
+
addSimpleTag('ALBUM_ARTIST', value);
|
|
485
|
+
writtenTags.add('ALBUM_ARTIST');
|
|
486
|
+
}; break;
|
|
487
|
+
|
|
488
|
+
case 'genre': {
|
|
489
|
+
addSimpleTag('GENRE', value);
|
|
490
|
+
writtenTags.add('GENRE');
|
|
491
|
+
}; break;
|
|
492
|
+
|
|
493
|
+
case 'comment': {
|
|
494
|
+
addSimpleTag('COMMENT', value);
|
|
495
|
+
writtenTags.add('COMMENT');
|
|
496
|
+
}; break;
|
|
497
|
+
|
|
498
|
+
case 'lyrics': {
|
|
499
|
+
addSimpleTag('LYRICS', value);
|
|
500
|
+
writtenTags.add('LYRICS');
|
|
501
|
+
}; break;
|
|
502
|
+
|
|
503
|
+
case 'date': {
|
|
504
|
+
addSimpleTag('DATE', value.toISOString().slice(0, 10));
|
|
505
|
+
writtenTags.add('DATE');
|
|
506
|
+
}; break;
|
|
507
|
+
|
|
508
|
+
case 'trackNumber': {
|
|
509
|
+
const string = metadataTags.tracksTotal !== undefined
|
|
510
|
+
? `${value}/${metadataTags.tracksTotal}`
|
|
511
|
+
: value.toString();
|
|
512
|
+
|
|
513
|
+
addSimpleTag('PART_NUMBER', string);
|
|
514
|
+
writtenTags.add('PART_NUMBER');
|
|
515
|
+
}; break;
|
|
516
|
+
|
|
517
|
+
case 'discNumber': {
|
|
518
|
+
const string = metadataTags.discsTotal !== undefined
|
|
519
|
+
? `${value}/${metadataTags.discsTotal}`
|
|
520
|
+
: value.toString();
|
|
521
|
+
|
|
522
|
+
addSimpleTag('DISC', string);
|
|
523
|
+
writtenTags.add('DISC');
|
|
524
|
+
}; break;
|
|
525
|
+
|
|
526
|
+
case 'tracksTotal':
|
|
527
|
+
case 'discsTotal': {
|
|
528
|
+
// Handled with trackNumber and discNumber respectively
|
|
529
|
+
}; break;
|
|
530
|
+
|
|
531
|
+
case 'images':
|
|
532
|
+
case 'raw': {
|
|
533
|
+
// Handled elsewhere
|
|
534
|
+
}; break;
|
|
535
|
+
|
|
536
|
+
default: assertNever(key);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
if (metadataTags.raw) {
|
|
541
|
+
for (const key in metadataTags.raw) {
|
|
542
|
+
const value = metadataTags.raw[key]!;
|
|
543
|
+
if (value == null || writtenTags.has(key)) {
|
|
544
|
+
continue;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
if (typeof value === 'string' || value instanceof Uint8Array) {
|
|
548
|
+
addSimpleTag(key, value);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
if (simpleTags.length === 0) {
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
this.tagsElement = {
|
|
558
|
+
id: EBMLId.Tags,
|
|
559
|
+
data: [{ id: EBMLId.Tag, data: [
|
|
560
|
+
{ id: EBMLId.Targets, data: [
|
|
561
|
+
{ id: EBMLId.TargetTypeValue, data: 50 },
|
|
562
|
+
{ id: EBMLId.TargetType, data: 'MOVIE' },
|
|
563
|
+
] },
|
|
564
|
+
...simpleTags,
|
|
565
|
+
] }],
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
private maybeCreateAttachments() {
|
|
570
|
+
const metadataTags = this.output._metadataTags;
|
|
571
|
+
const elements: EBMLElement[] = [];
|
|
572
|
+
|
|
573
|
+
const existingFileUids = new Set<bigint>();
|
|
574
|
+
const images = metadataTags.images ?? [];
|
|
575
|
+
|
|
576
|
+
for (const image of images) {
|
|
577
|
+
let imageName = image.name;
|
|
578
|
+
if (imageName === undefined) {
|
|
579
|
+
const baseName = image.kind === 'coverFront' ? 'cover' : image.kind === 'coverBack' ? 'back' : 'image';
|
|
580
|
+
imageName = baseName + (imageMimeTypeToExtension(image.mimeType) ?? '');
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
let fileUid: bigint;
|
|
584
|
+
while (true) {
|
|
585
|
+
// Generate a random 64-bit unsigned integer
|
|
586
|
+
fileUid = 0n;
|
|
587
|
+
for (let i = 0; i < 8; i++) {
|
|
588
|
+
fileUid <<= 8n;
|
|
589
|
+
fileUid |= BigInt(Math.floor(Math.random() * 256));
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
if (fileUid !== 0n && !existingFileUids.has(fileUid)) {
|
|
593
|
+
break;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
existingFileUids.add(fileUid);
|
|
598
|
+
|
|
599
|
+
elements.push({
|
|
600
|
+
id: EBMLId.AttachedFile,
|
|
601
|
+
data: [
|
|
602
|
+
image.description !== undefined
|
|
603
|
+
? { id: EBMLId.FileDescription, data: new EBMLUnicodeString(image.description) }
|
|
604
|
+
: null,
|
|
605
|
+
{ id: EBMLId.FileName, data: new EBMLUnicodeString(imageName) },
|
|
606
|
+
{ id: EBMLId.FileMediaType, data: image.mimeType },
|
|
607
|
+
{ id: EBMLId.FileData, data: image.data },
|
|
608
|
+
{ id: EBMLId.FileUID, data: fileUid },
|
|
609
|
+
],
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
// Add all AttachedFiles from the raw metadata
|
|
614
|
+
for (const [key, value] of Object.entries(metadataTags.raw ?? {})) {
|
|
615
|
+
if (!(value instanceof AttachedFile)) {
|
|
616
|
+
continue;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
const keyIsNumeric = /^\d+$/.test(key);
|
|
620
|
+
if (!keyIsNumeric) {
|
|
621
|
+
continue;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
if (images.find(x => x.mimeType === value.mimeType && uint8ArraysAreEqual(x.data, value.data))) {
|
|
625
|
+
// This attached file has very likely already been added as an image above
|
|
626
|
+
// (happens when remuxing Matroska)
|
|
627
|
+
continue;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
elements.push({
|
|
631
|
+
id: EBMLId.AttachedFile,
|
|
632
|
+
data: [
|
|
633
|
+
value.description !== undefined
|
|
634
|
+
? { id: EBMLId.FileDescription, data: new EBMLUnicodeString(value.description) }
|
|
635
|
+
: null,
|
|
636
|
+
{ id: EBMLId.FileName, data: new EBMLUnicodeString(value.name ?? '') },
|
|
637
|
+
{ id: EBMLId.FileMediaType, data: value.mimeType ?? '' },
|
|
638
|
+
{ id: EBMLId.FileData, data: value.data },
|
|
639
|
+
{ id: EBMLId.FileUID, data: BigInt(key) },
|
|
640
|
+
],
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
if (elements.length === 0) {
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
this.attachmentsElement = { id: EBMLId.Attachments, data: elements };
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
private createSegment() {
|
|
652
|
+
this.createTracks();
|
|
653
|
+
this.maybeCreateTags();
|
|
654
|
+
this.maybeCreateAttachments();
|
|
655
|
+
this.maybeCreateSeekHead(false);
|
|
656
|
+
|
|
657
|
+
const segment: EBML = {
|
|
658
|
+
id: EBMLId.Segment,
|
|
659
|
+
size: this.format._options.appendOnly ? -1 : SEGMENT_SIZE_BYTES,
|
|
660
|
+
data: [
|
|
661
|
+
this.seekHead, // null if append-only
|
|
662
|
+
this.segmentInfo,
|
|
663
|
+
this.tracksElement,
|
|
664
|
+
// Matroska spec says put this at the end of the file, but I think placing it before the first cluster
|
|
665
|
+
// makes more sense, and FFmpeg agrees (argumentum ad ffmpegum fallacy)
|
|
666
|
+
this.attachmentsElement,
|
|
667
|
+
this.tagsElement,
|
|
668
|
+
],
|
|
669
|
+
};
|
|
670
|
+
this.segment = segment;
|
|
671
|
+
|
|
672
|
+
if (this.format._options.onSegmentHeader) {
|
|
673
|
+
this.writer.startTrackingWrites();
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
this.ebmlWriter.writeEBML(segment);
|
|
677
|
+
|
|
678
|
+
if (this.format._options.onSegmentHeader) {
|
|
679
|
+
const { data, start } = this.writer.stopTrackingWrites();
|
|
680
|
+
this.format._options.onSegmentHeader(data, start);
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
private createCues() {
|
|
685
|
+
this.cues = { id: EBMLId.Cues, data: [] };
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
private get segmentDataOffset() {
|
|
689
|
+
assert(this.segment);
|
|
690
|
+
return this.ebmlWriter.dataOffsets.get(this.segment)!;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
private allTracksAreKnown() {
|
|
694
|
+
for (const track of this.output.tracks) {
|
|
695
|
+
if (!track.source._closed && !this.trackDatas.some(x => x.track === track)) {
|
|
696
|
+
return false; // We haven't seen a sample from this open track yet
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
return true;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
async getMimeType() {
|
|
704
|
+
await this.allTracksKnown.promise;
|
|
705
|
+
|
|
706
|
+
const codecStrings = this.trackDatas.map((trackData) => {
|
|
707
|
+
if (trackData.type === 'video') {
|
|
708
|
+
return trackData.info.decoderConfig.codec;
|
|
709
|
+
} else if (trackData.type === 'audio') {
|
|
710
|
+
return trackData.info.decoderConfig.codec;
|
|
711
|
+
} else {
|
|
712
|
+
const map: Record<SubtitleCodec, string> = {
|
|
713
|
+
webvtt: 'wvtt',
|
|
714
|
+
};
|
|
715
|
+
return map[trackData.track.source._codec];
|
|
716
|
+
}
|
|
717
|
+
});
|
|
718
|
+
|
|
719
|
+
return buildMatroskaMimeType({
|
|
720
|
+
isWebM: this.format instanceof WebMOutputFormat,
|
|
721
|
+
hasVideo: this.trackDatas.some(x => x.type === 'video'),
|
|
722
|
+
hasAudio: this.trackDatas.some(x => x.type === 'audio'),
|
|
723
|
+
codecStrings,
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
private getVideoTrackData(track: OutputVideoTrack, packet: EncodedPacket, meta?: EncodedVideoChunkMetadata) {
|
|
728
|
+
const existingTrackData = this.trackDatas.find(x => x.track === track);
|
|
729
|
+
if (existingTrackData) {
|
|
730
|
+
return existingTrackData as MatroskaVideoTrackData;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
validateVideoChunkMetadata(meta);
|
|
734
|
+
|
|
735
|
+
assert(meta);
|
|
736
|
+
assert(meta.decoderConfig);
|
|
737
|
+
assert(meta.decoderConfig.codedWidth !== undefined);
|
|
738
|
+
assert(meta.decoderConfig.codedHeight !== undefined);
|
|
739
|
+
|
|
740
|
+
const displayAspectWidth = meta.decoderConfig.displayAspectWidth;
|
|
741
|
+
const displayAspectHeight = meta.decoderConfig.displayAspectHeight;
|
|
742
|
+
|
|
743
|
+
const aspectRatio = displayAspectWidth === undefined || displayAspectHeight === undefined
|
|
744
|
+
? null
|
|
745
|
+
: simplifyRational({
|
|
746
|
+
num: displayAspectWidth,
|
|
747
|
+
den: displayAspectHeight,
|
|
748
|
+
});
|
|
749
|
+
|
|
750
|
+
const newTrackData: MatroskaVideoTrackData = {
|
|
751
|
+
track,
|
|
752
|
+
type: 'video',
|
|
753
|
+
info: {
|
|
754
|
+
width: meta.decoderConfig.codedWidth,
|
|
755
|
+
height: meta.decoderConfig.codedHeight,
|
|
756
|
+
aspectRatio,
|
|
757
|
+
decoderConfig: meta.decoderConfig,
|
|
758
|
+
alphaMode: !!packet.sideData.alpha, // The first packet determines if this track has alpha or not
|
|
759
|
+
},
|
|
760
|
+
chunkQueue: [],
|
|
761
|
+
lastWrittenMsTimestamp: null,
|
|
762
|
+
codecPrivate: meta.decoderConfig.description ?? null,
|
|
763
|
+
closed: false,
|
|
764
|
+
};
|
|
765
|
+
|
|
766
|
+
if (track.source._codec === 'vp9') {
|
|
767
|
+
// https://www.webmproject.org/docs/container specifies that VP9 "SHOULD" make use of the CodecPrivate
|
|
768
|
+
// field. Since WebCodecs makes no use of the description field for VP9, we need to derive it ourselves:
|
|
769
|
+
newTrackData.codecPrivate = new Uint8Array(
|
|
770
|
+
generateVp9CodecConfigurationFromCodecString(newTrackData.info.decoderConfig.codec),
|
|
771
|
+
);
|
|
772
|
+
} else if (track.source._codec === 'av1') {
|
|
773
|
+
// Per https://github.com/ietf-wg-cellar/matroska-specification/blob/master/codec/av1.md, AV1 requires
|
|
774
|
+
// CodecPrivate to be set, but WebCodecs makes no use of the description field for AV1. Thus, let's derive
|
|
775
|
+
// it ourselves:
|
|
776
|
+
newTrackData.codecPrivate = new Uint8Array(
|
|
777
|
+
generateAv1CodecConfigurationFromCodecString(newTrackData.info.decoderConfig.codec),
|
|
778
|
+
);
|
|
779
|
+
} else if (track.source._codec === 'prores') {
|
|
780
|
+
// "The Private Data contains the FourCC as found in MP4 movies"
|
|
781
|
+
newTrackData.codecPrivate = textEncoder.encode(meta.decoderConfig.codec);
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
this.trackDatas.push(newTrackData);
|
|
785
|
+
this.trackDatas.sort((a, b) => a.track.id - b.track.id);
|
|
786
|
+
|
|
787
|
+
if (this.allTracksAreKnown()) {
|
|
788
|
+
this.allTracksKnown.resolve();
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
return newTrackData;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
private getAudioTrackData(track: OutputAudioTrack, packet: EncodedPacket, meta?: EncodedAudioChunkMetadata) {
|
|
795
|
+
const existingTrackData = this.trackDatas.find(x => x.track === track);
|
|
796
|
+
if (existingTrackData) {
|
|
797
|
+
return existingTrackData as MatroskaAudioTrackData;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
validateAudioChunkMetadata(meta);
|
|
801
|
+
|
|
802
|
+
assert(meta);
|
|
803
|
+
assert(meta.decoderConfig);
|
|
804
|
+
|
|
805
|
+
const decoderConfig = { ...meta.decoderConfig };
|
|
806
|
+
let requiresAdtsStripping = false;
|
|
807
|
+
|
|
808
|
+
if (track.source._codec === 'aac' && !decoderConfig.description) {
|
|
809
|
+
// Matroska stores raw AAC with AudioSpecificConfig in CodecPrivate, not ADTS-wrapped data.
|
|
810
|
+
// Parse the first packet to extract the AudioSpecificConfig.
|
|
811
|
+
const adtsFrame = readAdtsFrameHeader(FileSlice.tempFromBytes(packet.data));
|
|
812
|
+
if (!adtsFrame) {
|
|
813
|
+
throw new Error(
|
|
814
|
+
'Couldn\'t parse ADTS header from the AAC packet. Make sure the packets are in ADTS format'
|
|
815
|
+
+ ' (as specified in ISO 13818-7) when not providing a description, or provide a description'
|
|
816
|
+
+ ' (must be an AudioSpecificConfig as specified in ISO 14496-3) and ensure the packets'
|
|
817
|
+
+ ' are raw AAC data.',
|
|
818
|
+
);
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
const sampleRate = aacFrequencyTable[adtsFrame.samplingFrequencyIndex];
|
|
822
|
+
const numberOfChannels = aacChannelMap[adtsFrame.channelConfiguration];
|
|
823
|
+
|
|
824
|
+
if (sampleRate === undefined || numberOfChannels === undefined) {
|
|
825
|
+
throw new Error('Invalid ADTS frame header.');
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
decoderConfig.description = buildAacAudioSpecificConfig({
|
|
829
|
+
objectType: adtsFrame.objectType,
|
|
830
|
+
sampleRate,
|
|
831
|
+
numberOfChannels,
|
|
832
|
+
});
|
|
833
|
+
requiresAdtsStripping = true;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
const newTrackData: MatroskaAudioTrackData = {
|
|
837
|
+
track,
|
|
838
|
+
type: 'audio',
|
|
839
|
+
info: {
|
|
840
|
+
numberOfChannels: meta.decoderConfig.numberOfChannels,
|
|
841
|
+
sampleRate: meta.decoderConfig.sampleRate,
|
|
842
|
+
decoderConfig,
|
|
843
|
+
requiresAdtsStripping,
|
|
844
|
+
},
|
|
845
|
+
chunkQueue: [],
|
|
846
|
+
lastWrittenMsTimestamp: null,
|
|
847
|
+
codecPrivate: decoderConfig.description ?? null,
|
|
848
|
+
closed: false,
|
|
849
|
+
};
|
|
850
|
+
|
|
851
|
+
this.trackDatas.push(newTrackData);
|
|
852
|
+
this.trackDatas.sort((a, b) => a.track.id - b.track.id);
|
|
853
|
+
|
|
854
|
+
if (this.allTracksAreKnown()) {
|
|
855
|
+
this.allTracksKnown.resolve();
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
return newTrackData;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
private getSubtitleTrackData(track: OutputSubtitleTrack, meta?: SubtitleMetadata) {
|
|
862
|
+
const existingTrackData = this.trackDatas.find(x => x.track === track);
|
|
863
|
+
if (existingTrackData) {
|
|
864
|
+
return existingTrackData as MatroskaAudioTrackData;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
validateSubtitleMetadata(meta);
|
|
868
|
+
|
|
869
|
+
assert(meta);
|
|
870
|
+
assert(meta.config);
|
|
871
|
+
|
|
872
|
+
const newTrackData: MatroskaSubtitleTrackData = {
|
|
873
|
+
track,
|
|
874
|
+
type: 'subtitle',
|
|
875
|
+
info: {
|
|
876
|
+
config: meta.config,
|
|
877
|
+
},
|
|
878
|
+
chunkQueue: [],
|
|
879
|
+
lastWrittenMsTimestamp: null,
|
|
880
|
+
codecPrivate: textEncoder.encode(meta.config.description),
|
|
881
|
+
closed: false,
|
|
882
|
+
};
|
|
883
|
+
|
|
884
|
+
this.trackDatas.push(newTrackData);
|
|
885
|
+
this.trackDatas.sort((a, b) => a.track.id - b.track.id);
|
|
886
|
+
|
|
887
|
+
if (this.allTracksAreKnown()) {
|
|
888
|
+
this.allTracksKnown.resolve();
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
return newTrackData;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
async addEncodedVideoPacket(track: OutputVideoTrack, packet: EncodedPacket, meta?: EncodedVideoChunkMetadata) {
|
|
895
|
+
const release = await this.mutex.acquire();
|
|
896
|
+
|
|
897
|
+
try {
|
|
898
|
+
const trackData = this.getVideoTrackData(track, packet, meta);
|
|
899
|
+
|
|
900
|
+
let packetData = packet.data;
|
|
901
|
+
if (track.source._codec === 'prores') {
|
|
902
|
+
if (packetData.byteLength < 8) {
|
|
903
|
+
throw new Error('ProRes packet too small, expected at least 8 bytes.');
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
// Trim off the frame container atom header. FFmpeg does this too and cites the "Matroska spec" as the
|
|
907
|
+
// reason, despite the spec not saying anything about this.
|
|
908
|
+
packetData = packetData.subarray(8);
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
const isKeyFrame = packet.type === 'key';
|
|
912
|
+
this.validateTimestamp(trackData.track, packet.timestamp, isKeyFrame);
|
|
913
|
+
|
|
914
|
+
let timestamp = packet.timestamp;
|
|
915
|
+
let duration = packet.duration;
|
|
916
|
+
|
|
917
|
+
if (track.metadata.frameRate !== undefined) {
|
|
918
|
+
// Constrain the time values to the frame rate
|
|
919
|
+
timestamp = roundToDivisor(timestamp, track.metadata.frameRate);
|
|
920
|
+
duration = roundToDivisor(duration, track.metadata.frameRate);
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
const additions = trackData.info.alphaMode
|
|
924
|
+
? packet.sideData.alpha ?? null
|
|
925
|
+
: null;
|
|
926
|
+
|
|
927
|
+
const videoChunk = this.createInternalChunk(packetData, timestamp, duration, packet.type, additions);
|
|
928
|
+
if (track.source._codec === 'vp9') this.fixVP9ColorSpace(trackData, videoChunk);
|
|
929
|
+
|
|
930
|
+
trackData.chunkQueue.push(videoChunk);
|
|
931
|
+
await this.interleaveChunks();
|
|
932
|
+
} finally {
|
|
933
|
+
release();
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
async addEncodedAudioPacket(track: OutputAudioTrack, packet: EncodedPacket, meta?: EncodedAudioChunkMetadata) {
|
|
938
|
+
const release = await this.mutex.acquire();
|
|
939
|
+
|
|
940
|
+
try {
|
|
941
|
+
const trackData = this.getAudioTrackData(track, packet, meta);
|
|
942
|
+
|
|
943
|
+
let packetData = packet.data;
|
|
944
|
+
if (trackData.info.requiresAdtsStripping) {
|
|
945
|
+
const adtsFrame = readAdtsFrameHeader(FileSlice.tempFromBytes(packetData));
|
|
946
|
+
if (!adtsFrame) {
|
|
947
|
+
throw new Error('Expected ADTS frame, didn\'t get one.');
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
const headerLength = adtsFrame.crcCheck === null
|
|
951
|
+
? MIN_ADTS_FRAME_HEADER_SIZE
|
|
952
|
+
: MAX_ADTS_FRAME_HEADER_SIZE;
|
|
953
|
+
packetData = packetData.subarray(headerLength);
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
const isKeyFrame = packet.type === 'key';
|
|
957
|
+
this.validateTimestamp(trackData.track, packet.timestamp, isKeyFrame);
|
|
958
|
+
|
|
959
|
+
const audioChunk = this.createInternalChunk(packetData, packet.timestamp, packet.duration, packet.type);
|
|
960
|
+
trackData.chunkQueue.push(audioChunk);
|
|
961
|
+
await this.interleaveChunks();
|
|
962
|
+
} finally {
|
|
963
|
+
release();
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
async addSubtitleCue(track: OutputSubtitleTrack, cue: SubtitleCue, meta?: SubtitleMetadata) {
|
|
968
|
+
const release = await this.mutex.acquire();
|
|
969
|
+
|
|
970
|
+
try {
|
|
971
|
+
const trackData = this.getSubtitleTrackData(track, meta);
|
|
972
|
+
|
|
973
|
+
this.validateTimestamp(trackData.track, cue.timestamp, true);
|
|
974
|
+
|
|
975
|
+
let bodyText = cue.text;
|
|
976
|
+
const timestampMs = Math.round(cue.timestamp * 1000);
|
|
977
|
+
|
|
978
|
+
// Replace in-body timestamps so that they're relative to the cue start time
|
|
979
|
+
inlineTimestampRegex.lastIndex = 0;
|
|
980
|
+
bodyText = bodyText.replace(inlineTimestampRegex, (match) => {
|
|
981
|
+
const time = parseSubtitleTimestamp(match.slice(1, -1));
|
|
982
|
+
const offsetTime = time - timestampMs;
|
|
983
|
+
|
|
984
|
+
return `<${formatSubtitleTimestamp(offsetTime)}>`;
|
|
985
|
+
});
|
|
986
|
+
|
|
987
|
+
const body = textEncoder.encode(bodyText);
|
|
988
|
+
const additions = `${cue.settings ?? ''}\n${cue.identifier ?? ''}\n${cue.notes ?? ''}`;
|
|
989
|
+
|
|
990
|
+
const subtitleChunk = this.createInternalChunk(
|
|
991
|
+
body,
|
|
992
|
+
cue.timestamp,
|
|
993
|
+
cue.duration,
|
|
994
|
+
'key',
|
|
995
|
+
additions.trim() ? textEncoder.encode(additions) : null,
|
|
996
|
+
);
|
|
997
|
+
|
|
998
|
+
trackData.chunkQueue.push(subtitleChunk);
|
|
999
|
+
await this.interleaveChunks();
|
|
1000
|
+
} finally {
|
|
1001
|
+
release();
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
private async interleaveChunks(isFinalCall = false) {
|
|
1006
|
+
if (!isFinalCall && !this.allTracksAreKnown()) {
|
|
1007
|
+
return; // We can't interleave yet as we don't yet know how many tracks we'll truly have
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
outer:
|
|
1011
|
+
while (true) {
|
|
1012
|
+
let trackWithMinTimestamp: MatroskaTrackData | null = null;
|
|
1013
|
+
let minTimestamp = Infinity;
|
|
1014
|
+
|
|
1015
|
+
for (const trackData of this.trackDatas) {
|
|
1016
|
+
if (!isFinalCall && trackData.chunkQueue.length === 0 && !trackData.closed) {
|
|
1017
|
+
break outer;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
if (trackData.chunkQueue.length > 0 && trackData.chunkQueue[0]!.timestamp < minTimestamp) {
|
|
1021
|
+
trackWithMinTimestamp = trackData;
|
|
1022
|
+
minTimestamp = trackData.chunkQueue[0]!.timestamp;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
if (!trackWithMinTimestamp) {
|
|
1027
|
+
break;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
const chunk = trackWithMinTimestamp.chunkQueue.shift()!;
|
|
1031
|
+
this.writeBlock(trackWithMinTimestamp, chunk);
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
if (!isFinalCall) {
|
|
1035
|
+
await this.writer.flush();
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* Due to [a bug in Chromium](https://bugs.chromium.org/p/chromium/issues/detail?id=1377842), VP9 streams often
|
|
1041
|
+
* lack color space information. This method patches in that information.
|
|
1042
|
+
*/
|
|
1043
|
+
private fixVP9ColorSpace(
|
|
1044
|
+
trackData: MatroskaVideoTrackData,
|
|
1045
|
+
chunk: InternalMediaChunk,
|
|
1046
|
+
) {
|
|
1047
|
+
// http://downloads.webmproject.org/docs/vp9/vp9-bitstream_superframe-and-uncompressed-header_v1.0.pdf
|
|
1048
|
+
|
|
1049
|
+
if (chunk.type !== 'key') return;
|
|
1050
|
+
if (!trackData.info.decoderConfig.colorSpace || !trackData.info.decoderConfig.colorSpace.matrix) return;
|
|
1051
|
+
|
|
1052
|
+
const bitstream = new Bitstream(chunk.data);
|
|
1053
|
+
|
|
1054
|
+
bitstream.skipBits(2);
|
|
1055
|
+
|
|
1056
|
+
const profileLowBit = bitstream.readBits(1);
|
|
1057
|
+
const profileHighBit = bitstream.readBits(1);
|
|
1058
|
+
const profile = (profileHighBit << 1) + profileLowBit;
|
|
1059
|
+
|
|
1060
|
+
if (profile === 3) bitstream.skipBits(1);
|
|
1061
|
+
|
|
1062
|
+
const showExistingFrame = bitstream.readBits(1);
|
|
1063
|
+
if (showExistingFrame) return;
|
|
1064
|
+
|
|
1065
|
+
const frameType = bitstream.readBits(1);
|
|
1066
|
+
if (frameType !== 0) return; // Just to be sure
|
|
1067
|
+
|
|
1068
|
+
bitstream.skipBits(2);
|
|
1069
|
+
|
|
1070
|
+
const syncCode = bitstream.readBits(24);
|
|
1071
|
+
if (syncCode !== 0x498342) return;
|
|
1072
|
+
|
|
1073
|
+
if (profile >= 2) bitstream.skipBits(1);
|
|
1074
|
+
|
|
1075
|
+
const colorSpaceID = {
|
|
1076
|
+
rgb: 7,
|
|
1077
|
+
bt709: 2,
|
|
1078
|
+
bt470bg: 1,
|
|
1079
|
+
smpte170m: 3,
|
|
1080
|
+
}[trackData.info.decoderConfig.colorSpace.matrix];
|
|
1081
|
+
|
|
1082
|
+
// The bitstream position is now at the start of the color space bits.
|
|
1083
|
+
// We can use the global writeBits function here as requested.
|
|
1084
|
+
writeBits(chunk.data, bitstream.pos, bitstream.pos + 3, colorSpaceID);
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
/** Converts a read-only external chunk into an internal one for easier use. */
|
|
1088
|
+
private createInternalChunk(
|
|
1089
|
+
data: Uint8Array,
|
|
1090
|
+
timestamp: number,
|
|
1091
|
+
duration: number,
|
|
1092
|
+
type: 'key' | 'delta',
|
|
1093
|
+
additions: Uint8Array | null = null,
|
|
1094
|
+
) {
|
|
1095
|
+
const internalChunk: InternalMediaChunk = {
|
|
1096
|
+
data,
|
|
1097
|
+
type,
|
|
1098
|
+
timestamp,
|
|
1099
|
+
duration,
|
|
1100
|
+
additions,
|
|
1101
|
+
};
|
|
1102
|
+
|
|
1103
|
+
return internalChunk;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
/** Writes a block containing media data to the file. */
|
|
1107
|
+
private writeBlock(trackData: MatroskaTrackData, chunk: InternalMediaChunk) {
|
|
1108
|
+
// Due to the interlacing algorithm, this code will be run once we've seen one chunk from every media track.
|
|
1109
|
+
if (!this.segment) {
|
|
1110
|
+
this.createSegment();
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
const msTimestamp = Math.round(1000 * chunk.timestamp);
|
|
1114
|
+
|
|
1115
|
+
// We wanna only finalize this cluster (and begin a new one) if we know that each track will be able to
|
|
1116
|
+
// start the new one with a key frame.
|
|
1117
|
+
const keyFrameQueuedEverywhere = this.trackDatas.every((otherTrackData) => {
|
|
1118
|
+
if (trackData === otherTrackData) {
|
|
1119
|
+
return chunk.type === 'key';
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
const firstQueuedSample = otherTrackData.chunkQueue[0];
|
|
1123
|
+
if (firstQueuedSample) {
|
|
1124
|
+
return firstQueuedSample.type === 'key';
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
return otherTrackData.closed;
|
|
1128
|
+
});
|
|
1129
|
+
|
|
1130
|
+
let shouldCreateNewCluster = false;
|
|
1131
|
+
if (!this.currentCluster) {
|
|
1132
|
+
shouldCreateNewCluster = true;
|
|
1133
|
+
} else {
|
|
1134
|
+
assert(this.currentClusterStartMsTimestamp !== null);
|
|
1135
|
+
assert(this.currentClusterMaxMsTimestamp !== null);
|
|
1136
|
+
|
|
1137
|
+
const relativeTimestamp = msTimestamp - this.currentClusterStartMsTimestamp;
|
|
1138
|
+
|
|
1139
|
+
shouldCreateNewCluster = (
|
|
1140
|
+
keyFrameQueuedEverywhere
|
|
1141
|
+
// This check is required because that means there is already a block with this timestamp in the
|
|
1142
|
+
// CURRENT chunk, meaning that starting the next cluster at the same timestamp is forbidden (since
|
|
1143
|
+
// the already-written block would belong into it instead).
|
|
1144
|
+
&& msTimestamp > this.currentClusterMaxMsTimestamp
|
|
1145
|
+
&& relativeTimestamp >= 1000 * (this.format._options.minimumClusterDuration ?? 1)
|
|
1146
|
+
)
|
|
1147
|
+
// The cluster would exceed its maximum allowed length. This puts us in an unfortunate position and forces
|
|
1148
|
+
// us to begin the next cluster with a delta frame. Although this is undesirable, it is not forbidden by the
|
|
1149
|
+
// spec and is supported by players.
|
|
1150
|
+
|| relativeTimestamp > MAX_CLUSTER_TIMESTAMP_MS;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
if (shouldCreateNewCluster) {
|
|
1154
|
+
this.createNewCluster(msTimestamp);
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
const relativeTimestamp = msTimestamp - this.currentClusterStartMsTimestamp!;
|
|
1158
|
+
if (relativeTimestamp < MIN_CLUSTER_TIMESTAMP_MS) {
|
|
1159
|
+
// The block lies too far in the past, it's not representable within this cluster
|
|
1160
|
+
return;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
const prelude = new Uint8Array(4);
|
|
1164
|
+
const view = new DataView(prelude.buffer);
|
|
1165
|
+
// 0x80 to indicate it's the last byte of a multi-byte number
|
|
1166
|
+
view.setUint8(0, 0x80 | trackData.track.id);
|
|
1167
|
+
view.setInt16(1, relativeTimestamp, false);
|
|
1168
|
+
|
|
1169
|
+
const msDuration = Math.round(1000 * chunk.duration);
|
|
1170
|
+
|
|
1171
|
+
// Subtitle cues need an explicit BlockDuration (a SimpleBlock has none)
|
|
1172
|
+
const needsBlockGroup = !!chunk.additions || trackData.type === 'subtitle';
|
|
1173
|
+
|
|
1174
|
+
if (!needsBlockGroup) {
|
|
1175
|
+
// No additions, we can write out a SimpleBlock
|
|
1176
|
+
view.setUint8(3, Number(chunk.type === 'key') << 7); // Flags (keyframe flag only present for SimpleBlock)
|
|
1177
|
+
|
|
1178
|
+
const simpleBlock = { id: EBMLId.SimpleBlock, data: [
|
|
1179
|
+
prelude,
|
|
1180
|
+
chunk.data,
|
|
1181
|
+
] };
|
|
1182
|
+
this.ebmlWriter.writeEBML(simpleBlock);
|
|
1183
|
+
} else {
|
|
1184
|
+
const blockGroup = { id: EBMLId.BlockGroup, data: [
|
|
1185
|
+
{ id: EBMLId.Block, data: [
|
|
1186
|
+
prelude,
|
|
1187
|
+
chunk.data,
|
|
1188
|
+
] },
|
|
1189
|
+
chunk.type === 'delta'
|
|
1190
|
+
? {
|
|
1191
|
+
id: EBMLId.ReferenceBlock,
|
|
1192
|
+
data: new EBMLSignedInt(trackData.lastWrittenMsTimestamp! - msTimestamp),
|
|
1193
|
+
}
|
|
1194
|
+
: null,
|
|
1195
|
+
chunk.additions
|
|
1196
|
+
? { id: EBMLId.BlockAdditions, data: [
|
|
1197
|
+
{ id: EBMLId.BlockMore, data: [
|
|
1198
|
+
{ id: EBMLId.BlockAddID, data: 1 }, // Some players expect BlockAddID to come first
|
|
1199
|
+
{ id: EBMLId.BlockAdditional, data: chunk.additions },
|
|
1200
|
+
] },
|
|
1201
|
+
] }
|
|
1202
|
+
: null,
|
|
1203
|
+
msDuration > 0 ? { id: EBMLId.BlockDuration, data: msDuration } : null,
|
|
1204
|
+
] };
|
|
1205
|
+
this.ebmlWriter.writeEBML(blockGroup);
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
this.startTimestamp = Math.min(this.startTimestamp, msTimestamp);
|
|
1209
|
+
this.endTimestamp = Math.max(this.endTimestamp, msTimestamp + msDuration);
|
|
1210
|
+
trackData.lastWrittenMsTimestamp = msTimestamp;
|
|
1211
|
+
|
|
1212
|
+
if (!this.trackDatasInCurrentCluster.has(trackData)) {
|
|
1213
|
+
this.trackDatasInCurrentCluster.set(trackData, {
|
|
1214
|
+
firstMsTimestamp: msTimestamp,
|
|
1215
|
+
});
|
|
1216
|
+
}
|
|
1217
|
+
this.currentClusterMaxMsTimestamp = Math.max(this.currentClusterMaxMsTimestamp!, msTimestamp);
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
/** Creates a new Cluster element to contain media chunks. */
|
|
1221
|
+
private createNewCluster(msTimestamp: number) {
|
|
1222
|
+
if (this.currentCluster) {
|
|
1223
|
+
this.finalizeCurrentCluster();
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
if (this.format._options.onCluster) {
|
|
1227
|
+
this.writer.startTrackingWrites();
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
this.currentCluster = {
|
|
1231
|
+
id: EBMLId.Cluster,
|
|
1232
|
+
size: this.format._options.appendOnly ? -1 : CLUSTER_SIZE_BYTES,
|
|
1233
|
+
data: [
|
|
1234
|
+
{ id: EBMLId.Timestamp, data: msTimestamp },
|
|
1235
|
+
],
|
|
1236
|
+
};
|
|
1237
|
+
this.ebmlWriter.writeEBML(this.currentCluster);
|
|
1238
|
+
|
|
1239
|
+
this.currentClusterStartMsTimestamp = msTimestamp;
|
|
1240
|
+
this.currentClusterMaxMsTimestamp = msTimestamp;
|
|
1241
|
+
this.trackDatasInCurrentCluster.clear();
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
private finalizeCurrentCluster() {
|
|
1245
|
+
assert(this.currentCluster);
|
|
1246
|
+
|
|
1247
|
+
if (!this.format._options.appendOnly) {
|
|
1248
|
+
const clusterSize = this.writer.getPos() - this.ebmlWriter.dataOffsets.get(this.currentCluster)!;
|
|
1249
|
+
const endPos = this.writer.getPos();
|
|
1250
|
+
|
|
1251
|
+
// Write the size now that we know it
|
|
1252
|
+
this.writer.seek(this.ebmlWriter.offsets.get(this.currentCluster)! + 4);
|
|
1253
|
+
this.ebmlWriter.writeVarInt(clusterSize, CLUSTER_SIZE_BYTES);
|
|
1254
|
+
this.writer.seek(endPos);
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
if (this.format._options.onCluster) {
|
|
1258
|
+
assert(this.currentClusterStartMsTimestamp !== null);
|
|
1259
|
+
|
|
1260
|
+
const { data, start } = this.writer.stopTrackingWrites();
|
|
1261
|
+
this.format._options.onCluster(data, start, this.currentClusterStartMsTimestamp / 1000);
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
const clusterOffsetFromSegment
|
|
1265
|
+
= this.ebmlWriter.offsets.get(this.currentCluster)! - this.segmentDataOffset;
|
|
1266
|
+
|
|
1267
|
+
// Group tracks by their first timestamp and create a CuePoint for each unique timestamp
|
|
1268
|
+
const groupedByTimestamp = new Map<number, MatroskaTrackData[]>();
|
|
1269
|
+
for (const [trackData, { firstMsTimestamp }] of this.trackDatasInCurrentCluster) {
|
|
1270
|
+
if (!groupedByTimestamp.has(firstMsTimestamp)) {
|
|
1271
|
+
groupedByTimestamp.set(firstMsTimestamp, []);
|
|
1272
|
+
}
|
|
1273
|
+
groupedByTimestamp.get(firstMsTimestamp)!.push(trackData);
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
const groupedAndSortedByTimestamp = [...groupedByTimestamp.entries()].sort((a, b) => a[0] - b[0]);
|
|
1277
|
+
|
|
1278
|
+
// Add CuePoints to the Cues element for better seeking
|
|
1279
|
+
for (const [msTimestamp, trackDatas] of groupedAndSortedByTimestamp) {
|
|
1280
|
+
assert(this.cues);
|
|
1281
|
+
(this.cues.data as EBML[]).push({ id: EBMLId.CuePoint, data: [
|
|
1282
|
+
{ id: EBMLId.CueTime, data: msTimestamp },
|
|
1283
|
+
// Create CueTrackPositions for each track that starts at this timestamp
|
|
1284
|
+
...trackDatas.map((trackData) => {
|
|
1285
|
+
return { id: EBMLId.CueTrackPositions, data: [
|
|
1286
|
+
{ id: EBMLId.CueTrack, data: trackData.track.id },
|
|
1287
|
+
{ id: EBMLId.CueClusterPosition, data: clusterOffsetFromSegment },
|
|
1288
|
+
] };
|
|
1289
|
+
}),
|
|
1290
|
+
] });
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
1295
|
+
override async onTrackClose(track: OutputTrack) {
|
|
1296
|
+
const release = await this.mutex.acquire();
|
|
1297
|
+
|
|
1298
|
+
const trackData = this.trackDatas.find(x => x.track === track);
|
|
1299
|
+
if (trackData) {
|
|
1300
|
+
trackData.closed = true;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
if (this.allTracksAreKnown()) {
|
|
1304
|
+
this.allTracksKnown.resolve();
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
// Since a track is now closed, we may be able to write out chunks that were previously waiting
|
|
1308
|
+
await this.interleaveChunks();
|
|
1309
|
+
|
|
1310
|
+
release();
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
/** Finalizes the file, making it ready for use. Must be called after all media chunks have been added. */
|
|
1314
|
+
async finalize() {
|
|
1315
|
+
const release = await this.mutex.acquire();
|
|
1316
|
+
|
|
1317
|
+
this.allTracksKnown.resolve();
|
|
1318
|
+
|
|
1319
|
+
for (const trackData of this.trackDatas) {
|
|
1320
|
+
trackData.closed = true;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
if (!this.segment) {
|
|
1324
|
+
this.createSegment();
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
// Flush any remaining queued chunks to the file
|
|
1328
|
+
await this.interleaveChunks(true);
|
|
1329
|
+
|
|
1330
|
+
if (this.currentCluster) {
|
|
1331
|
+
this.finalizeCurrentCluster();
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
assert(this.cues);
|
|
1335
|
+
this.ebmlWriter.writeEBML(this.cues);
|
|
1336
|
+
|
|
1337
|
+
if (!this.format._options.appendOnly) {
|
|
1338
|
+
// Write the Segment size
|
|
1339
|
+
const segmentSize = this.writer.getPos() - this.segmentDataOffset;
|
|
1340
|
+
this.writer.seek(this.ebmlWriter.offsets.get(this.segment!)! + 4);
|
|
1341
|
+
this.ebmlWriter.writeVarInt(segmentSize, SEGMENT_SIZE_BYTES);
|
|
1342
|
+
|
|
1343
|
+
// Write the duration of the media to the Segment
|
|
1344
|
+
const duration = this.startTimestamp === Infinity
|
|
1345
|
+
? 0
|
|
1346
|
+
: this.endTimestamp - this.startTimestamp;
|
|
1347
|
+
this.segmentDuration!.data = new EBMLFloat64(duration);
|
|
1348
|
+
this.writer.seek(this.ebmlWriter.offsets.get(this.segmentDuration!)!);
|
|
1349
|
+
this.ebmlWriter.writeEBML(this.segmentDuration);
|
|
1350
|
+
|
|
1351
|
+
// Fill in SeekHead position data and write it again
|
|
1352
|
+
assert(this.seekHead);
|
|
1353
|
+
this.writer.seek(this.ebmlWriter.offsets.get(this.seekHead)!);
|
|
1354
|
+
this.maybeCreateSeekHead(true);
|
|
1355
|
+
this.ebmlWriter.writeEBML(this.seekHead);
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
release();
|
|
1359
|
+
}
|
|
1360
|
+
}
|