Commit 0910435e authored by mcasas's avatar mcasas Committed by Commit bot

Android video capture: Set camera parameters continuous focus mode on, where supported

This is, apparently, needed for macro modes, although autofocus seems to
work ok in general.

A similar CL was landed and reverted (http://crrev.com/737003003). This CL
is an alternative where the supported focus modes are tested before being
set in the Camera.Parameters.

BUG=343894
TEST=Please refer to the bug, basically a gUM() + close text or QR codes focus test.

Review URL: https://codereview.chromium.org/744193002

Cr-Commit-Position: refs/heads/master@{#305117}
parent a602b405
...@@ -165,6 +165,13 @@ public abstract class VideoCaptureCamera extends VideoCapture ...@@ -165,6 +165,13 @@ public abstract class VideoCaptureCamera extends VideoCapture
Log.d(TAG, "Image stabilization not supported."); Log.d(TAG, "Image stabilization not supported.");
} }
if (parameters.getSupportedFocusModes().contains(
android.hardware.Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) {
parameters.setFocusMode(android.hardware.Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
} else {
Log.d(TAG, "Continuous focus mode not supported.");
}
setCaptureParameters(matchedWidth, matchedHeight, chosenFrameRate, parameters); setCaptureParameters(matchedWidth, matchedHeight, chosenFrameRate, parameters);
parameters.setPictureSize(matchedWidth, matchedHeight); parameters.setPictureSize(matchedWidth, matchedHeight);
parameters.setPreviewSize(matchedWidth, matchedHeight); parameters.setPreviewSize(matchedWidth, matchedHeight);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment