Camera: Fix color space info for camera buffers

Earlier understanding of color space flag for video
buffer was wrong. Video encoder actually assumes the
buffer is in 601 full range, and the flag specifies
which color space the encoder converts to.

As a result, camera HAL needs to set 709 in order
for encoder to do a 601->709 conversion.

Change-Id: Ia694dd83c65d43f87b0ebab8553de4e2a482ffe0
Bug: 17785855
diff --git a/camera/QCamera2/HAL/QCameraMem.cpp b/camera/QCamera2/HAL/QCameraMem.cpp
index 3062e52..1329588 100644
--- a/camera/QCamera2/HAL/QCameraMem.cpp
+++ b/camera/QCamera2/HAL/QCameraMem.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014, The Linux Foundataion. All rights reserved.
+/* Copyright (c) 2012-2015, The Linux Foundataion. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -1270,7 +1270,7 @@
  * RETURN     : none
  *==========================================================================*/
 QCameraGrallocMemory::QCameraGrallocMemory(camera_request_memory getMemory)
-        : QCameraMemory(true)
+        : QCameraMemory(true), mColorSpace(ITU_R_601_FR)
 {
     mMinUndequeuedBuffers = 0;
     mWindow = NULL;
@@ -1526,6 +1526,7 @@
                 goto end;
             }
         }
