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.
Files changed (215) hide show
  1. package/dist/detections/chunked-detection-frame-source.d.ts.map +1 -1
  2. package/dist/index.d.ts +11 -4
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +8856 -4559
  5. package/dist/index.js.map +1 -1
  6. package/dist/mask-preparation.worker.js +310 -164
  7. package/dist/mask-preparation.worker.js.map +1 -1
  8. package/dist/media/display-pixel-ratio.d.ts +15 -0
  9. package/dist/media/display-pixel-ratio.d.ts.map +1 -0
  10. package/dist/media/engine-import-failure.d.ts +16 -0
  11. package/dist/media/engine-import-failure.d.ts.map +1 -0
  12. package/dist/media/media-condition-probe.d.ts +51 -0
  13. package/dist/media/media-condition-probe.d.ts.map +1 -0
  14. package/dist/media/media-conditions.d.ts +28 -0
  15. package/dist/media/media-conditions.d.ts.map +1 -0
  16. package/dist/media/media-errors.d.ts +6 -0
  17. package/dist/media/media-errors.d.ts.map +1 -1
  18. package/dist/media/media-normalization.d.ts.map +1 -1
  19. package/dist/media/media-probe.d.ts.map +1 -1
  20. package/dist/media/media-source.d.ts +17 -0
  21. package/dist/media/media-source.d.ts.map +1 -1
  22. package/dist/media/mediabunny-media-source.d.ts.map +1 -1
  23. package/dist/media/video-engine-media-source.d.ts +44 -0
  24. package/dist/media/video-engine-media-source.d.ts.map +1 -0
  25. package/dist/render-preparation/mask-frame-artifact.d.ts +46 -12
  26. package/dist/render-preparation/mask-frame-artifact.d.ts.map +1 -1
  27. package/dist/render-preparation/mask-frame-compositor.d.ts +5 -5
  28. package/dist/render-preparation/mask-frame-compositor.d.ts.map +1 -1
  29. package/dist/render-preparation/mask-frame-preparer.d.ts.map +1 -1
  30. package/dist/render-preparation/mask-preparation-worker-count.d.ts +4 -4
  31. package/dist/render-preparation/mask-preparation-worker-protocol.d.ts +12 -3
  32. package/dist/render-preparation/mask-preparation-worker-protocol.d.ts.map +1 -1
  33. package/dist/render-preparation/prepared-render-window.d.ts +23 -0
  34. package/dist/render-preparation/prepared-render-window.d.ts.map +1 -1
  35. package/dist/render-preparation/prepared-window-timeline.d.ts +2 -6
  36. package/dist/render-preparation/prepared-window-timeline.d.ts.map +1 -1
  37. package/dist/renderers/mask-palette.d.ts +14 -0
  38. package/dist/renderers/mask-palette.d.ts.map +1 -0
  39. package/dist/renderers/mask-vertex.d.ts +14 -0
  40. package/dist/renderers/mask-vertex.d.ts.map +1 -0
  41. package/dist/renderers/media-renderer-core.d.ts.map +1 -1
  42. package/dist/renderers/media-renderer-scene.d.ts +37 -0
  43. package/dist/renderers/media-renderer-scene.d.ts.map +1 -1
  44. package/dist/renderers/media-renderer-state.d.ts +11 -1
  45. package/dist/renderers/media-renderer-state.d.ts.map +1 -1
  46. package/dist/renderers/media-renderer-transport.d.ts +59 -0
  47. package/dist/renderers/media-renderer-transport.d.ts.map +1 -0
  48. package/dist/renderers/pixi-box-layer.d.ts +5 -0
  49. package/dist/renderers/pixi-box-layer.d.ts.map +1 -1
  50. package/dist/renderers/pixi-focus-layer.d.ts +18 -2
  51. package/dist/renderers/pixi-focus-layer.d.ts.map +1 -1
  52. package/dist/renderers/pixi-frame-present.d.ts +77 -0
  53. package/dist/renderers/pixi-frame-present.d.ts.map +1 -0
  54. package/dist/renderers/pixi-id-mask-shader.d.ts +12 -2
  55. package/dist/renderers/pixi-id-mask-shader.d.ts.map +1 -1
  56. package/dist/renderers/pixi-interaction-layer.d.ts.map +1 -1
  57. package/dist/renderers/pixi-interaction-presentation-layer.d.ts +13 -2
  58. package/dist/renderers/pixi-interaction-presentation-layer.d.ts.map +1 -1
  59. package/dist/renderers/pixi-mask-halo.d.ts +24 -0
  60. package/dist/renderers/pixi-mask-halo.d.ts.map +1 -1
  61. package/dist/renderers/pixi-mask-layer.d.ts +71 -8
  62. package/dist/renderers/pixi-mask-layer.d.ts.map +1 -1
  63. package/dist/renderers/pixi-media-scene.d.ts +67 -0
  64. package/dist/renderers/pixi-media-scene.d.ts.map +1 -1
  65. package/dist/renderers/pixi-polygon-layer.d.ts +7 -2
  66. package/dist/renderers/pixi-polygon-layer.d.ts.map +1 -1
  67. package/dist/renderers/pixi-region-coverage-mask.d.ts +91 -0
  68. package/dist/renderers/pixi-region-coverage-mask.d.ts.map +1 -0
  69. package/dist/renderers/pixi-region-effect.d.ts +42 -0
  70. package/dist/renderers/pixi-region-effect.d.ts.map +1 -0
  71. package/dist/renderers/pixi-region-layer.d.ts +68 -2
  72. package/dist/renderers/pixi-region-layer.d.ts.map +1 -1
  73. package/dist/renderers/pixi-vector-layer.d.ts.map +1 -1
  74. package/dist/renderers/prepared-annotation-window.d.ts +47 -0
  75. package/dist/renderers/prepared-annotation-window.d.ts.map +1 -0
  76. package/dist/renderers/presented-frame-channel.d.ts +107 -0
  77. package/dist/renderers/presented-frame-channel.d.ts.map +1 -0
  78. package/dist/renderers/scene-render-scheduler.d.ts +20 -0
  79. package/dist/renderers/scene-render-scheduler.d.ts.map +1 -0
  80. package/dist/sessions/media-session-defaults.d.ts +10 -6
  81. package/dist/sessions/media-session-defaults.d.ts.map +1 -1
  82. package/dist/sessions/media-session-media.d.ts.map +1 -1
  83. package/dist/sessions/media-session-state.d.ts.map +1 -1
  84. package/dist/sessions/media-session.d.ts.map +1 -1
  85. package/dist/tracking.worker.js +58 -3
  86. package/dist/tracking.worker.js.map +1 -1
  87. package/dist/types/media-conditions.d.ts +149 -0
  88. package/dist/types/media-conditions.d.ts.map +1 -0
  89. package/dist/types/media-normalization.d.ts +34 -0
  90. package/dist/types/media-normalization.d.ts.map +1 -1
  91. package/dist/types/media-renderer.d.ts +31 -1
  92. package/dist/types/media-renderer.d.ts.map +1 -1
  93. package/dist/types/media-session.d.ts +89 -8
  94. package/dist/types/media-session.d.ts.map +1 -1
  95. package/dist/types/render-preparation.d.ts +101 -4
  96. package/dist/types/render-preparation.d.ts.map +1 -1
  97. package/dist/web-video-engine/analysis-session.d.ts +76 -0
  98. package/dist/web-video-engine/analysis-session.d.ts.map +1 -0
  99. package/dist/web-video-engine/analysis.d.ts +7 -0
  100. package/dist/web-video-engine/analysis.d.ts.map +1 -0
  101. package/dist/web-video-engine/analysis.js +1678 -0
  102. package/dist/web-video-engine/analysis.js.map +1 -0
  103. package/dist/web-video-engine/cache-budget.d.ts +19 -0
  104. package/dist/web-video-engine/cache-budget.d.ts.map +1 -0
  105. package/dist/web-video-engine/canvas-sink-scrub-cursor.d.ts +90 -0
  106. package/dist/web-video-engine/canvas-sink-scrub-cursor.d.ts.map +1 -0
  107. package/dist/web-video-engine/clock.d.ts +83 -0
  108. package/dist/web-video-engine/clock.d.ts.map +1 -0
  109. package/dist/web-video-engine/constants.d.ts +253 -0
  110. package/dist/web-video-engine/constants.d.ts.map +1 -0
  111. package/dist/web-video-engine/create-scrub-cursor.d.ts +62 -0
  112. package/dist/web-video-engine/create-scrub-cursor.d.ts.map +1 -0
  113. package/dist/web-video-engine/decode-resolution.d.ts +115 -0
  114. package/dist/web-video-engine/decode-resolution.d.ts.map +1 -0
  115. package/dist/web-video-engine/decode-scheduler.d.ts +356 -0
  116. package/dist/web-video-engine/decode-scheduler.d.ts.map +1 -0
  117. package/dist/web-video-engine/decode-session.d.ts +276 -0
  118. package/dist/web-video-engine/decode-session.d.ts.map +1 -0
  119. package/dist/web-video-engine/decode-source.d.ts +250 -0
  120. package/dist/web-video-engine/decode-source.d.ts.map +1 -0
  121. package/dist/web-video-engine/diagnostics-store.d.ts +18 -0
  122. package/dist/web-video-engine/diagnostics-store.d.ts.map +1 -0
  123. package/dist/web-video-engine/diagnostics.d.ts +316 -0
  124. package/dist/web-video-engine/diagnostics.d.ts.map +1 -0
  125. package/dist/web-video-engine/embedded-engine-worker.d.ts +2 -0
  126. package/dist/web-video-engine/embedded-engine-worker.d.ts.map +1 -0
  127. package/dist/web-video-engine/engine-core.d.ts +258 -0
  128. package/dist/web-video-engine/engine-core.d.ts.map +1 -0
  129. package/dist/web-video-engine/engine.d.ts +26 -0
  130. package/dist/web-video-engine/engine.d.ts.map +1 -0
  131. package/dist/web-video-engine/engine.js +873 -0
  132. package/dist/web-video-engine/engine.js.map +1 -0
  133. package/dist/web-video-engine/engine.worker.d.ts +2 -0
  134. package/dist/web-video-engine/engine.worker.d.ts.map +1 -0
  135. package/dist/web-video-engine/engine.worker.js +31320 -0
  136. package/dist/web-video-engine/engine.worker.js.map +1 -0
  137. package/dist/web-video-engine/frame-cache.d.ts +129 -0
  138. package/dist/web-video-engine/frame-cache.d.ts.map +1 -0
  139. package/dist/web-video-engine/frame-extractor.d.ts +28 -0
  140. package/dist/web-video-engine/frame-extractor.d.ts.map +1 -0
  141. package/dist/web-video-engine/frame-timeline-GINI8Gum.js +560 -0
  142. package/dist/web-video-engine/frame-timeline-GINI8Gum.js.map +1 -0
  143. package/dist/web-video-engine/frame-timeline.d.ts +71 -0
  144. package/dist/web-video-engine/frame-timeline.d.ts.map +1 -0
  145. package/dist/web-video-engine/frame-walker.d.ts +74 -0
  146. package/dist/web-video-engine/frame-walker.d.ts.map +1 -0
  147. package/dist/web-video-engine/index.d.ts +3 -0
  148. package/dist/web-video-engine/index.d.ts.map +1 -0
  149. package/dist/web-video-engine/index.js +3 -0
  150. package/dist/web-video-engine/index.js.map +1 -0
  151. package/dist/web-video-engine/key-packet.d.ts +65 -0
  152. package/dist/web-video-engine/key-packet.d.ts.map +1 -0
  153. package/dist/web-video-engine/keyframe-index.d.ts +91 -0
  154. package/dist/web-video-engine/keyframe-index.d.ts.map +1 -0
  155. package/dist/web-video-engine/mirror-store.d.ts +56 -0
  156. package/dist/web-video-engine/mirror-store.d.ts.map +1 -0
  157. package/dist/web-video-engine/renderer.d.ts +94 -0
  158. package/dist/web-video-engine/renderer.d.ts.map +1 -0
  159. package/dist/web-video-engine/rotation.d.ts +35 -0
  160. package/dist/web-video-engine/rotation.d.ts.map +1 -0
  161. package/dist/web-video-engine/scrub-controller.d.ts +376 -0
  162. package/dist/web-video-engine/scrub-controller.d.ts.map +1 -0
  163. package/dist/web-video-engine/scrub-cursor.d.ts +342 -0
  164. package/dist/web-video-engine/scrub-cursor.d.ts.map +1 -0
  165. package/dist/web-video-engine/scrub-trajectory.d.ts +30 -0
  166. package/dist/web-video-engine/scrub-trajectory.d.ts.map +1 -0
  167. package/dist/web-video-engine/source-residency.d.ts +57 -0
  168. package/dist/web-video-engine/source-residency.d.ts.map +1 -0
  169. package/dist/web-video-engine/trace-recorder.d.ts +164 -0
  170. package/dist/web-video-engine/trace-recorder.d.ts.map +1 -0
  171. package/dist/web-video-engine/types.d.ts +204 -0
  172. package/dist/web-video-engine/types.d.ts.map +1 -0
  173. package/dist/web-video-engine/video-engine.d.ts +426 -0
  174. package/dist/web-video-engine/video-engine.d.ts.map +1 -0
  175. package/dist/web-video-engine/webgpu-renderer.d.ts +62 -0
  176. package/dist/web-video-engine/webgpu-renderer.d.ts.map +1 -0
  177. package/dist/web-video-engine/worker-bridge.d.ts +12 -0
  178. package/dist/web-video-engine/worker-bridge.d.ts.map +1 -0
  179. package/dist/web-video-engine/worker-dispatch.d.ts +17 -0
  180. package/dist/web-video-engine/worker-dispatch.d.ts.map +1 -0
  181. package/dist/web-video-engine/worker-protocol.d.ts +267 -0
  182. package/dist/web-video-engine/worker-protocol.d.ts.map +1 -0
  183. package/node_modules/supervision-js-core/dist/detections/buffered-detection-timeline.d.ts.map +1 -1
  184. package/node_modules/supervision-js-core/dist/detections/composite-detection-frame-source.d.ts.map +1 -1
  185. package/node_modules/supervision-js-core/dist/index.d.ts +4 -3
  186. package/node_modules/supervision-js-core/dist/index.d.ts.map +1 -1
  187. package/node_modules/supervision-js-core/dist/index.js +1075 -266
  188. package/node_modules/supervision-js-core/dist/index.js.map +1 -1
  189. package/node_modules/supervision-js-core/dist/styles/default-annotation-presentation.d.ts.map +1 -1
  190. package/node_modules/supervision-js-core/dist/styles/interaction-style.d.ts +4 -36
  191. package/node_modules/supervision-js-core/dist/styles/interaction-style.d.ts.map +1 -1
  192. package/node_modules/supervision-js-core/dist/styles/polyline-style.d.ts +5 -0
  193. package/node_modules/supervision-js-core/dist/styles/polyline-style.d.ts.map +1 -1
  194. package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts +92 -7
  195. package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts.map +1 -1
  196. package/node_modules/supervision-js-core/dist/types/detection-timeline.d.ts +179 -17
  197. package/node_modules/supervision-js-core/dist/types/detection-timeline.d.ts.map +1 -1
  198. package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts +78 -2
  199. package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts.map +1 -1
  200. package/node_modules/supervision-js-core/dist/types/polyline-style.d.ts +2 -0
  201. package/node_modules/supervision-js-core/dist/types/polyline-style.d.ts.map +1 -1
  202. package/node_modules/supervision-js-core/dist/types/session-lifecycle.d.ts +16 -0
  203. package/node_modules/supervision-js-core/dist/types/session-lifecycle.d.ts.map +1 -1
  204. package/node_modules/supervision-js-core/dist/utils/detection-conversions.d.ts.map +1 -1
  205. package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts +5 -0
  206. package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts.map +1 -1
  207. package/node_modules/supervision-js-core/dist/utils/detection-masks.d.ts +9 -0
  208. package/node_modules/supervision-js-core/dist/utils/detection-masks.d.ts.map +1 -1
  209. package/node_modules/supervision-js-core/dist/utils/detection-ranges.d.ts +18 -0
  210. package/node_modules/supervision-js-core/dist/utils/detection-ranges.d.ts.map +1 -0
  211. package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts +15 -2
  212. package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts.map +1 -1
  213. package/node_modules/supervision-js-core/dist/utils/wait-bound.d.ts +7 -0
  214. package/node_modules/supervision-js-core/dist/utils/wait-bound.d.ts.map +1 -0
  215. package/package.json +22 -1
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Decode-resolution strategies. A strategy decides the pixel width each video
3
+ * frame is decoded to, independent of the source's native resolution. Height
4
+ * follows from native aspect, so a strategy only ever returns a width.
5
+ *
6
+ * Decoding below native trades preview sharpness for paint cost and frame-cache
7
+ * memory. It does NOT cut decode cost: the codec decodes the full coded frame
8
+ * regardless of target width, and CanvasSink resizes the result afterward. The
9
+ * win scales with the gap between source resolution and the on-screen box: a 4K
10
+ * source shown in a 640px surface still pays full 4K decode, but the smaller
11
+ * surface cuts the per-frame paint work and the cached blit size.
12
+ *
13
+ * A strategy applies wherever frames decode through this seam: the live scrub
14
+ * surface and the analysis / extraction path alike. AnalysisSession decodes at
15
+ * whatever strategy it is given (native when omitted), so a thumbnail pass can
16
+ * cache a small blit instead of a native-size one.
17
+ */
18
+ /**
19
+ * Inputs a strategy reasons over. Native dimensions are the decoded track's
20
+ * real resolution. Display dimensions describe the on-screen canvas box at
21
+ * decode time; displayWidth is null when the surface has not been laid out
22
+ * yet (a strategy that needs it should fall back to native).
23
+ */
24
+ export interface DecodeResolutionContext {
25
+ readonly nativeWidth: number;
26
+ readonly nativeHeight: number;
27
+ /** CSS-pixel width of the canvas box, or null when unmeasured. */
28
+ readonly displayWidth: number | null;
29
+ /** devicePixelRatio at decode time. */
30
+ readonly devicePixelRatio: number;
31
+ }
32
+ /**
33
+ * Resolved decode dimensions. Always a valid, native-bounded integer pair with
34
+ * native aspect preserved.
35
+ */
36
+ export interface DecodeDimensions {
37
+ readonly width: number;
38
+ readonly height: number;
39
+ }
40
+ /**
41
+ * A decode-resolution choice as serializable data. Held as a descriptor rather
42
+ * than a closure so the choice can cross the worker boundary in a load command;
43
+ * resolveDecodeDimensions runs the width math worker-side once native dimensions
44
+ * are known. The resolver clamps any result above native so no strategy can
45
+ * upscale during decode.
46
+ */
47
+ export type DecodeResolutionStrategy = {
48
+ readonly kind: "native";
49
+ } | {
50
+ readonly kind: "viewport";
51
+ readonly maxDevicePixelRatio: number;
52
+ } | {
53
+ readonly kind: "capped";
54
+ readonly maxWidth: number;
55
+ } | {
56
+ readonly kind: "displayBox";
57
+ readonly boxWidth: number;
58
+ readonly boxHeight: number;
59
+ readonly devicePixelRatio: number;
60
+ readonly maxDevicePixelRatio: number;
61
+ };
62
+ /** Decode at native resolution. The conservative default. */
63
+ export declare function nativeResolution(): DecodeResolutionStrategy;
64
+ export interface ViewportResolutionOptions {
65
+ /**
66
+ * Ceiling on devicePixelRatio so a 3x display does not triple decode cost
67
+ * for sharpness past what the eye resolves on a moving preview. Default 2.
68
+ */
69
+ maxDevicePixelRatio?: number;
70
+ }
71
+ /**
72
+ * Decode at the on-screen size: canvas CSS width times devicePixelRatio. Best
73
+ * for fixed-size surfaces fed by a much larger source (frame sampler, inline
74
+ * players). Falls back to native while the box is unmeasured.
75
+ *
76
+ * The box it reads is the one bindCanvas measures, so this strategy resolves to
77
+ * native under presentation "frames", where the engine holds no canvas and
78
+ * nothing ever measures one. A frames-mode consumer passes displayBoxResolution
79
+ * instead.
80
+ */
81
+ export declare function viewportResolution(options?: ViewportResolutionOptions): DecodeResolutionStrategy;
82
+ /**
83
+ * Decode at no more than maxWidth regardless of display size. For consumers
84
+ * with a hard throughput or memory ceiling (batch surfaces, thumbnail farms).
85
+ */
86
+ export declare function cappedResolution(maxWidth: number): DecodeResolutionStrategy;
87
+ export interface DisplayBoxResolutionOptions {
88
+ /** CSS-pixel width of the box the consumer paints frames into. */
89
+ boxWidth: number;
90
+ /** CSS-pixel height of that box. */
91
+ boxHeight: number;
92
+ /** The consumer's own devicePixelRatio; the engine has none to read. */
93
+ devicePixelRatio: number;
94
+ /** Ceiling on that ratio. Default 2, matching viewportResolution. */
95
+ maxDevicePixelRatio?: number;
96
+ }
97
+ /**
98
+ * Decode at the size the frame will actually occupy inside a box the consumer
99
+ * describes: native aspect fitted into boxWidth x boxHeight, times the clamped
100
+ * device pixel ratio. Letterboxing is why the box is two numbers and not one,
101
+ * since a portrait source in a landscape box paints far narrower than the box.
102
+ *
103
+ * This is the strategy for presentation "frames". There the consumer owns the
104
+ * compositor, so it is the only side that knows the box, and viewportResolution
105
+ * has nothing to read.
106
+ */
107
+ export declare function displayBoxResolution(options: DisplayBoxResolutionOptions): DecodeResolutionStrategy;
108
+ /**
109
+ * Runs a strategy and returns native-bounded, aspect-preserving integer
110
+ * dimensions safe to hand to CanvasSink and to size a canvas backing store.
111
+ * A strategy that returns garbage (non-finite, non-positive) falls back to
112
+ * native rather than producing a broken surface.
113
+ */
114
+ export declare function resolveDecodeDimensions(strategy: DecodeResolutionStrategy, ctx: DecodeResolutionContext): DecodeDimensions;
115
+ //# sourceMappingURL=decode-resolution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decode-resolution.d.ts","sourceRoot":"","sources":["../src/decode-resolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,uCAAuC;IACvC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAChC;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAA;CAAE,GACnE;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACtD;IACE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;CACtC,CAAC;AAEN,6DAA6D;AAC7D,wBAAgB,gBAAgB,IAAI,wBAAwB,CAE3D;AAED,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,yBAA8B,GACtC,wBAAwB,CAK1B;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,wBAAwB,CAE3E;AAED,MAAM,WAAW,2BAA2B;IAC1C,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,gBAAgB,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,2BAA2B,GACnC,wBAAwB,CAQ1B;AAkCD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,wBAAwB,EAClC,GAAG,EAAE,uBAAuB,GAC3B,gBAAgB,CAUlB"}
@@ -0,0 +1,356 @@
1
+ import { type AnySourceHandle } from "./decode-source";
2
+ import { FrameCache } from "./frame-cache";
3
+ import type { FrameId } from "./frame-timeline";
4
+ import { type ScrubCursor, ScrubCursorState, type ScrubFrame, type ScrubFrameListener, type ScrubTrackInfo, type SchedulerStats, type SeekIntent } from "./scrub-cursor";
5
+ import { type Sec, VideoEngineError } from "./types";
6
+ export interface DecodeSchedulerOptions {
7
+ readonly source: AnySourceHandle;
8
+ readonly cache: FrameCache;
9
+ /** A cache hit within this of the target serves a crisp frame; default 50. */
10
+ readonly exactToleranceMs?: number;
11
+ /** A coarse hit within this of the target serves a preview; default 250. */
12
+ readonly previewToleranceMs?: number;
13
+ /** Millisecond time source for latency stats; defaults to performance.now. */
14
+ readonly now?: () => number;
15
+ /**
16
+ * Opens a fresh source handle to replace a wedged decoder, or null when the
17
+ * source cannot be re-opened (a one-shot stream). mediabunny decodes take no
18
+ * AbortSignal, so a hung decode is uncancellable; the watchdog disposes the
19
+ * dead provider and rebuilds from this seam so later decodes work. Omitted in
20
+ * tests that do not exercise recovery, where the scheduler degrades instead.
21
+ */
22
+ readonly reopen?: (() => Promise<AnySourceHandle>) | null;
23
+ /**
24
+ * Hang ceiling for one random-access decode; defaults to the runtime
25
+ * constant. A decode that outruns it is treated as failed and triggers
26
+ * provider recovery. Overridable so a test can drive it with fake timers at a
27
+ * small value.
28
+ */
29
+ readonly decodeHangTimeoutMs?: number;
30
+ /**
31
+ * Hang ceiling for the first-frame seed; defaults to the runtime constant,
32
+ * which is tighter than the one above. Overridable so a test can drive it
33
+ * with fake timers at a small value.
34
+ */
35
+ readonly seedHangTimeoutMs?: number;
36
+ /**
37
+ * Called once, with the failure, when the decoder is judged unable to decode
38
+ * this source at all. Nothing else tells a consumer: a stalled decoder still
39
+ * accepts every command and answers none of them, so without this the
40
+ * transport reads as playing over a canvas that will never change again.
41
+ */
42
+ readonly onDecodeFailure?: (error: VideoEngineError) => void;
43
+ }
44
+ /**
45
+ * Caching scrub cursor. Wraps the same decode primitives as CanvasSinkScrubCursor
46
+ * but routes every random-access seek through a two-tier FrameCache and prefetches
47
+ * a decode window around the playhead so the next move is already in hand.
48
+ *
49
+ * A scrub first reads the cache. An exact hit needs no decode. A preview hit
50
+ * paints a coarse frame at once, then a crisp decode follows. A miss decodes
51
+ * straight away. Once the foreground frame settles, a background sweep fills the
52
+ * cache around the playhead, shaped by how the consumer is moving: neighbor
53
+ * frames while scrubbing or stepping, a coarse keyframe pass while idle.
54
+ *
55
+ * A new gesture signals the sweep to bail and proceeds without waiting for it, so
56
+ * speculative work never sits on the critical path; mediabunny builds a decoder
57
+ * per iterator, so a sweep still unwinding alongside a foreground decode costs
58
+ * memory, not correctness. Every decoded frame is copied into the cache, never
59
+ * held as a raw VideoFrame, so the decoder is never pinned.
60
+ */
61
+ export declare class DecodeScheduler implements ScrubCursor {
62
+ private provider;
63
+ private readonly cache;
64
+ private keyframeIndex;
65
+ private readonly trackInfo;
66
+ private readonly exactTolMs;
67
+ private readonly previewTolMs;
68
+ private readonly now;
69
+ /** Re-opens the source after a hung decode, or null when it cannot be re-opened. */
70
+ private readonly reopen;
71
+ private readonly decodeHangTimeoutMs;
72
+ private readonly seedHangTimeoutMs;
73
+ /** Single-flight latch: a watchdog recovery already running. A second hang
74
+ * during the rebuild awaits the same recovery rather than racing a second
75
+ * dispose/rebuild of the provider. */
76
+ private recovering;
77
+ /** True once a hang hit a non-re-openable source: the provider is dead and
78
+ * could not be rebuilt, so decodes no-op rather than hang. Surfaced via stats
79
+ * so a consumer can show a degraded state instead of a silent freeze. */
80
+ private decoderDead;
81
+ /** Consecutive failed rebuilds. One is a transient read; a run of them is a
82
+ * source that cannot be re-opened, which is what decoderDead describes. */
83
+ private failedRebuilds;
84
+ /** True once the decoder is judged unable to decode this source at all. See
85
+ * SchedulerStats.decoderStalled; latched, and it stops the rebuild loop. */
86
+ private decoderStalled;
87
+ /** The failure markStalled latched, so a caller still awaiting a decode is
88
+ * handed the same one the consumer was told about rather than a parallel
89
+ * account of it. */
90
+ private stallFailure;
91
+ /** Decode requests the live provider has left unanswered in a row; see
92
+ * MAX_UNANSWERED_DECODES. */
93
+ private unansweredDecodes;
94
+ private readonly onDecodeFailure;
95
+ private iterator;
96
+ private nextInFlight;
97
+ private nextPending;
98
+ private currentState;
99
+ private readonly listeners;
100
+ private idleResolvers;
101
+ private settleResolvers;
102
+ private pendingSeekTargetS;
103
+ private pendingSeekKeyOnly;
104
+ private seekDraining;
105
+ private closed;
106
+ private lastEmittedFrame;
107
+ private mode;
108
+ /** Recent scrub motion. Only its heading is read, which is what decides the
109
+ * side of the playhead a scrub window spends most of its budget on. */
110
+ private readonly trajectory;
111
+ /** Outstanding background prefetch chain, or null once it unwinds. Awaited
112
+ * only by close(), so teardown cannot outrun a sweep still holding a decoder. */
113
+ private prefetchTask;
114
+ /** Bumped when a running prefetch is cancelled; that prefetch bails when it
115
+ * sees the token move, which is how cancellation propagates. */
116
+ private prefetchGen;
117
+ /** Whether a sweep is still depending on the live token. Cleared both by the
118
+ * cancellation that supersedes the sweep and by the sweep finishing. */
119
+ private prefetchArmed;
120
+ /** Woken when the token moves, so a sweep parked on a decode unwinds at the
121
+ * gesture rather than at the end of the decode it is parked on. */
122
+ private abandonResolvers;
123
+ private scrubSamples;
124
+ private scrubSumMs;
125
+ private scrubMaxMs;
126
+ private scrubLastMs;
127
+ /** Ring of recent scrub-decode latencies for p50/p95. Overwrite-oldest so the
128
+ * percentile tracks the recent region, not an all-time tail. One push/seek. */
129
+ private readonly scrubLatencyRing;
130
+ private scrubLatencyCount;
131
+ private scrubLatencyHead;
132
+ private targetVsLandedLastMs;
133
+ private timeToCrispLastMs;
134
+ private foregroundDecodes;
135
+ private prefetchExactFrames;
136
+ private prefetchPreviewFrames;
137
+ private keyframeAnchoredEmits;
138
+ private exactSeeks;
139
+ private keySeeks;
140
+ private seekCoalesceOverwrites;
141
+ constructor(options: DecodeSchedulerOptions);
142
+ get state(): ScrubCursorState;
143
+ get track(): ScrubTrackInfo;
144
+ get playReadAhead(): number;
145
+ get isIdle(): boolean;
146
+ open(): Promise<void>;
147
+ /**
148
+ * The first frame, on the seed ceiling and its own attempt budget.
149
+ *
150
+ * A decoder that accepts this decode and never answers it is the one failure
151
+ * the rest of the machinery cannot see: nothing has been asked of it twice
152
+ * yet, so no request budget can run out, and open() is what the load path
153
+ * awaits, so the wait ends only when the caller above gives up on the whole
154
+ * worker. Bounding it here turns that into a decoder failure named at the
155
+ * point it happened.
156
+ *
157
+ * Attempts are spent against rebuilt providers wherever the source can be
158
+ * re-opened, so exhausting them means the source was re-opened that many
159
+ * times and the first frame never arrived.
160
+ */
161
+ private seedFirstFrame;
162
+ /**
163
+ * Synchronous best-effort lookup the render loop calls on scrub to paint a
164
+ * frame this same tick. Pure: it reads the cache and returns a paintable
165
+ * frame without touching decode or cursor state.
166
+ */
167
+ peekCached(timeMs: number): ScrubFrame | null;
168
+ /**
169
+ * Resolves once foreground work has settled and any background prefetch
170
+ * kicked by that settle has drained. The plain idle() contract excludes
171
+ * prefetch so commits resolve promptly; this awaits full quiescence.
172
+ */
173
+ whenSettled(): Promise<void>;
174
+ /**
175
+ * Walks the whole track's keyframes into the index, metadata only, so the
176
+ * diagnostics keyframe lane fills out across the entire file. Decoder-less
177
+ * (it rides the EncodedPacketSink probe, never the frame sink), so it does
178
+ * not contend with the foreground decode. Idempotent and best-effort: a
179
+ * failure just leaves the lane as sparse as the lazy probes made it.
180
+ */
181
+ ensureKeyframeIndex(): Promise<void>;
182
+ getStats(): SchedulerStats;
183
+ /** Percentile over the bounded recent-latency ring. Copies the live samples
184
+ * into a small scratch array and sorts; bounded by SCRUB_LATENCY_RING, and
185
+ * this runs only at snapshot time, never per seek. */
186
+ private scrubPercentile;
187
+ /** The targets the next prefetch sweep would decode for the current mode
188
+ * and position; a pure recompute from existing state. The Idle plan is
189
+ * built from the keyframes discovered so far, so it grows as the index
190
+ * learns, exactly like the sweep it predicts. */
191
+ private prefetchPlanMs;
192
+ seekTo(timestamp: Sec, intent?: SeekIntent): void;
193
+ seekToKey(timestamp: Sec): void;
194
+ /** Floors a seek target to the track's first timestamp. A seek below the
195
+ * origin (an offset/trimmed clip) has no sample to land on, so it would
196
+ * emit nothing; clamping lands it on the first frame instead. */
197
+ private clampToOrigin;
198
+ /** Motion sampled across a pause, a step, or a stretch of playback describes
199
+ * no hand still on the timeline, so leaving a scrub drops the gesture. */
200
+ private enterMode;
201
+ attachPlay(startS: number): void;
202
+ detachPlay(): void;
203
+ next(): void;
204
+ /**
205
+ * Decodes one named frame of the source and emits it.
206
+ *
207
+ * The retrieval is at-or-before a time the frame table produced, and the
208
+ * demuxer normalises that back to the same integer tick it came from, so it
209
+ * lands on that frame and no other. Nothing here walks, compares or skips,
210
+ * so a step across a frame boundary needs no epsilon, and a burst of steps
211
+ * reuses whatever decode position the session already holds, with no
212
+ * iterator opened per press.
213
+ */
214
+ seekToFrame(frame: FrameId): Promise<ScrubFrame | null>;
215
+ idle(): Promise<void>;
216
+ seekSettled(): Promise<void>;
217
+ subscribe(listener: ScrubFrameListener): () => void;
218
+ close(): Promise<void>;
219
+ private drainSeek;
220
+ private runSeek;
221
+ private runExactSeek;
222
+ /**
223
+ * Whether a decode that outlived its target still improves the picture,
224
+ * judged from where the gesture has since reached. A drag that outruns the
225
+ * decoder supersedes every decode it starts, and the screen holds something
226
+ * older than all of them, so refusing the lot pins the picture at whatever
227
+ * was up when the drag began.
228
+ *
229
+ * Only a gesture reads this way. A jump has one destination and no
230
+ * intermediate positions worth showing, so a superseded decode there is
231
+ * work for a place nobody is looking.
232
+ */
233
+ private gainsOnTarget;
234
+ /**
235
+ * Whether a cached frame earns the screen over what is already on it. A
236
+ * crisp frame always does. A coarse stand-in exists to bridge the wait for a
237
+ * decode, so it earns the screen only by landing closer to the target than
238
+ * what is showing: replacing a crisp frame with a blurry one at the same
239
+ * position is a visible drop in quality for nothing, and on a slow drag,
240
+ * where each step lands within a frame of the last, it repeats several times
241
+ * a second and reads as the picture flickering between sharp and soft.
242
+ */
243
+ private worthPainting;
244
+ private runKeySeek;
245
+ private pullForwardOne;
246
+ /**
247
+ * Bounds a decode so a hung mediabunny decode (which takes no AbortSignal and
248
+ * cannot be cancelled) never wedges the caller. On timeout it returns null and
249
+ * kicks provider recovery; the orphaned decode promise is abandoned, since
250
+ * there is no handle to cancel it. The healthy path resolves before the timer
251
+ * and behaves exactly as a bare await: the loser timer is cleared, so it adds
252
+ * no work to a decode that lands in time.
253
+ *
254
+ * A rejected decode takes the same route as a hung one. Every caller here is
255
+ * mid-gesture with no way to answer a decode failure other than to try again
256
+ * on a working decoder, and a throw would escape the fire-and-forget seek
257
+ * drain and the play pull chain as an unhandled rejection. Taking that route
258
+ * is also why an unanswered decode has to be counted here: the failure is
259
+ * absorbed at this one point, so this is the only place that can tell a
260
+ * decoder having a bad moment from one that will never answer again.
261
+ */
262
+ private withDecodeWatchdog;
263
+ /**
264
+ * The same watchdog over a container metadata read. Deliberately unbooked:
265
+ * the keyframe probe never touches the decoder, so its answer is no evidence
266
+ * that decoding works, and clearing the stall budget on one would keep a
267
+ * background sweep forgiving a decoder that answers nothing.
268
+ */
269
+ private withProbeWatchdog;
270
+ private watchdogged;
271
+ private raceWatchdog;
272
+ /**
273
+ * Books one decode the live provider failed to answer, and decides whether
274
+ * to rebuild or to give up. A decoder that refuses outright says so in the
275
+ * rejection and there is nothing to rebuild toward; otherwise the runtime
276
+ * rebuilds until the request budget runs out, which is what stops a source
277
+ * that re-opens cleanly and then decodes nothing from being rebuilt forever
278
+ * while every surface reads as healthy.
279
+ */
280
+ private noteUnanswered;
281
+ /** Latches the terminal decoder failure and hands it out exactly once. */
282
+ private markStalled;
283
+ /**
284
+ * Rebuilds the decoder after a hung decode. The old provider is wedged on an
285
+ * uncancellable decode, so it is disposed and a fresh source opened in its
286
+ * place; the keyframe index is repointed at the new probe since disposing the
287
+ * old input invalidated the old one. Single-flight: a second hang during the
288
+ * rebuild awaits the same recovery. When the source cannot be re-opened (a
289
+ * one-shot stream), the decoder is marked dead so later decodes no-op rather
290
+ * than hang, leaving the engine degraded but alive instead of frozen.
291
+ */
292
+ private recoverDecoder;
293
+ /**
294
+ * The only writer of the generation token, so no bump can move it without
295
+ * also waking the sweep it cancels. A running sweep bails at its next
296
+ * checkpoint and is never joined: joining it puts an unbounded background
297
+ * walk on the critical path of every seek and play pull. The task handle
298
+ * stays so close() can await teardown.
299
+ */
300
+ private abandonPrefetch;
301
+ /** Resolves the moment `gen` stops being the live prefetch generation. */
302
+ private whenAbandoned;
303
+ /**
304
+ * Kicks a background sweep around `aroundS` for the current access mode.
305
+ * Fire-and-forget: it waits for any prior sweep to tear down so the decoder
306
+ * is never used twice at once, then runs under a captured generation token.
307
+ */
308
+ private schedulePrefetch;
309
+ private runPrefetch;
310
+ private runExactWindow;
311
+ private runPreviewSweep;
312
+ private decodeInto;
313
+ /**
314
+ * One sweep pull, ended by abandonment rather than by the decode it is
315
+ * waiting on. A native async generator serializes its request queue, so the
316
+ * return() that cancellation would issue is queued behind the in-flight
317
+ * next() and lands only once that walk finishes; the pull itself cannot be
318
+ * called back. The sweep therefore stops awaiting it and leaves it orphaned,
319
+ * closing the sample it may still deliver, which the cache will never own.
320
+ */
321
+ private pullSwept;
322
+ private windowTimestamps;
323
+ /**
324
+ * How a window's slots divide between the way the gesture is heading and the
325
+ * way it came from. An unmoving gesture has no direction to favour, so it
326
+ * splits evenly, which is also what a step or an idle settle wants.
327
+ */
328
+ private splitByHeading;
329
+ /**
330
+ * Whether reaching `t` backwards is worth it, measured in frames the walk
331
+ * from its keyframe would decode. The index is what the runtime knows so far,
332
+ * so an empty one is no evidence and does not veto: guessing a source has no
333
+ * keyframes would throw away every backward slot on a source that has plenty.
334
+ */
335
+ private walkToTargetAffordable;
336
+ /**
337
+ * Per-side neighbor count for the current mode, clamped so the whole window
338
+ * (both sides plus the center already in hand) fits the exact tier. A window
339
+ * wider than the tier would evict its own freshly decoded frames, so a
340
+ * re-scrub into the swept region would still miss.
341
+ */
342
+ private perSideWindowFrames;
343
+ private frameIntervalS;
344
+ private currentPositionS;
345
+ private emitDecoded;
346
+ /** Puts a decoded frame in both tiers without painting it, and releases it.
347
+ * For a frame worth keeping whose moment to be seen has passed. */
348
+ private cacheDecoded;
349
+ private emitCached;
350
+ private emit;
351
+ private frameFromCache;
352
+ private recordScrubLatency;
353
+ private flushIdleResolvers;
354
+ private flushSettleResolvers;
355
+ }
356
+ //# sourceMappingURL=decode-scheduler.d.ts.map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