Merge remote-tracking branch 'goog/qcom/release/LA.UM.7.8.9.C2.08.00.00.618.012' into rvc-dev

 Conflicts:
	mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp

Bug: 149539244
Change-Id: I1f76b1a162e331bad8e6af6b259aca271a212460
diff --git a/Android.mk b/Android.mk
index 1d1920f..f716b2a 100644
--- a/Android.mk
+++ b/Android.mk
@@ -2,12 +2,16 @@
 
 #Compile these for all targets under QCOM_BOARD_PLATFORMS list.
 ifeq ($(call is-board-platform-in-list, $(QCOM_BOARD_PLATFORMS)),true)
+ifneq ($(BUILD_WITHOUT_VENDOR),true)
 include $(QCOM_MEDIA_ROOT)/libstagefrighthw/Android.mk
 include $(QCOM_MEDIA_ROOT)/mm-core/Android.mk
 endif
+endif
 
 ifeq ($(call is-board-platform-in-list, $(MSM_VIDC_TARGET_LIST)),true)
+ifneq ($(BUILD_WITHOUT_VENDOR),true)
 include $(QCOM_MEDIA_ROOT)/libplatformconfig/Android.mk
 include $(QCOM_MEDIA_ROOT)/mm-video-v4l2/Android.mk
 include $(QCOM_MEDIA_ROOT)/libc2dcolorconvert/Android.mk
 endif
+endif
diff --git a/conf_files/config.mk b/conf_files/config.mk
index 681e036..9355356 100644
--- a/conf_files/config.mk
+++ b/conf_files/config.mk
@@ -1,5 +1,5 @@
 ifeq ($(TARGET_BOARD_PLATFORM),msm8937)
-PRODUCT_COPY_FILES += hardware/qcom/media/conf_files/msm8937/media_profiles_8937.xml:system/etc/media_profiles.xml \
-                      hardware/qcom/media/conf_files/msm8937/media_codecs_8937.xml:system/etc/media_codecs.xml \
-                      hardware/qcom/media/conf_files/msm8937/media_codecs_performance_8937.xml:system/etc/media_codecs_performance.xml
+PRODUCT_COPY_FILES += hardware/qcom/sdm845/media/conf_files/msm8937/media_profiles_8937.xml:system/etc/media_profiles.xml \
+                      hardware/qcom/sdm845/media/conf_files/msm8937/media_codecs_8937.xml:system/etc/media_codecs.xml \
+                      hardware/qcom/sdm845/media/conf_files/msm8937/media_codecs_performance_8937.xml:system/etc/media_codecs_performance.xml
 endif #TARGET_BOARD_PLATFORM
diff --git a/libc2dcolorconvert/Android.mk b/libc2dcolorconvert/Android.mk
old mode 100644
new mode 100755
index f0dd3fa..4cda9c8
--- a/libc2dcolorconvert/Android.mk
+++ b/libc2dcolorconvert/Android.mk
@@ -15,6 +15,7 @@
         libhardware_headers
 
 LOCAL_SHARED_LIBRARIES := liblog libdl
+LOCAL_HEADER_LIBRARIES := libhardware_headers
 
 LOCAL_MODULE_TAGS := optional
 
diff --git a/libc2dcolorconvert/C2DColorConverter.cpp b/libc2dcolorconvert/C2DColorConverter.cpp
index 258af91..2102d06 100644
--- a/libc2dcolorconvert/C2DColorConverter.cpp
+++ b/libc2dcolorconvert/C2DColorConverter.cpp
@@ -28,6 +28,7 @@
  */
 
 #include <C2DColorConverter.h>
+#include <pthread.h> // pthread_mutex_*
 
 C2DColorConverter::C2DColorConverter()
     : mC2DLibHandle(NULL),
