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

Feature: Implement new High Resolution Size List #1241

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,14 @@ protected List<Size> getPreviewStreamAvailableSizes() {
Size add = new Size(size.getWidth(), size.getHeight());
if (!candidates.contains(add)) candidates.add(add);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
sizes = streamMap.getHighResolutionOutputSizes(ImageFormat.YUV_420_888);
if (sizes != null)
for (android.util.Size size : sizes) {
Size add = new Size(size.getWidth(), size.getHeight());
if (!candidates.contains(add)) candidates.add(add);
}
}
return candidates;
} catch (CameraAccessException e) {
throw createCameraException(e);
Expand All @@ -352,6 +360,14 @@ protected List<Size> getFrameProcessingAvailableSizes() {
Size add = new Size(size.getWidth(), size.getHeight());
if (!candidates.contains(add)) candidates.add(add);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
sizes = streamMap.getHighResolutionOutputSizes(mFrameProcessingFormat);
if (sizes != null)
for (android.util.Size size : sizes) {
Size add = new Size(size.getWidth(), size.getHeight());
if (!candidates.contains(add)) candidates.add(add);
}
}
return candidates;
} catch (CameraAccessException e) {
throw createCameraException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ public Camera2Options(@NonNull CameraManager manager,
supportedPictureSizes.add(new Size(width, height));
supportedPictureAspectRatio.add(AspectRatio.of(width, height));
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
psizes = streamMap.getHighResolutionOutputSizes(pictureFormat);
if (psizes != null)
for (android.util.Size size : psizes) {
int width = flipSizes ? size.getHeight() : size.getWidth();
int height = flipSizes ? size.getWidth() : size.getHeight();
supportedPictureSizes.add(new Size(width, height));
supportedPictureAspectRatio.add(AspectRatio.of(width, height));
}
}

// Video Sizes
// As a safety measure, remove Sizes bigger than CamcorderProfile.highest
Expand Down