1LOCAL_PATH := $(call my-dir)
2
3_software_codecs := \
4    libstagefright_soft_aacdec \
5    libstagefright_soft_aacenc \
6    libstagefright_soft_amrdec \
7    libstagefright_soft_amrnbenc \
8    libstagefright_soft_amrwbenc \
9    libstagefright_soft_avcdec \
10    libstagefright_soft_avcenc \
11    libstagefright_soft_flacdec \
12    libstagefright_soft_flacenc \
13    libstagefright_soft_g711dec \
14    libstagefright_soft_gsmdec \
15    libstagefright_soft_hevcdec \
16    libstagefright_soft_mp3dec \
17    libstagefright_soft_mpeg2dec \
18    libstagefright_soft_mpeg4dec \
19    libstagefright_soft_mpeg4enc \
20    libstagefright_soft_opusdec \
21    libstagefright_soft_rawdec \
22    libstagefright_soft_vorbisdec \
23    libstagefright_soft_vpxdec \
24    libstagefright_soft_vpxenc \
25
26# service executable
27include $(CLEAR_VARS)
28# seccomp is not required for coverage build.
29ifneq ($(NATIVE_COVERAGE),true)
30LOCAL_REQUIRED_MODULES := crash_dump.policy
31LOCAL_REQUIRED_MODULES_arm := mediacodec.policy
32LOCAL_REQUIRED_MODULES_x86 := mediacodec.policy
33endif
34LOCAL_SRC_FILES := main_codecservice.cpp
35LOCAL_SHARED_LIBRARIES := \
36    libmedia_omx \
37    libbinder \
38    libutils \
39    liblog \
40    libbase \
41    libavservices_minijail_vendor \
42    libcutils \
43    libhwbinder \
44    libhidltransport \
45    libstagefright_omx \
46    libstagefright_xmlparser \
47    android.hardware.media.omx@1.0 \
48    android.hidl.memory@1.0
49
50LOCAL_MODULE := android.hardware.media.omx@1.0-service
51LOCAL_MODULE_RELATIVE_PATH := hw
52LOCAL_VENDOR_MODULE := true
53LOCAL_32_BIT_ONLY := true
54# Since this is 32-bit-only module, only 32-bit version of the codecs are installed.
55# TODO(b/72343507): eliminate the need for manually adding .vendor suffix. This should be done
56# by the build system.
57LOCAL_REQUIRED_MODULES += \
58$(foreach codec,$(_software_codecs),\
59  $(eval _vendor_suffix := $(if $(BOARD_VNDK_VERSION),.vendor))\
60  $(codec)$(_vendor_suffix)\
61)
62_software_codecs :=
63LOCAL_INIT_RC := android.hardware.media.omx@1.0-service.rc
64
65include $(BUILD_EXECUTABLE)
66
67# service seccomp policy
68ifeq ($(TARGET_ARCH), $(filter $(TARGET_ARCH), x86 x86_64 arm arm64))
69include $(CLEAR_VARS)
70LOCAL_MODULE := mediacodec.policy
71LOCAL_MODULE_CLASS := ETC
72LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/seccomp_policy
73# mediacodec runs in 32-bit combatibility mode. For 64 bit architectures,
74# use the 32 bit policy
75ifdef TARGET_2ND_ARCH
76  ifneq ($(TARGET_TRANSLATE_2ND_ARCH),true)
77    LOCAL_SRC_FILES := seccomp_policy/mediacodec-$(TARGET_2ND_ARCH).policy
78  else
79    LOCAL_SRC_FILES := seccomp_policy/mediacodec-$(TARGET_ARCH).policy
80  endif
81else
82    LOCAL_SRC_FILES := seccomp_policy/mediacodec-$(TARGET_ARCH).policy
83endif
84include $(BUILD_PREBUILT)
85endif
86
87include $(call all-makefiles-under, $(LOCAL_PATH))
88