Index: webrtc/api/android/java/src/org/webrtc/VideoCapturerAndroid.java |
diff --git a/webrtc/api/android/java/src/org/webrtc/VideoCapturerAndroid.java b/webrtc/api/android/java/src/org/webrtc/VideoCapturerAndroid.java |
index 990563adcaab246af596448e3e210da0537b405a..9f90f5381ff0c7d68f0090cce67f2b2317afd75c 100644 |
--- a/webrtc/api/android/java/src/org/webrtc/VideoCapturerAndroid.java |
+++ b/webrtc/api/android/java/src/org/webrtc/VideoCapturerAndroid.java |
@@ -391,8 +391,11 @@ public class VideoCapturerAndroid implements |
final CaptureFormat.FramerateRange fpsRange = |
CameraEnumerationAndroid.getClosestSupportedFramerateRange(supportedFramerates, framerate); |
- final Size previewSize = CameraEnumerationAndroid.getClosestSupportedSize( |
- Camera1Enumerator.convertSizes(parameters.getSupportedPreviewSizes()), width, height); |
+ final List<Size> supportedPreviewSizes = |
+ Camera1Enumerator.convertSizes(parameters.getSupportedPreviewSizes()); |
+ final Size previewSize = |
+ CameraEnumerationAndroid.getClosestSupportedSize(supportedPreviewSizes, width, height); |
+ Logging.d(TAG, "Available preview sizes: " + supportedPreviewSizes); |
final CaptureFormat captureFormat = |
new CaptureFormat(previewSize.width, previewSize.height, fpsRange); |
@@ -432,15 +435,16 @@ public class VideoCapturerAndroid implements |
camera.setPreviewCallbackWithBuffer(null); |
} |
- // (Re)start preview. |
- Logging.d(TAG, "Start capturing: " + captureFormat); |
- this.captureFormat = captureFormat; |
- |
List<String> focusModes = parameters.getSupportedFocusModes(); |
if (focusModes.contains(android.hardware.Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) { |
+ Logging.d(TAG, "Enable continuous auto focus mode."); |
parameters.setFocusMode(android.hardware.Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO); |
} |
+ // (Re)start preview. |
+ Logging.d(TAG, "Start capturing: " + captureFormat); |
+ this.captureFormat = captureFormat; |
+ |
camera.setParameters(parameters); |
// Calculate orientation manually and send it as CVO instead. |
camera.setDisplayOrientation(0 /* degrees */); |