supervision 0.1.7 → 0.2.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/media-renderer.d.ts +3 -0
- package/dist/constants/media-renderer.d.ts.map +1 -1
- package/dist/detections/chunked-detection-frame-source.d.ts.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9281 -5038
- package/dist/index.js.map +1 -1
- package/dist/mask-preparation.worker.js +409 -185
- package/dist/mask-preparation.worker.js.map +1 -1
- package/dist/media/display-pixel-ratio.d.ts +15 -0
- package/dist/media/display-pixel-ratio.d.ts.map +1 -0
- package/dist/media/engine-import-failure.d.ts +16 -0
- package/dist/media/engine-import-failure.d.ts.map +1 -0
- package/dist/media/media-errors.d.ts +6 -0
- package/dist/media/media-errors.d.ts.map +1 -1
- package/dist/media/media-normalization.d.ts.map +1 -1
- package/dist/media/media-probe.d.ts.map +1 -1
- package/dist/media/media-source-state.d.ts.map +1 -1
- package/dist/media/media-source.d.ts +17 -0
- package/dist/media/media-source.d.ts.map +1 -1
- package/dist/media/mediabunny-media-source.d.ts.map +1 -1
- package/dist/media/video-engine-media-source.d.ts +54 -0
- package/dist/media/video-engine-media-source.d.ts.map +1 -0
- package/dist/media/video-engine-media-source.js +3 -0
- package/dist/media/video-engine-media-source.js.map +1 -0
- package/dist/playback/media-playback-controller.d.ts +7 -1
- package/dist/playback/media-playback-controller.d.ts.map +1 -1
- package/dist/render-preparation/mask-frame-artifact.d.ts +48 -12
- package/dist/render-preparation/mask-frame-artifact.d.ts.map +1 -1
- package/dist/render-preparation/mask-frame-compositor.d.ts +12 -5
- package/dist/render-preparation/mask-frame-compositor.d.ts.map +1 -1
- package/dist/render-preparation/mask-frame-preparer.d.ts.map +1 -1
- package/dist/render-preparation/mask-preparation-worker-count.d.ts +4 -4
- package/dist/render-preparation/mask-preparation-worker-protocol.d.ts +13 -3
- package/dist/render-preparation/mask-preparation-worker-protocol.d.ts.map +1 -1
- package/dist/render-preparation/prepared-render-window.d.ts +44 -2
- package/dist/render-preparation/prepared-render-window.d.ts.map +1 -1
- package/dist/render-preparation/prepared-window-timeline.d.ts +2 -6
- package/dist/render-preparation/prepared-window-timeline.d.ts.map +1 -1
- package/dist/renderers/injected-pixi.d.ts +38 -0
- package/dist/renderers/injected-pixi.d.ts.map +1 -0
- package/dist/renderers/mask-palette.d.ts +14 -0
- package/dist/renderers/mask-palette.d.ts.map +1 -0
- package/dist/renderers/mask-vertex.d.ts +14 -0
- package/dist/renderers/mask-vertex.d.ts.map +1 -0
- package/dist/renderers/media-renderer-core.d.ts +9 -0
- package/dist/renderers/media-renderer-core.d.ts.map +1 -1
- package/dist/renderers/media-renderer-scene.d.ts +50 -2
- package/dist/renderers/media-renderer-scene.d.ts.map +1 -1
- package/dist/renderers/media-renderer-state.d.ts +20 -1
- package/dist/renderers/media-renderer-state.d.ts.map +1 -1
- package/dist/renderers/media-renderer-transport.d.ts +72 -0
- package/dist/renderers/media-renderer-transport.d.ts.map +1 -0
- package/dist/renderers/pixi-box-layer.d.ts +5 -0
- package/dist/renderers/pixi-box-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-focus-layer.d.ts +19 -2
- package/dist/renderers/pixi-focus-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-frame-present.d.ts +77 -0
- package/dist/renderers/pixi-frame-present.d.ts.map +1 -0
- package/dist/renderers/pixi-id-mask-shader.d.ts +6 -25
- package/dist/renderers/pixi-id-mask-shader.d.ts.map +1 -1
- package/dist/renderers/pixi-interaction-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-interaction-presentation-layer.d.ts +12 -2
- package/dist/renderers/pixi-interaction-presentation-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-mask-halo.d.ts +18 -23
- package/dist/renderers/pixi-mask-halo.d.ts.map +1 -1
- package/dist/renderers/pixi-mask-layer.d.ts +94 -32
- package/dist/renderers/pixi-mask-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-media-scene.d.ts +67 -0
- package/dist/renderers/pixi-media-scene.d.ts.map +1 -1
- package/dist/renderers/pixi-polygon-layer.d.ts +9 -2
- package/dist/renderers/pixi-polygon-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-region-coverage-mask.d.ts +62 -0
- package/dist/renderers/pixi-region-coverage-mask.d.ts.map +1 -0
- package/dist/renderers/pixi-region-effect.d.ts +42 -0
- package/dist/renderers/pixi-region-effect.d.ts.map +1 -0
- package/dist/renderers/pixi-region-layer.d.ts +43 -2
- package/dist/renderers/pixi-region-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-shader-lifecycle.d.ts +14 -0
- package/dist/renderers/pixi-shader-lifecycle.d.ts.map +1 -0
- package/dist/renderers/pixi-vector-layer.d.ts.map +1 -1
- package/dist/renderers/prepared-annotation-window.d.ts +47 -0
- package/dist/renderers/prepared-annotation-window.d.ts.map +1 -0
- package/dist/renderers/presented-frame-channel.d.ts +138 -0
- package/dist/renderers/presented-frame-channel.d.ts.map +1 -0
- package/dist/renderers/scene-render-scheduler.d.ts +20 -0
- package/dist/renderers/scene-render-scheduler.d.ts.map +1 -0
- package/dist/sessions/media-session-defaults.d.ts +10 -6
- package/dist/sessions/media-session-defaults.d.ts.map +1 -1
- package/dist/sessions/media-session-media.d.ts.map +1 -1
- package/dist/sessions/media-session-state.d.ts.map +1 -1
- package/dist/sessions/media-session.d.ts.map +1 -1
- package/dist/tracking.worker.js +73 -4
- package/dist/tracking.worker.js.map +1 -1
- package/dist/types/media-normalization.d.ts +34 -0
- package/dist/types/media-normalization.d.ts.map +1 -1
- package/dist/types/media-renderer.d.ts +31 -1
- package/dist/types/media-renderer.d.ts.map +1 -1
- package/dist/types/media-session.d.ts +89 -15
- package/dist/types/media-session.d.ts.map +1 -1
- package/dist/types/render-preparation.d.ts +149 -5
- package/dist/types/render-preparation.d.ts.map +1 -1
- package/dist/video-engine-media-source-CUXnOJOV.js +450 -0
- package/dist/video-engine-media-source-CUXnOJOV.js.map +1 -0
- package/dist/web-video-engine/analysis-session.d.ts +75 -0
- package/dist/web-video-engine/analysis.d.ts +6 -0
- package/dist/web-video-engine/analysis.js +1850 -0
- package/dist/web-video-engine/cache-budget.d.ts +18 -0
- package/dist/web-video-engine/canvas-sink-scrub-cursor.d.ts +89 -0
- package/dist/web-video-engine/clock.d.ts +82 -0
- package/dist/web-video-engine/constants.d.ts +261 -0
- package/dist/web-video-engine/create-scrub-cursor.d.ts +65 -0
- package/dist/web-video-engine/decode-resolution.d.ts +114 -0
- package/dist/web-video-engine/decode-scheduler.d.ts +371 -0
- package/dist/web-video-engine/decode-session.d.ts +283 -0
- package/dist/web-video-engine/decode-source.d.ts +258 -0
- package/dist/web-video-engine/diagnostics-store.d.ts +17 -0
- package/dist/web-video-engine/diagnostics.d.ts +316 -0
- package/dist/web-video-engine/embedded-engine-worker.d.ts +1 -0
- package/dist/web-video-engine/engine-core.d.ts +269 -0
- package/dist/web-video-engine/engine.d.ts +25 -0
- package/dist/web-video-engine/engine.js +912 -0
- package/dist/web-video-engine/engine.worker.d.ts +1 -0
- package/dist/web-video-engine/engine.worker.js +33624 -0
- package/dist/web-video-engine/frame-cache.d.ts +236 -0
- package/dist/web-video-engine/frame-extractor.d.ts +27 -0
- package/dist/web-video-engine/frame-timeline-DreEwsRY.js +616 -0
- package/dist/web-video-engine/frame-timeline.d.ts +80 -0
- package/dist/web-video-engine/frame-walker.d.ts +73 -0
- package/dist/web-video-engine/index.d.ts +13 -0
- package/dist/web-video-engine/index.d.ts.map +1 -0
- package/dist/web-video-engine/index.js +3 -0
- package/dist/web-video-engine/index.js.map +1 -0
- package/dist/web-video-engine/key-packet.d.ts +64 -0
- package/dist/web-video-engine/keyframe-index.d.ts +90 -0
- package/dist/web-video-engine/mirror-store.d.ts +55 -0
- package/dist/web-video-engine/renderer.d.ts +93 -0
- package/dist/web-video-engine/rotation.d.ts +34 -0
- package/dist/web-video-engine/scrub-controller.d.ts +375 -0
- package/dist/web-video-engine/scrub-cursor.d.ts +347 -0
- package/dist/web-video-engine/scrub-trajectory.d.ts +29 -0
- package/dist/web-video-engine/source-residency.d.ts +91 -0
- package/dist/web-video-engine/trace-recorder.d.ts +163 -0
- package/dist/web-video-engine/types.d.ts +200 -0
- package/dist/web-video-engine/video-engine.d.ts +437 -0
- package/dist/web-video-engine/webgpu-renderer.d.ts +61 -0
- package/dist/web-video-engine/worker-bridge.d.ts +11 -0
- package/dist/web-video-engine/worker-dispatch.d.ts +16 -0
- package/dist/web-video-engine/worker-protocol.d.ts +282 -0
- package/node_modules/supervision-js-core/dist/detections/buffered-detection-timeline.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/detections/composite-detection-frame-source.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/index.d.ts +5 -4
- package/node_modules/supervision-js-core/dist/index.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/index.js +1167 -280
- package/node_modules/supervision-js-core/dist/index.js.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/default-annotation-presentation.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/interaction-style.d.ts +4 -36
- package/node_modules/supervision-js-core/dist/styles/interaction-style.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/polyline-style.d.ts +5 -0
- package/node_modules/supervision-js-core/dist/styles/polyline-style.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts +92 -7
- package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/detection-timeline.d.ts +191 -17
- package/node_modules/supervision-js-core/dist/types/detection-timeline.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts +83 -5
- package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/polyline-style.d.ts +2 -0
- package/node_modules/supervision-js-core/dist/types/polyline-style.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/session-lifecycle.d.ts +32 -0
- package/node_modules/supervision-js-core/dist/types/session-lifecycle.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/utils/detection-conversions.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts +5 -0
- package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/utils/detection-masks.d.ts +9 -0
- package/node_modules/supervision-js-core/dist/utils/detection-masks.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/utils/detection-ranges.d.ts +18 -0
- package/node_modules/supervision-js-core/dist/utils/detection-ranges.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts +34 -2
- package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/utils/wait-bound.d.ts +7 -0
- package/node_modules/supervision-js-core/dist/utils/wait-bound.d.ts.map +1 -0
- package/package.json +24 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GLSL charges a uniform array of scalars one uniform vector per element, the
|
|
3
|
+
* same as an array of vec4, so the stroke widths ride four to a vector and an
|
|
4
|
+
* entry costs 2.25 vectors instead of 3. The lanes only line up while the entry
|
|
5
|
+
* count stays a multiple of four.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ID_MASK_STROKE_WIDTH_LANES: number;
|
|
8
|
+
export declare const idMaskPaletteGlsl = "\nuniform vec4 uFillPalette[80];\nuniform vec4 uStrokePalette[80];\nuniform vec4 uStrokeWidths[20];\n\nint paletteIndex(float maskId) {\n return int(clamp(maskId, 0.0, float(79)));\n}\n\nvec4 readFill(float maskId) {\n return uFillPalette[paletteIndex(maskId)];\n}\n\nvec4 readStroke(float maskId) {\n return uStrokePalette[paletteIndex(maskId)];\n}\n\nfloat readStrokeWidth(float maskId) {\n int index = paletteIndex(maskId);\n\n return uStrokeWidths[index / 4][index % 4];\n}\n";
|
|
9
|
+
export declare const idMaskFillPaletteWgslField = "uFillPalette: array<vec4<f32>, 80>,";
|
|
10
|
+
export declare const idMaskStrokePaletteWgslField = "uStrokePalette: array<vec4<f32>, 80>,";
|
|
11
|
+
export declare const idMaskStrokeWidthsWgslField = "uStrokeWidths: array<vec4<f32>, 20>,";
|
|
12
|
+
/** Reads the uniform group a fragment stage must bind under the name maskUniforms. */
|
|
13
|
+
export declare const idMaskPaletteWgsl = "\nfn paletteIndex(maskId: f32) -> i32 {\n return i32(clamp(maskId, 0.0, 79.0));\n}\n\nfn readFill(maskId: f32) -> vec4<f32> {\n return maskUniforms.uFillPalette[paletteIndex(maskId)];\n}\n\nfn readStroke(maskId: f32) -> vec4<f32> {\n return maskUniforms.uStrokePalette[paletteIndex(maskId)];\n}\n\nfn readStrokeWidth(maskId: f32) -> f32 {\n let index = paletteIndex(maskId);\n\n return maskUniforms.uStrokeWidths[index / 4][index % 4];\n}\n";
|
|
14
|
+
//# sourceMappingURL=mask-palette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mask-palette.d.ts","sourceRoot":"","sources":["../../src/renderers/mask-palette.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,QAAkC,CAAC;AAE1E,eAAO,MAAM,iBAAiB,yeAsB7B,CAAC;AAEF,eAAO,MAAM,0BAA0B,wCAAoE,CAAC;AAE5G,eAAO,MAAM,4BAA4B,0CAAsE,CAAC;AAEhH,eAAO,MAAM,2BAA2B,yCAAoE,CAAC;AAE7G,sFAAsF;AACtF,eAAO,MAAM,iBAAiB,kcAkB7B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The vertex stage every mask shader draws with. Only the tint varies: a
|
|
3
|
+
* fragment stage that multiplies the mask by the world color reads vColor,
|
|
4
|
+
* one that samples the mask alone takes no such input.
|
|
5
|
+
*/
|
|
6
|
+
export declare const tintedMaskVertexWgsl = "\nstruct GlobalUniforms {\n uProjectionMatrix: mat3x3<f32>,\n uWorldTransformMatrix: mat3x3<f32>,\n uWorldColorAlpha: vec4<f32>,\n uResolution: vec2<f32>,\n}\n\nstruct LocalUniforms {\n uTransformMatrix: mat3x3<f32>,\n uColor: vec4<f32>,\n uRound: f32,\n}\n\n@group(0) @binding(0) var<uniform> globalUniforms: GlobalUniforms;\n@group(1) @binding(0) var<uniform> localUniforms: LocalUniforms;\n\nstruct VertexOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) vUV: vec2<f32>,\n @location(1) vColor: vec4<f32>,\n}\n\n@vertex\nfn mainVertex(\n @location(0) aPosition: vec2<f32>,\n @location(1) aUV: vec2<f32>,\n) -> VertexOutput {\n let modelViewProjectionMatrix =\n globalUniforms.uProjectionMatrix *\n globalUniforms.uWorldTransformMatrix *\n localUniforms.uTransformMatrix;\n\n var output: VertexOutput;\n\n output.position = vec4<f32>(\n (modelViewProjectionMatrix * vec3<f32>(aPosition, 1.0)).xy,\n 0.0,\n 1.0\n );\n output.vUV = aUV;\n output.vColor = globalUniforms.uWorldColorAlpha * localUniforms.uColor;\n\n return output;\n}\n";
|
|
7
|
+
export declare const untintedMaskVertexWgsl = "\nstruct GlobalUniforms {\n uProjectionMatrix: mat3x3<f32>,\n uWorldTransformMatrix: mat3x3<f32>,\n uWorldColorAlpha: vec4<f32>,\n uResolution: vec2<f32>,\n}\n\nstruct LocalUniforms {\n uTransformMatrix: mat3x3<f32>,\n uColor: vec4<f32>,\n uRound: f32,\n}\n\n@group(0) @binding(0) var<uniform> globalUniforms: GlobalUniforms;\n@group(1) @binding(0) var<uniform> localUniforms: LocalUniforms;\n\nstruct VertexOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) vUV: vec2<f32>,\n}\n\n@vertex\nfn mainVertex(\n @location(0) aPosition: vec2<f32>,\n @location(1) aUV: vec2<f32>,\n) -> VertexOutput {\n let modelViewProjectionMatrix =\n globalUniforms.uProjectionMatrix *\n globalUniforms.uWorldTransformMatrix *\n localUniforms.uTransformMatrix;\n\n var output: VertexOutput;\n\n output.position = vec4<f32>(\n (modelViewProjectionMatrix * vec3<f32>(aPosition, 1.0)).xy,\n 0.0,\n 1.0\n );\n output.vUV = aUV;\n\n return output;\n}\n";
|
|
8
|
+
/**
|
|
9
|
+
* The GL counterpart of the tinted vertex stage. Pixi caches a program under
|
|
10
|
+
* both of its stages' source text, so shaders that share this one still get a
|
|
11
|
+
* program each from their own fragment stage.
|
|
12
|
+
*/
|
|
13
|
+
export declare const tintedMaskVertexGlsl = "#version 300 es\nprecision highp float;\n\nin vec2 aPosition;\nin vec2 aUV;\n\nuniform mat3 uProjectionMatrix;\nuniform mat3 uWorldTransformMatrix;\nuniform vec4 uWorldColorAlpha;\nuniform mat3 uTransformMatrix;\nuniform vec4 uColor;\n\nout vec2 vUV;\nout vec4 vColor;\n\nvoid main(void) {\n mat3 modelViewProjectionMatrix =\n uProjectionMatrix * uWorldTransformMatrix * uTransformMatrix;\n\n gl_Position =\n vec4((modelViewProjectionMatrix * vec3(aPosition, 1.0)).xy, 0.0, 1.0);\n vUV = aUV;\n vColor = uWorldColorAlpha * uColor;\n}\n";
|
|
14
|
+
//# sourceMappingURL=mask-vertex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mask-vertex.d.ts","sourceRoot":"","sources":["../../src/renderers/mask-vertex.ts"],"names":[],"mappings":"AAuDA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,mkCAA+F,CAAC;AAEjI,eAAO,MAAM,sBAAsB,q9BAAgE,CAAC;AAEpG;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,siBAwBhC,CAAC"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import type { DecodedMediaSource } from "#media/media-source";
|
|
2
2
|
import { type MediaRenderer, type MediaRendererOptions } from "#types/media-renderer";
|
|
3
3
|
import type { MediaRendererScene, MediaRendererSceneOptions } from "./media-renderer-scene";
|
|
4
|
+
/**
|
|
5
|
+
* Two seconds of frozen picture for masks that have not been cooked.
|
|
6
|
+
*
|
|
7
|
+
* Preparation is local work, so a lead it cannot rebuild in this long is one it
|
|
8
|
+
* is losing rather than one that is late, and every further second is spent on
|
|
9
|
+
* a picture that has stopped. The detection gate waits five times as long
|
|
10
|
+
* because what it waits on is a model somewhere else.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveRenderPreparationMaxWaitSeconds(value: number | undefined): number;
|
|
4
13
|
export interface MediaRendererCoreProviders {
|
|
5
14
|
openMediaSource(src: string | URL | Request): Promise<DecodedMediaSource>;
|
|
6
15
|
createScene(options: MediaRendererSceneOptions): Promise<MediaRendererScene>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-renderer-core.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-core.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"media-renderer-core.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-core.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,kBAAkB,EAInB,MAAM,qBAAqB,CAAC;AAU7B,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAE1B,MAAM,uBAAuB,CAAC;AAmB/B,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAIhC;;;;;;;GAOG;AACH,wBAAgB,sCAAsC,CACpD,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,MAAM,CASR;AAsBD,MAAM,WAAW,0BAA0B;IACzC,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC1E,WAAW,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC9E;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,oBAAoB,EAC7B,SAAS,EAAE,0BAA0B,GACpC,OAAO,CAAC,aAAa,CAAC,CAmtCxB"}
|
|
@@ -14,8 +14,10 @@ import type { RegionAnnotationRenderer, PolygonStyle, PolylineStyle, ShapeStyle,
|
|
|
14
14
|
import type { MediaDisplayAdjustments } from "supervision-js-core";
|
|
15
15
|
import type { Point, ViewportTransform } from "supervision-js-core";
|
|
16
16
|
import type { AnnotationEditingEngine, AnnotationOverlayStyle, PreviewOverlayData } from "supervision-js-core";
|
|
17
|
-
import type { RenderPreparationOptions,
|
|
17
|
+
import type { RenderPreparationOptions, ResolvedRenderPreparationGateThresholds } from "#types/render-preparation";
|
|
18
18
|
import type { MaskBrushPreviewOptions } from "#editing/mask-brush-editor";
|
|
19
|
+
import type { PresentedFrameSource } from "./presented-frame-channel";
|
|
20
|
+
import type { PreparedAnnotationWindowSnapshot } from "./prepared-annotation-window";
|
|
19
21
|
export interface MediaRendererSceneOptions {
|
|
20
22
|
readonly container: HTMLElement;
|
|
21
23
|
readonly backgroundColor: MediaRendererPresentation["backgroundColor"];
|
|
@@ -51,22 +53,56 @@ export interface MediaRendererSceneOptions {
|
|
|
51
53
|
readonly previewOverlay: (() => PreviewOverlayData | null) | undefined;
|
|
52
54
|
/** Propagates renderer-owned asynchronous visual changes into runtime state. */
|
|
53
55
|
readonly onPresentationUpdate?: (sample: PresentedMediaSample) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Present plane of a media source that decides for itself which frame is on
|
|
58
|
+
* screen. Given one, the scene presents what the producer announces instead
|
|
59
|
+
* of what the renderer pulls, and renders only when something changed.
|
|
60
|
+
*/
|
|
61
|
+
readonly presentedFrames?: PresentedFrameSource;
|
|
54
62
|
}
|
|
55
63
|
export interface PresentedMediaSample {
|
|
64
|
+
/**
|
|
65
|
+
* Which frame the scene has on screen, as its count of the frames it has
|
|
66
|
+
* presented. Two presentations of one media time carry different serials, and
|
|
67
|
+
* every redraw of the frame on screen carries that frame's own.
|
|
68
|
+
*/
|
|
69
|
+
readonly presentedFrameSerial: number;
|
|
56
70
|
readonly mediaTime: number;
|
|
57
71
|
readonly duration?: number;
|
|
58
72
|
readonly activeDetectionFrameTime: number | null;
|
|
59
73
|
readonly activeDetectionFrameIndex: number | null;
|
|
60
74
|
readonly activeDetectionCount: number;
|
|
75
|
+
/** Detection frame the mask raster on screen belongs to, null when no mask is
|
|
76
|
+
* up. Apart from `activeDetectionFrameTime` it names a desync in seconds. */
|
|
77
|
+
readonly drawnMaskFrameTime: number | null;
|
|
78
|
+
/** The raster on screen and the detections over it name different frames.
|
|
79
|
+
* This is an invariant breach: a pending mask must leave the frame bare. */
|
|
80
|
+
readonly maskHeldStale: boolean;
|
|
61
81
|
readonly detectionBuffer: DetectionBufferState;
|
|
62
82
|
readonly renderTimings?: MediaFrameRenderTimings;
|
|
63
83
|
}
|
|
64
84
|
export interface MediaRendererScene {
|
|
65
85
|
readonly rendererBackend: string;
|
|
86
|
+
/**
|
|
87
|
+
* Explicit renders issued so far, which a push-presented scene only issues on
|
|
88
|
+
* change. A scene that free-runs on the ticker has no such count.
|
|
89
|
+
*/
|
|
90
|
+
getRenderCount?(): number | null;
|
|
91
|
+
/**
|
|
92
|
+
* Which frames around the playhead have every enabled layer's data cooked. A
|
|
93
|
+
* scene that free-runs on the ticker gates nothing and reports none.
|
|
94
|
+
*/
|
|
95
|
+
getPreparedAnnotationWindow?(): PreparedAnnotationWindowSnapshot | null;
|
|
66
96
|
initializeMedia(dimensions: {
|
|
67
97
|
width: number;
|
|
68
98
|
height: number;
|
|
69
99
|
}): void;
|
|
100
|
+
/**
|
|
101
|
+
* Whether the playhead is moving. Cooking far ahead of a resting playhead is
|
|
102
|
+
* speculation, so the scene narrows what it prepares until the playhead moves
|
|
103
|
+
* again.
|
|
104
|
+
*/
|
|
105
|
+
setPlaybackActive?(active: boolean): void;
|
|
70
106
|
setTimelineContext?(context: MediaRendererSceneTimelineContext): void;
|
|
71
107
|
presentSample(sample: DecodedVideoSample): PresentedMediaSample;
|
|
72
108
|
/**
|
|
@@ -74,7 +110,19 @@ export interface MediaRendererScene {
|
|
|
74
110
|
* that sample's presentation timestamp.
|
|
75
111
|
*/
|
|
76
112
|
captureFrame?(options: MediaFrameCaptureOptions | undefined): Promise<MediaFrameCapture>;
|
|
77
|
-
|
|
113
|
+
/**
|
|
114
|
+
* Whether `waitForRenderPreparation` would wait, scheduling nothing. A source
|
|
115
|
+
* that owns its own playhead is held by stopping it, so the renderer needs
|
|
116
|
+
* this answer before it opens a wait rather than from the wait itself.
|
|
117
|
+
*/
|
|
118
|
+
needsRenderPreparationWait?(mediaTime: number, options: ResolvedRenderPreparationGateThresholds): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Frames render preparation has finished, counted up over the scene's life.
|
|
121
|
+
* A gate that gave up reads this to tell preparation that is slow from
|
|
122
|
+
* preparation that is stuck: only the second deserves to stay given up on.
|
|
123
|
+
*/
|
|
124
|
+
getRenderPreparationProgress?(): number;
|
|
125
|
+
waitForRenderPreparation?(mediaTime: number, options: ResolvedRenderPreparationGateThresholds, signal?: AbortSignal): Promise<void>;
|
|
78
126
|
setRenderQuality(maxDevicePixelRatio: number | undefined): void;
|
|
79
127
|
setDisplayAdjustments?(adjustments: MediaDisplayAdjustments): void;
|
|
80
128
|
getViewportTransform?(): ViewportTransform;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-renderer-scene.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EACjB,wBAAwB,EACxB,+BAA+B,EAC/B,uBAAuB,EACvB,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EACV,wBAAwB,EACxB,YAAY,EACZ,aAAa,EACb,UAAU,EACV,aAAa,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,wBAAwB,EACxB,
|
|
1
|
+
{"version":3,"file":"media-renderer-scene.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EAC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AAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1C,aAAa,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC;IACpC,aAAa,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC;IACpC,uBAAuB,CAAC,CACtB,WAAW,EAAE,MAAM,GAAG,MAAM,GAC3B,oBAAoB,GAAG,IAAI,CAAC;IAC/B,aAAa,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,cAAc,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACpD,qBAAqB,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3D,eAAe,CACb,YAAY,EAAE,yBAAyB,EACvC,SAAS,EAAE,MAAM,GAChB,oBAAoB,GAAG,IAAI,CAAC;IAC/B,oBAAoB,CAAC,CACnB,SAAS,EAAE,yBAAyB,GAAG,IAAI,EAC3C,SAAS,EAAE,MAAM,GAChB,mBAAmB,GAAG,IAAI,CAAC;IAC9B,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { PlaybackGateReach } from "supervision-js-core";
|
|
1
2
|
import type { DecodedMediaSourceMetadata } from "#media/media-source";
|
|
2
3
|
import type { DetectionBufferState } from "supervision-js-core";
|
|
3
4
|
import { type MediaFrameDiagnostics, type MediaRendererFit, type MediaRendererState, type MediaSourceState } from "#types/media-renderer";
|
|
4
5
|
import type { PresentedMediaSample } from "./media-renderer-scene";
|
|
5
6
|
interface MediaRendererRuntimeStateOptions {
|
|
6
7
|
readonly fit: MediaRendererFit;
|
|
8
|
+
readonly getPlaybackGateReach: () => PlaybackGateReach;
|
|
7
9
|
readonly playbackRate: number;
|
|
8
10
|
readonly getDetectionBufferState: () => DetectionBufferState;
|
|
9
11
|
readonly onFrame?: (diagnostics: MediaFrameDiagnostics) => void;
|
|
@@ -12,11 +14,13 @@ interface MediaRendererRuntimeStateOptions {
|
|
|
12
14
|
}
|
|
13
15
|
export interface MediaRendererRuntimeState {
|
|
14
16
|
currentTime(): number;
|
|
17
|
+
presentedTime(): number | null;
|
|
15
18
|
duration(): number | null;
|
|
16
19
|
errorMessage(): string | null;
|
|
17
20
|
isDestroyed(): boolean;
|
|
18
21
|
isError(): boolean;
|
|
19
22
|
isPlaybackActive(): boolean;
|
|
23
|
+
playbackRate(): number;
|
|
20
24
|
isBuffering(): boolean;
|
|
21
25
|
isPlaying(): boolean;
|
|
22
26
|
emitSourceState(): void;
|
|
@@ -25,14 +29,29 @@ export interface MediaRendererRuntimeState {
|
|
|
25
29
|
width: number;
|
|
26
30
|
};
|
|
27
31
|
setSourceReady(metadata: DecodedMediaSourceMetadata): void;
|
|
28
|
-
|
|
32
|
+
/** Whether the picture is stopped on a read the source has not answered. */
|
|
33
|
+
setSourceAwaitingRead(awaitingRead: boolean): void;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the render-preparation gate has given up on artifacts it stopped
|
|
36
|
+
* playback for.
|
|
37
|
+
*/
|
|
38
|
+
setRenderPreparationGateAbandoned(abandoned: boolean): void;
|
|
39
|
+
/** A playhead that moved. Emits, so a readout follows a seek before its
|
|
40
|
+
* frame lands. */
|
|
41
|
+
recordPlayheadTime(currentTime: number): void;
|
|
29
42
|
setPlaybackRate(playbackRate: number): void;
|
|
30
43
|
setRendererBackend(rendererBackend: string | null): void;
|
|
31
44
|
recordPresentedSample(sample: PresentedMediaSample): void;
|
|
45
|
+
/** What the scene put on screen, whether on its own or on a repaint the
|
|
46
|
+
* renderer asked for. Counts a frame not counted before, so a redraw counts
|
|
47
|
+
* nothing and one media time presented twice counts twice. */
|
|
32
48
|
recordPresentationUpdate(sample: PresentedMediaSample): void;
|
|
33
49
|
setReady(): void;
|
|
50
|
+
setLoading(): void;
|
|
34
51
|
setPlaying(): void;
|
|
35
52
|
setBuffering(): void;
|
|
53
|
+
setSeeking(seeking: boolean): void;
|
|
54
|
+
setScrubbing(scrubbing: boolean): void;
|
|
36
55
|
setPaused(): void;
|
|
37
56
|
setRenderError(error: unknown): void;
|
|
38
57
|
markDestroyed(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-renderer-state.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"media-renderer-state.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAK7D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAGL,KAAK,qBAAqB,EAE1B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,UAAU,gCAAgC;IACxC,QAAQ,CAAC,GAAG,EAAE,gBAAgB,CAAC;IAC/B,QAAQ,CAAC,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;IACvD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;IAC7D,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChE,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,K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AI,IAAI,CAAC;IACnB,YAAY,IAAI,IAAI,CAAC;IACrB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,YAAY,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IACvC,SAAS,IAAI,IAAI,CAAC;IAClB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACrC,aAAa,IAAI,IAAI,CAAC;IACtB,kBAAkB,IAAI,IAAI,CAAC;IAC3B,QAAQ,IAAI,kBAAkB,CAAC;CAChC;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,gCAAgC,GACxC,yBAAyB,CA6S3B"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { MediaRendererPlaybackState } from "#types/media-renderer";
|
|
2
|
+
import type { PresentedFrameChannel, PresentedFrameNavigation } from "./presented-frame-channel";
|
|
3
|
+
export interface MediaRendererTransport {
|
|
4
|
+
play(): Promise<void>;
|
|
5
|
+
pause(): void;
|
|
6
|
+
togglePlayback(): Promise<void>;
|
|
7
|
+
scrub(mediaTime: number): void;
|
|
8
|
+
commit(mediaTime: number): Promise<void>;
|
|
9
|
+
step(direction: 1 | -1): Promise<void>;
|
|
10
|
+
setPlaybackRate(rate: number): void;
|
|
11
|
+
/** Holds a producer frame before the scene can display it. */
|
|
12
|
+
protectPresentation(mediaTime: number, signal: AbortSignal): Promise<void> | null;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
}
|
|
15
|
+
export interface MediaRendererTransportOptions {
|
|
16
|
+
/** Replay from the start when the producer reports the source ended. */
|
|
17
|
+
readonly loop: boolean;
|
|
18
|
+
readonly channel: PresentedFrameChannel;
|
|
19
|
+
readonly onPlaybackRate: (rate: number) => void;
|
|
20
|
+
readonly onPlaybackState: (state: MediaRendererPlaybackState) => void;
|
|
21
|
+
readonly onPlayheadTime: (mediaTime: number) => void;
|
|
22
|
+
/**
|
|
23
|
+
* The playhead has moved to a frame that is not on screen yet. Reported apart
|
|
24
|
+
* from `onPlaybackState` because the state a seek settles from is the one the
|
|
25
|
+
* transport keeps reporting throughout it.
|
|
26
|
+
*
|
|
27
|
+
* True for a scrub as well as for a landing, so pair it with `onScrubbing` to
|
|
28
|
+
* tell a viewer who is waiting from one who is dragging.
|
|
29
|
+
*/
|
|
30
|
+
readonly onSeeking: (seeking: boolean) => void;
|
|
31
|
+
/**
|
|
32
|
+
* A drag is open on the playhead. Published as the drag opens and closes
|
|
33
|
+
* without waiting for the producer, whose next word on a slow source is
|
|
34
|
+
* seconds away.
|
|
35
|
+
*/
|
|
36
|
+
readonly onScrubbing: (scrubbing: boolean) => void;
|
|
37
|
+
/** Buffered playback. Awaited before the producer is asked to run. */
|
|
38
|
+
readonly waitForReadiness?: (mediaTime: number, signal: AbortSignal) => Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* A bounded wait for whatever annotates `mediaTime`, or null when nothing is
|
|
41
|
+
* missing. Asked on every playhead move, so answering null has to be cheap.
|
|
42
|
+
*
|
|
43
|
+
* This is what stops a producer already at speed, so what it waits for has to
|
|
44
|
+
* be something that gives up on its own. Left out, playback is held once and
|
|
45
|
+
* never again, and a producer outrunning whatever feeds it runs on past
|
|
46
|
+
* frames that have nothing to draw.
|
|
47
|
+
*
|
|
48
|
+
* `signal` aborts once anything else settles playback, so a hold the viewer
|
|
49
|
+
* has already paused or seeked past is not still holding a play nobody asked
|
|
50
|
+
* for.
|
|
51
|
+
*/
|
|
52
|
+
readonly holdForReadiness?: (mediaTime: number, signal: AbortSignal) => Promise<void> | null;
|
|
53
|
+
/** Readiness required before a producer frame may enter the scene. */
|
|
54
|
+
readonly waitForPresentationReadiness?: (mediaTime: number, signal: AbortSignal) => Promise<void> | null;
|
|
55
|
+
/** Drops a guarded frame synchronously when navigation supersedes it. */
|
|
56
|
+
readonly invalidatePresentedFrame?: () => void;
|
|
57
|
+
/** Opens an acknowledgment that settles after the scene accepts the frame
|
|
58
|
+
* where the producer's navigation landed. */
|
|
59
|
+
readonly beginPresentedFrameNavigation?: () => PresentedFrameNavigation;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The renderer's playback surface over a producer that owns the playhead.
|
|
63
|
+
* Seconds meet milliseconds here and nowhere else.
|
|
64
|
+
*
|
|
65
|
+
* A drag is a pair: every `scrub` belongs to one gesture the producer is told
|
|
66
|
+
* about, and the `commit` that lands it releases that gesture, so a producer
|
|
67
|
+
* that froze itself for the drag is the one deciding whether to resume. The
|
|
68
|
+
* drag and the settle travel as separate signals: which of the two a viewer is
|
|
69
|
+
* looking at is the host's judgement, not the transport's.
|
|
70
|
+
*/
|
|
71
|
+
export declare function createMediaRendererTransport(options: MediaRendererTransportOptions): MediaRendererTransport;
|
|
72
|
+
//# sourceMappingURL=media-renderer-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-renderer-transport.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EACV,qBAAqB,EAErB,wBAAwB,EACzB,MAAM,2BAA2B,CAAC;AAInC,MAAM,WAAW,sBAAsB;IACrC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,KAAK,IAAI,IAAI,CAAC;IACd,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,8DAA8D;IAC9D,mBAAmB,CACjB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WA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ED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,6BAA6B,GACrC,sBAAsB,CAqZxB"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { type BoxStyle } from "supervision-js-core";
|
|
2
2
|
import type { BufferedDetectionTimeline } from "supervision-js-core";
|
|
3
|
+
import type { DetectionFrame } from "supervision-js-core";
|
|
3
4
|
import type { AnnotationStyleContext, Detection } from "supervision-js-core";
|
|
4
5
|
import type { Graphics as PixiGraphics } from "pixi.js";
|
|
5
6
|
import type { Container as PixiContainer } from "pixi.js";
|
|
6
7
|
export interface PixiBoxLayerState {
|
|
8
|
+
/** The frame this layer resolved and drew. The timeline's answer for one
|
|
9
|
+
* media time moves when a load lands, so this is the only record of which
|
|
10
|
+
* frame the screen actually got. */
|
|
11
|
+
readonly activeDetectionFrame: DetectionFrame | undefined;
|
|
7
12
|
readonly activeDetectionFrameTime: number | null;
|
|
8
13
|
readonly activeDetectionFrameIndex: number | null;
|
|
9
14
|
readonly activeDetectionCount: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-box-layer.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-box-layer.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,QAAQ,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"pixi-box-layer.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-box-layer.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,QAAQ,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO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AAC;IAC3C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAC7B,SAAS,EAAE,SAAS,KACjB,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACtC,GAAG,YAAY,CAyIf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PreparedIdMaskFrame } from "#render-preparation/mask-frame-artifact";
|
|
2
2
|
import type { FocusStyle } from "supervision-js-core";
|
|
3
3
|
import type { DetectionPickResult } from "supervision-js-core";
|
|
4
4
|
import type { Container as PixiContainer, ImageSource as PixiImageSource, Mesh as PixiMesh, MeshGeometry as PixiMeshGeometry, Shader as PixiShader, Texture as PixiTexture, UniformGroup as PixiUniformGroup } from "pixi.js";
|
|
@@ -30,6 +30,16 @@ type ShaderFactory = {
|
|
|
30
30
|
fragment: string;
|
|
31
31
|
vertex: string;
|
|
32
32
|
};
|
|
33
|
+
gpu: {
|
|
34
|
+
fragment: {
|
|
35
|
+
entryPoint: string;
|
|
36
|
+
source: string;
|
|
37
|
+
};
|
|
38
|
+
vertex: {
|
|
39
|
+
entryPoint: string;
|
|
40
|
+
source: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
33
43
|
resources: Record<string, unknown>;
|
|
34
44
|
}): PixiShader;
|
|
35
45
|
};
|
|
@@ -56,13 +66,20 @@ type PixiFocusGraphics = {
|
|
|
56
66
|
poly?(points: number[], close?: boolean): PixiFocusGraphics;
|
|
57
67
|
};
|
|
58
68
|
export interface PixiFocusMaskArtifact {
|
|
59
|
-
readonly frame:
|
|
69
|
+
readonly frame: PreparedIdMaskFrame;
|
|
60
70
|
readonly texture: PixiTexture;
|
|
61
71
|
}
|
|
62
72
|
export interface PixiFocusLayerFrameContext {
|
|
63
73
|
readonly frame: FocusDrawFrame | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* The detection frame the mask raster on screen belongs to, when the mask
|
|
76
|
+
* layer is holding that raster over the frame being drawn. A cutout cut from
|
|
77
|
+
* that raster is as current as the mask drawn from it.
|
|
78
|
+
*/
|
|
79
|
+
readonly heldMaskFrameTime?: number | null;
|
|
64
80
|
readonly hoveredPick: DetectionPickResult | null;
|
|
65
81
|
readonly idMaskArtifact?: PixiFocusMaskArtifact | null;
|
|
82
|
+
readonly isMaskArtifactOwed?: boolean;
|
|
66
83
|
readonly mediaTime: number;
|
|
67
84
|
readonly selectedPick: DetectionPickResult | null;
|
|
68
85
|
readonly viewportScale?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-focus-layer.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-focus-layer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pixi-focus-layer.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-focus-layer.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAGnF,OAAO,KAAK,EAAwB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAI/D,OAAO,KAAK,EACV,SAAS,IAAI,aAAa,EAC1B,WAAW,IAAI,eAAe,EAC9B,IAAI,IAAI,QAAQ,EAChB,YAAY,IAAI,gBAAgB,EAChC,MAAM,IAAI,UAAU,EACpB,OAAO,IAAI,WAAW,EACtB,YAAY,IAAI,gBAAgB,EACjC,MAAM,SAAS,CAAC;AAiBjB,KAAK,aAAa,GAAG,QAAQ,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;AAwB5D,KAAK,mBAAmB,GAAG,UAAU,iBAAiB,CAAC;AACvD,KAAK,oBAAoB,GAAG,UAAU,aAAa,CAAC;AACpD,KAAK,sBAAsB,GAAG,KAAK,OAAO,EAAE;IAC1C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,iBAAiB,CAAC;I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
+
import type { PixiBoxLayerState } from "./pixi-box-layer";
|
|
2
|
+
import type { PixiRegionLayerState } from "./pixi-region-layer";
|
|
3
|
+
import type { PresentedFrameId, PresentedVideoFrame } from "./presented-frame-channel";
|
|
4
|
+
type PresentedFrameStamp = Pick<PresentedVideoFrame, "frameId" | "mediaTimeS">;
|
|
5
|
+
/**
|
|
6
|
+
* Every drawing step of a present, each taking the media time in seconds. A
|
|
7
|
+
* step that reads a time from anywhere but its argument breaks the guarantee
|
|
8
|
+
* this module exists to hold.
|
|
9
|
+
*
|
|
10
|
+
* The mask step also takes the producer's name for the frame these pixels are,
|
|
11
|
+
* because it is the one step that keeps a raster between presents and so is the
|
|
12
|
+
* one step that can put a raster from one frame over the pixels of another. A
|
|
13
|
+
* walk with no presented frame hands it null: a pull-path sample and a redraw
|
|
14
|
+
* at a resting playhead both have a media time and no frame identity.
|
|
15
|
+
*/
|
|
16
|
+
export interface FramePresentLayers {
|
|
17
|
+
readonly drawMask: ((mediaTime: number, presentedFrameId: PresentedFrameId | null) => void) | undefined;
|
|
18
|
+
readonly drawBox: (mediaTime: number) => PixiBoxLayerState;
|
|
19
|
+
readonly drawPolygon: ((mediaTime: number) => void) | undefined;
|
|
20
|
+
readonly drawVector: (mediaTime: number) => void;
|
|
21
|
+
readonly drawRegion: (mediaTime: number) => PixiRegionLayerState;
|
|
22
|
+
readonly drawInteraction: ((mediaTime: number) => void) | undefined;
|
|
23
|
+
readonly drawFocus: (mediaTime: number) => void;
|
|
24
|
+
/** Moves the focus layer's fade to where the presented media time puts it. */
|
|
25
|
+
readonly advanceFocus: (mediaTime: number) => void;
|
|
26
|
+
readonly drawInteractionPresentation: (mediaTime: number) => void;
|
|
27
|
+
readonly drawLabel: ((mediaTime: number) => void) | undefined;
|
|
28
|
+
readonly drawAnnotationOverlay: (mediaTime: number) => void;
|
|
29
|
+
}
|
|
30
|
+
export interface FramePresentLayerStates {
|
|
31
|
+
readonly boxState: PixiBoxLayerState;
|
|
32
|
+
readonly regionState: PixiRegionLayerState;
|
|
33
|
+
}
|
|
34
|
+
export interface FramePresentTargets {
|
|
35
|
+
/** Adopts the presented time as the scene's media time, before anything draws. */
|
|
36
|
+
readonly adoptMediaTime: (mediaTime: number) => void;
|
|
37
|
+
readonly fitMediaScene: () => void;
|
|
38
|
+
readonly uploadFrame: (frame: VideoFrame) => void;
|
|
39
|
+
readonly layers: FramePresentLayers;
|
|
40
|
+
readonly render: () => void;
|
|
41
|
+
readonly completePresentation: (mediaTime: number, boxState: PixiBoxLayerState, regionState: PixiRegionLayerState) => void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The atomic present: one frame handed to the host becomes one composited screen.
|
|
45
|
+
*
|
|
46
|
+
* The media time is the one the producer published for the frame these pixels
|
|
47
|
+
* are, and it is the only time any step below sees. Nothing here awaits, so no
|
|
48
|
+
* other frame can be presented between the pixel upload and the annotations
|
|
49
|
+
* drawn over it, and nothing here consults a wall clock, a playhead getter or
|
|
50
|
+
* a store, so no step can disagree with the pixels about which moment is on
|
|
51
|
+
* screen. One render closes the block, after every layer has drawn; the frame
|
|
52
|
+
* is closed on the way out, once, by its only owner.
|
|
53
|
+
*/
|
|
54
|
+
export declare function presentVideoFrame(presented: PresentedVideoFrame, targets: FramePresentTargets): void;
|
|
55
|
+
/**
|
|
56
|
+
* The one declaration of the draw order: a present walks it, and so does a
|
|
57
|
+
* redraw at a resting playhead, so a layer cannot be in one sequence and be
|
|
58
|
+
* missing or out of place in the other.
|
|
59
|
+
*
|
|
60
|
+
* A walk with no presented frame is not a present, and has no frame timestamp
|
|
61
|
+
* to check its steps against.
|
|
62
|
+
*/
|
|
63
|
+
export declare function drawFramePresentLayers(layers: FramePresentLayers, mediaTime: number, presented?: PresentedFrameStamp): FramePresentLayerStates;
|
|
64
|
+
export type FramePresentStep = keyof FramePresentLayers;
|
|
65
|
+
/**
|
|
66
|
+
* The steps a walk would take, each reporting its cost, so a present that
|
|
67
|
+
* wants a timing breakdown still reads the one declared order.
|
|
68
|
+
*/
|
|
69
|
+
export declare function measureFramePresentLayers(layers: FramePresentLayers, measureStep: <T>(step: FramePresentStep, draw: () => T) => T): FramePresentLayers;
|
|
70
|
+
/**
|
|
71
|
+
* Fails when a step is handed anything but the presented media time. It reads
|
|
72
|
+
* as a tautology against the line above it, and that is the point: it is the
|
|
73
|
+
* line that breaks when someone later gives one step a time of its own.
|
|
74
|
+
*/
|
|
75
|
+
export declare function assertPresentedTimestamp(mediaTime: number, presented: PresentedFrameStamp): void;
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=pixi-frame-present.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pixi-frame-present.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-frame-present.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,2BAA2B,CAAC;AAUnC,KAAK,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,YAAY,CAAC,CAAC;AAE/E;;;;;;;;;;GAUG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EACb,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAC,GACxE,SAAS,CAAC;IACd,QAAQ,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,iBAAiB,CAAC;IAC3D,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAChE,QAAQ,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,UAAU,E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,EAC9B,OAAO,EAAE,mBAAmB,GAC3B,IAAI,CAqBN;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,kBAAkB,EAC1B,SAAS,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,mBAAmB,GAC9B,uBAAuB,CAczB;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,kBAAkB,CAAC;AAExD;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,kBAAkB,EAC1B,WAAW,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,GAC3D,kBAAkB,CAkCpB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,mBAAmB,GAC7B,IAAI,CAWN"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InjectedMeshConstructor, InjectedMeshGeometryConstructor, InjectedShaderFactory } from "#renderers/injected-pixi";
|
|
2
|
+
import type { PreparedIdMaskFrame } from "#render-preparation/mask-frame-artifact";
|
|
2
3
|
import type { ImageSource as PixiImageSource, Mesh as PixiMesh, MeshGeometry as PixiMeshGeometry, Shader as PixiShader, Texture as PixiTexture, UniformGroup as PixiUniformGroup } from "pixi.js";
|
|
3
4
|
type PixiIdMaskMesh = PixiMesh<PixiMeshGeometry, PixiShader>;
|
|
4
|
-
type MeshConstructor = new (options: {
|
|
5
|
-
geometry: PixiMeshGeometry;
|
|
6
|
-
shader: PixiShader;
|
|
7
|
-
}) => PixiIdMaskMesh;
|
|
8
5
|
type ImageSourceConstructor = new (options: {
|
|
9
6
|
autoGenerateMipmaps?: boolean;
|
|
10
7
|
dynamic: boolean;
|
|
@@ -13,22 +10,6 @@ type ImageSourceConstructor = new (options: {
|
|
|
13
10
|
scaleMode?: "linear" | "nearest";
|
|
14
11
|
width: number;
|
|
15
12
|
}) => PixiImageSource;
|
|
16
|
-
type MeshGeometryConstructor = new (options: {
|
|
17
|
-
indices: Uint32Array;
|
|
18
|
-
positions: Float32Array;
|
|
19
|
-
shrinkBuffersToFit: boolean;
|
|
20
|
-
topology: "triangle-list";
|
|
21
|
-
uvs: Float32Array;
|
|
22
|
-
}) => PixiMeshGeometry;
|
|
23
|
-
type ShaderFactory = {
|
|
24
|
-
from(options: {
|
|
25
|
-
gl: {
|
|
26
|
-
fragment: string;
|
|
27
|
-
vertex: string;
|
|
28
|
-
};
|
|
29
|
-
resources: Record<string, unknown>;
|
|
30
|
-
}): PixiShader;
|
|
31
|
-
};
|
|
32
13
|
type UniformGroupConstructor = new (uniforms: Record<string, {
|
|
33
14
|
type: "f32";
|
|
34
15
|
value: number;
|
|
@@ -45,15 +26,15 @@ export interface PixiIdMaskShaderRenderer {
|
|
|
45
26
|
readonly mesh: PixiIdMaskMesh;
|
|
46
27
|
clearTexture(): void;
|
|
47
28
|
hide(): void;
|
|
48
|
-
render(frame:
|
|
29
|
+
render(frame: PreparedIdMaskFrame, texture: PixiTexture): void;
|
|
49
30
|
setOpacity(opacity: number): void;
|
|
50
31
|
destroy(): void;
|
|
51
32
|
}
|
|
52
33
|
export declare function createPixiIdMaskShaderRenderer(options: {
|
|
53
34
|
readonly ImageSource: ImageSourceConstructor;
|
|
54
|
-
readonly Mesh:
|
|
55
|
-
readonly MeshGeometry:
|
|
56
|
-
readonly Shader:
|
|
35
|
+
readonly Mesh: InjectedMeshConstructor<PixiIdMaskMesh>;
|
|
36
|
+
readonly MeshGeometry: InjectedMeshGeometryConstructor;
|
|
37
|
+
readonly Shader: InjectedShaderFactory;
|
|
57
38
|
readonly UniformGroup: UniformGroupConstructor;
|
|
58
39
|
readonly mediaHeight: number;
|
|
59
40
|
readonly mediaWidth: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-id-mask-shader.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-id-mask-shader.ts"],"names":[],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AC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACvD,GAAG,oBAAoB,CAikBvB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PreparedIdMaskFrame } from "#render-preparation/mask-frame-artifact";
|
|
2
2
|
import type { Detection, DetectionFrame } from "supervision-js-core";
|
|
3
3
|
import type { DetectionPickResult } from "supervision-js-core";
|
|
4
4
|
import { type InteractionStyle } from "supervision-js-core";
|
|
@@ -35,6 +35,16 @@ type ShaderFactory = {
|
|
|
35
35
|
fragment: string;
|
|
36
36
|
vertex: string;
|
|
37
37
|
};
|
|
38
|
+
gpu: {
|
|
39
|
+
fragment: {
|
|
40
|
+
entryPoint: string;
|
|
41
|
+
source: string;
|
|
42
|
+
};
|
|
43
|
+
vertex: {
|
|
44
|
+
entryPoint: string;
|
|
45
|
+
source: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
38
48
|
resources: Record<string, unknown>;
|
|
39
49
|
}): PixiShader;
|
|
40
50
|
};
|
|
@@ -48,7 +58,7 @@ type UniformGroupConstructor = new (uniforms: Record<string, {
|
|
|
48
58
|
value: Float32Array;
|
|
49
59
|
}>) => PixiUniformGroup;
|
|
50
60
|
export interface PixiInteractionMaskArtifact {
|
|
51
|
-
readonly frame:
|
|
61
|
+
readonly frame: PreparedIdMaskFrame;
|
|
52
62
|
readonly texture: PixiTexture;
|
|
53
63
|
}
|
|
54
64
|
export interface PixiInteractionPresentationLayerFrameContext {
|