Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support tap to focus without a Preview View #3089

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

mrousavy
Copy link
Owner

@mrousavy mrousavy commented Jul 17, 2024

What

Currently, focusing only works when using the normal Preview View.
When using Skia, there is no Preview View and we cannot focus.

My idea was to move the layer point conversion method to JS, so that we can do it synchronously & instantly - either convert a view point to PreviewView coordinates, or Skia video output stream coordinates.

Unfortunately both iOS and Android do not expose matrixes that allow me to convert x/y coordinates myself.
You have to use their functions for it, and on Android it only works on the UI Thread (why do you need to dispatch to the UI thread for some number multiplication you ask? I dont know. 🤦‍♂️)

So now I think the only solution we have is to actually pass a prop to focus which is coordinateSystem: 'preview' | 'video'... No way around it 🤦‍♂️

Changes

Tested on

Related issues

Copy link

vercel bot commented Jul 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-vision-camera ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2024 9:45am

@mrousavy mrousavy marked this pull request as ready for review August 28, 2024 09:45
@mrousavy mrousavy mentioned this pull request Oct 1, 2024
5 tasks
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