@displayxr/inline3d 1.49.0 → 1.49.2

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
@@ -5,6 +5,52 @@ entry points (`.`, `./three`) are frozen for 1.x, while the **scene subpaths** (
5
5
  `./splat`, `./model`) are a preview tier whose options may change in any release. Entries below say
6
6
  which tier they touch, because that is what tells you whether an upgrade can move your pixels.
7
7
 
8
+ ## 1.49.2 — 2026-11-04
9
+
10
+ ### Fixed — the camera probe waits for the DisplayXR 3D camera before opening a plain lens (`./camera`, `./call`)
11
+
12
+ Preview tier. In a DisplayXR Browser the runtime lists its 3D camera lazily. On a phone it is
13
+ missing from the list right after a runtime restart, or after the camera service restarted. With
14
+ the 3D camera absent, `camera: 'auto'` read the list once more and then opened the plain front lens.
15
+ On some phones that open crashes the camera HAL while head tracking streams. The HAL restart takes
16
+ the 3D camera down again, so the call never got it back: the self view stayed 2D, or the call
17
+ reported "Camera busy".
18
+
19
+ - **The wait:** with camera labels visible and no stereo-named device listed, `'auto'` / `'stereo'`
20
+ now wait up to `stereoWaitMs` (new option, default **2500 ms in a DisplayXR Browser**, 0
21
+ elsewhere) before opening any plain lens. They re-read the list on every `devicechange` and every
22
+ 500 ms, and open the 3D camera as soon as it appears. `'mono'`, an explicit `deviceId` and
23
+ `label:` never wait. The rule is in [`docs/camera.md`](docs/camera.md), "Waiting for the 3D camera".
24
+ - **No shape probe of a second lens in a DisplayXR Browser:** once a plain lens is in hand, the
25
+ last-resort probe no longer opens the other plain lenses to test whether one is a side-by-side
26
+ pair. There, a stereo webcam (a USB SBS one included, through the runtime's UVC source) is the
27
+ runtime's named "3D Camera". The extra open is the one that can crash a phone's camera HAL. Other
28
+ browsers keep the shape probe, which is how a USB stereo webcam is found there.
29
+ - **Pinned:** when the default camera opens but delivers no picture (0x0), a lens that opens by id
30
+ is kept as the fallback, never stopped and reported as busy. This has worked since 1.48.0; a test
31
+ now covers it.
32
+
33
+ ## 1.49.1 — 2026-11-03
34
+
35
+ ### Fixed — app share on browsers without the app-share device patch (`./call`, `./camera`)
36
+
37
+ Preview tier. A DisplayXR Browser that predates the app-share device patch (1.9.x) lists a running
38
+ app through its 3D-camera device, as `3D Camera (DisplayXR) - <app>` with no `source` in
39
+ `displayxrStereo` — and once the runtime offers more than one source it suffixes the REAL camera the
40
+ same way, so the label cannot tell an app from a camera. On such a browser `camera: 'auto'` could
41
+ open the app and send it as your face, and `listShareableApps()` found nothing.
42
+
43
+ - **Detection by the opened track**: an app source advertises `baselineMm: 0` and
44
+ `horizontalFovDeg: 0` (runtime ADR-061 decision 2); a real camera never has baseline 0.
45
+ `isAppShareDevice()` now accepts that hint as well as `source: 'app'`. The legacy label alone is
46
+ never enough.
47
+ - **Camera probe**: every probe path checks the opened track; an app is closed again and reported
48
+ in `skipped` with `reason: 'app-share'`, and probing goes on. Suffixed real cameras open as before.
49
+ - **Discovery**: with no `DisplayXR: <app> (3D)` device listed, `listShareableApps()` returns the
50
+ `3D Camera (DisplayXR) - <name>` entries as candidates (`ShareableApp.legacy: true`, `appName`
51
+ from the label). `openAppShare()` verifies the opened track and rejects a real camera with
52
+ `code: 'not-app-share'` (stopped again); the descriptor's `appName` falls back to the label's name.
53
+
8
54
  ## 1.49.0 — 2026-11-03
9
55
 
10
56
  ### Added — the content tile: share a running 3D app into a call (`./call`, `./camera`)
package/call.d.ts CHANGED
@@ -374,9 +374,15 @@ export interface CallContent {
374
374
  /** A running DisplayXR app the browser offers to share (`listShareableApps`). */
375
375
  export interface ShareableApp {
376
376
  readonly deviceId: string;
377
- /** `DisplayXR: <app> (3D)`. */
377
+ /** `DisplayXR: <app> (3D)` (or `3D Camera (DisplayXR) - <app>` for a `legacy` candidate). */
378
378
  readonly label: string;
379
379
  readonly appName: string | null;
380
+ /**
381
+ * A browser without the app-share device patch: a CANDIDATE listed by its label shape only — a
382
+ * real camera can carry the same shape. `openAppShare()` verifies it (a camera rejects with
383
+ * `not-app-share`).
384
+ */
385
+ readonly legacy?: true;
380
386
  }
381
387
 
382
388
  /** An opened app share (`openAppShare`): pass `stream` (+ `descriptor`) to `shareContent`. The track is yours to stop. */
@@ -392,8 +398,9 @@ export type AppShareErrorCode = 'share-denied' | 'share-failed' | 'not-app-share
392
398
  /**
393
399
  * Is this a running DisplayXR app offered for 3D screen share (runtime ADR-061) rather than a
394
400
  * camera? A `MediaDeviceInfo`, a label, a track, or its settings: true on the label
395
- * `DisplayXR: <app> (3D)`, a `dxr-app:` device id, or `displayxrStereo.source === 'app'`. No camera
396
- * probe (`camera: 'auto'`, `openCamera`) ever opens one.
401
+ * `DisplayXR: <app> (3D)`, a `dxr-app:` device id, `displayxrStereo.source === 'app'`, or (browsers
402
+ * without the app-share device patch) a hint with `baselineMm` and `horizontalFovDeg` both 0. No
403
+ * camera probe (`camera: 'auto'`, `openCamera`) ever uses one.
397
404
  */
398
405
  export function isAppShareDevice(device: MediaDeviceInfo | MediaStreamTrack | MediaTrackSettings | { label?: string; deviceId?: string } | string | null | undefined): boolean;
399
406
 
package/camera.d.ts CHANGED
@@ -73,6 +73,13 @@ export interface CameraOptions {
73
73
  * list off. An explicit `deviceId` or `label:` (`prefer`) is your choice and is opened regardless.
74
74
  */
75
75
  exclude?: ReadonlyArray<string | RegExp> | false;
76
+ /**
77
+ * `'auto'` / `'stereo'` with labels visible and no 3D camera listed: how long (ms) to wait for
78
+ * the runtime's 3D camera to be listed before any plain lens is opened. Default 2500 in a
79
+ * DisplayXR Browser, 0 elsewhere (one re-read of the list). Opening a phone lens while head
80
+ * tracking streams can crash the camera HAL on some devices and take the 3D camera down with it.
81
+ */
82
+ stereoWaitMs?: number;
76
83
  /** Verbose console logging. */
77
84
  debug?: boolean;
78
85
  }