diff --git a/libc2dcolorconvert/C2DColorConverter.h b/libc2dcolorconvert/C2DColorConverter.h
index 23192d2..9eb94ed 100755
--- a/libc2dcolorconvert/C2DColorConverter.h
+++ b/libc2dcolorconvert/C2DColorConverter.h
@@ -35,7 +35,7 @@
 #include <pthread.h>
 #include <linux/msm_kgsl.h>
 #include <sys/ioctl.h>
-#include <utils/Log.h>
+#include <log/log.h>
 #include <dlfcn.h>
 #include <string.h>
 #include <errno.h>
diff --git a/libplatformconfig/Android.mk b/libplatformconfig/Android.mk
index 9fe15be..97c89f6 100644
--- a/libplatformconfig/Android.mk
+++ b/libplatformconfig/Android.mk
@@ -25,8 +25,6 @@
             libcutils \
             libutils
 
-LOCAL_STATIC_LIBRARIES := libOmxVidcCommon
-
 LOCAL_C_INCLUDES += \
             external/expat/lib \
             $(LOCAL_PATH)/../mm-core/inc \
diff --git a/libstagefrighthw/Android.mk b/libstagefrighthw/Android.mk
old mode 100644
new mode 100755
index 89f17d7..4179415
--- a/libstagefrighthw/Android.mk
+++ b/libstagefrighthw/Android.mk
@@ -50,6 +50,9 @@
         libcutils               \
         libdl                   \
 
+LOCAL_HEADER_LIBRARIES :=       \
+        media_plugin_headers
+
 LOCAL_MODULE := libstagefrighthw
 
 LOCAL_VENDOR_MODULE := true
diff --git a/libstagefrighthw/QComOMXMetadata.h b/libstagefrighthw/QComOMXMetadata.h
index f1d2688..50fae08 100644
--- a/libstagefrighthw/QComOMXMetadata.h
+++ b/libstagefrighthw/QComOMXMetadata.h
@@ -18,7 +18,7 @@
 #ifndef QCOM_OMX_METADATA_H_
 #define QCOM_OMX_METADATA_H_
 
