From 1eff55c0639910a06c012e71229889c647c9ca8a Mon Sep 17 00:00:00 2001
From: xianming wang <mingwax@codeaurora.org>
Date: Mon, 2 Apr 2018 17:59:26 +0800
Subject: [PATCH] SnapdragonCamera: Add support ZZHDR configuration of the
 stream

Add support the ZZHDR configuration of the stream.

CRs-Fixed: 2217939
Change-Id: Ia3c0de968644e77adb45b3a2b7dfd0a2af7d7304
---
 src/com/android/camera/CaptureModule.java | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index d075ed10f..1196f3c29 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -214,6 +214,7 @@ public class CaptureModule implements CameraModule, PhotoController,
     private static final int STREAM_CONFIG_MODE_QTIEIS_REALTIME = 0xF004;
     private static final int STREAM_CONFIG_MODE_QTIEIS_LOOKAHEAD = 0xF008;
     private static final int STREAM_CONFIG_MODE_FOVC = 0xF010;
+    private static final int STREAM_CONFIG_MODE_ZZHDR  = 0xF002;
 
     public static final boolean DEBUG =
             (PersistUtil.getCamera2Debug() == PersistUtil.CAMERA2_DEBUG_DUMP_LOG) ||
@@ -3783,11 +3784,19 @@ public class CaptureModule implements CameraModule, PhotoController,
                 }, null);
             } else {
                 surfaces.add(mVideoSnapshotImageReader.getSurface());
-                setOpModeForVideoStream(cameraId);
+                String zzHDR = mSettingsManager.getValue(SettingsManager.KEY_VIDEO_HDR_VALUE);
+                boolean zzHdrStatue = zzHDR.equals("1");
+                // if enable ZZHDR mode, don`t call the setOpModeForVideoStream method.
+                if (!zzHdrStatue) {
+                    setOpModeForVideoStream(cameraId);
+                }
                 String value = mSettingsManager.getValue(SettingsManager.KEY_FOVC_VALUE);
                 if (value != null && Boolean.parseBoolean(value)) {
                     mStreamConfigOptMode = mStreamConfigOptMode | STREAM_CONFIG_MODE_FOVC;
                 }
+                if (zzHdrStatue) {
+                    mStreamConfigOptMode = STREAM_CONFIG_MODE_ZZHDR;
+                }
                 if (DEBUG) {
                     Log.v(TAG, "createCustomCaptureSession mStreamConfigOptMode :"
                             + mStreamConfigOptMode);
-- 
GitLab