Move Android.mks to their parent dir.

So we don't need "../" to reference source files in the common/
directory.
"../" in LOCAL_SRC_FILES causes build race condition: the path of object
file of ../common/src/extra_data_handler.cpp in vdec actually is the same
as the path of object file of ../common/src/extra_data_handler.cpp in
venc.

Bug: 12779537
Change-Id: Ifd7fef36810c15fbe7854aeb3d505fba63f5d7e2
(cherry picked from commit c9a7bd20d3891b002f6b0285692adb9d246036ae)
diff --git a/mm-video-v4l2/Android.mk b/mm-video-v4l2/Android.mk
index 2d0a533..e27c970 100755
--- a/mm-video-v4l2/Android.mk
+++ b/mm-video-v4l2/Android.mk
@@ -1,6 +1,5 @@
 OMX_VIDEO_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
-include $(OMX_VIDEO_PATH)/vidc/vdec/Android.mk
-include $(OMX_VIDEO_PATH)/vidc/venc/Android.mk
+include $(OMX_VIDEO_PATH)/vidc/Android.mk
 include $(OMX_VIDEO_PATH)/DivxDrmDecrypt/Android.mk
diff --git a/mm-video-v4l2/vidc/Android.mk b/mm-video-v4l2/vidc/Android.mk
new file mode 100644
index 0000000..b2294aa
--- /dev/null
+++ b/mm-video-v4l2/vidc/Android.mk
@@ -0,0 +1,3 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(LOCAL_PATH)/vdec.mk $(LOCAL_PATH)/venc.mk
diff --git a/mm-video-v4l2/vidc/vdec/Android.mk b/mm-video-v4l2/vidc/vdec.mk
old mode 100755
new mode 100644
similarity index 83%
rename from mm-video-v4l2/vidc/vdec/Android.mk
rename to mm-video-v4l2/vidc/vdec.mk
index 1f08fad..366d0bd
--- a/mm-video-v4l2/vidc/vdec/Android.mk
+++ b/mm-video-v4l2/vidc/vdec.mk
@@ -88,7 +88,7 @@
 
 libmm-vdec-inc          := bionic/libc/include
 libmm-vdec-inc          += bionic/libstdc++/include
-libmm-vdec-inc          += $(LOCAL_PATH)/inc
+libmm-vdec-inc          += $(LOCAL_PATH)/vdec/inc
 libmm-vdec-inc          += $(OMX_VIDEO_PATH)/vidc/common/inc
 libmm-vdec-inc          += hardware/qcom/media/mm-core/inc
 #DRM include - Interface which loads the DRM library
@@ -114,21 +114,21 @@
 LOCAL_SHARED_LIBRARIES  += libdivxdrmdecrypt
 LOCAL_SHARED_LIBRARIES  += libqdMetaData
 
-LOCAL_SRC_FILES         := src/frameparser.cpp
-LOCAL_SRC_FILES         += src/h264_utils.cpp
-LOCAL_SRC_FILES         += src/ts_parser.cpp
-LOCAL_SRC_FILES         += src/mp4_utils.cpp
+LOCAL_SRC_FILES         := vdec/src/frameparser.cpp
+LOCAL_SRC_FILES         += vdec/src/h264_utils.cpp
+LOCAL_SRC_FILES         += vdec/src/ts_parser.cpp
+LOCAL_SRC_FILES         += vdec/src/mp4_utils.cpp
 ifneq ($(filter msm8974 msm8610 msm8226 apq8084 mpq8092,$(TARGET_BOARD_PLATFORM)),)
-LOCAL_SRC_FILES         += src/omx_vdec_msm8974.cpp
+LOCAL_SRC_FILES         += vdec/src/omx_vdec_msm8974.cpp
 else
 LOCAL_SHARED_LIBRARIES  += libhardware
 libmm-vdec-inc          += hardware/qcom/display/$(TARGET_BOARD_PLATFORM)/libhwcomposer
-LOCAL_SRC_FILES         += src/power_module.cpp
-LOCAL_SRC_FILES         += src/omx_vdec.cpp
+LOCAL_SRC_FILES         += vdec/src/power_module.cpp
+LOCAL_SRC_FILES         += vdec/src/omx_vdec.cpp
 endif
 
