From b87b7bb9d0a8cef7c433d36837f5f77aa4973030 Mon Sep 17 00:00:00 2001 From: Qian Li Date: Wed, 24 Feb 2016 11:28:29 +0800 Subject: [PATCH] Use Parameters.FOCUS_MODE_CONTINUOUS_VIDEO to enable the auto focus for video call in Android --- .../video/capture/AndroidVideoApi9JniWrapper.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/java/src/org/linphone/mediastream/video/capture/AndroidVideoApi9JniWrapper.java b/java/src/org/linphone/mediastream/video/capture/AndroidVideoApi9JniWrapper.java index 42fb25009..a73fe6734 100644 --- a/java/src/org/linphone/mediastream/video/capture/AndroidVideoApi9JniWrapper.java +++ b/java/src/org/linphone/mediastream/video/capture/AndroidVideoApi9JniWrapper.java @@ -60,6 +60,11 @@ public static Object startRecording(int cameraId, int width, int height, int fps params.setPreviewSize(width, height); int[] chosenFps = findClosestEnclosingFpsRange(fps*1000, params.getSupportedPreviewFpsRange()); params.setPreviewFpsRange(chosenFps[0], chosenFps[1]); + + if(camera.getParameters().getSupportedFocusModes().contains(Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) { + params.setFocusMode(Parameters.FOCUS_MODE_CONTINUOUS_VIDEO); + } + camera.setParameters(params); int bufferSize = (width * height * ImageFormat.getBitsPerPixel(params.getPreviewFormat())) / 8;