media: Use project pathmap

Change-Id: I4f2e1f666deded6d53f23c97718b4246b48cf780
diff --git a/Android.mk b/Android.mk
index a99e4c6..60b16cf 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,3 +1,5 @@
+ifeq ($(call my-dir),$(call project-path-for,qcom-media))
+
 QCOM_MEDIA_ROOT := $(call my-dir)
 
 #Compile these for all targets under QCOM_BOARD_PLATFORMS list.
@@ -7,3 +9,4 @@
     include $(QCOM_MEDIA_ROOT)/libplatformconfig/Android.mk
 endif
 
+endif
diff --git a/mm-core/Android.mk b/mm-core/Android.mk
index e0aed81..97571fb 100644
--- a/mm-core/Android.mk
+++ b/mm-core/Android.mk
@@ -12,8 +12,6 @@
 OMXCORE_CFLAGS += -DVIDC_STUB_HAL
 endif
 
-QCOM_MEDIA_ROOT ?= hardware/qcom/media
-
 #===============================================================================
 #             Figure out the targets
 #===============================================================================
@@ -35,7 +33,7 @@
 #===============================================================================
 
 LOCAL_C_INCLUDES        := $(LOCAL_PATH)/src/common
-LOCAL_C_INCLUDES        += $(TOP)/$(QCOM_MEDIA_ROOT)/libplatformconfig
+LOCAL_C_INCLUDES        += $(call project-path-for,qcom-media)/libplatformconfig
 
 LOCAL_HEADER_LIBRARIES := \
         libutils_headers \
@@ -76,7 +74,7 @@
 include $(CLEAR_VARS)
 
 LOCAL_C_INCLUDES        := $(LOCAL_PATH)/src/common
-LOCAL_C_INCLUDES        += $(TOP)/$(QCOM_MEDIA_ROOT)/libplatformconfig
+LOCAL_C_INCLUDES        += $(call project-path-for,qcom-media)/libplatformconfig
 
 LOCAL_HEADER_LIBRARIES := \
         libutils_headers \