QCamera2: Propagate initial NR mode to stream info

For optimization purposes the initial noise reduction mode is
needed as part of the stream information.

Bug: 37320397
Test: Manual using camera application.
Change-Id: Ieaa496cd0000ebab05f9538b952cd2fd8ba6a109
diff --git a/msm8998/QCamera2/HAL3/QCamera3HWI.cpp b/msm8998/QCamera2/HAL3/QCamera3HWI.cpp
index f52814e..f1f325a 100644
--- a/msm8998/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/msm8998/QCamera2/HAL3/QCamera3HWI.cpp
@@ -4824,6 +4824,11 @@
 
         setMobicat();
 
+        uint8_t nrMode = 0;
+        if (meta.exists(ANDROID_NOISE_REDUCTION_MODE)) {
+            nrMode = meta.find(ANDROID_NOISE_REDUCTION_MODE).data.u8[0];
+        }
+
         /* Set fps and hfr mode while sending meta stream info so that sensor
          * can configure appropriate streaming mode */
         mHFRVideoFps = DEFAULT_VIDEO_FPS;
@@ -4937,6 +4942,9 @@
         for (List<stream_info_t *>::iterator it = mStreamInfo.begin();
             it != mStreamInfo.end(); it++) {
             QCamera3Channel *channel = (QCamera3Channel *)(*it)->stream->priv;
+
+            /* Initial value of NR mode is needed before stream on */
+            channel->setNRMode(nrMode);
             if ((((1U << CAM_STREAM_TYPE_VIDEO) == channel->getStreamTypeMask()) ||
                ((1U << CAM_STREAM_TYPE_PREVIEW) == channel->getStreamTypeMask())) &&
                setEis) {