Commit 0981b952 authored by Sylvain Berfini's avatar Sylvain Berfini
Browse files

Activate AutoFocus modified

parent 041744e5
......@@ -78,8 +78,8 @@ public class AndroidVideoApi5JniWrapper {
static public void activateAutoFocus(Object cam) {
Log.d("mediastreamer", "Turning on autofocus on camera " + cam);
Camera camera = (Camera) cam;
if (camera.getParameters().getFocusMode() == Parameters.FOCUS_MODE_AUTO || camera.getParameters().getFocusMode() == Parameters.FOCUS_MODE_MACRO)
camera.autoFocus(null);
if (camera != null && (camera.getParameters().getFocusMode() == Parameters.FOCUS_MODE_AUTO || camera.getParameters().getFocusMode() == Parameters.FOCUS_MODE_MACRO))
camera.autoFocus(null); // We don't need to do anything after the focus finished, so we don't need a callback
}
public static Object startRecording(int cameraId, int width, int height, int fps, int rotation, final long nativePtr) {
......@@ -93,8 +93,8 @@ public class AndroidVideoApi5JniWrapper {
// forward image data to JNI
putImage(nativePtr, data);
}
});
});
camera.startPreview();
Log.d("mediastreamer", "Returning camera object: " + camera);
return camera;
......
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