diff options
author | Pengchong Jin <pengchong@google.com> | 2015-05-20 19:19:00 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-05-20 19:19:00 +0000 |
commit | 5d410fb5ff31c08531a0d3bde153d5bf5146b96b (patch) | |
tree | 23af59ad8e3445bd0e97685c2bd694b9b8f4255b | |
parent | 077cfbd4161ac1866a820529bb7d7802ed3a67ef (diff) | |
parent | b1f23f9b60e28c814828e3a87652ef5580c647f4 (diff) | |
download | android_packages_apps_Camera2-5d410fb5ff31c08531a0d3bde153d5bf5146b96b.tar.gz android_packages_apps_Camera2-5d410fb5ff31c08531a0d3bde153d5bf5146b96b.tar.bz2 android_packages_apps_Camera2-5d410fb5ff31c08531a0d3bde153d5bf5146b96b.zip |
am b1f23f9b: am 10aea802: Merge "Workaround of the face detection failure on L and N5" into ub-camera-haleakala
* commit 'b1f23f9b60e28c814828e3a87652ef5580c647f4':
Workaround of the face detection failure on L and N5
-rw-r--r-- | src/com/android/camera/one/v2/initialization/PreviewStarter.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/com/android/camera/one/v2/initialization/PreviewStarter.java b/src/com/android/camera/one/v2/initialization/PreviewStarter.java index bba0f54b2..99c34a348 100644 --- a/src/com/android/camera/one/v2/initialization/PreviewStarter.java +++ b/src/com/android/camera/one/v2/initialization/PreviewStarter.java @@ -20,6 +20,7 @@ import android.view.Surface; import com.android.camera.one.OneCamera; import com.android.camera.one.v2.camera2proxy.CameraCaptureSessionProxy; +import com.android.camera.util.ApiHelper; import com.google.common.util.concurrent.AsyncFunction; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; @@ -63,8 +64,20 @@ class PreviewStarter { */ public ListenableFuture<Void> startPreview(final Surface surface) { // When we have the preview surface, start the capture session. - List<Surface> surfaceList = new ArrayList<Surface>(mOutputSurfaces); - surfaceList.add(surface); + List<Surface> surfaceList = new ArrayList<>(); + + // Workaround of the face detection failure on Nexus 5 and L. (b/21039466) + // Need to create a capture session with the single preview stream first + // to lock it as the first stream. Then resend the another session with preview + // and JPEG stream. + if (ApiHelper.isLorLMr1() && ApiHelper.IS_NEXUS_5) { + surfaceList.add(surface); + mCaptureSessionCreator.createCaptureSession(surfaceList); + surfaceList.addAll(mOutputSurfaces); + } else { + surfaceList.addAll(mOutputSurfaces); + surfaceList.add(surface); + } final ListenableFuture<CameraCaptureSessionProxy> sessionFuture = mCaptureSessionCreator.createCaptureSession(surfaceList); |