QCamera2: Allocate depth buffers dynamically

'depth_data' is always allocated as part of the metadata
buffers. This is wasting memory in all cases where the
depth channel is not part of the configured streams.
To avoid this, allocate depth data buffers dynamically
ony when a depth stream is present in the configuration.

Bug: 38292566
Test: Manual using application,
Complete Camera/Camera2 CTS.
Change-Id: I1fbdb263551fa6fb0222346e0f5bbc3415ae8f2f
diff --git a/msm8998/QCamera2/HAL3/QCamera3HWI.cpp b/msm8998/QCamera2/HAL3/QCamera3HWI.cpp
index cc3a843..46d1c7d 100644
--- a/msm8998/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/msm8998/QCamera2/HAL3/QCamera3HWI.cpp
@@ -2232,6 +2232,7 @@
         pthread_mutex_unlock(&mMutex);
         return rc;
     }
+    mMetadataChannel->enableDepthData(depthPresent);
     rc = mMetadataChannel->initialize(IS_TYPE_NONE);
     if (rc < 0) {
         LOGE("metadata channel initialization failed");