8000 Future of the Camera Plugin (Refactor/Rework) · Issue #31225 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Future of the Camera Plugin (Refactor/Rework) #31225
Closed
@bparrishMines

Description

@bparrishMines

As our team decides on the direction of the camera plugin, I wanted to create this issue to keep the community updated on our decisions and to catalog the highest requested features and issues with the current implementation.

Below are what I found are a combination of the main requested features and issues. Please feel free to let us know if there is anything else we should also consider.

We’ll update this issue when we have come up with a design.

Support Android Camera 16+:

flutter/plugins#1482
#19083

In order to support 16+, we will have to use the Camera API. (As opposed to Camera2). This comes at the expense of features only available on Camera2. The alternative would be to maintain both an api for 16-20 and 21+.

Also note that CameraX will be discussed at I/O and could be used in the Android implementation.

Support iOS Camera 8.0+

flutter/plugins#801
#20708

We currently use AVCapturePhotoOutput to take photos. For 8.0-10.0, we would need to use AVCaptureStillImageOutput.
We also use AVCaptureDeviceDiscoverySession to find available devices. We could use AVCaptureDevice.devicesWithMediaType: for 8.0-10.0.

Camera Orientation Control

flutter/plugins#1452
#27201
#25232

On iOS, this feature is controlled by AVCaptureVideoOrientation. On Android, the Camera API has setDisplayOrientation and there is no equivalent feature on the Camera2 API.

Video/Preview/Picture output sizes

flutter/plugins#1403
flutter/plugins#1186
flutter/plugins#1107
#15953
#20994

Currently we use preview presets. But, it would probably be best to expose all available formats.

Android Pause and Resume video recording (MediaRecorder)

flutter/plugins#1370

Zoom Control

flutter/plugins#1304

We would expose the zoom feature on both platforms. Similar to the above PR.

Flash

flutter/plugins#1047
#19845

We would expose the flash feature on both platforms. Similar to the above PR.

Automatic Exposure

flutter/plugins#1035

We would expose the AE feature on both platforms. Similar to the above PR.

Permission Handling (Camera/Audio)

flutter/plugins#904
flutter/plugins#837
flutter/plugins#823
#19670

The solution to this one is a little bit more complicated. Below are proposed solutions:

  1. Remove permissions from the plugin entirely. This would require users to use a separate plugin to handle permissions. Currently, there isn’t any first party plugin that supports this, but there are a few popular external ones. (e.g. permission_handler, simple_permissions)

  2. Don’t automatically handle permissions when accessing the camera, but expose the api and allow the user to ask for permissions when they want.

Auto Focus

flutter/plugins#709

We would expose the AF feature on both platforms. Similar to the above PR.

Memory Leak

#29586

Currently no solution for this, but could likely be related to not deallocating the FlutterTexture.

Provide Complex Camera Example

#19515
#18989

Expand Controls over video and image formats

flutter/plugins#1525

Direct access to image buffer when taking a photo

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Fluttercustomer: crowdAffects or could affect many people, though not necessarily a specific customer.p: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0