-#include "cutils/native_handle.h"
+#include <cutils/native_handle.h>
 #include <media/hardware/MetadataBufferType.h>
 
 namespace android {
diff --git a/mm-core/Android.mk b/mm-core/Android.mk
old mode 100644
new mode 100755
index 6a9c691..c9cb62a
--- a/mm-core/Android.mk
+++ b/mm-core/Android.mk
@@ -7,6 +7,7 @@
 OMXCORE_CFLAGS += -O0 -fno-inline -fno-short-enums
 OMXCORE_CFLAGS += -D_ANDROID_
 OMXCORE_CFLAGS += -U_ENABLE_QC_MSG_LOG_
+OMXCORE_CFLAGS += -Wno-error
 
 #===============================================================================
 #             Figure out the targets
diff --git a/mm-core/inc/qc_omx_msg.h b/mm-core/inc/qc_omx_msg.h
index e0c8592..a644c25 100644
--- a/mm-core/inc/qc_omx_msg.h
+++ b/mm-core/inc/qc_omx_msg.h
@@ -39,7 +39,7 @@
 
 #ifdef _ENABLE_QC_MSG_LOG_
     #ifdef _ANDROID_
-        #include <utils/Log.h>
+        #include <log/log.h>
 
         #ifdef __cplusplus
         extern "C" {
@@ -79,7 +79,7 @@
     #endif // _ANDROID_
 #else
     #ifdef _ANDROID_
-        #include <utils/Log.h>
+        #include <log/log.h>
         #define DEBUG_PRINT_ERROR ALOGV
         #define DEBUG_PRINT ALOGV
         #define DEBUG_DETAIL ALOGV
diff --git a/mm-core/src/sdm710/registry_table_android.c b/mm-core/src/sdm710/registry_table_android.c
index 9155c19..a2512b3 100644
--- a/mm-core/src/sdm710/registry_table_android.c
+++ b/mm-core/src/sdm710/registry_table_android.c
@@ -72,54 +72,6 @@
     }
   },
   {
-    "OMX.qcom.video.decoder.mpeg2",
-    NULL, // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxVdec.so",
-    {
-      "video_decoder.mpeg2"
-    }
-  },
-  {
-    "OMX.qcom.video.decoder.mpeg2.secure",
-    NULL, // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxVdec.so",
-    {
-      "video_decoder.mpeg2"
-    }
-  },
-  {
-    "OMX.qti.video.decoder.vc1sw",
-    NULL, // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxSwVdec.so",
-    {
-      "video_decoder.vc1"
-    }
-  },
-  {
     "OMX.qcom.video.decoder.hevc",
     NULL,   // Create instance function
     // Unique instance handle
@@ -200,90 +152,6 @@
     }
   },
   {
-    "OMX.qti.video.decoder.mpeg4sw",
-    NULL,   // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxSwVdec.so",
-    {
-      "video_decoder.mpeg4"
-    }
-  },
-  {
-    "OMX.qti.video.decoder.divxsw",
-    NULL,   // Create instance function
-    // Unique instance handle
-    {
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxSwVdec.so",
-    {
-      "video_decoder.divx"
-    }
-  },
-  {
-    "OMX.qti.video.decoder.divx4sw",
-    NULL,   // Create instance function
-    // Unique instance handle
-    {
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxSwVdec.so",
-    {
-      "video_decoder.divx"
-    }
-  },
-  {
-    "OMX.qti.video.decoder.h263sw",
-    NULL, // Create instance function
-    // Unique instance handle
-    {
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxSwVdec.so",
-    {
-      "video_decoder.h263"
-    }
-  },
-   {
-    "OMX.qcom.video.encoder.mpeg4sw",
-    NULL,   // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxSwVencMpeg4.so",
-    {
-      "video_encoder.mpeg4"
-    }
-  },
-  {
-    "OMX.qcom.video.encoder.h263sw",
-    NULL, // Create instance function
-    // Unique instance handle
-    {
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxSwVencMpeg4.so",
-    {
-      "video_encoder.h263"
-    }
-  },
-  {
     "OMX.qcom.video.encoder.avc",
     NULL, // Create instance function
     // Unique instance handle
@@ -300,22 +168,6 @@
     }
   },
   {
-    "OMX.qcom.video.encoder.avc.secure",
-    NULL, // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxVenc.so",
-    {
-      "video_encoder.avc"
-    }
-  },
-  {
     "OMX.qcom.video.encoder.vp8",
     NULL, // Create instance function
     // Unique instance handle
@@ -347,388 +199,6 @@
       "video_encoder.hevc"
     }
   },
-  {
-    "OMX.qcom.audio.decoder.Qcelp13",
-    NULL, // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxQcelp13Dec.so",
-    {
-      "audio_decoder.Qcelp13"
-    }
-  },
-  {
-    "OMX.qcom.audio.decoder.evrc",
-    NULL, // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxEvrcDec.so",
-    {
-      "audio_decoder.evrc"
-    }
-  },
-  {
-    "OMX.qcom.audio.decoder.wma",
-    NULL, // Create instance function
-    // Unique instance handle
-    {
-     NULL,
-     NULL,
-     NULL,
-     NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxWmaDec.so",
-    {
-     "audio_decoder.wma"
-    }
-  },
-  {
-    "OMX.qcom.audio.decoder.wma10Pro",
-    NULL,   // Create instance function
-    // Unique instance handle
-    {
-     NULL,
-     NULL,
-     NULL,
-     NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxWmaDec.so",
-    {
-     "audio_decoder.wma"
-    }
-  },
-  {
-    "OMX.qcom.audio.decoder.wmaLossLess",
-    NULL,   // Create instance function
-    // Unique instance handle
-    {
-     NULL,
-     NULL,
-     NULL,
-     NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxWmaDec.so",
-    {
-     "audio_decoder.wma"
-    }
-  },
-  {
-    "OMX.qcom.audio.decoder.amrwbplus",
-    NULL,   // Create instance function
-    // Unique instance handle
-    {
-     NULL,
-     NULL,
-     NULL,
-     NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxAmrwbplusDec.so",
-    {
-     "audio_decoder.awbplus"
-    }
-  },
-  {
-    "OMX.qcom.audio.decoder.alac",
-    NULL,   // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxAlacDec.so",
-    {
-      "audio_decoder.alac"
-    }
-  },
-  {
-    "OMX.qti.audio.decoder.alac.sw",
-    NULL,   // Create instance function
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxAlacDecSw.so",
-    {
-      "audio_decoder.alac"
-    }
-  },
-  {
-    "OMX.qcom.audio.decoder.ape",
-    NULL,   // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxApeDec.so",
-    {
-      "audio_decoder.ape"
-    }
-  },
-  {
-    "OMX.qti.audio.decoder.ape.sw",
-    NULL,   // Create instance function
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxApeDecSw.so",
-    {
-      "audio_decoder.ape"
-    }
-  },
-  {
-    "OMX.qti.audio.decoder.dsd",
-    NULL,   // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxDsdDec.so",
-    {
-      "audio_decoder.dsd"
-    }
-  },
-  {
-    "OMX.qcom.audio.encoder.aac",
-    NULL, // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,  // Shared object library handle
-    "libOmxAacEnc.so",
-    {
-      "audio_encoder.aac"
-    }
-  },
-  {
-    "OMX.qcom.audio.encoder.qcelp13",
-    NULL,   // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxQcelp13Enc.so",
-    {
-      "audio_encoder.qcelp13"
-    }
-  },
-  {
-    "OMX.qcom.audio.encoder.evrc",
-    NULL,   // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxEvrcEnc.so",
-    {
-      "audio_encoder.evrc"
-    }
-  },
-  {
-    "OMX.qcom.audio.encoder.amrnb",
-    NULL,   // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxAmrEnc.so",
-    {
-      "audio_encoder.amrnb"
-    }
-  },
- {
-    "OMX.qcom.audio.decoder.aac",
-    NULL,   // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxAacDec.so",
-    {
-      "audio_decoder.aac"
-    }
-  },
- {
-    "OMX.qcom.audio.decoder.multiaac",
-    NULL,   // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxAacDec.so",
-    {
-      "audio_decoder.aac"
-    }
-  },
-  {
-    "AIV.play.generic",
-    NULL, // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,  // Shared object library handle
-    "libAivPlay.so",
-    {
-      "AIV.play.role.generic"
-    }
-  },
-  {
-    "OMX.QCOM.CUST.COMP.START",
-    NULL, //Create instance function
-    //Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,
-    NULL,   // Shared object library handle
-    {
-      NULL
-    }
-  },
-  {
-    "OMX.qcom.file.muxer",
-    NULL, // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxMux.so",
-    {
-      "container_muxer.mp2"
-    }
-  },
-  {
-    "OMX.qcom.video.decoder.avc.secure.dsmode",
-    NULL, // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxVideoDSMode.so",
-    {
-      "video_decoder.avc"
-    }
-  },
-  {
-    "OMX.qcom.video.decoder.avc.dsmode",
-    NULL, // Create instance function
-         // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxVideoDSMode.so",
-    {
-      "video_decoder.avc"
-    }
-  },
-  {
-    "OMX.qcom.video.encoder.hevc.secure",
-    NULL,   // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxVenc.so",
-    {
-      "video_encoder.hevc"
-    }
-  },
-  {
-    "OMX.qti.vdec.vpp",
-    NULL, // Create instance function
-    // Unique instance handle
-    {
-      NULL,
-      NULL,
-      NULL,
-      NULL
-    },
-    NULL,   // Shared object library handle
-    "libOmxVpp.so",
-    {
-      "video_decoder.vpp"
-    }
-  }
 };
 
 const unsigned int SIZE_OF_CORE = sizeof(core) / sizeof(omx_core_cb_type);
diff --git a/mm-video-v4l2/vidc/common/Android.mk b/mm-video-v4l2/vidc/common/Android.mk
index 5e85a12..c70d04e 100644
--- a/mm-video-v4l2/vidc/common/Android.mk
+++ b/mm-video-v4l2/vidc/common/Android.mk
@@ -21,19 +21,20 @@
 # ---------------------------------------------------------------------------------
 
 libmm-vidc-inc      := $(LOCAL_PATH)/inc
-libmm-vidc-inc      += $(TOP)/hardware/qcom/media/mm-core/inc
+libmm-vidc-inc      += $(QCOM_MEDIA_ROOT)/mm-core/inc
 libmm-vidc-inc      += $(TARGET_OUT_HEADERS)/qcom/display
-libmm-vidc-inc      += $(TOP)/hardware/qcom/media/libc2dcolorconvert
+libmm-vidc-inc      += $(QCOM_MEDIA_ROOT)/libc2dcolorconvert
 libmm-vidc-inc      += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
 
 LOCAL_MODULE                    := libOmxVidcCommon
 LOCAL_MODULE_TAGS               := optional
-LOCAL_VENDOR_MODULE             := true
+LOCAL_PROPRIETARY_MODULE        := true
 LOCAL_CFLAGS                    := $(libmm-vidc-def)
 LOCAL_C_INCLUDES                := $(libmm-vidc-inc)
 
 LOCAL_PRELINK_MODULE      := false
 LOCAL_SHARED_LIBRARIES    := liblog libcutils libdl
+LOCAL_HEADER_LIBRARIES    := libutils_headers
 
 LOCAL_HEADER_LIBRARIES := \
         libutils_headers
diff --git a/mm-video-v4l2/vidc/common/src/vidc_common.cpp b/mm-video-v4l2/vidc/common/src/vidc_common.cpp
index f977ba2..db96ece 100644
--- a/mm-video-v4l2/vidc/common/src/vidc_common.cpp
+++ b/mm-video-v4l2/vidc/common/src/vidc_common.cpp
@@ -28,7 +28,7 @@
 --------------------------------------------------------------------------*/
 #define LOG_TAG "OMX_COMMON"
 
-#include <utils/Log.h>
+#include <log/log.h>
 #include "vidc_debug.h"
 #include "vidc_common.h"
 #include "OMX_Core.h"
diff --git a/mm-video-v4l2/vidc/common/src/vidc_vendor_extensions.cpp b/mm-video-v4l2/vidc/common/src/vidc_vendor_extensions.cpp
index 3b06bc7..e1ed639 100644
--- a/mm-video-v4l2/vidc/common/src/vidc_vendor_extensions.cpp
+++ b/mm-video-v4l2/vidc/common/src/vidc_vendor_extensions.cpp
@@ -28,7 +28,7 @@
 --------------------------------------------------------------------------*/
 
 #define LOG_TAG "OMX-VENDOR-EXT"
-#include <utils/Log.h>
+#include <log/log.h>
 #include "vidc_debug.h"
 
 #include "OMX_Core.h"
diff --git a/mm-video-v4l2/vidc/vdec/Android.mk b/mm-video-v4l2/vidc/vdec/Android.mk
old mode 100644
new mode 100755
index 84ee185..3f8fa79
--- a/mm-video-v4l2/vidc/vdec/Android.mk
+++ b/mm-video-v4l2/vidc/vdec/Android.mk
@@ -55,19 +55,19 @@
 
 # Common Includes
 libmm-vdec-inc          := $(LOCAL_PATH)/inc
-libmm-vdec-inc          += $(TOP)/hardware/qcom/media/mm-video-v4l2/vidc/common/inc
-libmm-vdec-inc          += $(TOP)/hardware/qcom/media/mm-core/inc
-libmm-vdec-inc          += hardware/qcom/media/libplatformconfig
+libmm-vdec-inc          += $(QCOM_MEDIA_ROOT)/mm-video-v4l2/vidc/common/inc
+libmm-vdec-inc          += $(QCOM_MEDIA_ROOT)/mm-core/inc
+libmm-vdec-inc          += $(QCOM_MEDIA_ROOT)/libplatformconfig
 libmm-vdec-inc          += $(TARGET_OUT_HEADERS)/qcom/display
 libmm-vdec-inc          += $(TARGET_OUT_HEADERS)/adreno
-libmm-vdec-inc      	+= $(TOP)/hardware/qcom/media/libc2dcolorconvert
-libmm-vdec-inc      	+= $(TARGET_OUT_HEADERS)/mm-video/SwVdec
-libmm-vdec-inc      	+= $(TARGET_OUT_HEADERS)/mm-video/swvdec
-libmm-vdec-inc      	+= $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
+libmm-vdec-inc          += $(QCOM_MEDIA_ROOT)/libc2dcolorconvert
+libmm-vdec-inc          += $(TARGET_OUT_HEADERS)/mm-video/SwVdec
+libmm-vdec-inc          += $(TARGET_OUT_HEADERS)/mm-video/swvdec
+libmm-vdec-inc          += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
 
 ifeq ($(PLATFORM_SDK_VERSION), 18)  #JB_MR2
 libmm-vdec-def += -DANDROID_JELLYBEAN_MR2=1
-libmm-vdec-inc += $(TOP)/hardware/qcom/media/libstagefrighthw
+libmm-vdec-inc += $(QCOM_MEDIA_ROOT)/libstagefrighthw
 endif
 
 # Common Dependencies
@@ -110,11 +110,17 @@
 LOCAL_SHARED_LIBRARIES  += libc2dcolorconvert
 LOCAL_SHARED_LIBRARIES  += libqdMetaData
 LOCAL_SHARED_LIBRARIES  += libplatformconfig
+LOCAL_SHARED_LIBRARIES  += libnativewindow
+LOCAL_HEADER_LIBRARIES  := libnativebase_headers
+LOCAL_HEADER_LIBRARIES  += media_plugin_headers
+LOCAL_HEADER_LIBRARIES  += libhardware_headers
 
 LOCAL_SRC_FILES         := src/ts_parser.cpp
 LOCAL_STATIC_LIBRARIES  := libOmxVidcCommon
 LOCAL_SRC_FILES         += src/omx_vdec_v4l2.cpp
 
+LOCAL_CFLAGS            += -Wno-error
+
 include $(BUILD_SHARED_LIBRARY)
 
 
@@ -143,6 +149,7 @@
 
 LOCAL_PRELINK_MODULE          := false
 LOCAL_SHARED_LIBRARIES        := liblog libcutils libc2dcolorconvert libswvdec
+LOCAL_SHARED_LIBRARIES        += libnativewindow
 
 LOCAL_SRC_FILES               := src/omx_swvdec.cpp
 LOCAL_SRC_FILES               += src/omx_swvdec_utils.cpp
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
index 9cb4c70..8eb30c3 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
@@ -55,6 +55,7 @@
 #include <media/hardware/HardwareAPI.h>
 #include <sys/eventfd.h>
 #include "PlatformConfig.h"
+#include <nativebase/nativebase.h>
 
 #if !defined(_ANDROID_) || defined(SYS_IOCTL)
 #include <sys/ioctl.h>
@@ -11375,7 +11376,7 @@
     bool status = true;
     pthread_mutex_lock(&omx->c_lock);
      /* Whenever port mode is set to kPortModeDynamicANWBuffer, Video Frameworks
-        always uses VideoNativeMetadata and OMX recives buffer type as
+        always uses VideoNativeMetadata and OMX receives buffer type as
         grallocsource via storeMetaDataInBuffers_l API. The buffer_size
         will be communicated to frameworks via IndexParamPortdefinition. */
     if (!enabled)
diff --git a/mm-video-v4l2/vidc/venc/Android.mk b/mm-video-v4l2/vidc/venc/Android.mk
index a3617d0..5397360 100644
--- a/mm-video-v4l2/vidc/venc/Android.mk
+++ b/mm-video-v4l2/vidc/venc/Android.mk
@@ -57,13 +57,13 @@
 
 # Common Includes
 libmm-venc-inc      := $(LOCAL_PATH)/inc
-libmm-venc-inc      += $(TOP)/hardware/qcom/media/mm-video-v4l2/vidc/common/inc
-libmm-venc-inc      += hardware/qcom/media/mm-core/inc
-libmm-venc-inc      += hardware/qcom/media/libstagefrighthw
-libmm-venc-inc      += hardware/qcom/media/libplatformconfig
+libmm-venc-inc      += $(QCOM_MEDIA_ROOT)/mm-video-v4l2/vidc/common/inc
+libmm-venc-inc      += $(QCOM_MEDIA_ROOT)/mm-core/inc
+libmm-venc-inc      += $(QCOM_MEDIA_ROOT)/libstagefrighthw
+libmm-venc-inc      += $(QCOM_MEDIA_ROOT)/libplatformconfig
 libmm-venc-inc      += $(TARGET_OUT_HEADERS)/qcom/display
 libmm-venc-inc      += $(TARGET_OUT_HEADERS)/adreno
-libmm-venc-inc      += hardware/qcom/media/libc2dcolorconvert
+libmm-venc-inc      += $(QCOM_MEDIA_ROOT)/libc2dcolorconvert
 libmm-venc-inc      += $(TARGET_OUT_HEADERS)/libvqzip
 libmm-venc-inc      += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
 
@@ -97,17 +97,23 @@
 
 LOCAL_PRELINK_MODULE      := false
 LOCAL_SHARED_LIBRARIES    := liblog libcutils libdl libplatformconfig
+LOCAL_SHARED_LIBRARIES    += libnativewindow
 
 # ifeq ($(BOARD_USES_ADRENO), true)
 LOCAL_SHARED_LIBRARIES    += libc2dcolorconvert
 # endif # ($(BOARD_USES_ADRENO), true)
 LOCAL_SHARED_LIBRARIES += libqdMetaData
 LOCAL_STATIC_LIBRARIES    := libOmxVidcCommon
+LOCAL_HEADER_LIBRARIES    := media_plugin_headers
+LOCAL_HEADER_LIBRARIES    += libhardware_headers
 
 LOCAL_SRC_FILES   := src/omx_video_base.cpp
 LOCAL_SRC_FILES   += src/omx_video_encoder.cpp
 LOCAL_SRC_FILES   += src/video_encoder_device_v4l2.cpp
 
+# Suppress warnings until they are fixed in video_encoder_device_v4l2.cpp
+LOCAL_CFLAGS += -Wno-error=implicit-fallthrough
+
 include $(BUILD_SHARED_LIBRARY)
 
 ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_NEED_SW_VENC_MPEG4)),true)
@@ -136,6 +142,7 @@
 
 LOCAL_PRELINK_MODULE      := false
 LOCAL_SHARED_LIBRARIES    := liblog libcutils libdl libplatformconfig libMpeg4SwEncoder
+LOCAL_SHARED_LIBRARIES    += libnativewindow
 LOCAL_SHARED_LIBRARIES    += libqdMetaData
 
 ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_SUPPORT_SW_VENC_ROTATION)),true)
@@ -143,6 +150,8 @@
 LOCAL_SHARED_LIBRARIES += libutils
 endif
 
+LOCAL_HEADER_LIBRARIES    := media_plugin_headers
+
 # ifeq ($(BOARD_USES_ADRENO), true)
 LOCAL_SHARED_LIBRARIES    += libc2dcolorconvert
 # endif # ($(BOARD_USES_ADRENO), true)