-LOCAL_SRC_FILES         += ../common/src/extra_data_handler.cpp
-LOCAL_SRC_FILES         += ../common/src/vidc_color_converter.cpp
+LOCAL_SRC_FILES         += common/src/extra_data_handler.cpp
+LOCAL_SRC_FILES         += common/src/vidc_color_converter.cpp
 
 include $(BUILD_SHARED_LIBRARY)
 
@@ -153,16 +153,16 @@
 LOCAL_SHARED_LIBRARIES  += libdivxdrmdecrypt
 LOCAL_SHARED_LIBRARIES  += libqdMetaData
 
-LOCAL_SRC_FILES         := src/frameparser.cpp
-LOCAL_SRC_FILES         += src/h264_utils.cpp
-LOCAL_SRC_FILES         += src/ts_parser.cpp
-LOCAL_SRC_FILES         += src/mp4_utils.cpp
+LOCAL_SRC_FILES         := vdec/src/frameparser.cpp
+LOCAL_SRC_FILES         += vdec/src/h264_utils.cpp
+LOCAL_SRC_FILES         += vdec/src/ts_parser.cpp
+LOCAL_SRC_FILES         += vdec/src/mp4_utils.cpp
 
-LOCAL_SRC_FILES         += src/omx_vdec_hevc.cpp
-LOCAL_SRC_FILES         += src/hevc_utils.cpp
+LOCAL_SRC_FILES         += vdec/src/omx_vdec_hevc.cpp
+LOCAL_SRC_FILES         += vdec/src/hevc_utils.cpp
 
-LOCAL_SRC_FILES         += ../common/src/extra_data_handler.cpp
-LOCAL_SRC_FILES         += ../common/src/vidc_color_converter.cpp
+LOCAL_SRC_FILES         += common/src/extra_data_handler.cpp
+LOCAL_SRC_FILES         += common/src/vidc_color_converter.cpp
 
 include $(BUILD_SHARED_LIBRARY)
 
@@ -174,7 +174,7 @@
 include $(CLEAR_VARS)
 
 mm-vdec-test-inc    := hardware/qcom/media/mm-core/inc
-mm-vdec-test-inc    += $(LOCAL_PATH)/inc
+mm-vdec-test-inc    += $(LOCAL_PATH)/vdec/inc
 mm-vdec-test-inc    += $(vdec-inc)
 
 LOCAL_MODULE                    := mm-vdec-omx-test
@@ -185,8 +185,8 @@
 LOCAL_PRELINK_MODULE      := false
 LOCAL_SHARED_LIBRARIES    := libutils libOmxCore libOmxVdec libbinder libcutils
 
-LOCAL_SRC_FILES           := src/queue.c
-LOCAL_SRC_FILES           += test/omx_vdec_test.cpp
+LOCAL_SRC_FILES           := vdec/src/queue.c
+LOCAL_SRC_FILES           += vdec/test/omx_vdec_test.cpp
 
 include $(BUILD_EXECUTABLE)
 
@@ -196,7 +196,7 @@
 include $(CLEAR_VARS)
 
 mm-vdec-drv-test-inc    := hardware/qcom/media/mm-core/inc
-mm-vdec-drv-test-inc    += $(LOCAL_PATH)/inc
+mm-vdec-drv-test-inc    += $(LOCAL_PATH)/vdec/inc
 mm-vdec-drv-test-inc    += $(vdec-inc)
 
 LOCAL_MODULE                    := mm-video-driver-test
@@ -205,8 +205,8 @@
 LOCAL_C_INCLUDES                := $(mm-vdec-drv-test-inc)
 LOCAL_PRELINK_MODULE            := false
 
-LOCAL_SRC_FILES                 := src/message_queue.c
-LOCAL_SRC_FILES                 += test/decoder_driver_test.c
+LOCAL_SRC_FILES                 := vdec/src/message_queue.c
+LOCAL_SRC_FILES                 += vdec/test/decoder_driver_test.c
 
 include $(BUILD_EXECUTABLE)
 
diff --git a/mm-video-v4l2/vidc/venc/Android.mk b/mm-video-v4l2/vidc/venc.mk
similarity index 86%
rename from mm-video-v4l2/vidc/venc/Android.mk
rename to mm-video-v4l2/vidc/venc.mk
index 1488c87..27e89e3 100644
--- a/mm-video-v4l2/vidc/venc/Android.mk
+++ b/mm-video-v4l2/vidc/venc.mk
@@ -76,7 +76,7 @@
 
 libmm-venc-inc      := bionic/libc/include
 libmm-venc-inc      += bionic/libstdc++/include
