Skip to content

Feat/recording result - #443

Merged
doranteseduardo merged 3 commits into
release/3.1.0from
feat/recording-result
Nov 4, 2026
Merged

doranteseduardo merged 3 commits into
release/3.1.0from
feat/recording-result

Conversation

@PetkoKuzmanov

@PetkoKuzmanov PetkoKuzmanov commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Recording result. VROARSession::stopRecording takes a completion that receives a VROARRecordingResult. It holds success, error, durationSec, frames, depthFrames, gpsFixes and bytes, and is called once video.mp4, session.jsonl and any depth files are complete. The no-argument form stays. On Android, ARScene.stopRecording() returns an ARScene.RecordingResult with the same fields.
  • Depth support check. isRecordingDepthSupported() answers LiDAR scene depth on iOS and the Depth API on ARCore. ARScene.isRecordingSupported(boolean depth) exposes it on Android, where both answers stay false until the ARCore session exists.
  • Android hit tests always deliver their results. The AR point, ray and position hit tests, the Quest OpenXR hit tests and the scene hit test held the caller's one-shot listener only as a weak global reference. The garbage collector could take it before the renderer thread answered, and the results never arrived. On a Pixel 6 Pro this happened about 11 s into a recording that hit-tests every 250 ms. The listener is now a global reference, deleted once the callback has run.
  • Stop failures no longer leave the status at IOError (Android). encoder.stop() and muxer.stop() failures, and now the encoder drain timeout, used to reach the scene after the stop had reset the status, so getRecordingStatus() read IOError with nothing recording. A failure while stopping now goes into the stop's result only. An encoder that does not finish now counts as a failed recording, as it already did on iOS.
  • Thread safety. ARScene.stopRecording() may be called off the UI thread (mSessionRecorder is volatile). On iOS the pose counters and the last pose time are kept under the sidecar lock and count only lines actually written, so stop() no longer races the AR thread.

Commits

  • c1a4f5f2 Android hit tests: hold the result listener with a global ref
  • f5407868 Return what a recording wrote from stopRecording, and whether depth can be recorded

viro's feat/vps-developer-tools ships binaries built from this branch, so merge this one first.

PetkoKuzmanov and others added 3 commits November 3, 2026 20:29
performARHitTestWithPoint, the ray, position and Quest OpenXR hit tests and the scene hit test kept the bridge's one-shot listener only as a weak global ref. Nothing else holds that listener, so the GC could collect it before the renderer thread answered, onHitTestFinished never ran and the JS promise stayed pending. On a Pixel 6 Pro this happened about 11 s into a recording that hit-tests every 250 ms.

The listener is now a global ref, deleted after the callback runs. With the rebuilt libviro_renderer.so in a host app, 120 probes all answered.
…an be recorded

VROARSession::stopRecording takes a completion receiving a
VROARRecordingResult (success, error, durationSec, frames, depthFrames,
gpsFixes, bytes), called once video.mp4, session.jsonl and any depth files
are complete; the no-argument form remains. ARScene.stopRecording() returns
an ARScene.RecordingResult with the same fields. isRecordingDepthSupported()
answers LiDAR scene depth on iOS and the Depth API on ARCore, and
ARScene.isRecordingSupported(boolean depth) exposes it on Android.

Android reports an encoder that did not finish as a failure, as iOS does.
A failure while stopping goes into the result only: it used to reach the
scene after the stop had reset the status, leaving getRecordingStatus() at
IOError with nothing recording. ARScene.stopRecording() may run off the UI
thread. On iOS the pose counters are kept under the sidecar lock, counting
only lines actually written.
@doranteseduardo
doranteseduardo merged commit 6c96a82 into release/3.1.0 Nov 4, 2026
4 checks passed
@doranteseduardo
doranteseduardo deleted the feat/recording-result branch November 4, 2026 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants