summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorZhijun He <zhijunhe@google.com>2015-06-17 18:00:05 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-17 18:00:17 +0000
commit0f70c415519f0a89f8ba765f9046802a2223f790 (patch)
treecbdac1e44e9f1e41bf2c9122f764a0e378d5844a /core
parent4250c8d6435cca2c14839f7adec0a43773d01e3b (diff)
parenta002fb4df44e7bea22c193095aec6516411f65d6 (diff)
downloadframeworks_base-0f70c415519f0a89f8ba765f9046802a2223f790.zip
frameworks_base-0f70c415519f0a89f8ba765f9046802a2223f790.tar.gz
frameworks_base-0f70c415519f0a89f8ba765f9046802a2223f790.tar.bz2
Merge "Camera2: fix high speed request builder creation issue" into mnc-dev
Diffstat (limited to 'core')
-rw-r--r--core/java/android/hardware/camera2/impl/CameraDeviceImpl.java5
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,