supervision 0.1.7 → 0.2.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/detections/chunked-detection-frame-source.d.ts.map +1 -1
- package/dist/index.d.ts +11 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8856 -4559
- package/dist/index.js.map +1 -1
- package/dist/mask-preparation.worker.js +310 -164
- 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-condition-probe.d.ts +51 -0
- package/dist/media/media-condition-probe.d.ts.map +1 -0
- package/dist/media/media-conditions.d.ts +28 -0
- package/dist/media/media-conditions.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.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 +44 -0
- package/dist/media/video-engine-media-source.d.ts.map +1 -0
- package/dist/render-preparation/mask-frame-artifact.d.ts +46 -12
- package/dist/render-preparation/mask-frame-artifact.d.ts.map +1 -1
- package/dist/render-preparation/mask-frame-compositor.d.ts +5 -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 +12 -3
- package/dist/render-preparation/mask-preparation-worker-protocol.d.ts.map +1 -1
- package/dist/render-preparation/prepared-render-window.d.ts +23 -0
- 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/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.map +1 -1
- package/dist/renderers/media-renderer-scene.d.ts +37 -0
- package/dist/renderers/media-renderer-scene.d.ts.map +1 -1
- package/dist/renderers/media-renderer-state.d.ts +11 -1
- package/dist/renderers/media-renderer-state.d.ts.map +1 -1
- package/dist/renderers/media-renderer-transport.d.ts +59 -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 +18 -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 +12 -2
- 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 +13 -2
- package/dist/renderers/pixi-interaction-presentation-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-mask-halo.d.ts +24 -0
- package/dist/renderers/pixi-mask-halo.d.ts.map +1 -1
- package/dist/renderers/pixi-mask-layer.d.ts +71 -8
- 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 +7 -2
- package/dist/renderers/pixi-polygon-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-region-coverage-mask.d.ts +91 -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 +68 -2
- package/dist/renderers/pixi-region-layer.d.ts.map +1 -1
- 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 +107 -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 +58 -3
- package/dist/tracking.worker.js.map +1 -1
- package/dist/types/media-conditions.d.ts +149 -0
- package/dist/types/media-conditions.d.ts.map +1 -0
- 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 -8
- package/dist/types/media-session.d.ts.map +1 -1
- package/dist/types/render-preparation.d.ts +101 -4
- package/dist/types/render-preparation.d.ts.map +1 -1
- package/dist/web-video-engine/analysis-session.d.ts +76 -0
- package/dist/web-video-engine/analysis-session.d.ts.map +1 -0
- package/dist/web-video-engine/analysis.d.ts +7 -0
- package/dist/web-video-engine/analysis.d.ts.map +1 -0
- package/dist/web-video-engine/analysis.js +1678 -0
- package/dist/web-video-engine/analysis.js.map +1 -0
- package/dist/web-video-engine/cache-budget.d.ts +19 -0
- package/dist/web-video-engine/cache-budget.d.ts.map +1 -0
- package/dist/web-video-engine/canvas-sink-scrub-cursor.d.ts +90 -0
- package/dist/web-video-engine/canvas-sink-scrub-cursor.d.ts.map +1 -0
- package/dist/web-video-engine/clock.d.ts +83 -0
- package/dist/web-video-engine/clock.d.ts.map +1 -0
- package/dist/web-video-engine/constants.d.ts +253 -0
- package/dist/web-video-engine/constants.d.ts.map +1 -0
- package/dist/web-video-engine/create-scrub-cursor.d.ts +62 -0
- package/dist/web-video-engine/create-scrub-cursor.d.ts.map +1 -0
- package/dist/web-video-engine/decode-resolution.d.ts +115 -0
- package/dist/web-video-engine/decode-resolution.d.ts.map +1 -0
- package/dist/web-video-engine/decode-scheduler.d.ts +356 -0
- package/dist/web-video-engine/decode-scheduler.d.ts.map +1 -0
- package/dist/web-video-engine/decode-session.d.ts +276 -0
- package/dist/web-video-engine/decode-session.d.ts.map +1 -0
- package/dist/web-video-engine/decode-source.d.ts +250 -0
- package/dist/web-video-engine/decode-source.d.ts.map +1 -0
- package/dist/web-video-engine/diagnostics-store.d.ts +18 -0
- package/dist/web-video-engine/diagnostics-store.d.ts.map +1 -0
- package/dist/web-video-engine/diagnostics.d.ts +316 -0
- package/dist/web-video-engine/diagnostics.d.ts.map +1 -0
- package/dist/web-video-engine/embedded-engine-worker.d.ts +2 -0
- package/dist/web-video-engine/embedded-engine-worker.d.ts.map +1 -0
- package/dist/web-video-engine/engine-core.d.ts +258 -0
- package/dist/web-video-engine/engine-core.d.ts.map +1 -0
- package/dist/web-video-engine/engine.d.ts +26 -0
- package/dist/web-video-engine/engine.d.ts.map +1 -0
- package/dist/web-video-engine/engine.js +873 -0
- package/dist/web-video-engine/engine.js.map +1 -0
- package/dist/web-video-engine/engine.worker.d.ts +2 -0
- package/dist/web-video-engine/engine.worker.d.ts.map +1 -0
- package/dist/web-video-engine/engine.worker.js +31320 -0
- package/dist/web-video-engine/engine.worker.js.map +1 -0
- package/dist/web-video-engine/frame-cache.d.ts +129 -0
- package/dist/web-video-engine/frame-cache.d.ts.map +1 -0
- package/dist/web-video-engine/frame-extractor.d.ts +28 -0
- package/dist/web-video-engine/frame-extractor.d.ts.map +1 -0
- package/dist/web-video-engine/frame-timeline-GINI8Gum.js +560 -0
- package/dist/web-video-engine/frame-timeline-GINI8Gum.js.map +1 -0
- package/dist/web-video-engine/frame-timeline.d.ts +71 -0
- package/dist/web-video-engine/frame-timeline.d.ts.map +1 -0
- package/dist/web-video-engine/frame-walker.d.ts +74 -0
- package/dist/web-video-engine/frame-walker.d.ts.map +1 -0
- package/dist/web-video-engine/index.d.ts +3 -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 +65 -0
- package/dist/web-video-engine/key-packet.d.ts.map +1 -0
- package/dist/web-video-engine/keyframe-index.d.ts +91 -0
- package/dist/web-video-engine/keyframe-index.d.ts.map +1 -0
- package/dist/web-video-engine/mirror-store.d.ts +56 -0
- package/dist/web-video-engine/mirror-store.d.ts.map +1 -0
- package/dist/web-video-engine/renderer.d.ts +94 -0
- package/dist/web-video-engine/renderer.d.ts.map +1 -0
- package/dist/web-video-engine/rotation.d.ts +35 -0
- package/dist/web-video-engine/rotation.d.ts.map +1 -0
- package/dist/web-video-engine/scrub-controller.d.ts +376 -0
- package/dist/web-video-engine/scrub-controller.d.ts.map +1 -0
- package/dist/web-video-engine/scrub-cursor.d.ts +342 -0
- package/dist/web-video-engine/scrub-cursor.d.ts.map +1 -0
- package/dist/web-video-engine/scrub-trajectory.d.ts +30 -0
- package/dist/web-video-engine/scrub-trajectory.d.ts.map +1 -0
- package/dist/web-video-engine/source-residency.d.ts +57 -0
- package/dist/web-video-engine/source-residency.d.ts.map +1 -0
- package/dist/web-video-engine/trace-recorder.d.ts +164 -0
- package/dist/web-video-engine/trace-recorder.d.ts.map +1 -0
- package/dist/web-video-engine/types.d.ts +204 -0
- package/dist/web-video-engine/types.d.ts.map +1 -0
- package/dist/web-video-engine/video-engine.d.ts +426 -0
- package/dist/web-video-engine/video-engine.d.ts.map +1 -0
- package/dist/web-video-engine/webgpu-renderer.d.ts +62 -0
- package/dist/web-video-engine/webgpu-renderer.d.ts.map +1 -0
- package/dist/web-video-engine/worker-bridge.d.ts +12 -0
- package/dist/web-video-engine/worker-bridge.d.ts.map +1 -0
- package/dist/web-video-engine/worker-dispatch.d.ts +17 -0
- package/dist/web-video-engine/worker-dispatch.d.ts.map +1 -0
- package/dist/web-video-engine/worker-protocol.d.ts +267 -0
- package/dist/web-video-engine/worker-protocol.d.ts.map +1 -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 +4 -3
- package/node_modules/supervision-js-core/dist/index.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/index.js +1075 -266
- 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 +179 -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 +78 -2
- 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 +16 -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 +15 -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 +22 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A frame of the source, named by its place in presentation order and by its
|
|
3
|
+
* presentation timestamp in the container's own integer grain.
|
|
4
|
+
*/
|
|
5
|
+
export interface PresentedFrameId {
|
|
6
|
+
readonly index: number;
|
|
7
|
+
readonly ticks: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* One frame a push-based media producer has decided is on screen, carrying the
|
|
11
|
+
* frame it is and the media time it stands for. Whoever receives it owns it and
|
|
12
|
+
* must close it.
|
|
13
|
+
*/
|
|
14
|
+
export interface PresentedVideoFrame {
|
|
15
|
+
readonly frameId: PresentedFrameId;
|
|
16
|
+
/**
|
|
17
|
+
* The producer's count of the paints it has made, which is what its own
|
|
18
|
+
* diagnostics name a paint by. Two paints of one frame carry different
|
|
19
|
+
* numbers, so this is the only key that joins a frame the renderer drew to
|
|
20
|
+
* the paint the producer recorded making.
|
|
21
|
+
*/
|
|
22
|
+
readonly paintSeq: number;
|
|
23
|
+
/**
|
|
24
|
+
* The producer's seconds for `frameId`. The producer also states the position
|
|
25
|
+
* in milliseconds, and this deliberately does not carry it: that value is the
|
|
26
|
+
* seconds scaled by a thousand, so dividing it back is not the identity, and
|
|
27
|
+
* on a container whose tick grain is not whole milliseconds, an NTSC
|
|
28
|
+
* 30000/1001 track among them, the result names no frame at all.
|
|
29
|
+
*/
|
|
30
|
+
readonly mediaTimeS: number;
|
|
31
|
+
readonly frame: VideoFrame;
|
|
32
|
+
}
|
|
33
|
+
/** Where the producer's playhead sits, named as a frame of the source. */
|
|
34
|
+
export interface PresentedFramePlayhead {
|
|
35
|
+
readonly frame: PresentedFrameId;
|
|
36
|
+
readonly mediaTimeS: number;
|
|
37
|
+
}
|
|
38
|
+
/** Coarse producer status, reported in the producer's own vocabulary. */
|
|
39
|
+
export type PresentedFrameChannelStatus = "IDLE" | "LOADING" | "READY" | "PLAYING" | "PAUSED" | "SEEKING" | "ENDED" | "ERRORED";
|
|
40
|
+
/**
|
|
41
|
+
* Whether a seek is a gesture still moving or a jump to a destination. A
|
|
42
|
+
* producer may answer a gesture from a cheap cache and a jump exactly.
|
|
43
|
+
*/
|
|
44
|
+
export type PresentedFrameSeekIntent = "gesture" | "jump";
|
|
45
|
+
/**
|
|
46
|
+
* Producer signals, one per cadence: `time` on every playhead move, `state` on
|
|
47
|
+
* coarse status transitions, `seeking` when a seek starts or settles, `rate`
|
|
48
|
+
* when the playback speed changes.
|
|
49
|
+
*/
|
|
50
|
+
export type PresentedFrameChannelSignal = "time" | "state" | "seeking" | "rate";
|
|
51
|
+
/**
|
|
52
|
+
* A producer's presented-frame plane. Registering replaces any previous
|
|
53
|
+
* handler, so the registered handler is the single owner of every frame.
|
|
54
|
+
*/
|
|
55
|
+
export interface PresentedFrameSource {
|
|
56
|
+
onPresentedFrame(handler: (presented: PresentedVideoFrame) => void): void;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The frame plane plus the transport that moves it. Everything below the frames
|
|
60
|
+
* is the playhead, and the producer owns it: a renderer holding this channel
|
|
61
|
+
* asks rather than decides.
|
|
62
|
+
*/
|
|
63
|
+
export interface PresentedFrameChannel extends PresentedFrameSource {
|
|
64
|
+
/**
|
|
65
|
+
* Runs the playhead forward from where it stands, and from `ENDED` restarts
|
|
66
|
+
* at the start of the source.
|
|
67
|
+
*
|
|
68
|
+
* A channel never loops itself. A renderer told to loop replays by calling
|
|
69
|
+
* this when the status turns `ENDED`, so a channel that resumes in place
|
|
70
|
+
* from `ENDED` never loops.
|
|
71
|
+
*/
|
|
72
|
+
play(): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Stops the playhead where it stands. A pause asked for here outranks the
|
|
75
|
+
* freeze `beginInteractiveSeek` holds, so the `endInteractiveSeek` that ends
|
|
76
|
+
* the drag has nothing left to resume.
|
|
77
|
+
*/
|
|
78
|
+
pause(): void;
|
|
79
|
+
/** Latest-wins seek for a gesture in flight; returns without settling. */
|
|
80
|
+
scrub(timeMs: number, intent?: PresentedFrameSeekIntent): void;
|
|
81
|
+
/** Seek that settles: resolves once the producer has landed on `timeMs`. */
|
|
82
|
+
commit(timeMs: number): Promise<void>;
|
|
83
|
+
/** Walks one real source frame in presentation order. */
|
|
84
|
+
step(direction: 1 | -1): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Forward playback speed, in media seconds per wall second. Throws on a rate
|
|
87
|
+
* the producer cannot play, reverse included.
|
|
88
|
+
*/
|
|
89
|
+
setPlaybackRate(rate: number): void;
|
|
90
|
+
getPlaybackRate(): number;
|
|
91
|
+
/** Freezes a playing producer for the length of a drag. */
|
|
92
|
+
beginInteractiveSeek(): void;
|
|
93
|
+
/** Resumes play only if `beginInteractiveSeek` was what paused it. */
|
|
94
|
+
endInteractiveSeek(): Promise<void>;
|
|
95
|
+
getPlayhead(): PresentedFramePlayhead;
|
|
96
|
+
getDurationMs(): number;
|
|
97
|
+
getStatus(): PresentedFrameChannelStatus;
|
|
98
|
+
getSeeking(): boolean;
|
|
99
|
+
subscribe(signal: PresentedFrameChannelSignal, listener: () => void): () => void;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Reads the presented-frame plane an opened media source publishes as `engine`.
|
|
103
|
+
* A source without one is pull-only, and the renderer keeps driving it by
|
|
104
|
+
* asking for samples.
|
|
105
|
+
*/
|
|
106
|
+
export declare function resolvePresentedFrameChannel(source: unknown): PresentedFrameChannel | null;
|
|
107
|
+
//# sourceMappingURL=presented-frame-channel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presented-frame-channel.d.ts","sourceRoot":"","sources":["../../src/renderers/presented-frame-channel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;CAC5B;AAED,0EAA0E;AAC1E,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,yEAAyE;AACzE,MAAM,MAAM,2BAA2B,GACnC,MAAM,GACN,SAAS,GACT,OAAO,GACP,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,SAAS,CAAC;AAEd;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,MAAM,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEhF;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,mBAAmB,KAAK,IAAI,GAAG,IAAI,CAAC;CAC3E;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB;IACjE;;;;;;;OAOG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB;;;;OAIG;IACH,KAAK,IAAI,IAAI,CAAC;IACd,0EAA0E;IAC1E,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAC/D,4EAA4E;IAC5E,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,yDAAyD;IACzD,IAAI,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC;;;OAGG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,eAAe,IAAI,MAAM,CAAC;IAC1B,2DAA2D;IAC3D,oBAAoB,IAAI,IAAI,CAAC;IAC7B,sEAAsE;IACtE,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,WAAW,IAAI,sBAAsB,CAAC;IACtC,aAAa,IAAI,MAAM,CAAC;IACxB,SAAS,IAAI,2BAA2B,CAAC;IACzC,UAAU,IAAI,OAAO,CAAC;IACtB,SAAS,CACP,MAAM,EAAE,2BAA2B,EACnC,QAAQ,EAAE,MAAM,IAAI,GACnB,MAAM,IAAI,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,OAAO,GACd,qBAAqB,GAAG,IAAI,CAQ9B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A comparable description of everything a render would put on screen. Values
|
|
3
|
+
* are compared position by position with `Object.is`, so a notification whose
|
|
4
|
+
* description matches the one already drawn costs nothing.
|
|
5
|
+
*/
|
|
6
|
+
export type SceneRenderSignature = readonly unknown[];
|
|
7
|
+
export interface SceneRenderScheduler {
|
|
8
|
+
/** Renders only when the description differs from what was last drawn. */
|
|
9
|
+
renderOnChange(signature: SceneRenderSignature): boolean;
|
|
10
|
+
/** Renders whatever the description says, for pixels that changed outside it. */
|
|
11
|
+
render(signature: SceneRenderSignature): void;
|
|
12
|
+
/** Renders this scheduler issued, which is every render under its policy. */
|
|
13
|
+
getRenderCount(): number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Turns change notifications into renders. It owns no timer, no ticker and no
|
|
17
|
+
* animation frame: a scheduler nobody notifies renders nothing, forever.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createSceneRenderScheduler(draw: () => void): SceneRenderScheduler;
|
|
20
|
+
//# sourceMappingURL=scene-render-scheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-render-scheduler.d.ts","sourceRoot":"","sources":["../../src/renderers/scene-render-scheduler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,SAAS,OAAO,EAAE,CAAC;AAEtD,MAAM,WAAW,oBAAoB;IACnC,0EAA0E;IAC1E,cAAc,CAAC,SAAS,EAAE,oBAAoB,GAAG,OAAO,CAAC;IACzD,iFAAiF;IACjF,MAAM,CAAC,SAAS,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC9C,6EAA6E;IAC7E,cAAc,IAAI,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,MAAM,IAAI,GACf,oBAAoB,CA0BtB"}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import type { DetectionBufferOptions, DetectionFrameRetentionOptions } from "supervision-js-core";
|
|
2
2
|
import type { RenderPreparationOptions } from "#types/render-preparation";
|
|
3
|
-
import type { MediaSessionAppendableDetectionOptions,
|
|
3
|
+
import type { MediaSessionAppendableDetectionOptions, MediaSessionMode, MediaSessionOptions } from "#types/media-session";
|
|
4
4
|
export interface ResolvedMediaSessionDefaults {
|
|
5
5
|
readonly detectionBuffer: DetectionBufferOptions;
|
|
6
6
|
readonly renderPreparation: RenderPreparationOptions;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
/**
|
|
9
|
+
* The detection-buffer and render-preparation configuration a session created
|
|
10
|
+
* with these options actually runs on.
|
|
11
|
+
*
|
|
12
|
+
* `createMediaSession` resolves its options through this, so a host can read
|
|
13
|
+
* the numbers a session will use, and show or log them, without restating the
|
|
14
|
+
* defaults itself.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveMediaSessionDefaults(options: Pick<MediaSessionOptions, "detections" | "mode" | "playbackGate" | "renderer">): ResolvedMediaSessionDefaults;
|
|
13
17
|
export declare function resolveMediaSessionAppendableRetention(options: {
|
|
14
18
|
readonly mode?: MediaSessionMode;
|
|
15
19
|
readonly appendable?: MediaSessionAppendableDetectionOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-session-defaults.d.ts","sourceRoot":"","sources":["../../src/sessions/media-session-defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,8BAA8B,EAC/B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EACV,sCAAsC,EACtC,
|
|
1
|
+
{"version":3,"file":"media-session-defaults.d.ts","sourceRoot":"","sources":["../../src/sessions/media-session-defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,8BAA8B,EAC/B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EACV,sCAAsC,EACtC,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAuD9B,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,eAAe,EAAE,sBAAsB,CAAC;IACjD,QAAQ,CAAC,iBAAiB,EAAE,wBAAwB,CAAC;CACtD;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,IAAI,CACX,mBAAmB,EACnB,YAAY,GAAG,MAAM,GAAG,cAAc,GAAG,UAAU,CACpD,GACA,4BAA4B,CAgF9B;AAED,wBAAgB,sCAAsC,CAAC,OAAO,EAAE;IAC9D,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,sCAAsC,CAAC;CAC9D,GAAG,8BAA8B,CAgCjC;AAED,wBAAgB,oCAAoC,CAAC,OAAO,EAAE;IAC5D,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,sCAAsC,CAAC;CAC5D,GAAG,8BAA8B,CAKjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-session-media.d.ts","sourceRoot":"","sources":["../../src/sessions/media-session-media.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"media-session-media.d.ts","sourceRoot":"","sources":["../../src/sessions/media-session-media.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACtB,gCAAgC,EACjC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,GAAG,KAAK,CAAC,CAAC;IAC5E,QAAQ,CAAC,KAAK,EAAE,sBAAsB,CAAC;IACvC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,UAAU,4BAA4B;IACpC,uBAAuB,IAAI,IAAI,CAAC;IAChC,uBAAuB,CAAC,QAAQ,EAAE;QAChC,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;KACvB,GAAG,IAAI,CAAC;IACT,oBAAoB,IAAI,IAAI,CAAC;CAC9B;AAED,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,KAAK,GAAG,gCAAgC,GAAG,SAAS,EAC/D,SAAS,EAAE,4BAA4B,GACtC,OAAO,CAAC,oBAAoB,CAAC,CAkH/B;AAED,wBAAgB,qBAAqB,IAAI,sBAAsB,CAO9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-session-state.d.ts","sourceRoot":"","sources":["../../src/sessions/media-session-state.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,
|
|
1
|
+
{"version":3,"file":"media-session-state.d.ts","sourceRoot":"","sources":["../../src/sessions/media-session-state.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAIL,KAAK,4BAA4B,EAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAML,KAAK,sBAAsB,EAC3B,KAAK,8BAA8B,EACnC,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,sBAAsB,CAAC;IACvC,QAAQ,CAAC,aAAa,EAAE,8BAA8B,GAAG,IAAI,CAAC;IAC9D,QAAQ,CAAC,iBAAiB,EAAE,4BAA4B,GAAG,IAAI,CAAC;IAChE,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAC9C;AAED,wBAAgB,+BAA+B,CAAC,EAC9C,YAAY,EACZ,KAAK,EACL,aAAa,EACb,iBAAiB,EACjB,QAAQ,GACT,EAAE,8BAA8B,GAAG,iBAAiB,CAiMpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-session.d.ts","sourceRoot":"","sources":["../../src/sessions/media-session.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,gBAAgB,EAKhB,mBAAmB,EAEpB,MAAM,sBAAsB,CAAC;AAoB9B;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"media-session.d.ts","sourceRoot":"","sources":["../../src/sessions/media-session.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,gBAAgB,EAKhB,mBAAmB,EAEpB,MAAM,sBAAsB,CAAC;AAoB9B;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CAqf3B"}
|
package/dist/tracking.worker.js
CHANGED
|
@@ -17,6 +17,12 @@
|
|
|
17
17
|
(function (DetectionBufferStatus) {
|
|
18
18
|
DetectionBufferStatus["Idle"] = "idle";
|
|
19
19
|
DetectionBufferStatus["Loading"] = "loading";
|
|
20
|
+
/**
|
|
21
|
+
* The playback gate is holding playback until the source produces detections
|
|
22
|
+
* for the requested range. {@link DetectionBufferStatus.Loading} fetches
|
|
23
|
+
* detections the source already has; this one waits on a producer.
|
|
24
|
+
*/
|
|
25
|
+
DetectionBufferStatus["AwaitingCoverage"] = "awaitingCoverage";
|
|
20
26
|
DetectionBufferStatus["Ready"] = "ready";
|
|
21
27
|
DetectionBufferStatus["Error"] = "error";
|
|
22
28
|
DetectionBufferStatus["Destroyed"] = "destroyed";
|
|
@@ -29,12 +35,30 @@
|
|
|
29
35
|
/**
|
|
30
36
|
* Select the frame whose `[mediaTime, endTime)` interval contains the media
|
|
31
37
|
* time. This is the default for interval annotations and timestamped sources.
|
|
38
|
+
*
|
|
39
|
+
* Frame times must come from the media itself. Times reconstructed from a
|
|
40
|
+
* nominal frame rate drift against a clip whose real rate differs, and once
|
|
41
|
+
* that drift passes the half-millisecond selection tolerance a playhead
|
|
42
|
+
* landing on a frame boundary selects the previous frame's detections.
|
|
43
|
+
*
|
|
44
|
+
* A frame that carries no `endTime` stays active until the next frame starts,
|
|
45
|
+
* which bridges an index the source never produced.
|
|
46
|
+
* {@link DetectionFrameSelectionMode.NearestFrameIndex} bounds each frame to
|
|
47
|
+
* one grid step instead, so a missing index reads as no detections.
|
|
32
48
|
*/
|
|
33
49
|
DetectionFrameSelectionMode["Interval"] = "interval";
|
|
34
50
|
/**
|
|
35
|
-
* Select from a known inference frame grid using `frameIndex
|
|
36
|
-
*
|
|
37
|
-
*
|
|
51
|
+
* Select from a known inference frame grid using `frameIndex` and
|
|
52
|
+
* `frameRate`. This is useful when inference was run on normalized frames and
|
|
53
|
+
* playback should snap detections to that grid.
|
|
54
|
+
*
|
|
55
|
+
* A frame speaks for one grid step starting at its own media time, and an
|
|
56
|
+
* index the source never produced selects nothing rather than a neighbour.
|
|
57
|
+
*
|
|
58
|
+
* A frame carrying no `frameIndex` speaks for its step on the same terms,
|
|
59
|
+
* reached by the time it starts at rather than by an index that names it. Its
|
|
60
|
+
* `endTime` does not widen it past that step, so a source that labels only
|
|
61
|
+
* part of what it writes cannot bridge the indexes it never produced.
|
|
38
62
|
*/
|
|
39
63
|
DetectionFrameSelectionMode["NearestFrameIndex"] = "nearestFrameIndex";
|
|
40
64
|
})(DetectionFrameSelectionMode || (DetectionFrameSelectionMode = {}));
|
|
@@ -1398,6 +1422,30 @@
|
|
|
1398
1422
|
MediaSourceStatus["Error"] = "error";
|
|
1399
1423
|
MediaSourceStatus["Destroyed"] = "destroyed";
|
|
1400
1424
|
})(MediaSourceStatus || (MediaSourceStatus = {}));
|
|
1425
|
+
/**
|
|
1426
|
+
* Current renderer state.
|
|
1427
|
+
*/
|
|
1428
|
+
/**
|
|
1429
|
+
* What a playback gate holds back.
|
|
1430
|
+
*
|
|
1431
|
+
* A source the renderer pulls samples from can be held between any two frames,
|
|
1432
|
+
* because the renderer decides when each one is drawn. A source that presents
|
|
1433
|
+
* its own frames owns the playhead, so holding it means stopping the producer
|
|
1434
|
+
* and starting it again, which the detection gate does and the
|
|
1435
|
+
* render-preparation gate does not.
|
|
1436
|
+
*/
|
|
1437
|
+
var PlaybackGateReach;
|
|
1438
|
+
(function (PlaybackGateReach) {
|
|
1439
|
+
/** No gate: the picture moves and unprepared layers are absent from it. */
|
|
1440
|
+
PlaybackGateReach["Off"] = "off";
|
|
1441
|
+
/**
|
|
1442
|
+
* Playback waits to begin, and stops again at any frame whose artifacts are
|
|
1443
|
+
* missing, until they arrive or the gate's own wait bound gives up on them.
|
|
1444
|
+
*/
|
|
1445
|
+
PlaybackGateReach["EveryFrame"] = "everyFrame";
|
|
1446
|
+
/** Playback waits to begin; frames after that are not held. */
|
|
1447
|
+
PlaybackGateReach["StartOfPlayback"] = "startOfPlayback";
|
|
1448
|
+
})(PlaybackGateReach || (PlaybackGateReach = {}));
|
|
1401
1449
|
|
|
1402
1450
|
/**
|
|
1403
1451
|
* Media-session operating mode.
|
|
@@ -1438,6 +1486,13 @@
|
|
|
1438
1486
|
*/
|
|
1439
1487
|
var MediaSessionActivityKind;
|
|
1440
1488
|
(function (MediaSessionActivityKind) {
|
|
1489
|
+
/**
|
|
1490
|
+
* Playback is held waiting for a producer to emit detections for the frame
|
|
1491
|
+
* about to be shown, which is a wait on inference rather than on transfer or
|
|
1492
|
+
* decode. `DetectionsBuffering` is the transfer of detections that already
|
|
1493
|
+
* exist, and `PlaybackBuffering` is the wait for media bytes.
|
|
1494
|
+
*/
|
|
1495
|
+
MediaSessionActivityKind["DetectionsAwaitingCoverage"] = "detectionsAwaitingCoverage";
|
|
1441
1496
|
MediaSessionActivityKind["DetectionsBuffering"] = "detectionsBuffering";
|
|
1442
1497
|
MediaSessionActivityKind["DetectionsLoading"] = "detectionsLoading";
|
|
1443
1498
|
MediaSessionActivityKind["Error"] = "error";
|