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] give computeBestCaptureSize option #49359

Open
pedrocar opened this issue Jan 23, 2020 · 0 comments
Open

[camera] give computeBestCaptureSize option #49359

pedrocar opened this issue Jan 23, 2020 · 0 comments
Labels
c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter p: camera The camera plugin P3 Issues that are less important to the Flutter project package flutter/packages repository. See also p: labels. team-ecosystem Owned by Ecosystem team triaged-ecosystem Triaged by Ecosystem team

Comments

@pedrocar
Copy link

pedrocar commented Jan 23, 2020

I have been trying to take photos with maximum resolution with the flutter camera plugin. however, the resolution of the captured images does never have the best capture size available through Camera2 API, independently of the ResolutionPreset parameter.

Looking at the code I found that the capture size is always using the best CamcorderProfile for ResolutionPreset


packages/camera/android/src/main/java/io/flutter/plugins/camera/Camera.java

recordingProfile = CameraUtils.getBestAvailableCamcorderProfileForResolutionPreset(cameraName, preset);
captureSize = new Size(recordingProfile.videoFrameWidth, recordingProfile.videoFrameHeight);
previewSize = computeBestPreviewSize(cameraName, preset);

The capture size should be the best available resolution for capturing image, like this:

captureSize = CameraUtils.computeBestCaptureSize(streamConfigurationMap);

Or give the plugin an option to select a resolution for the capture. Actually, the "computeBestCaptureSize" is implemented but never used in the current version of camera plugin.

@iapicca iapicca added p: camera The camera plugin p: first party c: proposal A detailed proposal for a change to Flutter c: new feature Nothing broken; request for a new capability labels Jan 24, 2020
@iapicca iapicca changed the title [camera] Image Capture resolution is not the best available [camera] give computeBestCaptureSize option Jan 24, 2020
@stuartmorgan stuartmorgan added the P3 Issues that are less important to the Flutter project label Jul 21, 2021
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
@Hixie Hixie removed the plugin label Jul 6, 2023
@flutter-triage-bot flutter-triage-bot bot added team-ecosystem Owned by Ecosystem team triaged-ecosystem Triaged by Ecosystem team labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter p: camera The camera plugin P3 Issues that are less important to the Flutter project package flutter/packages repository. See also p: labels. team-ecosystem Owned by Ecosystem team triaged-ecosystem Triaged by Ecosystem team
Projects
None yet
Development

No branches or pull requests

4 participants