+        setMetaData(mPrivateHandle[cnt], UPDATE_COLOR_SPACE, &mColorSpace);
         mCameraMemory[cnt] =
             mGetMemory(mPrivateHandle[cnt]->fd,
                     mPrivateHandle[cnt]->size,
diff --git a/camera/QCamera2/HAL/QCameraMem.h b/camera/QCamera2/HAL/QCameraMem.h
index 2eed9a8..244e307 100644
--- a/camera/QCamera2/HAL/QCameraMem.h
+++ b/camera/QCamera2/HAL/QCameraMem.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014, The Linux Foundataion. All rights reserved.
+/* Copyright (c) 2012-2015, The Linux Foundataion. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -33,6 +33,7 @@
 #include <hardware/camera.h>
 #include <utils/Mutex.h>
 #include <utils/List.h>
+#include <qdMetaData.h>
 
 extern "C" {
 #include <sys/types.h>
@@ -229,6 +230,7 @@
     camera_request_memory mGetMemory;
     camera_memory_t *mCameraMemory[MM_CAMERA_MAX_NUM_FRAMES];
     int mMinUndequeuedBuffers;
+    enum ColorSpace_t mColorSpace;
 };
 
 }; // namespace qcamera
diff --git a/camera/QCamera2/HAL3/QCamera3Channel.cpp b/camera/QCamera2/HAL3/QCamera3Channel.cpp
index 7d093ee..8030fcc 100644
--- a/camera/QCamera2/HAL3/QCamera3Channel.cpp
+++ b/camera/QCamera2/HAL3/QCamera3Channel.cpp
@@ -543,13 +543,11 @@
  *              none-zero failure code
  *==========================================================================*/
 
-int32_t QCamera3RawChannel::initialize(cam_is_type_t isType,
-        uint8_t intent)
+int32_t QCamera3RawChannel::initialize(cam_is_type_t isType)
 {
-    return QCamera3RegularChannel::initialize(isType, intent);
+    return QCamera3RegularChannel::initialize(isType);
 }
-int32_t QCamera3RegularChannel::initialize(cam_is_type_t isType,
-        uint8_t intent)
+int32_t QCamera3RegularChannel::initialize(cam_is_type_t isType)
 {
     ATRACE_CALL();
     int32_t rc = NO_ERROR;
@@ -574,8 +572,6 @@
 
     mNumBufs = CAM_MAX_NUM_BUFS_PER_STREAM;
     mIsType  = isType;
-    mIntent = intent;
-    mMemory.setColorSpace(mIntent);
 
     if (mCamera3Stream->format == HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED) {
         if (mStreamType ==  CAM_STREAM_TYPE_VIDEO) {
@@ -662,7 +658,7 @@
     }
 
     if(!m_bIsActive) {
-        rc = registerBuffer(buffer, mIsType, mIntent);
+        rc = registerBuffer(buffer, mIsType);
         if (NO_ERROR != rc) {
             ALOGE("%s: On-the-fly buffer registration failed %d",
                     __func__, rc);
@@ -679,7 +675,7 @@
 
     index = mMemory.getMatchBufIndex((void*)buffer);
     if(index < 0) {
-        rc = registerBuffer(buffer, mIsType, mIntent);
+        rc = registerBuffer(buffer, mIsType);
         if (NO_ERROR != rc) {
             ALOGE("%s: On-the-fly buffer registration failed %d",
                     __func__, rc);
@@ -717,12 +713,12 @@
  *              none-zero failure code
  *==========================================================================*/
 int32_t QCamera3RegularChannel::registerBuffer(buffer_handle_t *buffer,
-        cam_is_type_t isType,
-        uint8_t intent)
+        cam_is_type_t isType)
 {
     ATRACE_CALL();
     int rc = 0;
     mIsType = isType;
+    cam_stream_type_t streamType;
 
     if ((uint32_t)mMemory.getCnt() > (mNumBufs - 1)) {
         ALOGE("%s: Trying to register more buffers than initially requested",
@@ -731,7 +727,7 @@
     }
 
     if (0 == m_numStreams) {
-        rc = initialize(mIsType, intent);
+        rc = initialize(mIsType);
         if (rc != NO_ERROR) {
             ALOGE("%s: Couldn't initialize camera stream %d",
                     __func__, rc);
@@ -739,7 +735,8 @@
         }
     }
 
-    rc = mMemory.registerBuffer(buffer);
+    streamType = mStreams[0]->getMyType();
+    rc = mMemory.registerBuffer(buffer, streamType);
     if (ALREADY_EXISTS == rc) {
         return NO_ERROR;
     } else if (NO_ERROR != rc) {
@@ -850,8 +847,7 @@
     }
 }
 
-int32_t QCamera3MetadataChannel::initialize(cam_is_type_t isType,
-        uint8_t /*intent*/)
+int32_t QCamera3MetadataChannel::initialize(cam_is_type_t isType)
 {
     ATRACE_CALL();
     int32_t rc;
@@ -1291,8 +1287,7 @@
  *              NO_ERROR  -- success
  *              none-zero failure code
  *==========================================================================*/
-int32_t QCamera3RawDumpChannel::initialize(cam_is_type_t isType,
-        uint8_t /*intent*/)
+int32_t QCamera3RawDumpChannel::initialize(cam_is_type_t isType)
 {
     int32_t rc;
 
@@ -1534,8 +1529,7 @@
    }
 }
 
-int32_t QCamera3PicChannel::initialize(cam_is_type_t isType,
-        uint8_t intent)
+int32_t QCamera3PicChannel::initialize(cam_is_type_t isType)
 {
     int32_t rc = NO_ERROR;
     cam_dimension_t streamDim;
@@ -1566,8 +1560,6 @@
         return rc;
     }
     mIsType = isType;
-    mIntent = intent;
-    mMemory.setColorSpace(mIntent);
 
     streamType = mStreamType;
     streamFormat = mStreamFormat;
@@ -1649,7 +1641,7 @@
 
     index = mMemory.getMatchBufIndex((void*)buffer);
     if(index < 0) {
-        rc = registerBuffer(buffer, mIsType, mIntent);
+        rc = registerBuffer(buffer, mIsType);
         if (NO_ERROR != rc) {
             ALOGE("%s: On-the-fly buffer registration failed %d",
                     __func__, rc);
@@ -1704,7 +1696,7 @@
 
         int input_index = mOfflineMemory.getMatchBufIndex((void*)pInputBuffer->buffer);
         if(input_index < 0) {
-            rc = mOfflineMemory.registerBuffer(pInputBuffer->buffer);
+            rc = mOfflineMemory.registerBuffer(pInputBuffer->buffer, mStreamType);
             if (NO_ERROR != rc) {
                 ALOGE("%s: On-the-fly input buffer registration failed %d",
                         __func__, rc);
@@ -1850,12 +1842,10 @@
  *              NO_ERROR  -- success
  *              none-zero failure code
  *==========================================================================*/
-int32_t QCamera3PicChannel::registerBuffer(buffer_handle_t *buffer, cam_is_type_t isType,
-        uint8_t intent)
+int32_t QCamera3PicChannel::registerBuffer(buffer_handle_t *buffer, cam_is_type_t isType)
 {
     int rc = 0;
     mIsType = isType;
-    mIntent = intent;
     if ((uint32_t)mMemory.getCnt() > (mNumBufsRegistered - 1)) {
         ALOGE("%s: Trying to register more buffers than initially requested",
                 __func__);
@@ -1863,14 +1853,15 @@
     }
 
     if (0 == m_numStreams) {
-        rc = initialize(mIsType, intent);
+        rc = initialize(mIsType);
         if (rc != NO_ERROR) {
             ALOGE("%s: Couldn't initialize camera stream %d",
                     __func__, rc);
             return rc;
         }
     }
-    rc = mMemory.registerBuffer(buffer);
+
+    rc = mMemory.registerBuffer(buffer, mStreamType);
     if (ALREADY_EXISTS == rc) {
         return NO_ERROR;
     } else if (NO_ERROR != rc) {
@@ -2651,8 +2642,7 @@
  *
  * RETURN     : none
  *==========================================================================*/
-int32_t QCamera3ReprocessChannel::initialize(cam_is_type_t isType,
-        uint8_t /*intent*/)
+int32_t QCamera3ReprocessChannel::initialize(cam_is_type_t isType)
 {
     int32_t rc = NO_ERROR;
     mm_camera_channel_attr_t attr;
@@ -3334,8 +3324,7 @@
     }
 }
 
-int32_t QCamera3SupportChannel::initialize(cam_is_type_t isType,
-        uint8_t /*intent*/)
+int32_t QCamera3SupportChannel::initialize(cam_is_type_t isType)
 {
     int32_t rc;
 
diff --git a/camera/QCamera2/HAL3/QCamera3Channel.h b/camera/QCamera2/HAL3/QCamera3Channel.h
index f67216e..e6158b5 100644
--- a/camera/QCamera2/HAL3/QCamera3Channel.h
+++ b/camera/QCamera2/HAL3/QCamera3Channel.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2013, The Linux Foundataion. All rights reserved.
+/* Copyright (c) 2012-2015, The Linux Foundataion. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -74,8 +74,7 @@
 
     uint32_t getStreamTypeMask();
     uint32_t getStreamID(uint32_t streamMask);
-    virtual int32_t initialize(cam_is_type_t isType,
-            uint8_t intent) = 0;
+    virtual int32_t initialize(cam_is_type_t isType) = 0;
     virtual int32_t request(buffer_handle_t * /*buffer*/,
                 uint32_t /*frameNumber*/){ return 0;};
     virtual int32_t request(buffer_handle_t * /*buffer*/,
@@ -85,8 +84,7 @@
     virtual void streamCbRoutine(mm_camera_super_buf_t *super_frame,
                             QCamera3Stream *stream) = 0;
 
-    virtual int32_t registerBuffer(buffer_handle_t *buffer, cam_is_type_t isType,
-            uint8_t intent) = 0;
+    virtual int32_t registerBuffer(buffer_handle_t *buffer, cam_is_type_t isType) = 0;
     virtual QCamera3Memory *getStreamBufs(uint32_t len) = 0;
     virtual void putStreamBufs() = 0;
 
@@ -147,16 +145,14 @@
     virtual ~QCamera3RegularChannel();
 
     virtual int32_t start();
-    virtual int32_t initialize(cam_is_type_t isType,
-            uint8_t intent);
+    virtual int32_t initialize(cam_is_type_t isType);
     virtual int32_t request(buffer_handle_t *buffer, uint32_t frameNumber);
     virtual void streamCbRoutine(mm_camera_super_buf_t *super_frame,
                                             QCamera3Stream *stream);
 
     virtual QCamera3Memory *getStreamBufs(uint32_t le);
     virtual void putStreamBufs();
-    virtual int32_t registerBuffer(buffer_handle_t *buffer, cam_is_type_t isType,
-            uint8_t intent);
+    virtual int32_t registerBuffer(buffer_handle_t *buffer, cam_is_type_t isType);
 
 public:
     static int kMaxBuffers;
@@ -183,8 +179,7 @@
                     void *userData);
     virtual ~QCamera3MetadataChannel();
 
-    virtual int32_t initialize(cam_is_type_t isType,
-            uint8_t intent);
+    virtual int32_t initialize(cam_is_type_t isType);
 
     virtual int32_t request(buffer_handle_t *buffer, uint32_t frameNumber);
     virtual void streamCbRoutine(mm_camera_super_buf_t *super_frame,
@@ -192,8 +187,7 @@
 
     virtual QCamera3Memory *getStreamBufs(uint32_t le);
     virtual void putStreamBufs();
-    virtual int32_t registerBuffer(buffer_handle_t * /*buffer*/, cam_is_type_t /*isType*/,
-            uint8_t /*intent*/)
+    virtual int32_t registerBuffer(buffer_handle_t * /*buffer*/, cam_is_type_t /*isType*/)
             { return NO_ERROR; };
 
 private:
@@ -215,8 +209,7 @@
                     bool raw_16 = false);
     virtual ~QCamera3RawChannel();
 
-    virtual int32_t initialize(cam_is_type_t isType,
-            uint8_t intent);
+    virtual int32_t initialize(cam_is_type_t isType);
 
     virtual void streamCbRoutine(mm_camera_super_buf_t *super_frame,
                             QCamera3Stream *stream);
@@ -247,13 +240,12 @@
                     void *userData,
                     uint32_t postprocess_mask);
     virtual ~QCamera3RawDumpChannel();
-    virtual int32_t initialize(cam_is_type_t isType, uint8_t intent);
+    virtual int32_t initialize(cam_is_type_t isType);
     virtual void streamCbRoutine(mm_camera_super_buf_t *super_frame,
                             QCamera3Stream *stream);
     virtual QCamera3Memory *getStreamBufs(uint32_t le);
     virtual void putStreamBufs();
-    virtual int32_t registerBuffer(buffer_handle_t * /*buffer*/, cam_is_type_t /*isType*/,
-            uint8_t /*intent*/)
+    virtual int32_t registerBuffer(buffer_handle_t * /*buffer*/, cam_is_type_t /*isType*/)
             { return NO_ERROR; };
     virtual int32_t request(buffer_handle_t *buffer, uint32_t frameNumber);
     void dumpRawSnapshot(mm_camera_buf_def_t *frame);
@@ -283,8 +275,7 @@
             QCamera3Channel *metadataChannel);
     ~QCamera3PicChannel();
 
-    virtual int32_t initialize(cam_is_type_t isType,
-            uint8_t intent);
+    virtual int32_t initialize(cam_is_type_t isType);
     virtual int32_t stop();
     virtual int32_t request(buffer_handle_t *buffer,
             uint32_t frameNumber,
@@ -309,8 +300,7 @@
             void *userdata);
     static void dataNotifyCB(mm_camera_super_buf_t *recvd_frame,
             void *userdata);
-    virtual int32_t registerBuffer(buffer_handle_t *buffer, cam_is_type_t isType,
-            uint8_t intent);
+    virtual int32_t registerBuffer(buffer_handle_t *buffer, cam_is_type_t isType);
     int32_t queueReprocMetadata(mm_camera_super_buf_t *metadata);
 
 private:
@@ -369,8 +359,7 @@
     int32_t extractCrop(qcamera_fwk_input_pp_data_t *frame);
     virtual QCamera3Memory *getStreamBufs(uint32_t len);
     virtual void putStreamBufs();
-    virtual int32_t initialize(cam_is_type_t isType,
-            uint8_t intent);
+    virtual int32_t initialize(cam_is_type_t isType);
     int32_t unmapOfflineBuffers(bool all);
     virtual int32_t stop();
     virtual void streamCbRoutine(mm_camera_super_buf_t *super_frame,
@@ -383,8 +372,7 @@
            QCamera3Channel *pMetaChannel);
     QCamera3Stream *getStreamBySrcHandle(uint32_t srcHandle);
     QCamera3Stream *getSrcStreamBySrcHandle(uint32_t srcHandle);
-    virtual int32_t registerBuffer(buffer_handle_t * /*buffer*/, cam_is_type_t /*isType*/,
-            uint8_t /*intent*/)
+    virtual int32_t registerBuffer(buffer_handle_t * /*buffer*/, cam_is_type_t /*isType*/)
             { return NO_ERROR; };
 
 public:
@@ -417,8 +405,7 @@
                     void *userData);
     virtual ~QCamera3SupportChannel();
 
-    virtual int32_t initialize(cam_is_type_t isType,
-            uint8_t intent);
+    virtual int32_t initialize(cam_is_type_t isType);
 
     virtual int32_t request(buffer_handle_t *buffer, uint32_t frameNumber);
     virtual void streamCbRoutine(mm_camera_super_buf_t *super_frame,
@@ -426,8 +413,7 @@
 
     virtual QCamera3Memory *getStreamBufs(uint32_t le);
     virtual void putStreamBufs();
-    virtual int32_t registerBuffer(buffer_handle_t * /*buffer*/, cam_is_type_t /*isType*/,
-            uint8_t /*intent*/)
+    virtual int32_t registerBuffer(buffer_handle_t * /*buffer*/, cam_is_type_t /*isType*/)
             { return NO_ERROR; };
 
     static cam_dimension_t kDim;
diff --git a/camera/QCamera2/HAL3/QCamera3HWI.cpp b/camera/QCamera2/HAL3/QCamera3HWI.cpp
index f690b8d..7b567fd 100644
--- a/camera/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/camera/QCamera2/HAL3/QCamera3HWI.cpp
@@ -1040,7 +1040,7 @@
         pthread_mutex_unlock(&mMutex);
         return rc;
     }
-    rc = mMetadataChannel->initialize(IS_TYPE_NONE, mCaptureIntent);
+    rc = mMetadataChannel->initialize(IS_TYPE_NONE);
     if (rc < 0) {
         ALOGE("%s: metadata channel initialization failed", __func__);
         delete mMetadataChannel;
@@ -2122,11 +2122,9 @@
             QCamera3Channel *channel = (QCamera3Channel *)output.stream->priv;
             /*for livesnapshot stream is_type will be DIS*/
             if (setEis && output.stream->format == HAL_PIXEL_FORMAT_BLOB) {
-                rc = channel->registerBuffer(output.buffer,
-                        IS_TYPE_DIS, mCaptureIntent);
+                rc = channel->registerBuffer(output.buffer, IS_TYPE_DIS);
             } else {
-                rc = channel->registerBuffer(output.buffer,
-                        is_type, mCaptureIntent);
+                rc = channel->registerBuffer(output.buffer, is_type);
             }
             if (rc < 0) {
                 ALOGE("%s: registerBuffer failed",
@@ -2146,9 +2144,9 @@
             it != mStreamInfo.end(); it++) {
             QCamera3Channel *channel = (QCamera3Channel *)(*it)->stream->priv;
             if (setEis && (*it)->stream->format == HAL_PIXEL_FORMAT_BLOB) {
-                rc = channel->initialize(IS_TYPE_DIS, mCaptureIntent);
+                rc = channel->initialize(IS_TYPE_DIS);
             } else {
-                rc = channel->initialize(is_type, mCaptureIntent);
+                rc = channel->initialize(is_type);
             }
             if (NO_ERROR != rc) {
                 ALOGE("%s : Channel initialization failed %d", __func__, rc);
@@ -2158,7 +2156,7 @@
         }
 
         if (mRawDumpChannel) {
-            rc = mRawDumpChannel->initialize(is_type, mCaptureIntent);
+            rc = mRawDumpChannel->initialize(is_type);
             if (rc != NO_ERROR) {
                 ALOGE("%s: Error: Raw Dump Channel init failed", __func__);
                 pthread_mutex_unlock(&mMutex);
@@ -2166,7 +2164,7 @@
             }
         }
         if (mSupportChannel) {
-            rc = mSupportChannel->initialize(is_type, mCaptureIntent);
+            rc = mSupportChannel->initialize(is_type);
             if (rc < 0) {
                 ALOGE("%s: Support channel initialization failed", __func__);
                 pthread_mutex_unlock(&mMutex);
@@ -6989,7 +6987,7 @@
         return NULL;
     }
 
-    rc = pChannel->initialize(IS_TYPE_NONE, mCaptureIntent);
+    rc = pChannel->initialize(IS_TYPE_NONE);
     if (rc != NO_ERROR) {
         ALOGE("%s: init reprocess channel failed, ret = %d", __func__, rc);
         delete pChannel;
diff --git a/camera/QCamera2/HAL3/QCamera3Mem.cpp b/camera/QCamera2/HAL3/QCamera3Mem.cpp
index d4416ef..c55d1b5 100644
--- a/camera/QCamera2/HAL3/QCamera3Mem.cpp
+++ b/camera/QCamera2/HAL3/QCamera3Mem.cpp
@@ -35,6 +35,7 @@
 #include <utils/Log.h>
 #include <utils/Errors.h>
 #include <gralloc_priv.h>
+#include <qdMetaData.h>
 #include "QCamera3Mem.h"
 #include "QCamera3HWI.h"
 
@@ -608,8 +609,7 @@
  * RETURN     : none
  *==========================================================================*/
 QCamera3GrallocMemory::QCamera3GrallocMemory()
-        : QCamera3Memory(),
-          mColorSpace(ITU_R_601)
+        : QCamera3Memory()
 {
     for (int i = 0; i < MM_CAMERA_MAX_NUM_FRAMES; i ++) {
         mBufferHandle[i] = NULL;
@@ -638,19 +638,23 @@
  *
  * PARAMETERS :
  *   @buffers : buffer_handle_t pointer
+ *   @type :    cam_stream_type_t
  *
  * RETURN     : int32_t type of status
  *              NO_ERROR  -- success
  *              none-zero failure code
  *==========================================================================*/
-int QCamera3GrallocMemory::registerBuffer(buffer_handle_t *buffer)
+int QCamera3GrallocMemory::registerBuffer(buffer_handle_t *buffer,
+        cam_stream_type_t type)
 {
     status_t ret = NO_ERROR;
     struct ion_fd_data ion_info_fd;
     void *vaddr = NULL;
-
+    
     int32_t idx = -1;
 
+    int32_t colorSpace =
+            (type == CAM_STREAM_TYPE_VIDEO) ? ITU_R_709 : ITU_R_601_FR;
     CDBG(" %s : E ", __FUNCTION__);
 
     memset(&ion_info_fd, 0, sizeof(ion_info_fd));
@@ -676,7 +680,7 @@
     mBufferHandle[idx] = buffer;
     mPrivateHandle[idx] = (struct private_handle_t *)(*mBufferHandle[idx]);
 
-    setMetaData(mPrivateHandle[idx], UPDATE_COLOR_SPACE, &mColorSpace);
+    setMetaData(mPrivateHandle[idx], UPDATE_COLOR_SPACE, &colorSpace);
 
     mMemInfo[idx].main_ion_fd = open("/dev/ion", O_RDONLY);
     if (mMemInfo[idx].main_ion_fd < 0) {
@@ -1059,35 +1063,4 @@
     return mBufferHandle[index];
 }
 
-/*===========================================================================
- * FUNCTION   : setColorSpace
- *
- * DESCRIPTION: Set color space based on capture intent
- *
- * PARAMETERS :
- *   @intent   : capture intent
- *
- * RETURN     : int32_t type of status
- *              NO_ERROR -- successs
- *              non-zero failure ccde
- *==========================================================================*/
-int32_t QCamera3GrallocMemory::setColorSpace(uint8_t intent)
-{
-    int32_t rc = NO_ERROR;
-
-    switch (intent) {
-    case ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_RECORD:
-    case ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT:
-        mColorSpace = ITU_R_709;
-        break;
-    default:
-        mColorSpace = ITU_R_601;
-        break;
-    }
-    ALOGI("%s: setting colorSpace to %d for capture intent %d",
-            __func__, mColorSpace, intent);
-
-    return rc;
-}
-
 }; //namespace qcamera
diff --git a/camera/QCamera2/HAL3/QCamera3Mem.h b/camera/QCamera2/HAL3/QCamera3Mem.h
index 08dfcb2..bfe08e7 100644
--- a/camera/QCamera2/HAL3/QCamera3Mem.h
+++ b/camera/QCamera2/HAL3/QCamera3Mem.h
@@ -31,7 +31,6 @@
 #define __QCAMERA3HWI_MEM_H__
 #include <hardware/camera3.h>
 #include <utils/Mutex.h>
-#include <qdMetaData.h>
 
 extern "C" {
 #include <sys/types.h>
@@ -114,7 +113,7 @@
     QCamera3GrallocMemory();
     virtual ~QCamera3GrallocMemory();
 
-    int registerBuffer(buffer_handle_t *buffer);
+    int registerBuffer(buffer_handle_t *buffer, cam_stream_type_t type);
     int32_t unregisterBuffer(size_t idx);
     void unregisterBuffers();
     virtual int cacheOps(int index, unsigned int cmd);
@@ -124,7 +123,6 @@
     int32_t markFrameNumber(int index, uint32_t frameNumber);
     int32_t getFrameNumber(int index);
     void *getBufferHandle(int index);
-    int32_t setColorSpace(uint8_t intent);
 protected:
     virtual void *getPtrLocked(int index);
 private:
@@ -133,7 +131,6 @@
     buffer_handle_t *mBufferHandle[MM_CAMERA_MAX_NUM_FRAMES];
     struct private_handle_t *mPrivateHandle[MM_CAMERA_MAX_NUM_FRAMES];
     uint32_t mCurrentFrameNumbers[MM_CAMERA_MAX_NUM_FRAMES];
-    enum ColorSpace_t mColorSpace;
 };
 
 };