Reputation: 317
Is it posible access to Camera parameters in CameraSource on Android's Mobile Vision API 8.4? I want to be able to adjust some Camera parameters (Shutter speed, ISO, aperture,...).
UPDATE I try to do it using this code:
public Camera getCamera(CameraSource cameraSource) {
Field[] declaredFields = CameraSource.class.getDeclaredFields();
for (Field field : declaredFields) {
if (field.getType() == Camera.class) {
field.setAccessible(true);
try {
Camera camera = (Camera) field.get(cameraSource);
if (camera != null) {
return camera;
}
return null;
} catch (IllegalAccessException e) {
e.printStackTrace();
}
break;
}
}
return null;
}
But it doesn´t work for me, field.get(cameraSource);
return null
when get the field with type Camera.class
.
Android-Vision team, do you plan to add these feature in the next releases?
Best regards,
Christian
Upvotes: 1
Views: 1041
Reputation: 2862
We have no plans to expose the underlying camera in the official API. But there's an open source version of this class that you can use and modify:
Upvotes: 1