Skip to content

[RFC] [Android] setting custom capture options for Camera2 API #15369

@floe

Description

@floe

For more specialized use cases, it is sometimes necessary to set custom capture options, particularly since the Camera2 API allows quite a number of different settings. Recent example, where I just directly edited JavaCamera2View.java:

 try {
     mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE,
-        CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE);
+        CaptureRequest.CONTROL_AF_MODE_OFF);
     mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE,
         CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH);
+    mPreviewRequestBuilder.set(CaptureRequest.LENS_FOCUS_DISTANCE, 0.0f);
+    mPreviewRequestBuilder.set(CaptureRequest.LENS_OPTICAL_STABILIZATION_MODE,
+        CameraMetadata.LENS_OPTICAL_STABILIZATION_MODE_OFF);                    

Unfortunately, I don't really have a good idea how to solve this in a generic way, i.e. expose the RequestBuilder object to the app. Suggestions?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions