Repository navigation
Add Depth probing and live depth-map preview - #337
Merged
Merged
Conversation
Reviewer's GuideThis PR adds end-to-end DEPTH16 capability reporting and a depth-only LIVE preview: metadata is modeled conservatively, frames are decoded and bounded into a non-persisted map, lifecycle transitions isolate depth from color capture, and UI/CLI controls are restricted accordingly. It also adds JVM and synthetic instrumentation coverage plus synchronized documentation and validation records; real DEPTH_OUTPUT hardware behavior remains unverified. Sequence diagram for switching from color to depth viewsequenceDiagram
actor User
participant MainActivity
participant ColorEngine
participant DepthCameraEngine
participant ImageReader
participant DepthMapView
User->>MainActivity: chooseDepth()
MainActivity->>ColorEngine: close(done)
ColorEngine-->>MainActivity: close complete
MainActivity->>DepthCameraEngine: start()
DepthCameraEngine->>DepthCameraEngine: depthSupport()
DepthCameraEngine->>DepthCameraEngine: open()
DepthCameraEngine->>ImageReader: create DEPTH16 reader
DepthCameraEngine->>ImageReader: setRepeatingRequest()
ImageReader-->>DepthCameraEngine: image available
DepthCameraEngine->>DepthFrame: render()
DepthFrame-->>MainActivity: depth frame
MainActivity->>DepthMapView: bind()
DepthMapView-->>User: distance, confidence, valid percentage
Sequence diagram for returning from depth to color capturesequenceDiagram
actor User
participant MainActivity
participant DepthCameraEngine
participant ColorEngine
User->>MainActivity: selectMode(video)
MainActivity->>DepthCameraEngine: close(done)
DepthCameraEngine-->>MainActivity: close complete
MainActivity->>ColorEngine: start()
ColorEngine-->>MainActivity: color preview ready
MainActivity-->>User: Photo or Video controls enabled
Flow diagram for conservative depth capability reportingflowchart TD
CameraCharacteristics --> DepthCapabilities
DepthCapabilities --> DepthSupport
DepthSupport --> ProbeRows
DepthSupport --> LiveDepthChoice
DepthSupport -->|missing or read failure| Unknown
DepthSupport -->|advertised and DEPTH16 sizes available| Available
Available --> DepthOnlySession
DepthOnlySession -.->|combination still requires verification| SessionCheck
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PROBE now reports whether each camera advertises
DEPTH_OUTPUT, itsDEPTH16resolutions, and whether the HAL allows color and depth in the same request. Missing metadata stays unknown, and declared support is distinguished from a verified stream combination.LIVE gains a Depth mode with a resolution picker. It closes the color engine before opening a depth-only Camera2 session, so the viewer can also target cameras that require exclusive depth requests. The map displays distance and confidence, center distance, and the valid sample percentage. Photo/Video restore color capture; media capture, PIP, zoom, manual controls and CLI tuning are disabled in depth view.
The change includes pure Kotlin depth decoding, bounded display work, buffer and camera cleanup, user documentation, and reviewed/generated documentation freshness records. Benchmark contracts and pixel-free incident exports are preserved.
Validation
lintDebug: 0 errors, 0 warnings; debug and instrumentation APKs built.DEPTH_MAP_CHECKS_OK).docflow check --buildanddocflow check --cipassed.Hardware limits
The connected SM-S936N exposes no Camera2 DEPTH_OUTPUT stream. Sustained sensor frames, resolution-specific session support, orientation and repeated color/depth transitions still need hardware validation. The viewer uses depth-only sessions; color/depth registration and bokeh composition are outside this change.
Documentation acceptance was explicitly authorized by the user and recorded as
codex-user-authorized-depth-review; it does not claim real-depth measurements or independent human code review.Screenshots
PROBE Depth search:
Unsupported camera in LIVE:
Synthetic DEPTH16 fixture (not real sensor output):
Summary by Sourcery
Add depth capability probing and a depth-only LIVE preview while keeping color capture workflows and existing benchmark artifacts isolated.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests:
Chores: