Skip to content

chore: Add todo comment#3864

Draft
mrousavy wants to merge 1 commit into
mainfrom
feat/useCameraDevices-default
Draft

chore: Add todo comment#3864
mrousavy wants to merge 1 commit into
mainfrom
feat/useCameraDevices-default

Conversation

@mrousavy
Copy link
Copy Markdown
Owner

useCameraDevice(..) and useCameraDevices() needs to change a bit.

If no filter? arg is passed, we should use CameraDeviceFactory.getDefaultCamera(..) instead - this is the OS recommended Camera. If an argument is passed, we should filter based on all available Camera Devices.

However, the CameraDeviceFactory is created asynchronously and should be shared across hooks calls and ideally also imperative API calls in the other file. Also, there's addOnCameraDevicesChangedListener(..), which potentially also affects the result of CameraDeviceFactory.getDefaultCamera(..) - at least we should treat it as if it would affect that even though it likely only affects external Cameras in practice.
Still, in this case the hook may recompute that Camera if that changed. I guess we should compare it via id? Otherwise it'd be a new object + full Camera Session reconfigure each re-compute.

Anyways, the default case should be the CameraDeviceFactory.getDefaultCamera(..) - without compromising advanced cases for filtering. We should also add depth to filter options so users can find depth capable cameras more quickly

@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-native-vision-camera-docs Ready Ready Preview, Comment May 12, 2026 3:43pm

Request Review

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.

1 participant