Yanis Deplazes
Yanis Deplazes

Reputation: 45

Flutter [camera_android] change LENS_FOCUS_DISTANCE for Android Device

I’m using Flutter's camera plugin but need more control over native camera settings like:

The camera plugin doesn't expose these controls, but I need to modify them for both Android (Camera2 API) and iOS (AVFoundation). I've successfully implemented these changes on iOS, but I’m stuck on Android because the plugin creates its own CaptureRequest instance, which I can't access.

iOS

device.setFocusModeLocked(lensPosition: distance) { (time) in
  device.unlockForConfiguration()
}

Android

captureRequestBuilder.set(CaptureRequest.LENS_FOCUS_DISTANCE, distance);

I’m stuck on Android because the plugin creates its own CaptureRequest instance, which I can't access.

Has anyone worked on a similar solution or found a workaround for this?

Upvotes: 1

Views: 68

Answers (0)

Related Questions