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

[Camera] Add lens type information (iOS) #7653

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

Conversation

lenzpaul
Copy link

@lenzpaul lenzpaul commented Sep 16, 2024

This PR adds lens type information, which wasn't available before. The goal is to identify whether the lens type is wide, ultra-wide, telephoto, etc., as discussed in flutter/flutter#119908. The iOS implementation is complete, so lens data will now be populated on iOS.

  • Introduces a new CameraLensType enum to provide lens type information about the camera (e.g.: ultra-wide, telephoto, ...)
  • Adds lensType in the PlatformCameraDescription and CameraDescription classes
  • Implements utility functions to convert between PlatformCameraLensType and CameraLensType.
  • Updates auto-generated code (using Pigeon) to reflect these changes.

Current CameraDescription for iPhone 11

[
    CameraDescription(
        com.apple.avfoundation.avcapturedevice.built-in_video:0,
        CameraLensDirection.back,
        90
    ),
    CameraDescription(
        com.apple.avfoundation.avcapturedevice.built-in_video:1,
        CameraLensDirection.front,
        90
    ),
    CameraDescription(
        com.apple.avfoundation.avcapturedevice.built-in_video:5,
        CameraLensDirection.back,
        90
    )
]

New CameraDescription for iPhone 11

[
    CameraDescription(
        com.apple.avfoundation.avcapturedevice.built-in_video:0,
        CameraLensDirection.back,
        90,
        CameraLensType.wide
    ),
    CameraDescription(
        com.apple.avfoundation.avcapturedevice.built-in_video:1,
        CameraLensDirection.front,
        90,
        CameraLensType.wide
    ),
    CameraDescription(
        com.apple.avfoundation.avcapturedevice.built-in_video:5,
        CameraLensDirection.back,
        90,
        CameraLensType.ultraWide
    )
]

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@lenzpaul lenzpaul changed the title [Camera] Add lens type information [Camera] Add lens type information [ios] Sep 17, 2024
@lenzpaul lenzpaul changed the title [Camera] Add lens type information [ios] [Camera] Add lens type information (iOS) Sep 17, 2024
@lenzpaul lenzpaul marked this pull request as ready for review September 17, 2024 15:01
@stuartmorgan
Copy link
Contributor

Please see https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins for information on how to make this PR pass CI checks, which is important for review.

@lenzpaul
Copy link
Author

Please see https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins for information on how to make this PR pass CI checks, which is important for review.

I made changes as specified by the docs, please let me if there's anything else I need to do

@stuartmorgan
Copy link
Contributor

  • All existing and new tests are passing.

This PR is currently failing a substantial number of our CI checks, so this checkbox state is not accurate. If you click through the details of each CI task failure you can see the specific issues that will need to be fixed before this would be ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants