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

Use largest available preview size from android camera #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

johnvh
Copy link

@johnvh johnvh commented Jan 4, 2016

@@ -719,6 +719,22 @@ public void surfaceDestroyed(SurfaceHolder holder) {
return optimalSize;
}

private Camera.Size getLargestPreviewSize(List<Camera.Size> sizes, int w, int h) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we not doing anything with w and h ?
Does the purpose of optimal size is to get closed camera size to requested ?
I think we should compare sizes.get(i).width > w starting with smallest.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we not doing anything with w and h ?

Correct, it would be safe to remove.

Does the purpose of optimal size is to get closed camera size to requested ?

No, that's what the original method - getOptimalPreviewSize() - does. This gets the largest preview (by width) available.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, ok. lets merge.

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