From 2deb3e7b7a23e5b0ef0025d060ad89521ce73b98 Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Wed, 13 Apr 2016 07:41:36 +0200 Subject: [PATCH] compat: media: don't put Android 5.x as a requirement for MediaCodecSource We will most likely get the case that a device running Android 4.x will get a backport of the MediaCodecSource class. In that case we should still support it through the media compat API. The device running Android 4.x then only has to specify a BOARD_HAS_MEDIA_CODEC_SOURCE := true in its BoardConfig.mk and we will add support for it. --- compat/media/Android.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compat/media/Android.mk b/compat/media/Android.mk index 03a2f1f34..a77e10026 100644 --- a/compat/media/Android.mk +++ b/compat/media/Android.mk @@ -25,6 +25,11 @@ HAS_ANDROID_5 := $(shell test $(ANDROID_VERSION_MAJOR) -ge 5 && echo true) ifeq ($(HAS_ANDROID_5),true) LOCAL_C_INCLUDES += system/media/camera/include + +# All devices having Android 5.x also have MediaCodecSource +# available so we don't have to put a switch for this into +# any BoardConfig.mk +BOARD_HAS_MEDIA_CODEC_SOURCE := true endif LOCAL_MODULE := camera_service @@ -65,7 +70,7 @@ LOCAL_SRC_FILES:= \ media_message_layer.cpp \ media_meta_data_layer.cpp -ifeq ($(HAS_ANDROID_5),true) +ifeq ($(BOARD_HAS_MEDIA_CODEC_SOURCE),true) # MediaCodecSource support is only available starting with # Android 5.x so we have to limit support for it. LOCAL_SRC_FILES += media_codec_source_layer.cpp