Android focus problem on rear camera.
On some devices (confirmed Samsung) the focus mode is not configured correctly by default.
The fix explicitly set the focus mode to FOCUS_MODE_CONTINUOUS_VIDEO if this mode is supported.
BUG=webrtc:4991
Review URL: https://codereview.webrtc.org/1338773002
Cr-Commit-Position: refs/heads/master@{#10128}
diff --git a/talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java b/talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java
index ee01eed..8d33013 100644
--- a/talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java
+++ b/talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java
@@ -448,6 +448,12 @@
// (Re)start preview.
Logging.d(TAG, "Start capturing: " + captureFormat);
this.captureFormat = captureFormat;
+
+ List<String> focusModes = parameters.getSupportedFocusModes();
+ if (focusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) {
+ parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
+ }
+
camera.setParameters(parameters);
videoBuffers.queueCameraBuffers(captureFormat.frameSize(), camera);
camera.setPreviewCallbackWithBuffer(this);