diff --git a/gralloc/QtiGralloc.cpp b/gralloc/QtiGralloc.cpp
index e71e545..e913090 100644
--- a/gralloc/QtiGralloc.cpp
+++ b/gralloc/QtiGralloc.cpp
@@ -30,6 +30,8 @@
 #include "QtiGralloc.h"
 
 #include <log/log.h>
+#include "color_extensions.h"
+
 namespace qtigralloc {
 
 using android::hardware::graphics::mapper::V4_0::IMapper;
@@ -216,6 +218,38 @@
   return Error::NONE;
 }
 
+Error decodeCustomContentMetadata(hidl_vec<uint8_t> &in, void *out) {
+  static size_t target_size = sizeof(CustomContentMetadata);
+
+  if (in.size() != target_size || !out) {
+    return Error::BAD_VALUE;
+  }
+
+  CustomContentMetadata *c_md_in = reinterpret_cast<CustomContentMetadata *>(in.data());
+  CustomContentMetadata *c_md_out = reinterpret_cast<CustomContentMetadata *>(out);
+
+  if (c_md_in->size > CUSTOM_METADATA_SIZE_BYTES) {
+    return Error::BAD_VALUE;
+  }
+
+  c_md_out->size = c_md_in->size;
+  memcpy(c_md_out->metadataPayload, c_md_in->metadataPayload, c_md_in->size);
+  return Error::NONE;
+}
+
+Error encodeCustomContentMetadata(const void *in, hidl_vec<uint8_t> *out) {
+  static size_t target_size = sizeof(CustomContentMetadata);
+
+  if (!in || !out) {
+    return Error::BAD_VALUE;
+  }
+
+  out->resize(target_size);
+
+  memcpy(out->data(), in, target_size);
+  return Error::NONE;
+}
+
 MetadataType getMetadataType(uint32_t in) {
   switch (in) {
     case QTI_VT_TIMESTAMP:
@@ -272,6 +306,8 @@
       return MetadataType_YuvPlaneInfo;
     case QTI_TIMED_RENDERING:
       return MetadataType_TimedRendering;
+    case QTI_CUSTOM_CONTENT_METADATA:
+      return MetadataType_CustomContentMetadata;
     default:
       return MetadataType_Invalid;
   }
@@ -404,6 +440,9 @@
       err = static_cast<Error>(android::gralloc4::decodeUint32(
           qtigralloc::MetadataType_TimedRendering, bytestream, reinterpret_cast<uint32_t *>(param)));
       break;
+    case QTI_CUSTOM_CONTENT_METADATA:
+      err = decodeCustomContentMetadata(bytestream, param);
+      break;
     default:
       param = nullptr;
       return Error::UNSUPPORTED;
@@ -484,6 +523,9 @@
           android::gralloc4::encodeUint32(qtigralloc::MetadataType_TimedRendering,
                                           *reinterpret_cast<uint32_t *>(param), &bytestream));
       break;
+    case QTI_CUSTOM_CONTENT_METADATA:
+      err = encodeCustomContentMetadata(param, &bytestream);
+      break;
     default:
       param = nullptr;
       return Error::UNSUPPORTED;
