diff options
author | Zhijun He <zhijunhe@google.com> | 2015-06-17 09:21:10 -0700 |
---|---|---|
committer | Zhijun He <zhijunhe@google.com> | 2015-06-17 09:23:22 -0700 |
commit | a002fb4df44e7bea22c193095aec6516411f65d6 (patch) | |
tree | 4f20a33857d189e0cd09e11b4c86085581052f6a /core | |
parent | 73d043232434f3ad37af26615919eac3117536b7 (diff) | |
download | frameworks_base-a002fb4df44e7bea22c193095aec6516411f65d6.zip frameworks_base-a002fb4df44e7bea22c193095aec6516411f65d6.tar.gz frameworks_base-a002fb4df44e7bea22c193095aec6516411f65d6.tar.bz2 |
Camera2: fix high speed request builder creation issue
The metadata local copy was mutated (swapped) to an empty copy after use,
we need make a copy every time.
Bug: 21442271
Change-Id: I8a71663ba964288bdd1d7f50b42db762d28d89c0
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/hardware/camera2/impl/CameraDeviceImpl.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java index a1ebe6a..20ce7a0 100644 --- a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java +++ b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java @@ -2049,6 +2049,8 @@ public class CameraDeviceImpl extends CameraDevice { // Prepare the Request builders: need carry over the request controls. // First, create a request builder that will only include preview or recording target. CameraMetadataNative requestMetadata = new CameraMetadataNative(request.getNativeCopy()); + // Note that after this step, the requestMetadata is mutated (swapped) and can not be used + // for next request builder creation. CaptureRequest.Builder singleTargetRequestBuilder = new CaptureRequest.Builder( requestMetadata, /*reprocess*/false, CameraCaptureSession.SESSION_ID_NONE); @@ -2069,6 +2071,9 @@ public class CameraDeviceImpl extends CameraDevice { // Second, Create a request builder that will include both preview and recording targets. CaptureRequest.Builder doubleTargetRequestBuilder = null; if (outputSurfaces.size() == 2) { + // Have to create a new copy, the original one was mutated after a new + // CaptureRequest.Builder creation. + requestMetadata = new CameraMetadataNative(request.getNativeCopy()); doubleTargetRequestBuilder = new CaptureRequest.Builder( requestMetadata, /*reprocess*/false, CameraCaptureSession.SESSION_ID_NONE); doubleTargetRequestBuilder.set(CaptureRequest.CONTROL_CAPTURE_INTENT, |