@vestra-player/sdk 1.11.4 → 1.11.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.11.5
4
+
5
+ **Apple motion smoothing** (request R1; needs the first player release with the Apple engine, 0.11.12 or later). An addition only: **nobody must change anything**; a plugin that does not use `"apple"` behaves as before. Used by Apple Motion Smoothing (`zysilm.applemotion`); also for any plugin that offers motion smoothing on macOS (a picture panel's smoothing switch, a per-file profile plugin that turns smoothing on for low-rate video).
6
+
7
+ - **`MotionEngine` gains `"apple"`**: Apple's frame interpolation in VideoToolbox, on a Mac with Apple silicon and macOS 15.4 or newer. `plugin.video.motion("apple")` has the same shape, modes, state, reasons and fallback as `amd` and `nvidia`; one converter runs at a time across the three engines (`other-engine`, the message names the holder). An engine reports `platform` where its system does not have it: `apple` on Windows and Linux, `amd` and `nvidia` on macOS and Linux. On a player before SDK 1.11.5, `plugin.video.motion("apple")` throws `invalid` (the player's own SDK copy checks the name): a plugin that uses it declares that player release in `minPlayerVersion`. A plugin that switches exhaustively over `MotionEngine` sees a new case at compile time (no plugin in either repository does).
8
+ - The services check accepts the three names; the `invalid` message is `engine must be "amd", "nvidia" or "apple"`.
9
+ - **`TestHost.appleMotion`** (new): Apple's engine with the same model as `TestHost.motion`, its own state (defaults: both modes work, a 24 fps video on a 60 Hz display, converting on an Apple M2). One converter at a time across the three engines, as the player: the first engine set to a mode holds it (preset modes: `amd`, then `nvidia`, then `apple`), and the others report `other-engine` in the player's order. A fix that comes with it: an engine a test preset to a mode (another plugin's) now holds the converter before the plugin's own `set` of another engine counts; before, the engine being set could take it when no state had been read yet (regression test: NVIDIA preset on, the plugin sets AMD, AMD waits with `other-engine`). `motionChanged()` sends each of the three engines' states. The API surface snapshot gains `TestHost.appleMotion`.
10
+ - **Docs**: `MotionEngine`, `plugin.video.motion`, `VideoMotion` (a macOS paragraph: Apple silicon and macOS 15.4, no copy-back, `display` with GPU rendering, no size table: with GPU rendering, a size that fell far behind on two playbacks (not counting a window in which the system's interpolation stalled) is `size` for that size and larger until a plugin sets the mode again or the player restarts, 10-bit SDR taken and HDR `format`, frames passed through undoubled until the system's interpolation is ready, again for a new video or size), `MotionState.searchMode` (Apple has no faster setting: straight to `overload`, `searchMode` stays `native`), the `MotionReasonCode` table (`platform` per engine and system; `no-gpu`, `runtime`, `filter`, `failed`, `overload`, `format` and `size` name Apple's cases: a Mac without Apple silicon, macOS before 15.4 or frame interpolation the system says is not available on this Mac, a player built without the converter, a size the system cannot interpolate, HDR only, the learned size limit), the Platforms page's row (also NVIDIA's on Windows, which it lacked) and the test host reference.
11
+
3
12
  ## 1.11.4
4
13
 
5
14
  Nobody must change anything. **Product data**: `BUILTIN_COMMANDS` lists `vestra.window/pip` as Tools ▸ Picture-in-Picture (player 0.11.8, user ruling 2026-11-27; it was palette only), and so does the built-in command table in [Commands](docs/reference/commands.md). It is registered only where the system has picture-in-picture (macOS 14+). No API change.
Binary file
@@ -529,7 +529,7 @@ const enabledOf = new WeakMap();
529
529
  /** The modes `VideoMotion.set` accepts. */
530
530
  const MOTION_MODES = ["off", "double", "display"];
531
531
  /** The engines `plugin.video.motion(engine)` accepts. */
532
- const MOTION_ENGINES = ["amd", "nvidia"];
532
+ const MOTION_ENGINES = ["amd", "nvidia", "apple"];
533
533
  /**
534
534
  * `plugin.video.motion(engine)`: both requests
535
535
  * name the engine; the event names it too and leaves out each plugin's own
@@ -538,7 +538,7 @@ const MOTION_ENGINES = ["amd", "nvidia"];
538
538
  */
539
539
  export const videoMotion = (scope, engine) => {
540
540
  if (typeof engine !== "string" || !MOTION_ENGINES.includes(engine))
541
- throw failure("invalid", 'engine must be "amd" or "nvidia"');
541
+ throw failure("invalid", 'engine must be "amd", "nvidia" or "apple"');
542
542
  const modes = () => {
543
543
  let map = modeOf.get(scope.runtime);
544
544
  if (!map)
@@ -2300,7 +2300,7 @@ export declare class TestHost implements Transport {
2300
2300
  * and a 60 Hz display, converting on an RTX 4070 Laptop GPU. One
2301
2301
  * converter at a time, as the player: the first engine set to a mode (or
2302
2302
  * preset to one, `amd` first) holds it while its mode is not `off`, and
2303
- * the other engine's modes report `other-engine`, in the player's order:
2303
+ * the other engines' modes report `other-engine`, in the player's order:
2304
2304
  * a model's own run-long, renderer, `upscaling` or `doubling` reason
2305
2305
  * comes first, its `failed`, `overload`, `rate`, `format` or `size` after.
2306
2306
  * A test of "another plugin holds AMD's converter" sets
@@ -2320,12 +2320,40 @@ export declare class TestHost implements Transport {
2320
2320
  * @since 1.11.1
2321
2321
  */
2322
2322
  readonly nvidiaMotion: TestHost["motion"];
2323
+ /**
2324
+ * Apple's engine behind `plugin.video.motion("apple")`: the same model
2325
+ * as {@link TestHost.motion} (AMD's), its own state, answered the same
2326
+ * way. The defaults are a player where both modes work on a 24 fps video
2327
+ * and a 60 Hz display, converting on an Apple M2. One converter at a
2328
+ * time across the three engines, as the player: the first engine set to
2329
+ * a mode (or preset to one: `amd`, then `nvidia`, then `apple`) holds it
2330
+ * while its mode is not `off`, and the other engines' modes report
2331
+ * `other-engine` in the player's order (as {@link TestHost.nvidiaMotion}
2332
+ * says).
2333
+ *
2334
+ * @example Test an Apple plugin on a Mac it cannot run on
2335
+ * The same reason on both modes is what the player answers on a Mac
2336
+ * without Apple silicon: the plugin shows it and keeps the mode off,
2337
+ * since `no-gpu` holds for the run. A test of "the player renders in
2338
+ * software" sets only `display` to a `rendering` reason.
2339
+ * ```ts
2340
+ * declare const host: TestHost;
2341
+ * // ---cut---
2342
+ * const reason = { code: "no-gpu", message: "this Mac has no frame interpolation" };
2343
+ * host.appleMotion.double = reason;
2344
+ * host.appleMotion.display = reason;
2345
+ * ```
2346
+ *
2347
+ * @since 1.11.5
2348
+ */
2349
+ readonly appleMotion: TestHost["motion"];
2323
2350
  /**
2324
2351
  * Send `video.motion.changed` with the state {@link TestHost.motion}
2325
- * describes now (without `mode`), and then the one of
2326
- * {@link TestHost.nvidiaMotion}, as the player does when they change; a
2327
- * plugin listening with `plugin.video.motion(engine).onChange` receives
2328
- * its engine's. Nothing reaches a plugin that does not listen.
2352
+ * describes now (without `mode`), and then the ones of
2353
+ * {@link TestHost.nvidiaMotion} and {@link TestHost.appleMotion}, as the
2354
+ * player does when they change; a plugin listening with
2355
+ * `plugin.video.motion(engine).onChange` receives its engine's. Nothing
2356
+ * reaches a plugin that does not listen.
2329
2357
  *
2330
2358
  * @example The GPU fell behind
2331
2359
  * The player turned the converter off for this video; the plugin's
@@ -1788,7 +1788,7 @@ export class TestHost {
1788
1788
  * and a 60 Hz display, converting on an RTX 4070 Laptop GPU. One
1789
1789
  * converter at a time, as the player: the first engine set to a mode (or
1790
1790
  * preset to one, `amd` first) holds it while its mode is not `off`, and
1791
- * the other engine's modes report `other-engine`, in the player's order:
1791
+ * the other engines' modes report `other-engine`, in the player's order:
1792
1792
  * a model's own run-long, renderer, `upscaling` or `doubling` reason
1793
1793
  * comes first, its `failed`, `overload`, `rate`, `format` or `size` after.
1794
1794
  * A test of "another plugin holds AMD's converter" sets
@@ -1818,12 +1818,50 @@ export class TestHost {
1818
1818
  displayFps: 60,
1819
1819
  gpu: "NVIDIA GeForce RTX 4070 Laptop GPU",
1820
1820
  };
1821
+ /**
1822
+ * Apple's engine behind `plugin.video.motion("apple")`: the same model
1823
+ * as {@link TestHost.motion} (AMD's), its own state, answered the same
1824
+ * way. The defaults are a player where both modes work on a 24 fps video
1825
+ * and a 60 Hz display, converting on an Apple M2. One converter at a
1826
+ * time across the three engines, as the player: the first engine set to
1827
+ * a mode (or preset to one: `amd`, then `nvidia`, then `apple`) holds it
1828
+ * while its mode is not `off`, and the other engines' modes report
1829
+ * `other-engine` in the player's order (as {@link TestHost.nvidiaMotion}
1830
+ * says).
1831
+ *
1832
+ * @example Test an Apple plugin on a Mac it cannot run on
1833
+ * The same reason on both modes is what the player answers on a Mac
1834
+ * without Apple silicon: the plugin shows it and keeps the mode off,
1835
+ * since `no-gpu` holds for the run. A test of "the player renders in
1836
+ * software" sets only `display` to a `rendering` reason.
1837
+ * ```ts
1838
+ * declare const host: TestHost;
1839
+ * // ---cut---
1840
+ * const reason = { code: "no-gpu", message: "this Mac has no frame interpolation" };
1841
+ * host.appleMotion.double = reason;
1842
+ * host.appleMotion.display = reason;
1843
+ * ```
1844
+ *
1845
+ * @since 1.11.5
1846
+ */
1847
+ appleMotion = {
1848
+ mode: "off",
1849
+ double: null,
1850
+ display: null,
1851
+ renderingStarting: false,
1852
+ sourceFps: 24,
1853
+ outputFps: null,
1854
+ performance: false,
1855
+ displayFps: 60,
1856
+ gpu: "Apple M2",
1857
+ };
1821
1858
  /**
1822
1859
  * Send `video.motion.changed` with the state {@link TestHost.motion}
1823
- * describes now (without `mode`), and then the one of
1824
- * {@link TestHost.nvidiaMotion}, as the player does when they change; a
1825
- * plugin listening with `plugin.video.motion(engine).onChange` receives
1826
- * its engine's. Nothing reaches a plugin that does not listen.
1860
+ * describes now (without `mode`), and then the ones of
1861
+ * {@link TestHost.nvidiaMotion} and {@link TestHost.appleMotion}, as the
1862
+ * player does when they change; a plugin listening with
1863
+ * `plugin.video.motion(engine).onChange` receives its engine's. Nothing
1864
+ * reaches a plugin that does not listen.
1827
1865
  *
1828
1866
  * @example The GPU fell behind
1829
1867
  * The player turned the converter off for this video; the plugin's
@@ -1841,7 +1879,7 @@ export class TestHost {
1841
1879
  motionChanged() {
1842
1880
  if (!this.subscriptions.has("video.motion.changed"))
1843
1881
  return;
1844
- for (const engine of ["amd", "nvidia"]) {
1882
+ for (const engine of ["amd", "nvidia", "apple"]) {
1845
1883
  const { mode: _, ...state } = motionState(this, engine);
1846
1884
  this.emit("video.motion.changed", state);
1847
1885
  }
@@ -1,5 +1,5 @@
1
1
  import type { Json, WireMotionState, WireRenderingState, WireUpscalingState } from "../../wire.ts";
2
- import type { UpscalingDecodingCause, UpscalingPlugin, UpscalingReason } from "../types.ts";
2
+ import type { MotionEngine, UpscalingDecodingCause, UpscalingPlugin, UpscalingReason } from "../types.ts";
3
3
  import type { TestHost } from "./index.ts";
4
4
  import type { Handler, Internals } from "./internals.ts";
5
5
  /**
@@ -53,6 +53,6 @@ export declare function failVideoShaders(host: TestHost, _inner: Internals, id:
53
53
  /** Implements `TestHost.upscalingDecoding`. */
54
54
  export declare function upscalingDecoding(host: TestHost, _inner: Internals, cause: UpscalingDecodingCause, plugins?: readonly UpscalingPlugin[]): UpscalingReason;
55
55
  /** `video.motion.state` of an engine from its model (`amd` by default). */
56
- export declare function motionState(host: TestHost, engine?: "amd" | "nvidia"): WireMotionState;
56
+ export declare function motionState(host: TestHost, engine?: MotionEngine): WireMotionState;
57
57
  /** The default handlers of this area's wire methods, by method name. */
58
58
  export declare function processingHandlers(host: TestHost, inner: Internals): Record<string, Handler>;
@@ -247,34 +247,51 @@ export function upscalingDecoding(host, _inner, cause, plugins = []) {
247
247
  host.upscaling.hwdecCurrent = current;
248
248
  return reason;
249
249
  }
250
+ /** The engines, in the order the player looks at them when none holds the converter. */
251
+ const ENGINES = [
252
+ "amd",
253
+ "nvidia",
254
+ "apple",
255
+ ];
250
256
  /** The engine a request names, checked as the player does. */
251
257
  function engineOf(p) {
252
- if (p.engine !== "amd" && p.engine !== "nvidia")
253
- throw new HostError("invalid", 'engine must be "amd" or "nvidia"');
254
- return p.engine;
258
+ const engine = ENGINES.find((name) => name === p.engine);
259
+ if (!engine)
260
+ throw new HostError("invalid", 'engine must be "amd", "nvidia" or "apple"');
261
+ return engine;
255
262
  }
256
- /** The model of an engine: {@link TestHost.motion} (`amd`) or {@link TestHost.nvidiaMotion}. */
263
+ /** The model of an engine: {@link TestHost.motion} (`amd`), {@link TestHost.nvidiaMotion} or {@link TestHost.appleMotion}. */
257
264
  function modelOf(host, engine) {
258
- return engine === "amd" ? host.motion : host.nvidiaMotion;
265
+ return engine === "amd"
266
+ ? host.motion
267
+ : engine === "nvidia"
268
+ ? host.nvidiaMotion
269
+ : host.appleMotion;
259
270
  }
260
271
  /** The engine whose converter is in the chain, as the player keeps it: the first one set to a mode, while its mode is not `off`. */
261
272
  const motionHolder = new WeakMap();
262
- /** Which engine holds the converter now: the one recorded while it is on, else the first that is on (`amd` first). */
273
+ /** Which engine holds the converter now: the one recorded while it is on, else the first that is on (`amd`, then `nvidia`, then `apple`). */
263
274
  function holderOf(host) {
264
275
  const on = (engine) => modelOf(host, engine).mode !== "off";
265
276
  const recorded = motionHolder.get(host);
266
277
  if (recorded && on(recorded))
267
278
  return recorded;
268
- const next = on("amd") ? "amd" : on("nvidia") ? "nvidia" : null;
279
+ const next = ENGINES.find(on) ?? null;
269
280
  if (next)
270
281
  motionHolder.set(host, next);
271
282
  else
272
283
  motionHolder.delete(host);
273
284
  return next;
274
285
  }
275
- /** The player's message while the other engine holds the converter (as playback/motion.rs). */
286
+ /** Each engine's vendor, for the messages (as playback/motion.rs `Engine::vendor`). */
287
+ const VENDORS = {
288
+ amd: "AMD",
289
+ nvidia: "NVIDIA",
290
+ apple: "Apple",
291
+ };
292
+ /** The player's message while another engine holds the converter (as playback/motion.rs). */
276
293
  function otherEngine(holder) {
277
- const vendor = holder === "amd" ? "AMD" : "NVIDIA";
294
+ const vendor = VENDORS[holder];
278
295
  return {
279
296
  code: "other-engine",
280
297
  message: `${vendor} motion smoothing is on (another plugin); one converter runs at a time, so this waits until it is off`,
@@ -388,9 +405,12 @@ export function processingHandlers(host, inner) {
388
405
  if (reason && MOTION_FIXED.includes(reason.code) && !passes)
389
406
  throw new HostError("unsupported", `motion smoothing cannot work here: ${reason.message}`);
390
407
  }
408
+ // An engine already on (preset by a test as another plugin's) holds
409
+ // the converter before this request counts.
410
+ const before = holderOf(host);
391
411
  model.mode = mode;
392
412
  // The first engine set to a mode holds the converter while it is on.
393
- if (mode !== "off" && holderOf(host) === null)
413
+ if (mode !== "off" && before === null)
394
414
  motionHolder.set(host, engine);
395
415
  holderOf(host);
396
416
  return motionState(host, engine);
@@ -281,14 +281,19 @@ export interface Scope extends Disposable {
281
281
  */
282
282
  readonly upscaling: VideoUpscaling;
283
283
  /**
284
- * Motion smoothing with one GPU vendor's frame-rate converter: whether it works here and why not, and this
284
+ * Motion smoothing with one vendor's frame-rate converter: whether it works here and why not, and this
285
285
  * plugin's mode. `amd` is AMD AMF's on Windows; `nvidia` is NVIDIA's
286
286
  * (FFmpeg's `fruc_vulkan`, GeForce RTX 30 and newer, on Windows; an
287
- * older player reports `engine` for every mode).
287
+ * older player reports `engine` for every mode); `apple` is Apple's
288
+ * frame interpolation in VideoToolbox (Apple silicon, macOS 15.4 and
289
+ * newer; since SDK 1.11.5 and the first player release with the Apple
290
+ * engine, 0.11.12 or later). An engine reports `platform` on a system
291
+ * that does not have it.
288
292
  *
289
- * @param engine - The converter: `"amd"` or `"nvidia"`.
293
+ * @param engine - The converter: `"amd"`, `"nvidia"` or `"apple"`.
290
294
  * @returns A {@link VideoMotion} for that converter.
291
- * @throws `invalid` (throws) `engine` is not one of the two.
295
+ * @throws `invalid` (throws) `engine` is not one of the three (also
296
+ * `apple` on a player before SDK 1.11.5).
292
297
  * @player 0.8.1
293
298
  * @since 1.7.19
294
299
  */
@@ -928,19 +928,28 @@ export interface VideoUpscaling {
928
928
  onChange(listener: (state: UpscalingState) => void): Disposable;
929
929
  }
930
930
  /**
931
- * A GPU vendor's frame-rate converter for motion smoothing: `amd` (AMD
932
- * AMF's, on Windows with an AMD Radeon GPU) and `nvidia` (FFmpeg's
931
+ * A vendor's frame-rate converter for motion smoothing: `amd` (AMD
932
+ * AMF's, on Windows with an AMD Radeon GPU), `nvidia` (FFmpeg's
933
933
  * `fruc_vulkan` on the optical flow hardware of NVIDIA GeForce RTX 30 and
934
934
  * newer GPUs, on Windows with driver 573.38 or newer; a player before it
935
- * reports `engine` for every mode). Each vendor's motion smoothing is its
936
- * own plugin. One converter runs at a time: while one engine's is on for
937
- * some plugin, the other engine's modes report `other-engine` and wait.
935
+ * reports `engine` for every mode) and `apple` (Apple's frame interpolation
936
+ * in VideoToolbox, on a Mac with Apple silicon and macOS 15.4 or newer;
937
+ * since SDK 1.11.5). Each vendor's motion smoothing is its own plugin. An
938
+ * engine that does not exist on the system reports `platform` for every
939
+ * mode (`apple` on Windows and Linux, `amd` and `nvidia` on macOS and
940
+ * Linux). One converter runs at a time: while one engine's is on for some
941
+ * plugin, the other engines' modes report `other-engine` and wait.
942
+ *
943
+ * A player whose SDK is older than the engine refuses its name: on a
944
+ * player before SDK 1.11.5, `plugin.video.motion("apple")` throws
945
+ * `invalid`. A plugin that uses `apple` declares the first player release
946
+ * with the Apple engine (0.11.12 or later) in `minPlayerVersion`.
938
947
  *
939
948
  * @player 0.8.1
940
949
  * @since 1.7.19
941
950
  * @category Processing
942
951
  */
943
- export type MotionEngine = "amd" | "nvidia";
952
+ export type MotionEngine = "amd" | "nvidia" | "apple";
944
953
  /**
945
954
  * What motion smoothing does: `off`; `double`, twice the video's frame rate
946
955
  * with real in-between frames from the GPU's frame-rate converter, shown as
@@ -962,19 +971,19 @@ export type MotionMode = "off" | "double" | "display";
962
971
  * | Code | Meaning |
963
972
  * | --- | --- |
964
973
  * | `engine` | The player has no converter of this engine on this system (`nvidia` on a player before it). |
965
- * | `platform` | The player has no frame-rate converter on this system (macOS, Linux). |
966
- * | `no-gpu` | No GPU with this engine's converter (Windows: no AMD Radeon GPU; no NVIDIA GeForce RTX 30 or newer GPU). |
967
- * | `runtime` | The GPU's runtime is missing or too old (Windows: AMD's AMF runtime, installed with the AMD driver; an NVIDIA driver before 573.38), or the converter cannot start on this system (AMD: it failed to start the same way on two videos in this run, an older GPU AMF does not serve; NVIDIA: no Vulkan device or optical flow from the driver, at the first try). |
968
- * | `filter` | The player's video library has no frame-rate converter (a player built without it). |
974
+ * | `platform` | This engine's converter does not exist on this operating system: `amd` and `nvidia` on macOS and Linux, `apple` on Windows and Linux. |
975
+ * | `no-gpu` | No GPU with this engine's converter (Windows: no AMD Radeon GPU; no NVIDIA GeForce RTX 30 or newer GPU. macOS: a Mac without Apple silicon, where the system offers no frame interpolation). |
976
+ * | `runtime` | The GPU's runtime is missing or too old (Windows: AMD's AMF runtime, installed with the AMD driver; an NVIDIA driver before 573.38. macOS: a version before 15.4, which has no frame interpolation in VideoToolbox), or the converter cannot start on this system (AMD: it failed to start the same way on two videos in this run, an older GPU AMF does not serve; NVIDIA: no Vulkan device or optical flow from the driver, at the first try; Apple: the system says its frame interpolation is not available on this Mac, at the first try). |
977
+ * | `filter` | The player's video library has no frame-rate converter of this engine (a player built without it). |
969
978
  * | `rendering` | Match Display only: the player renders in software, or GPU rendering is still starting ({@link Rendering}). |
970
979
  * | `upscaling` | AI upscaling is on ({@link VideoUpscaling}); the two cannot run together. |
971
980
  * | `doubling` | A plugin's video filter already raises the frame rate (a `frameBlend` node, such as Frame Doubling); the two cannot run together. |
972
- * | `other-engine` | The other engine's converter is on for another plugin (the message names it); one converter runs at a time, so this waits until that one is off. |
973
- * | `failed` | The converter stopped on this video; the message has its error. The next video tries again. |
974
- * | `overload` | The output could not keep up with this video: the GPU, even with the faster motion search, or, with software rendering, the CPU drawing the doubled frames (the message says which, and that GPU Rendering helps then). The next video tries again. |
981
+ * | `other-engine` | Another engine's converter is on for another plugin (the message names it); one converter runs at a time, so this waits until that one is off. |
982
+ * | `failed` | The converter stopped on this video; the message has its error (Apple: for example a size the system cannot interpolate). The next video tries again. |
983
+ * | `overload` | The output could not keep up with this video: the GPU, even with the faster motion search (Apple: the Mac's frame interpolation, which has no faster setting), or, with software rendering, the CPU drawing the doubled frames (the message says which, and that GPU Rendering helps then). The next video tries again. |
975
984
  * | `rate` | The converter's input rate ({@link MotionState.sourceFps}: 25i deinterlaced by field reads 50) does not fit: outside 10–30 fps (the rates measured), doubled above the display's refresh rate, or (software rendering, Double) twice it is not the display's rate. |
976
- * | `format` | The video's format was not measured: 10-bit or deeper, or HDR. |
977
- * | `size` | The video is too large for this mode on this renderer: its width × height × the doubled rate is more than the player measured it keeps up with (on the reference laptop: software rendering up to 1080p at 30 fps, GPU rendering's Double up to 4K at 24 fps, Match Display up to 1080p on a 60 Hz display, counted at the display's refresh rate). The next video may fit. |
985
+ * | `format` | The video's format was not measured or is not taken: 10-bit or deeper, or HDR (Apple: HDR only; it takes 10-bit SDR). |
986
+ * | `size` | The video is too large for this mode on this renderer: its width × height × the doubled rate is more than the player measured it keeps up with (on the reference laptop: software rendering up to 1080p at 30 fps, GPU rendering's Double up to 4K at 24 fps, Match Display up to 1080p on a 60 Hz display, counted at the display's refresh rate). Apple has no such table, since its speed depends on the Mac: with GPU rendering, a size it fell far behind on (`overload`, about a quarter of the frames lost, in a window without a stall of the system's interpolation) on two playbacks of about that size in this run is `size` for that size and larger, for that mode, until a plugin sets the mode again or the player restarts; smaller videos are still tried (on an Apple M2, 1080p at 24 fps keeps up and 4K falls behind). The next video may fit. |
978
987
  *
979
988
  * `engine`, `platform`, `no-gpu`, `runtime`, `filter` and `rendering` (once GPU
980
989
  * rendering is not just starting) hold until the player restarts, and
@@ -1068,7 +1077,8 @@ export interface MotionState {
1068
1077
  * setting for this video, or `performance`, the faster one (the first
1069
1078
  * step when the GPU falls behind: AMD searches downscaled frames, NVIDIA
1070
1079
  * uses its fast optical flow, which it already uses above 1440p); `null`
1071
- * while off.
1080
+ * while off. Apple's converter has no faster setting: it falls back
1081
+ * straight to `overload`, and `searchMode` stays `native`.
1072
1082
  */
1073
1083
  readonly searchMode: "native" | "performance" | null;
1074
1084
  /**
@@ -1091,27 +1101,30 @@ export interface MotionState {
1091
1101
  }
1092
1102
  /**
1093
1103
  * `plugin.video.motion(engine)`: motion smoothing, the video's frame rate doubled by
1094
- * a GPU vendor's frame-rate converter (AMD AMF's or NVIDIA's
1095
- * `fruc_vulkan`, on Windows).
1104
+ * a vendor's frame-rate converter (AMD AMF's or NVIDIA's `fruc_vulkan` on
1105
+ * Windows, Apple's VideoToolbox frame interpolation on macOS).
1096
1106
  * Read whether it works here and why not; choose a mode for this plugin.
1097
1107
  *
1098
1108
  * @remarks
1099
1109
  * The converter makes real in-between frames (motion estimation, not
1100
1110
  * blending). While some plugin asks for a mode that can work, the player
1101
- * puts the converter last in the video filter chain, decodes with copy-back
1102
- * (the converter needs the frames in memory) and, for `display`, has the
1103
- * GPU renderer interpolate the doubled frames to the display. The strongest
1111
+ * puts the converter last in the video filter chain, decodes the way the
1112
+ * converter takes its frames (AMD and NVIDIA: copy-back, the frames in
1113
+ * memory; Apple: as decoded, VideoToolbox frames included) and, for
1114
+ * `display`, has the GPU renderer interpolate the doubled frames to the
1115
+ * display. The strongest
1104
1116
  * mode any plugin asked for applies; a stopped plugin's request is revoked.
1105
1117
  *
1106
1118
  * The player watches the converter while the video plays: when its output
1107
1119
  * falls behind the doubled rate or many frames are dropped, it first
1108
- * switches to a faster motion search on downscaled frames, then turns the
1109
- * converter off for this video with an `overload` reason. The next video
1120
+ * switches to a faster motion search ({@link MotionState.searchMode}) where
1121
+ * the engine has one, then turns the converter off for this video with an
1122
+ * `overload` reason. The next video
1110
1123
  * starts afresh.
1111
1124
  *
1112
1125
  * Motion smoothing and {@link VideoUpscaling | AI upscaling} exclude each
1113
- * other (the upscaler needs the frames on the GPU, the converter in
1114
- * memory): while upscaling is on, every mode waits with `upscaling`.
1126
+ * other (on Windows the upscaler needs the frames on the GPU, the converter
1127
+ * in memory): while upscaling is on, every mode waits with `upscaling`.
1115
1128
  * Doubling makes film look like video (the "soap-opera effect"): offer it
1116
1129
  * off by default.
1117
1130
  *
@@ -1120,9 +1133,26 @@ export interface MotionState {
1120
1133
  * newer (the converter gets a Vulkan device of its own while it runs, the
1121
1134
  * renderer is not involved; it starts on slow optical flow on a 4-pixel
1122
1135
  * grid, fast above 1440p). On a laptop with two GPUs the converter runs on
1123
- * the engine's GPU, whichever GPU renders. One engine's converter at a
1124
- * time: the other's modes wait with `other-engine`.
1125
- * **macOS, Linux:** every mode reports `platform`.
1136
+ * the engine's GPU, whichever GPU renders. `apple` reports `platform`.
1137
+ * **macOS:** `apple`: a Mac with Apple silicon and macOS 15.4 or newer;
1138
+ * the converter is the system's frame interpolation (VideoToolbox) on the
1139
+ * Mac's own chip, and {@link MotionState.gpu} names the chip (for example
1140
+ * `Apple M2`). `display` needs GPU rendering, the player's default on
1141
+ * macOS (`rendering` after a fallback to software rendering). How large a
1142
+ * video each mode keeps up with depends on the Mac: one too large falls
1143
+ * behind and reports `overload` for that video; once two playbacks of
1144
+ * about that size fell far behind with GPU rendering, that size and
1145
+ * larger report `size` until a plugin sets the mode again or the player
1146
+ * restarts (on an Apple M2, 1080p at 24 fps
1147
+ * keeps up, 4K does not). It takes 10-bit SDR video; HDR reports
1148
+ * `format`. Until the system's interpolation is ready (under a second on
1149
+ * an M2; the first time after the Mac starts it can take longer; again
1150
+ * for a new video or size) the frames pass through undoubled, and the
1151
+ * player judges the output only from then. `amd` and `nvidia` report `platform`.
1152
+ * **Linux:** every engine reports `platform`.
1153
+ *
1154
+ * One engine's converter at a time, on every system: the other engines'
1155
+ * modes wait with `other-engine`.
1126
1156
  *
1127
1157
  * @example Offer the three modes as radio commands
1128
1158
  * Each command chooses one mode; one the player cannot run here is
package/dist/wire.d.ts CHANGED
@@ -655,7 +655,7 @@ export interface WireUpscalingState {
655
655
  * @category Playback
656
656
  */
657
657
  export interface WireMotionState {
658
- /** The converter this state is of (`amd`; `nvidia` is reserved). */
658
+ /** The converter this state is of (`amd`, `nvidia` or `apple`). */
659
659
  engine: string;
660
660
  /** This plugin's own mode (`off`, `double` or `display`). */
661
661
  mode: "off" | "double" | "display";
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vestra Player SDK
2
2
 
3
- > @vestra-player/sdk 1.11.4: write plugins for Vestra Player in TypeScript (plugin API `vestra/1`). A plugin is a folder with `manifest.json` and an entry module whose default export `activate(plugin)` the player calls. The documentation is a tree of short pages read by path, like `go doc`: the same pages and API as https://vestrasys.github.io/vestra-player-sdk/.
3
+ > @vestra-player/sdk 1.11.5: write plugins for Vestra Player in TypeScript (plugin API `vestra/1`). A plugin is a folder with `manifest.json` and an entry module whose default export `activate(plugin)` the player calls. The documentation is a tree of short pages read by path, like `go doc`: the same pages and API as https://vestrasys.github.io/vestra-player-sdk/.
4
4
 
5
5
  ## Read the documentation
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vestra-player/sdk",
3
- "version": "1.11.4",
3
+ "version": "1.11.5",
4
4
  "description": "Plugin API types, test host and plugin CLI for Vestra Player (apiVersion vestra/1)",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {