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

Wide Angle & Zoom Lens Switching? #195

Open
jtkeyva opened this issue Jan 7, 2023 · 8 comments
Open

Wide Angle & Zoom Lens Switching? #195

jtkeyva opened this issue Jan 7, 2023 · 8 comments
Labels
android Android related issue enhancement New feature or request

Comments

@jtkeyva
Copy link

jtkeyva commented Jan 7, 2023

Proposal

Include the option to cycle through all available camera/lenses.

iPhone Pro has 3 different lenses / cameras. I recall using a Flutter app/package that allowed you to cycle through all the lenses which included the wide-angle the regular as well as the zoom lens. It was a while back but I think it was just a matter of allowing 4 cameras in the list rather than 2.

Any plans for this?

Thanks

@g-apparence
Copy link
Collaborator

Hello,
This has just been made by our awesome @istornz
You can test it on master branch directly.

@ghost ghost added enhancement New feature or request android Android related issue labels Jan 10, 2023
@istornz
Copy link
Contributor

istornz commented Jan 10, 2023

It's done on iOS, missing the Android part.

@jamesdixon
Copy link

@istornz amazing work!

Is this possible on Android? I believe I saw another thread that maybe questioned whether it was possible or not.

@istornz
Copy link
Contributor

istornz commented Jan 13, 2023

@jamesdixon Thanks, I think it's possible but complicated, any advise @apalala-dev ?

@apalala-dev
Copy link
Contributor

@jamesdixon It should be possible but for some reason I am only getting 2 camera ids (one for front and one for back camera) whatever I do.

Same goes for CameraX extensions (night mode, HDR...). In theory, the code is ready but my code or CameraX API is broken atm 😅

I am trying with devices from Firebase Test Lab since my own is getting old (Xiaomi Mi 9T), but even a Pixel 7 Pro doesn't return more than 2 cameras and can't use CameraX extensions.

We'll let you know if we figure it out!

@apalala-dev
Copy link
Contributor

On Android, there is a concept of "logical camera" and "physical camera". A logical camera can use multiple physical camera.

Most of the time, it seems that there is only one logical camera for each side of the phone and I didn't find a way to directly use the physical camera with CameraX.

However, it is still possible to switch between several cameras with different capabilities by setting a specific zoom to them.
On a Pixel 7 Pro for instance, I was able to get the wide angle camera (x0.6) by setting a zoom value between 0.0 and 0.4 (included).
I got back to the normal sensor (x1) starting at 0.5 value and even could be able to achieve a x30 when setting the zoom value to 1.0 (PIxel 7 Pro has a telephoto sensor that allows x30 zoom).

@jtkeyva
Copy link
Author

jtkeyva commented Jan 17, 2023

Thanks all!

@Verman98
Copy link

Verman98 commented Nov 11, 2024

Hi All,
has anyone find any solution for this issue?

@istornz @apalala-dev
With https://developer.android.com/media/camera/camera2 it is possible to get the various cameras from Android phones, this can also be tested with the camera_android package.
Does camerAwesome use cameraX under the hood? That is not supporting multiple physical sensors for Android

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Android related issue enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants