Repository navigation
Conversation
Expose the video dimensions the constraint resolver negotiated so a caller can read them from `onSessionConfigSelected` before the session starts. The only other source is an output's `currentResolution`, which depends on an input-port `formatDescription` that is legitimately absent until the session is running. iOS reads the dimensions from the negotiated `AVCaptureDevice.Format`. Android returns `undefined`: CameraX does not expose an authoritative use-case resolution before binding, so callers keep reading an output's `currentResolution` from the configured callback there. Bindings regenerated with `bun run specs` (Nitrogen 0.37.0); the generated diff is limited to the `CameraSessionConfig` spec files. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@don4325 is attempting to deploy a commit to the Margelo Team on Vercel. A member of the Team first needs to authorize it. |
|
Device follow-up for the "not verified against a written asset" limit, on a development build running this change as a patch on 5.2.3, with a video-only session targeting 1080x1440:
The value read before session start matched the recorded file wherever a file was recorded. Photo plus video sessions were not covered.
On #4224: that PR adds |
Problem
There is no way to learn the video dimensions the constraint resolver negotiated before the
session starts.
onSessionConfigSelectedhands back aCameraSessionConfigwith the selectedFPS, stabilization modes, dynamic range, pixel format and so on, but not the resolution. The
only other source is an output's
currentResolution, which on iOS reads the input port'sformatDescription, and that is legitimately absent until the session is running. A callerthat wants to size UI or validate a recording plan from the resolved config has nothing to read.
Change
CameraSessionConfig.selectedVideoResolution?: Size(reuses the existingcommon-types/Size). Documented as "may beundefinedwhen the platform cannot report itbefore the session starts".
HybridCameraSessionConfig.selectedVideoResolutionreturnsSize(dimensions: negotiatedFormat.format.formatDescription.dimensions); added totoString().HybridCameraSessionConfig.selectedVideoResolutionreturnsnull, with a comment:CameraX does not expose an authoritative use-case resolution before binding, so callers keep
reading an output's
currentResolutionfrom the configured callback there. Added totoString().bun run specsinpackages/react-native-vision-camera(Nitrogen 0.37.0, the version pinned in the package). The generated diff is limited to the
eight
CameraSessionConfigspec files (shared C++ .hpp/.cpp, iOS Swift/Swift_cxx/C++ .hpp,Android Kotlin and JNI .hpp/.cpp).
lib/is build output and is not committed.Verification
bun run typecheck(tsc --noEmit) in the package: passes.biome checkon the changed spec: passes.swift format(config/.swift-format) on the hand-edited Swift file: no diff.ktlint --editorconfig=config/.editorconfigon the hand-edited Kotlin file: clean.mainfirst: the only drift is trailing-whitespace-only lines infour unrelated generated files (
HybridTapToFocusGestureControllerSpec.kt,VisionCamera-Swift-Cxx-Bridge.{cpp,hpp},PhotoFile.swift); that drift is pre-existingand is not included here.
react-native-vision-camera@5.2.3in a shipping app.Limits and open questions
a per-output size after any stabilization crop or output scaling. The existing
currentResolutionreads the same source, so this is not a regression, but a different name(
selectedFormatResolution,nativeResolution) might describe it better. Open to renaming.undefinedis deliberate but asymmetric; if a CameraX path to the resolveduse-case size before bind exists that I have missed, I will wire it.
photo+video sessions, and camera flips.
🤖 Generated with Claude Code