-libmm-venc-inc      += $(LOCAL_PATH)/inc
+libmm-venc-inc      += $(LOCAL_PATH)/venc/inc
 libmm-venc-inc      += $(OMX_VIDEO_PATH)/vidc/common/inc
 libmm-venc-inc      += hardware/qcom/media/mm-core/inc
 libmm-venc-inc      += hardware/qcom/media/libstagefrighthw
@@ -98,15 +98,15 @@
 LOCAL_SHARED_LIBRARIES    := liblog libutils libbinder libcutils \
                              libc2dcolorconvert libdl
 
-LOCAL_SRC_FILES   := src/omx_video_base.cpp
-LOCAL_SRC_FILES   += src/omx_video_encoder.cpp
+LOCAL_SRC_FILES   := venc/src/omx_video_base.cpp
+LOCAL_SRC_FILES   += venc/src/omx_video_encoder.cpp
 ifneq ($(filter msm8974 msm8610 msm8226 apq8084 mpq8092,$(TARGET_BOARD_PLATFORM)),)
-LOCAL_SRC_FILES   += src/video_encoder_device_v4l2.cpp
+LOCAL_SRC_FILES   += venc/src/video_encoder_device_v4l2.cpp
 else
-LOCAL_SRC_FILES   += src/video_encoder_device.cpp
+LOCAL_SRC_FILES   += venc/src/video_encoder_device.cpp
 endif
 
-LOCAL_SRC_FILES   += ../common/src/extra_data_handler.cpp
+LOCAL_SRC_FILES   += common/src/extra_data_handler.cpp
 
 include $(BUILD_SHARED_LIBRARY)
 
@@ -117,7 +117,7 @@
 include $(CLEAR_VARS)
 
 mm-venc-test720p-inc            := $(TARGET_OUT_HEADERS)/mm-core
-mm-venc-test720p-inc            += $(LOCAL_PATH)/inc
+mm-venc-test720p-inc            += $(LOCAL_PATH)/venc/inc
 mm-venc-test720p-inc            += $(OMX_VIDEO_PATH)/vidc/common/inc
 mm-venc-test720p-inc            += hardware/qcom/media/mm-core/inc
 mm-venc-test720p-inc            += hardware/qcom/display/$(TARGET_BOARD_PLATFORM)/libgralloc
@@ -130,10 +130,10 @@
 LOCAL_PRELINK_MODULE            := false
 LOCAL_SHARED_LIBRARIES          := libmm-omxcore libOmxVenc libbinder liblog
 
-LOCAL_SRC_FILES                 := test/venc_test.cpp
-LOCAL_SRC_FILES                 += test/camera_test.cpp
-LOCAL_SRC_FILES                 += test/venc_util.c
-LOCAL_SRC_FILES                 += test/fb_test.c
+LOCAL_SRC_FILES                 := venc/test/venc_test.cpp
+LOCAL_SRC_FILES                 += venc/test/camera_test.cpp
+LOCAL_SRC_FILES                 += venc/test/venc_util.c
+LOCAL_SRC_FILES                 += venc/test/fb_test.c
 
 include $(BUILD_EXECUTABLE)
 
@@ -143,7 +143,7 @@
 
 include $(CLEAR_VARS)
 
-venc-test-inc                   += $(LOCAL_PATH)/inc
+venc-test-inc                   += $(LOCAL_PATH)/venc/inc
 venc-test-inc                   += hardware/qcom/display/$(TARGET_BOARD_PLATFORM)/libgralloc
 venc-test-inc                   += $(venc-inc)
 
@@ -154,8 +154,8 @@
 
 LOCAL_PRELINK_MODULE            := false
 
-LOCAL_SRC_FILES                 := test/video_encoder_test.c
-LOCAL_SRC_FILES                 += test/queue.c
+LOCAL_SRC_FILES                 := venc/test/video_encoder_test.c
+LOCAL_SRC_FILES                 += venc/test/queue.c
 
 include $(BUILD_EXECUTABLE)