-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
🐛 onInitialized seems to be called too early on Android #1053
Comments
Huh that's interesting, I'm not sure if there is a native event that we need to wait for here: react-native-vision-camera/android/src/main/java/com/mrousavy/camera/CameraView.kt Lines 499 to 508 in 83943da
|
@mrousavy I'm not sure exactly (your code seems to look ok). I did see this which could be useful to know when the preview is streaming (which might be the event we could key off of). https://stackoverflow.com/questions/69401931/android-how-to-get-a-callback-in-camerax-when-the-camera-device-has-finished-op |
@mrousavy just checking up with this... do you think we could get an event with the preview is streaming? I think that will do what I'm looking for. |
I think that's implied with a Frame Processor, I'll have a look if that also works if the FP use case is not attached... |
Hey! I've rewritten the entire Android codebase of VisionCamera from CameraX to Camera2 in the efforts of ✨ VisionCamera V3. I just now completed the Camera2 rewrite and I believe the core structure is running, but there might be some edge cases to iron out. Can you try and test the PR #1674 for me to see if you can still reproduce this issue here? Here's an instruction on how you can test that: #1674 (comment) If the issue cannot be reproduced with that version/PR anymore, then hoorayy, I fixed it! 🎉 Thank you! |
Thanks @mrousavy. I'll try to find some time to integrate the new code in the coming days/weeks. Thanks again for all of your work on this. 🙏 |
What were you trying to do?
On some Android devices (Google Pixel 2) the camera returns from
onInitialized
yet doesn't seem ready to capture. If I put asetTimeout
of 500ms before allowingtakePhoto
to be called it helps on the faster devices but not on the Pixel 2. I can continue to tweak the timeout, but I'm hoping you see what the issue could be.Reproduceable Code
No response
What happened instead?
The camera doesn't take a photo, or when running in Waldo, the screen stays black (see below, the upper row is using
react-native-camera
and the second row isreact-native-vision-camera
).Relevant log output
No response
Device
Pixel 2, Galaxy S10
VisionCamera Version
2.13.3
Additional information
The text was updated successfully, but these errors were encountered: