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: Android Camera v2 API #339

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

dpa99c
Copy link

@dpa99c dpa99c commented Jun 22, 2024

This PR contains a rewrite of the Android implementation to use the Camera v2 API instead of the deprecated Camera API.

The main reason for this change is to fix issues I was encountering with the existing implementation where the camera preview/captured image from this plugin did not correspond the camera preview/captured image from the default Camera app. i.e. this fixes #275

It also opens the way to fetch the device's camera details and select a specific camera/lens based on these [see #256].
While the fetch side is implemented by this PR (getCameraCharacteristics()), the selection of a specific camera/lens is not (as I didn't need it for my use case).

I also implements getZoom(), setZoom() and getMaxZoom() on both Android & iOS, reworking my previous PR #326 on Android to work with Camera v2 API.

@forgr-owner
Copy link

Hey @dpa99c feel free to propose your PR here: Cap-go/camera-preview#61
There is bounty of $100

@varshith257
Copy link

varshith257 commented Jul 7, 2024

@dpa99c Is this changes works? Maybe a demo video demonstrating this changes could be good to add in PR description.

It could get easy for @pbowyer or @arielhernandezmusa to get quick reviewed. Hope this get merged soon. I am waiting for the Camera2 API to be integrated in the capacitor soon :)

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.

Preview size is not correctly calculated in Portrait mode
3 participants