supervision 0.2.5 → 0.2.6
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/depth-preview-probe-DG7McQEN.js +314 -0
- package/dist/depth-preview-probe-DG7McQEN.js.map +1 -0
- package/dist/depth-preview-track-BvgwNEE9.js +612 -0
- package/dist/depth-preview-track-BvgwNEE9.js.map +1 -0
- package/dist/detections/chunked-detection-frame-source.d.ts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9504 -4719
- package/dist/index.js.map +1 -1
- package/dist/mask-preparation.worker.js +658 -21
- package/dist/mask-preparation.worker.js.map +1 -1
- package/dist/media/decoder-deadline.d.ts +18 -0
- package/dist/media/decoder-deadline.d.ts.map +1 -0
- package/dist/media/depth-preview-probe.d.ts +65 -0
- package/dist/media/depth-preview-probe.d.ts.map +1 -0
- package/dist/media/depth-preview-track.d.ts +96 -0
- package/dist/media/depth-preview-track.d.ts.map +1 -0
- package/dist/media/media-normalization.d.ts.map +1 -1
- package/dist/media/media-source.d.ts +7 -0
- package/dist/media/media-source.d.ts.map +1 -1
- package/dist/media/mediabunny-frame-clock.d.ts +7 -0
- package/dist/media/mediabunny-frame-clock.d.ts.map +1 -0
- package/dist/media/mediabunny-media-source.d.ts +3 -0
- package/dist/media/mediabunny-media-source.d.ts.map +1 -1
- package/dist/media/track-frame-index.d.ts +14 -0
- package/dist/media/track-frame-index.d.ts.map +1 -0
- package/dist/media/video-engine-media-source.d.ts.map +1 -1
- package/dist/media/video-engine-media-source.js +1 -1
- package/dist/render-preparation/depth/clip-preview.d.ts +41 -0
- package/dist/render-preparation/depth/clip-preview.d.ts.map +1 -0
- package/dist/render-preparation/depth/clip-timing.d.ts +18 -0
- package/dist/render-preparation/depth/clip-timing.d.ts.map +1 -0
- package/dist/render-preparation/depth/clip.d.ts +14 -0
- package/dist/render-preparation/depth/clip.d.ts.map +1 -0
- package/dist/render-preparation/depth/exact-at-rest.d.ts +44 -0
- package/dist/render-preparation/depth/exact-at-rest.d.ts.map +1 -0
- package/dist/render-preparation/depth/exact-playback.d.ts +40 -0
- package/dist/render-preparation/depth/exact-playback.d.ts.map +1 -0
- package/dist/render-preparation/depth/files.d.ts +55 -0
- package/dist/render-preparation/depth/files.d.ts.map +1 -0
- package/dist/render-preparation/depth/frame-decode.d.ts +20 -0
- package/dist/render-preparation/depth/frame-decode.d.ts.map +1 -0
- package/dist/render-preparation/depth/frame-preparer.d.ts +51 -0
- package/dist/render-preparation/depth/frame-preparer.d.ts.map +1 -0
- package/dist/render-preparation/depth/frame-window.d.ts +146 -0
- package/dist/render-preparation/depth/frame-window.d.ts.map +1 -0
- package/dist/render-preparation/depth/options.d.ts +37 -0
- package/dist/render-preparation/depth/options.d.ts.map +1 -0
- package/dist/render-preparation/depth/png16.d.ts +40 -0
- package/dist/render-preparation/depth/png16.d.ts.map +1 -0
- package/dist/render-preparation/depth/preview-luma-copier.d.ts +12 -0
- package/dist/render-preparation/depth/preview-luma-copier.d.ts.map +1 -0
- package/dist/render-preparation/depth/preview-luma.d.ts +48 -0
- package/dist/render-preparation/depth/preview-luma.d.ts.map +1 -0
- package/dist/render-preparation/depth/source.d.ts +123 -0
- package/dist/render-preparation/depth/source.d.ts.map +1 -0
- package/dist/render-preparation/depth/worker-protocol.d.ts +76 -0
- package/dist/render-preparation/depth/worker-protocol.d.ts.map +1 -0
- package/dist/render-preparation/playhead-motion.d.ts +67 -0
- package/dist/render-preparation/playhead-motion.d.ts.map +1 -0
- package/dist/render-preparation/prepared-render-window.d.ts +12 -0
- package/dist/render-preparation/prepared-render-window.d.ts.map +1 -1
- package/dist/renderers/depth-textures.d.ts +79 -0
- package/dist/renderers/depth-textures.d.ts.map +1 -0
- package/dist/renderers/id-mask-stroke-coverage.d.ts +3 -0
- package/dist/renderers/id-mask-stroke-coverage.d.ts.map +1 -0
- package/dist/renderers/media-renderer-core.d.ts.map +1 -1
- package/dist/renderers/media-renderer-scene.d.ts +14 -1
- package/dist/renderers/media-renderer-scene.d.ts.map +1 -1
- package/dist/renderers/pixi-batch-texture-bindings.d.ts +9 -0
- package/dist/renderers/pixi-batch-texture-bindings.d.ts.map +1 -0
- package/dist/renderers/pixi-depth-layer.d.ts +76 -0
- package/dist/renderers/pixi-depth-layer.d.ts.map +1 -0
- package/dist/renderers/pixi-depth-shader.d.ts +76 -0
- package/dist/renderers/pixi-depth-shader.d.ts.map +1 -0
- package/dist/renderers/pixi-focus-layer.d.ts +1 -0
- package/dist/renderers/pixi-focus-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-frame-present.d.ts +1 -0
- package/dist/renderers/pixi-frame-present.d.ts.map +1 -1
- package/dist/renderers/pixi-id-mask-shader.d.ts +1 -0
- package/dist/renderers/pixi-id-mask-shader.d.ts.map +1 -1
- package/dist/renderers/pixi-interaction-layer.d.ts +1 -1
- package/dist/renderers/pixi-interaction-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-interaction-presentation-layer.d.ts +1 -0
- package/dist/renderers/pixi-interaction-presentation-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-mask-halo.d.ts +1 -0
- package/dist/renderers/pixi-mask-halo.d.ts.map +1 -1
- package/dist/renderers/pixi-mask-layer.d.ts +4 -0
- package/dist/renderers/pixi-mask-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-media-scene.d.ts.map +1 -1
- package/dist/renderers/pixi-region-coverage-mask.d.ts +1 -0
- package/dist/renderers/pixi-region-coverage-mask.d.ts.map +1 -1
- package/dist/renderers/pixi-region-layer.d.ts +1 -0
- package/dist/renderers/pixi-region-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-scene-layer-slot.d.ts +1 -0
- package/dist/renderers/pixi-scene-layer-slot.d.ts.map +1 -1
- package/dist/renderers/prepared-annotation-window.d.ts +1 -0
- package/dist/renderers/prepared-annotation-window.d.ts.map +1 -1
- package/dist/renderers/render-preparation-report.d.ts +23 -0
- package/dist/renderers/render-preparation-report.d.ts.map +1 -0
- package/dist/sessions/media-session-defaults.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 +64 -0
- package/dist/tracking.worker.js.map +1 -1
- package/dist/types/media-depth.d.ts +55 -0
- package/dist/types/media-depth.d.ts.map +1 -0
- package/dist/types/media-renderer.d.ts +19 -0
- package/dist/types/media-renderer.d.ts.map +1 -1
- package/dist/types/media-session.d.ts +19 -0
- package/dist/types/media-session.d.ts.map +1 -1
- package/dist/types/render-preparation.d.ts +105 -3
- package/dist/types/render-preparation.d.ts.map +1 -1
- package/dist/{video-engine-media-source-DR-x1UfK.js → video-engine-media-source-DOFsuGS4.js} +35 -29
- package/dist/video-engine-media-source-DOFsuGS4.js.map +1 -0
- package/dist/web-video-engine/analysis.js +6 -43
- package/dist/web-video-engine/cache-budget.d.ts +4 -7
- package/dist/web-video-engine/constants.d.ts +3 -4
- package/dist/web-video-engine/create-scrub-cursor.d.ts +1 -0
- package/dist/web-video-engine/decode-resolution-fynpRIAG.js +109 -0
- package/dist/web-video-engine/decode-scheduler.d.ts +1 -0
- package/dist/web-video-engine/engine-core.d.ts +4 -2
- package/dist/web-video-engine/engine.js +8 -6
- package/dist/web-video-engine/engine.worker.js +164 -66
- package/dist/web-video-engine/frame-cache.d.ts +9 -0
- package/dist/web-video-engine/frame-index.d.ts +1 -0
- package/dist/web-video-engine/frame-index.js +97 -0
- package/dist/web-video-engine/{frame-timeline-DreEwsRY.js → frame-timeline-CYgzzmpA.js} +1 -109
- package/dist/web-video-engine/frame-timeline-reader.d.ts +21 -0
- package/dist/web-video-engine/video-engine.d.ts +9 -4
- package/node_modules/supervision-js-core/THIRD_PARTY_NOTICES.md +132 -0
- package/node_modules/supervision-js-core/dist/detections/buffered-detection-timeline.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/index.d.ts +7 -2
- package/node_modules/supervision-js-core/dist/index.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/index.js +1128 -59
- package/node_modules/supervision-js-core/dist/index.js.map +1 -1
- package/node_modules/supervision-js-core/dist/interactions/annotation-editing-engine.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/interactions/annotation-handles.d.ts +2 -2
- package/node_modules/supervision-js-core/dist/interactions/annotation-handles.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/annotation-renderer-presentation.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/annotation-renderer-registry.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts +50 -3
- package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/depth-map.d.ts +203 -0
- package/node_modules/supervision-js-core/dist/types/depth-map.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/editing.d.ts +2 -0
- package/node_modules/supervision-js-core/dist/types/editing.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts +3 -0
- package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/utils/depth-color-mapping.d.ts +91 -0
- package/node_modules/supervision-js-core/dist/utils/depth-color-mapping.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/depth-colormap-tables.d.ts +30 -0
- package/node_modules/supervision-js-core/dist/utils/depth-colormap-tables.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/depth-colormaps.d.ts +16 -0
- package/node_modules/supervision-js-core/dist/utils/depth-colormaps.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/depth-manifest.d.ts +23 -0
- package/node_modules/supervision-js-core/dist/utils/depth-manifest.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/depth-readout.d.ts +14 -0
- package/node_modules/supervision-js-core/dist/utils/depth-readout.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts +21 -0
- package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts +3 -7
- package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts.map +1 -1
- package/node_modules/supervision-js-core/package.json +2 -1
- package/package.json +6 -1
- package/dist/video-engine-media-source-DR-x1UfK.js.map +0 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { DepthManifest, DepthMap } from "supervision-js-core";
|
|
2
|
+
/**
|
|
3
|
+
* Depth for the media a renderer presents: a map you already hold, or a
|
|
4
|
+
* `depth.json` manifest the session loads.
|
|
5
|
+
*
|
|
6
|
+
* A `map` is one still depth map drawn under every frame, stretched over the
|
|
7
|
+
* media rectangle; it must have the media's aspect ratio within 1 %. The
|
|
8
|
+
* session keeps the map's arrays for readouts and never copies them.
|
|
9
|
+
*
|
|
10
|
+
* A `manifest` is the URL of a `depth.json`, or its `parseDepthManifest`
|
|
11
|
+
* output. The session fetches the 16-bit PNG it names, and the confidence PNG
|
|
12
|
+
* when there is one.
|
|
13
|
+
*
|
|
14
|
+
* A clip manifest (`frames`) pairs one PNG with each video frame, so it needs
|
|
15
|
+
* media with a frame index: a URL or file, or
|
|
16
|
+
* `createWebVideoEngineMediaRendererSource()`. Other media, and a `preview`
|
|
17
|
+
* whose frames are not the video's by count or by time, are refused with a
|
|
18
|
+
* `RangeError`. During playback the session draws the exact frames or the
|
|
19
|
+
* manifest's 8-bit `preview` video as `renderPreparation.depth.playback`
|
|
20
|
+
* picks: by default the exact frames while they keep up and the preview
|
|
21
|
+
* otherwise; a clip without a preview plays its exact frames. Once playback
|
|
22
|
+
* rests, the session fetches the exact frame on screen, then its neighbours,
|
|
23
|
+
* so stepping shows depth at once.
|
|
24
|
+
*/
|
|
25
|
+
export type MediaRendererDepthInput = {
|
|
26
|
+
readonly map: DepthMap;
|
|
27
|
+
readonly manifest?: undefined;
|
|
28
|
+
readonly baseUrl?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
readonly manifest: string | URL | DepthManifest;
|
|
31
|
+
/**
|
|
32
|
+
* What a relative manifest URL, or the files of a manifest passed as an
|
|
33
|
+
* object, resolve against. Files of a fetched manifest resolve against
|
|
34
|
+
* the manifest's own URL.
|
|
35
|
+
*/
|
|
36
|
+
readonly baseUrl?: string | URL;
|
|
37
|
+
readonly map?: undefined;
|
|
38
|
+
};
|
|
39
|
+
/** The depth map on screen, for readouts such as `readDepthAt`. */
|
|
40
|
+
export interface ActiveDepthMap {
|
|
41
|
+
readonly map: DepthMap;
|
|
42
|
+
/** Clip frame index of the map, or null for a still map. */
|
|
43
|
+
readonly frameIndex: number | null;
|
|
44
|
+
/** Media time the map was drawn for, in seconds. */
|
|
45
|
+
readonly mediaTime: number;
|
|
46
|
+
/**
|
|
47
|
+
* `"preview"` for a map of 8-bit `preview8` codes, such as a clip's preview
|
|
48
|
+
* frame, as `readDepthAt` reports it.
|
|
49
|
+
*/
|
|
50
|
+
readonly precision: "exact" | "preview";
|
|
51
|
+
/** Media size the map is stretched over, the coordinate space for readouts. */
|
|
52
|
+
readonly mediaWidth: number;
|
|
53
|
+
readonly mediaHeight: number;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=media-depth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-depth.d.ts","sourceRoot":"","sources":["../../src/types/media-depth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,uBAAuB,GAC/B;IACE,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;CAC9B,GACD;IACE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,GAAG,aAAa,CAAC;IAChD;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IAChC,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC;CAC1B,CAAC;AAEN,mEAAmE;AACnE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;IACvB,4DAA4D;IAC5D,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,oDAAoD;IACpD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IACxC,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B"}
|
|
@@ -9,6 +9,7 @@ import type { MediaFrameClock } from "#types/media-frame-clock";
|
|
|
9
9
|
import type { MediaFrameNavigation } from "#types/media-frame-navigation";
|
|
10
10
|
import type { AnnotationEditingEngine, PreviewOverlayData } from "supervision-js-core";
|
|
11
11
|
import type { MaskBrushPreviewOptions } from "../editing";
|
|
12
|
+
import type { ActiveDepthMap, MediaRendererDepthInput } from "#types/media-depth";
|
|
12
13
|
export { MediaRendererFit, MediaRendererPlaybackState, MediaSourceStatus, } from "supervision-js-core";
|
|
13
14
|
export type { MediaFrameDiagnostics, MediaFrameRenderTimings, MediaRendererDiagnosticsOptions, MediaRendererAssetError, MediaRendererPresentation, MediaRendererQuality, MediaRendererState, MediaDisplayAdjustments, MediaSourceState, } from "supervision-js-core";
|
|
14
15
|
/** Clock used by semantic detection frames supplied to a media renderer. */
|
|
@@ -53,6 +54,13 @@ export interface MediaRendererOptions extends MediaRendererPresentation {
|
|
|
53
54
|
* is not zero. Defaults to `MediaTimeline` for backward compatibility.
|
|
54
55
|
*/
|
|
55
56
|
readonly detectionTimelineOrigin?: DetectionTimelineOrigin;
|
|
57
|
+
/**
|
|
58
|
+
* Depth drawn by `depth` annotation renderers, separate from detection
|
|
59
|
+
* frames. A map whose aspect ratio differs from the media's puts the
|
|
60
|
+
* renderer in its error state. A manifest loads once the media's first
|
|
61
|
+
* frame is up; one that fails leaves the media playing without depth.
|
|
62
|
+
*/
|
|
63
|
+
readonly depth?: MediaRendererDepthInput;
|
|
56
64
|
readonly interaction?: MediaInteractionOptions;
|
|
57
65
|
readonly renderPreparation?: RenderPreparationOptions;
|
|
58
66
|
readonly diagnostics?: MediaRendererDiagnosticsOptions;
|
|
@@ -167,6 +175,17 @@ export interface MediaRenderer extends MediaRendererStateController {
|
|
|
167
175
|
*/
|
|
168
176
|
captureFrame(options?: MediaFrameCaptureOptions): Promise<MediaFrameCapture>;
|
|
169
177
|
setSelectedDetection(selection: DetectionSelectionOptions | null): DetectionPickResult | null;
|
|
178
|
+
/**
|
|
179
|
+
* Replaces the depth that `depth` renderers draw, or removes it with
|
|
180
|
+
* `null`, and redraws the frame on screen. Rejects with a `RangeError` for a
|
|
181
|
+
* malformed map or one whose aspect ratio differs from the media's.
|
|
182
|
+
*/
|
|
183
|
+
setDepth?(depth: MediaRendererDepthInput | null): Promise<void>;
|
|
184
|
+
/**
|
|
185
|
+
* The depth map on screen, with the media size it is stretched over, or
|
|
186
|
+
* null when no depth is drawn. Pass it to `readDepthAt` for a readout.
|
|
187
|
+
*/
|
|
188
|
+
getActiveDepth?(): ActiveDepthMap | null;
|
|
170
189
|
/**
|
|
171
190
|
* Explicit renders issued under the render-on-change policy, which only a
|
|
172
191
|
* media source that pushes presented frames runs under: the count moves when
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-renderer.d.ts","sourceRoot":"","sources":["../../src/types/media-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,EACV,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACr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IACvC,qEAAqE;IACrE,aAAa,CACX,KAAK,EAAE,OAAO,qBAAqB,EAAE,KAAK,GACzC,OAAO,qBAAqB,EAAE,KAAK,CAAC;IACvC;;;;;OAKG;IACH,uBAAuB,CACrB,WAAW,EAAE,MAAM,GAAG,MAAM,GAC3B,oBAAoB,GAAG,IAAI,CAAC;IAC/B,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,cAAc,CACZ,KAAK,EAAE,OAAO,qBAAqB,EAAE,KAAK,EAC1C,MAAM,EAAE,MAAM,GACb,IAAI,CAAC;IACR,qBAAqB,CACnB,KAAK,EAAE,OAAO,qBAAqB,EAAE,KAAK,EAC1C,MAAM,EAAE,MAAM,GACb,IAAI,CAAC;CACT"}
|
|
@@ -7,6 +7,7 @@ import type { DetectionTimelineOrigin, MediaFrameCapture, MediaFrameCaptureOptio
|
|
|
7
7
|
import type { RenderPreparationDiagnostics } from "#types/render-preparation";
|
|
8
8
|
import type { MediaFrameClock } from "#types/media-frame-clock";
|
|
9
9
|
import type { MediaFrameNavigation } from "#types/media-frame-navigation";
|
|
10
|
+
import type { MediaRendererDepthInput } from "#types/media-depth";
|
|
10
11
|
export { MediaSessionActivityKind, MediaSessionActivityStatus, MediaSessionMode, MediaSessionStatus, } from "supervision-js-core";
|
|
11
12
|
export type { MediaSessionActivity, MediaSessionStateUnsubscribe, } from "supervision-js-core";
|
|
12
13
|
/**
|
|
@@ -204,6 +205,17 @@ export interface MediaSessionOptions {
|
|
|
204
205
|
* Detection frames or sources to render with the media.
|
|
205
206
|
*/
|
|
206
207
|
readonly detections?: MediaSessionDetectionOptions;
|
|
208
|
+
/**
|
|
209
|
+
* Depth drawn by `depth` annotation renderers, beside detections. See
|
|
210
|
+
* {@link MediaRendererDepthInput} for what a map or a clip manifest needs.
|
|
211
|
+
*
|
|
212
|
+
* The session does not wait for a manifest: the media shows and plays as
|
|
213
|
+
* soon as it can, and depth joins it when its files arrive. A manifest
|
|
214
|
+
* that fails to load leaves the media playing without depth, with a
|
|
215
|
+
* console warning and the reason in `renderPreparation.message`. To wait
|
|
216
|
+
* for depth or catch its error, call `setDepth()`.
|
|
217
|
+
*/
|
|
218
|
+
readonly depth?: MediaRendererDepthInput;
|
|
207
219
|
/**
|
|
208
220
|
* Buffered playback: hold the picture until the frame it is about to show has
|
|
209
221
|
* both its detections and its prepared annotation artifacts. Opening still
|
|
@@ -355,6 +367,13 @@ export interface MediaSession {
|
|
|
355
367
|
*/
|
|
356
368
|
captureFrame(options?: MediaFrameCaptureOptions): Promise<MediaFrameCapture>;
|
|
357
369
|
setPresentation(presentation: MediaRendererPresentation): void;
|
|
370
|
+
/**
|
|
371
|
+
* Replaces the session's depth, or removes it with `null`, and redraws the
|
|
372
|
+
* frame on screen. Resolves once the renderer has that depth, and rejects
|
|
373
|
+
* with the reason a manifest did not load; the media keeps playing
|
|
374
|
+
* meanwhile. `session.renderer.getActiveDepth()` reads back what is drawn.
|
|
375
|
+
*/
|
|
376
|
+
setDepth?(depth: MediaRendererDepthInput | null): Promise<void>;
|
|
358
377
|
setRenderQuality(quality: MediaRendererQuality): void;
|
|
359
378
|
subscribe(listener: MediaSessionStateListener): MediaSessionStateUnsubscribe;
|
|
360
379
|
getState(): MediaSessionState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-session.d.ts","sourceRoot":"","sources":["../../src/types/media-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,EACV,uBAAuB,EACvB,mCAAmC,EACnC,sBAAsB,EACtB,yBAAyB,EACzB,8BAA8B,EAC9B,8BAA8B,EAC9B,4BAA4B,EAC5B,oBAAoB,EACpB,0BAA0B,EAC1B,gBAAgB,EAChB,yBAAyB,IAAI,6BAA6B,EAC1D,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO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eAAe,CAAC,YAAY,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAC/D;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,KAAK,EAAE,uBAAuB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACtD,SAAS,CAAC,QAAQ,EAAE,yBAAyB,GAAG,4BAA4B,CAAC;IAC7E,QAAQ,IAAI,iBAAiB,CAAC;IAC9B,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD;;;;;;OAMG;IACH,wBAAwB,CACtB,KAAK,EAAE,cAAc,EACrB,OAAO,CAAC,EAAE,iCAAiC,GAC1C,OAAO,CAAC,mCAAmC,CAAC,CAAC;IAChD;;;;;;;;OAQG;IACH,yBAAyB,CACvB,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,iCAAiC,GAC1C,OAAO,CAAC,mCAAmC,GAAG,IAAI,CAAC,CAAC;CACxD"}
|
|
@@ -39,7 +39,14 @@ export declare enum RenderPreparationArtifactKind {
|
|
|
39
39
|
/** Frame-level ID-mask artifact prepared from semantic masks. */
|
|
40
40
|
MaskFrame = "maskFrame",
|
|
41
41
|
/** Frame-level ID-mask artifact rasterized from semantic polygons. */
|
|
42
|
-
PolygonFrame = "polygonFrame"
|
|
42
|
+
PolygonFrame = "polygonFrame",
|
|
43
|
+
/** A clip's 8-bit preview depth, decoded ahead of playback. */
|
|
44
|
+
DepthFrame = "depthFrame",
|
|
45
|
+
/**
|
|
46
|
+
* A clip's exact 16-bit depth, loaded for the frame at rest and its
|
|
47
|
+
* neighbours: `preparedCount` frames kept, `pendingCount` loading.
|
|
48
|
+
*/
|
|
49
|
+
ExactDepthFrame = "exactDepthFrame"
|
|
43
50
|
}
|
|
44
51
|
/**
|
|
45
52
|
* Preparation status for the active artifact frame.
|
|
@@ -59,7 +66,7 @@ export declare enum RenderPreparationArtifactFrameStatus {
|
|
|
59
66
|
* apart, and describing the second as missing media is wrong on any source.
|
|
60
67
|
*/
|
|
61
68
|
export declare enum RenderPreparationGateHoldReason {
|
|
62
|
-
/** The frame about to be presented
|
|
69
|
+
/** The frame about to be presented lacks the required raster quality. */
|
|
63
70
|
ActiveFrameUnprepared = "activeFrameUnprepared",
|
|
64
71
|
/** That frame is ready, and the prepared lead in front of it is short. */
|
|
65
72
|
LeadBelowRequirement = "leadBelowRequirement"
|
|
@@ -92,7 +99,9 @@ export interface RenderPreparationMaskFrameOptions {
|
|
|
92
99
|
* The box the host paints prepared masks into, in CSS pixels, with the pixel
|
|
93
100
|
* ratio it paints them at. A mask frame's id raster is then capped to the
|
|
94
101
|
* size that box can show; absent, it is cooked at the detections' own
|
|
95
|
-
* resolution.
|
|
102
|
+
* resolution. Exact depth frames the box cannot show at least twice over
|
|
103
|
+
* go up to the GPU decimated by that whole factor; readouts still read every
|
|
104
|
+
* sample.
|
|
96
105
|
*/
|
|
97
106
|
readonly display?: {
|
|
98
107
|
readonly boxHeight: number;
|
|
@@ -100,10 +109,29 @@ export interface RenderPreparationMaskFrameOptions {
|
|
|
100
109
|
readonly devicePixelRatio: number;
|
|
101
110
|
readonly maxDevicePixelRatio?: number;
|
|
102
111
|
};
|
|
112
|
+
/**
|
|
113
|
+
* Scale of the display-fitted width cap for previews during rapid movement.
|
|
114
|
+
* Default: 0.5. Rasters never exceed native mask dimensions.
|
|
115
|
+
* Positive values up to 1 are accepted; invalid values use the default.
|
|
116
|
+
* A value of 1 keeps the full display-fitted resolution during motion.
|
|
117
|
+
* Once motion settles, the visible frame uses the full fitted resolution.
|
|
118
|
+
* Without a display box, masks keep their native resolution.
|
|
119
|
+
*/
|
|
120
|
+
readonly previewScale?: number;
|
|
103
121
|
/**
|
|
104
122
|
* Maximum number of prepared mask frames retained in memory.
|
|
105
123
|
*/
|
|
106
124
|
readonly maxCacheFrameCount?: number;
|
|
125
|
+
/**
|
|
126
|
+
* Byte budget for retained prepared mask payloads and reserved renderer
|
|
127
|
+
* backing, including exact region coverage. Values below 16 MiB are raised
|
|
128
|
+
* to 16 MiB. This budget and `maxCacheFrameCount` both trigger eviction;
|
|
129
|
+
* the active frame remains protected even when it exceeds the budget.
|
|
130
|
+
* Transient preparation allocations and unrelated renderer resources are
|
|
131
|
+
* excluded. Default: 64 MiB per reported GB of device memory, clamped to
|
|
132
|
+
* 256 MiB–1 GiB; 256 MiB when unavailable.
|
|
133
|
+
*/
|
|
134
|
+
readonly maxCacheBytes?: number;
|
|
107
135
|
/**
|
|
108
136
|
* Maximum number of mask frames queued for preparation.
|
|
109
137
|
*/
|
|
@@ -151,6 +179,16 @@ export interface RenderPreparationPlaybackGateOptions {
|
|
|
151
179
|
* off. A renderer created directly leaves it off.
|
|
152
180
|
*/
|
|
153
181
|
readonly enabled?: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Raster quality required by an enabled gate. Default: "adaptive", which
|
|
184
|
+
* accepts smaller previews during rapid movement. "fine" waits for the full
|
|
185
|
+
* display-fitted raster and prepares its lead at that quality. An enabled
|
|
186
|
+
* fine gate overrides `maskFrame.previewScale` during playback, scrubbing,
|
|
187
|
+
* and seeking. This can increase CPU work and buffering.
|
|
188
|
+
* `maxWaitSeconds` still bounds the wait; on expiry, playback may use a
|
|
189
|
+
* preview or omit an unfinished artifact.
|
|
190
|
+
*/
|
|
191
|
+
readonly quality?: "adaptive" | "fine";
|
|
154
192
|
/**
|
|
155
193
|
* How long an enabled gate holds the picture for artifacts that are not
|
|
156
194
|
* prepared, before it gives up and lets the frames through without them.
|
|
@@ -238,11 +276,23 @@ export interface RenderPreparationArtifactWindowDiagnostics {
|
|
|
238
276
|
export interface RenderPreparationArtifactDiagnostics {
|
|
239
277
|
readonly activeFrame?: RenderPreparationActiveFrameDiagnostics | null;
|
|
240
278
|
readonly gateHold?: RenderPreparationGateHoldDiagnostics | null;
|
|
279
|
+
/** Times this family held the playback gate since it opened. Only depth reports it. */
|
|
280
|
+
readonly gateHoldCount?: number;
|
|
241
281
|
readonly inFlightCount?: number;
|
|
242
282
|
readonly kind: RenderPreparationArtifactKind;
|
|
283
|
+
/**
|
|
284
|
+
* A `DepthFrame` window's depth: `"preview"` for the preview video,
|
|
285
|
+
* `"exact"` for exact frames loaded ahead for playback.
|
|
286
|
+
*/
|
|
287
|
+
readonly precision?: "exact" | "preview";
|
|
243
288
|
readonly maxInFlightCount?: number;
|
|
244
289
|
readonly maxPendingCount?: number;
|
|
245
290
|
readonly maxPreparedCount?: number;
|
|
291
|
+
/** Retained payload and renderer backing budget, and its current reservation. */
|
|
292
|
+
readonly maxPreparedBytes?: number;
|
|
293
|
+
readonly preparedBytes?: number;
|
|
294
|
+
/** Prepared rasters currently at the coarse tier, owed a fine cook once settled. */
|
|
295
|
+
readonly coarseCount?: number;
|
|
246
296
|
readonly pendingCount: number;
|
|
247
297
|
/**
|
|
248
298
|
* Frames in the unbroken run of prepared frames starting at the active
|
|
@@ -252,6 +302,7 @@ export interface RenderPreparationArtifactDiagnostics {
|
|
|
252
302
|
* so N frames here do not cover N frame durations of playback, and the two
|
|
253
303
|
* numbers diverge by design. Deriving one from the other is wrong in both
|
|
254
304
|
* directions.
|
|
305
|
+
* With playback gate quality "fine", only fine rasters count as prepared.
|
|
255
306
|
*/
|
|
256
307
|
readonly preparedAheadFrameCount?: number;
|
|
257
308
|
/**
|
|
@@ -280,6 +331,55 @@ export interface RenderPreparationDiagnostics {
|
|
|
280
331
|
readonly message: string | null;
|
|
281
332
|
readonly workerStatus: RenderPreparationWorkerStatus;
|
|
282
333
|
}
|
|
334
|
+
/**
|
|
335
|
+
* Which depth a clip draws while playback runs.
|
|
336
|
+
*
|
|
337
|
+
* - `"preview"`: the 8-bit preview video, decoded ahead of the playhead.
|
|
338
|
+
* - `"exact"`: the exact 16-bit PNGs, loaded ahead of the playhead; the
|
|
339
|
+
* playback gate holds for them. A clip whose exact frames stop loading
|
|
340
|
+
* falls back to its preview.
|
|
341
|
+
* - `"auto"` (the default): the exact PNGs while they keep up, the preview
|
|
342
|
+
* otherwise. Exact depth takes over once its lead reaches three quarters
|
|
343
|
+
* of what it loads ahead, and hands back when the lead falls under a
|
|
344
|
+
* quarter or a frame is missing, waiting longer each time before it tries
|
|
345
|
+
* again. A clip without a preview plays exact depth.
|
|
346
|
+
*
|
|
347
|
+
* Whichever is drawn is the depth of the frame on screen;
|
|
348
|
+
* `getActiveDepth().precision` says which.
|
|
349
|
+
*/
|
|
350
|
+
export type DepthPlaybackSource = "auto" | "exact" | "preview";
|
|
351
|
+
/**
|
|
352
|
+
* Memory and timing for a depth clip. Every byte budget defaults to a size
|
|
353
|
+
* that scales with the clip's resolution, so a 4K clip keeps as many seconds
|
|
354
|
+
* as a 720p one, within a ceiling.
|
|
355
|
+
*/
|
|
356
|
+
export interface RenderPreparationDepthOptions {
|
|
357
|
+
/** Defaults to `"auto"`. See {@link DepthPlaybackSource}. */
|
|
358
|
+
readonly playback?: DepthPlaybackSource;
|
|
359
|
+
/**
|
|
360
|
+
* Exact frames loaded ahead for playback, in bytes. Defaults to room for
|
|
361
|
+
* twice `previewPrefetchSeconds` plus a quarter second of exact frames, at
|
|
362
|
+
* least 96 MiB and at most 512 MiB; a shorter budget lowers the lead exact
|
|
363
|
+
* playback reaches. A budget under one frame still holds the frame on
|
|
364
|
+
* screen.
|
|
365
|
+
*/
|
|
366
|
+
readonly maxExactPlaybackCacheBytes?: number;
|
|
367
|
+
/**
|
|
368
|
+
* Decoded preview frames kept, in bytes. Defaults to room for twice
|
|
369
|
+
* `previewPrefetchSeconds` plus a quarter second of the clip, at least
|
|
370
|
+
* 96 MiB and at most 512 MiB. A budget shorter than the playback gate's lead
|
|
371
|
+
* lowers the lead the gate waits for; one under one frame still holds the
|
|
372
|
+
* frame on screen.
|
|
373
|
+
*/
|
|
374
|
+
readonly maxPreviewCacheBytes?: number;
|
|
375
|
+
/**
|
|
376
|
+
* How far ahead of the playhead the preview, and exact frames when they
|
|
377
|
+
* play, are decoded while playing, in seconds of media. Defaults to 1.
|
|
378
|
+
* Above 1x it stretches by how many frames each present moves; a drag
|
|
379
|
+
* spends the same span both ways, most of it the way the hand heads.
|
|
380
|
+
*/
|
|
381
|
+
readonly previewPrefetchSeconds?: number;
|
|
382
|
+
}
|
|
283
383
|
/**
|
|
284
384
|
* Render-preparation configuration.
|
|
285
385
|
*
|
|
@@ -287,6 +387,8 @@ export interface RenderPreparationDiagnostics {
|
|
|
287
387
|
* long videos, worker policy, or playback gating need explicit behavior.
|
|
288
388
|
*/
|
|
289
389
|
export interface RenderPreparationOptions {
|
|
390
|
+
/** Budgets and timing for depth clips. */
|
|
391
|
+
readonly depth?: RenderPreparationDepthOptions;
|
|
290
392
|
readonly maskFrame?: RenderPreparationMaskFrameOptions;
|
|
291
393
|
readonly mode?: RenderPreparationMode;
|
|
292
394
|
readonly onDiagnostics?: (diagnostics: RenderPreparationDiagnostics) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-preparation.d.ts","sourceRoot":"","sources":["../../src/types/render-preparation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,qBAAqB;IAC/B;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,UAAU,eAAe;IACzB;;;OAGG;IACH,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,oBAAY,8BAA8B;IACxC,UAAU,eAAe;IACzB,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,oBAAY,6BAA6B;IACvC,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,WAAW,gBAAgB;IAC3B,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,oBAAY,6BAA6B;IACvC,iEAAiE;IACjE,SAAS,cAAc;IACvB,sEAAsE;IACtE,YAAY,iBAAiB;
|
|
1
|
+
{"version":3,"file":"render-preparation.d.ts","sourceRoot":"","sources":["../../src/types/render-preparation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oB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E,CAAC,WAAW,EAAE,4BAA4B,KAAK,IAAI,CAAC;IAC7E;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,oCAAoC,CAAC;IAC7D,QAAQ,CAAC,aAAa,CAAC,EAAE,8BAA8B,CAAC;CACzD"}
|
package/dist/{video-engine-media-source-DR-x1UfK.js → video-engine-media-source-DOFsuGS4.js}
RENAMED
|
@@ -84,30 +84,6 @@ function classifyMediaErrorMessage(message) {
|
|
|
84
84
|
return MediaErrorKind.Unknown;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
const DEFAULT_MAX_DEVICE_PIXEL_RATIO = 2;
|
|
88
|
-
/**
|
|
89
|
-
* The pixel ratio a host's display box rasterizes at, for every grid that lands
|
|
90
|
-
* in that box: the presentation surface, the mask rasters drawn onto it, and the
|
|
91
|
-
* decode under both. The ceiling is what keeps a 3x display from costing nine
|
|
92
|
-
* times the texels of a 1x one for sharpness nobody resolves on a moving
|
|
93
|
-
* picture. An id raster carries a detection per pixel and can only be sampled
|
|
94
|
-
* nearest, so a grid it does not share ragged its edges.
|
|
95
|
-
*
|
|
96
|
-
* A ceiling that is not a usable number states nothing, and takes the default.
|
|
97
|
-
*/
|
|
98
|
-
function resolveDisplayPixelRatio(display) {
|
|
99
|
-
const { devicePixelRatio, maxDevicePixelRatio } = display;
|
|
100
|
-
if (!Number.isFinite(devicePixelRatio) || devicePixelRatio <= 0) {
|
|
101
|
-
return 1;
|
|
102
|
-
}
|
|
103
|
-
const ceiling = maxDevicePixelRatio !== undefined &&
|
|
104
|
-
Number.isFinite(maxDevicePixelRatio) &&
|
|
105
|
-
maxDevicePixelRatio > 0
|
|
106
|
-
? maxDevicePixelRatio
|
|
107
|
-
: DEFAULT_MAX_DEVICE_PIXEL_RATIO;
|
|
108
|
-
return Math.min(devicePixelRatio, ceiling);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
87
|
function createMediaFrameClock(timeline) {
|
|
112
88
|
const { frameCount, tickRate } = timeline;
|
|
113
89
|
const firstTimestamp = timeline.timeAt(0);
|
|
@@ -139,6 +115,30 @@ function createMediaFrameClock(timeline) {
|
|
|
139
115
|
});
|
|
140
116
|
}
|
|
141
117
|
|
|
118
|
+
const DEFAULT_MAX_DEVICE_PIXEL_RATIO = 2;
|
|
119
|
+
/**
|
|
120
|
+
* The pixel ratio a host's display box rasterizes at, for every grid that lands
|
|
121
|
+
* in that box: the presentation surface, the mask rasters drawn onto it, and the
|
|
122
|
+
* decode under both. The ceiling is what keeps a 3x display from costing nine
|
|
123
|
+
* times the texels of a 1x one for sharpness nobody resolves on a moving
|
|
124
|
+
* picture. An id raster carries a detection per pixel and can only be sampled
|
|
125
|
+
* nearest, so a grid it does not share ragged its edges.
|
|
126
|
+
*
|
|
127
|
+
* A ceiling that is not a usable number states nothing, and takes the default.
|
|
128
|
+
*/
|
|
129
|
+
function resolveDisplayPixelRatio(display) {
|
|
130
|
+
const { devicePixelRatio, maxDevicePixelRatio } = display;
|
|
131
|
+
if (!Number.isFinite(devicePixelRatio) || devicePixelRatio <= 0) {
|
|
132
|
+
return 1;
|
|
133
|
+
}
|
|
134
|
+
const ceiling = maxDevicePixelRatio !== undefined &&
|
|
135
|
+
Number.isFinite(maxDevicePixelRatio) &&
|
|
136
|
+
maxDevicePixelRatio > 0
|
|
137
|
+
? maxDevicePixelRatio
|
|
138
|
+
: DEFAULT_MAX_DEVICE_PIXEL_RATIO;
|
|
139
|
+
return Math.min(devicePixelRatio, ceiling);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
142
|
const VIDEO_ENGINE_ENTRY = "supervision/web-video-engine";
|
|
143
143
|
const VIDEO_ENGINE_ANALYSIS_ENTRY = `${VIDEO_ENGINE_ENTRY}/analysis`;
|
|
144
144
|
/**
|
|
@@ -229,10 +229,14 @@ async function openWebVideoEngineMediaSource(options) {
|
|
|
229
229
|
try {
|
|
230
230
|
const { WebVideoEngine, displayBoxResolution, FrameTimeline } = await importEngineEntry();
|
|
231
231
|
const { display, frameDecodeStrategy, ...engineOptions } = options;
|
|
232
|
+
const decodeStrategy = engineOptions.decodeStrategy ??
|
|
233
|
+
(display ? displayBoxResolution(display) : undefined);
|
|
232
234
|
engine = new WebVideoEngine({
|
|
233
|
-
|
|
234
|
-
|
|
235
|
+
previewWidth: decodeStrategy?.kind === "displayBox"
|
|
236
|
+
? undefined
|
|
237
|
+
: framesPreviewWidth(display),
|
|
235
238
|
...engineOptions,
|
|
239
|
+
decodeStrategy,
|
|
236
240
|
presentation: "frames",
|
|
237
241
|
});
|
|
238
242
|
const openedEngine = engine;
|
|
@@ -247,7 +251,9 @@ async function openWebVideoEngineMediaSource(options) {
|
|
|
247
251
|
});
|
|
248
252
|
return {
|
|
249
253
|
engine: openedEngine,
|
|
250
|
-
setDisplay:
|
|
254
|
+
setDisplay: decodeStrategy?.kind === "displayBox"
|
|
255
|
+
? (display) => openedEngine.setDisplay(display)
|
|
256
|
+
: undefined,
|
|
251
257
|
frameClock: createMediaFrameClock(FrameTimeline.from(snapshot.timeline)),
|
|
252
258
|
input: {
|
|
253
259
|
dispose() {
|
|
@@ -479,5 +485,5 @@ function resolveFrameDuration(nativeFps) {
|
|
|
479
485
|
: 1 / DEFAULT_FRAME_RATE;
|
|
480
486
|
}
|
|
481
487
|
|
|
482
|
-
export { MediaSourceError as M, createWebVideoEngineMediaRendererSource as c, getMediaErrorKind as g, isMediaSourceError as i, openWebVideoEngineMediaSource as o, resolveDisplayPixelRatio as r, toMediaSourceError as t };
|
|
483
|
-
//# sourceMappingURL=video-engine-media-source-
|
|
488
|
+
export { MediaSourceError as M, createWebVideoEngineMediaRendererSource as a, createMediaFrameClock as c, getMediaErrorKind as g, isMediaSourceError as i, openWebVideoEngineMediaSource as o, resolveDisplayPixelRatio as r, toMediaSourceError as t };
|
|
489
|
+
//# sourceMappingURL=video-engine-media-source-DOFsuGS4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-engine-media-source-DOFsuGS4.js","sources":["../src/media/media-errors.ts","../src/media/media-frame-clock.ts","../src/media/display-pixel-ratio.ts","../src/media/engine-import-failure.ts","../src/media/video-engine-media-source.ts"],"sourcesContent":[null,null,null,null,null],"names":[],"mappings":";;AAsBA;;;;;;AAMG;AACH,MAAM,mBAAmB,GAAmD;IAC1E,OAAO,EAAE,cAAc,CAAC,OAAO;IAC/B,eAAe,EAAE,cAAc,CAAC,MAAM;IACtC,oBAAoB,EAAE,cAAc,CAAC,UAAU;IAC/C,eAAe,EAAE,cAAc,CAAC,MAAM;IACtC,kBAAkB,EAAE,cAAc,CAAC,iBAAiB;IACpD,cAAc,EAAE,cAAc,CAAC,YAAY;IAC3C,qBAAqB,EAAE,cAAc,CAAC,OAAO;IAC7C,gBAAgB,EAAE,cAAc,CAAC,OAAO;IACxC,iBAAiB,EAAE,cAAc,CAAC,UAAU;IAC5C,sBAAsB,EAAE,cAAc,CAAC,iBAAiB;CACzD;AAED,MAAM,0BAA0B,GAC9B,qEAAqE;AACvE,MAAM,cAAc,GAAG,0CAA0C;AACjE,MAAM,eAAe,GACnB,kEAAkE;AAEpE;;;;;;AAMG;AACG,MAAO,gBAAiB,SAAQ,KAAK,CAAA;AAChC,IAAA,IAAI;AAEb,IAAA,WAAA,CACE,IAAoB,EACpB,OAAe,EACf,OAAsC,EAAA;AAEtC,QAAA,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC;AACvB,QAAA,IAAI,CAAC,IAAI,GAAG,kBAAkB;AAC9B,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;IAClB;AACD;AAEK,SAAU,kBAAkB,CAAC,KAAc,EAAA;IAC/C,OAAO,KAAK,YAAY,gBAAgB;AAC1C;AAEA;;;;;;;AAOG;SACa,kBAAkB,CAChC,KAAc,EACd,eAAe,GAAG,sBAAsB,EAAA;AAExC,IAAA,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE;AAC7B,QAAA,OAAO,KAAK;IACd;AAEA,IAAA,MAAM,OAAO,GAAG,KA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EAAA;AACpD,IAAA,OAAO,SAAS,KAAK,IAAI,IAAI,SAAS,GAAG;UACrC,CAAC,GAAG;AACN,UAAE,CAAC,GAAG,kBAAkB;AAC5B;;;;"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { CanvasSink, EncodedPacketSink, Input, ALL_FORMATS, VideoSampleSink, ReadableStreamSource, BlobSource, UrlSource, UnsupportedInputFormatError } from 'mediabunny';
|
|
2
|
-
import { W as WebVideoEngineError,
|
|
2
|
+
import { W as WebVideoEngineError, b as WebVideoEngineErrorCode, g as SCRUB, f as asSec, S as SourceKind } from './frame-timeline-CYgzzmpA.js';
|
|
3
|
+
import { n as nativeResolution, r as resolveDecodeDimensions } from './decode-resolution-fynpRIAG.js';
|
|
4
|
+
import { readFrameTimeline } from './frame-index.js';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* An H.264 sync sample that is not an IDR frame cannot open a WebCodecs decode
|
|
@@ -1227,8 +1229,10 @@ async function openInput(options) {
|
|
|
1227
1229
|
}
|
|
1228
1230
|
const displayWidth = videoTrack.displayWidth;
|
|
1229
1231
|
const displayHeight = videoTrack.displayHeight;
|
|
1230
|
-
const durationS = asSec(await readTrackDurationS(videoTrack));
|
|
1231
1232
|
const timeline = await readFrameTimeline(videoTrack);
|
|
1233
|
+
// The demuxer measures a track to the end of its last packet, which falls
|
|
1234
|
+
// short when that packet states no duration and the timeline found one.
|
|
1235
|
+
const durationS = asSec(Math.max(await readTrackDurationS(videoTrack), timeline.endTicksAt(timeline.frameCount - 1) / timeline.tickRate));
|
|
1232
1236
|
// Mediabunny ships a measured native fps via computePacketStats:
|
|
1233
1237
|
// averagePacketRate "for video tracks, equals the average frame rate". We
|
|
1234
1238
|
// bound the packet sample to a small slice so the load promise doesn't stall
|
|
@@ -1283,47 +1287,6 @@ async function resolveVideoTrack(input) {
|
|
|
1283
1287
|
? new WebVideoEngineError(WebVideoEngineErrorCode.VideoTrackUnreadable, "openInput: the container opened and the demuxer parsed no track out of it")
|
|
1284
1288
|
: new WebVideoEngineError(WebVideoEngineErrorCode.NoVideoTrack, "openInput: the container's tracks read and none of them carries video");
|
|
1285
1289
|
}
|
|
1286
|
-
/**
|
|
1287
|
-
* Walks the track's packets metadata-only and records each one's timestamp in
|
|
1288
|
-
* the container's own integer grain, which is the grain every timestamp of the
|
|
1289
|
-
* track is a whole multiple of.
|
|
1290
|
-
*
|
|
1291
|
-
* Decode order is not presentation order on a B-frame source, so the table is
|
|
1292
|
-
* sorted before it is indexed, and the trailing frame's duration comes from the
|
|
1293
|
-
* packet that ends up last in that order.
|
|
1294
|
-
*/
|
|
1295
|
-
async function readFrameTimeline(videoTrack) {
|
|
1296
|
-
const track = videoTrack;
|
|
1297
|
-
const tickRate = typeof track.getTimeResolution === "function"
|
|
1298
|
-
? await track.getTimeResolution()
|
|
1299
|
-
: (track.timeResolution ?? FRAME_TIMELINE.FALLBACK_TICK_RATE);
|
|
1300
|
-
const sink = new EncodedPacketSink(videoTrack);
|
|
1301
|
-
const ticks = [];
|
|
1302
|
-
let lastTicks = -Infinity;
|
|
1303
|
-
let lastDurationTicks = 0;
|
|
1304
|
-
for await (const packet of sink.packets(undefined, undefined, {
|
|
1305
|
-
metadataOnly: true,
|
|
1306
|
-
})) {
|
|
1307
|
-
const at = Math.round(packet.timestamp * tickRate);
|
|
1308
|
-
if (ticks.length >= FRAME_TIMELINE.MAX_FRAMES) {
|
|
1309
|
-
throw new WebVideoEngineError(WebVideoEngineErrorCode.DecodeUnsupported, `openInput: source video track carries more than ${FRAME_TIMELINE.MAX_FRAMES} frames`);
|
|
1310
|
-
}
|
|
1311
|
-
ticks.push(at);
|
|
1312
|
-
if (at >= lastTicks) {
|
|
1313
|
-
lastTicks = at;
|
|
1314
|
-
lastDurationTicks = Math.round(packet.duration * tickRate);
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1317
|
-
if (ticks.length === 0) {
|
|
1318
|
-
throw new WebVideoEngineError(WebVideoEngineErrorCode.DecodeUnsupported, "openInput: source video track has no frames");
|
|
1319
|
-
}
|
|
1320
|
-
ticks.sort((a, b) => a - b);
|
|
1321
|
-
return FrameTimeline.from({
|
|
1322
|
-
lastDurationTicks,
|
|
1323
|
-
tickRate,
|
|
1324
|
-
ticks: Float64Array.from(ticks),
|
|
1325
|
-
});
|
|
1326
|
-
}
|
|
1327
1290
|
function shouldOwnDecodeSessionPixels(context) {
|
|
1328
1291
|
if (!context.offscreenCanvasAvailable)
|
|
1329
1292
|
return false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface CacheBudgets {
|
|
2
2
|
readonly exactBudgetBytes: number;
|
|
3
|
-
readonly
|
|
3
|
+
readonly previewBudgetBytes: number;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Sizes both cache tiers to the device's reported RAM and the frame size.
|
|
@@ -9,10 +9,7 @@ export interface CacheBudgets {
|
|
|
9
9
|
* scrub prefetch window, so its slot floor survives any frame size and the RAM
|
|
10
10
|
* band adds speculative slots on top only while a slot stays cheap. An 8MP
|
|
11
11
|
* source lands on the floor and keeps nothing speculative, which is what holds
|
|
12
|
-
* its resident footprint down
|
|
13
|
-
*
|
|
14
|
-
* so its count is purely its byte budget over the downscaled frame size, which
|
|
15
|
-
* gives a square 8MP source enough coarse history without over-allocating for a
|
|
16
|
-
* small 16:9 one.
|
|
12
|
+
* its resident footprint down. The preview tier's byte ceiling depends on
|
|
13
|
+
* device memory; FrameCache derives its slot count from the actual raster size.
|
|
17
14
|
*/
|
|
18
|
-
export declare function resolveCacheBudgets(decodeWidth: number, decodeHeight: number
|
|
15
|
+
export declare function resolveCacheBudgets(decodeWidth: number, decodeHeight: number): CacheBudgets;
|