1LOCAL_PATH := $(call my-dir)
2include $(CLEAR_VARS)
3
4# ---------------------------------------------------------------------------------
5# 				Common definitons
6# ---------------------------------------------------------------------------------
7
8libmm-venc-def := -g -O3 -Dlrintf=_ffix_r
9libmm-venc-def += -D__align=__alignx
10libmm-venc-def += -D__alignx\(x\)=__attribute__\(\(__aligned__\(x\)\)\)
11libmm-venc-def += -DT_ARM
12libmm-venc-def += -Dinline=__inline
13libmm-venc-def += -D_ANDROID_
14libmm-venc-def += -UENABLE_DEBUG_LOW
15libmm-venc-def += -UENABLE_DEBUG_HIGH
16libmm-venc-def += -DENABLE_DEBUG_ERROR
17libmm-venc-def += -UINPUT_BUFFER_LOG
18libmm-venc-def += -UOUTPUT_BUFFER_LOG
19libmm-venc-def += -USINGLE_ENCODER_INSTANCE
20libmm-venc-def += -Werror
21libmm-venc-def += -D_ANDROID_ICS_
22libmm-venc-def += -D_MSM8974_
23
24TARGETS_THAT_USE_FLAG_MSM8226 := msm8226 msm8916 msm8909
25TARGETS_THAT_NEED_SW_VENC_MPEG4 := msm8909
26TARGETS_THAT_NEED_SW_VENC_HEVC := msm8992
27
28ifeq ($(TARGET_BOARD_PLATFORM),msm8610)
29libmm-venc-def += -DMAX_RES_720P
30libmm-venc-def += -D_MSM8610_
31else
32ifeq ($(TARGET_BOARD_PLATFORM),msm8226)
33libmm-venc-def += -DMAX_RES_1080P
34else
35libmm-venc-def += -DMAX_RES_1080P
36libmm-venc-def += -DMAX_RES_1080P_EBI
37endif
38endif
39
40ifeq ($(TARGET_BOARD_PLATFORM),msm8996)
41libmm-venc-def += -D_UBWC_
42endif
43
44ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_USE_FLAG_MSM8226)),true)
45libmm-venc-def += -D_MSM8226_
46endif
47
48ifeq ($(TARGET_USES_ION),true)
49libmm-venc-def += -DUSE_ION
50endif
51
52ifeq ($(call is-board-platform-in-list, $(MASTER_SIDE_CP_TARGET_LIST)),true)
53libmm-venc-def += -DMASTER_SIDE_CP
54endif
55
56# Common Includes
57libmm-venc-inc      := $(LOCAL_PATH)/inc
58libmm-venc-inc      += $(TOP)/hardware/qcom/media/msm8996/mm-video-v4l2/vidc/common/inc
59libmm-venc-inc      += hardware/qcom/media/msm8996/mm-core/inc
60libmm-venc-inc      += hardware/qcom/media/msm8996/libstagefrighthw
61libmm-venc-inc      += $(TARGET_OUT_HEADERS)/qcom/display
62libmm-venc-inc      += $(TARGET_OUT_HEADERS)/adreno
63libmm-venc-inc      += frameworks/native/include/media/hardware
64libmm-venc-inc      += frameworks/native/include/media/openmax
65libmm-venc-inc      += hardware/qcom/media/msm8996/libc2dcolorconvert
66libmm-venc-inc      += $(TARGET_OUT_HEADERS)/libvqzip
67libmm-venc-inc      += frameworks/av/include/media/stagefright
68ifeq ($(TARGET_COMPILE_WITH_MSM_KERNEL),true)
69libmm-venc-inc      += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
70endif
71
72# Common Dependencies
73ifeq ($(TARGET_COMPILE_WITH_MSM_KERNEL),true)
74libmm-venc-add-dep  := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
75endif
76
77# ---------------------------------------------------------------------------------
78# 			Make the Shared library (libOmxVenc)
79# ---------------------------------------------------------------------------------
80
81include $(CLEAR_VARS)
82
83LOCAL_MODULE                    := libOmxVenc
84LOCAL_LICENSE_KINDS             := SPDX-license-identifier-BSD
85LOCAL_LICENSE_CONDITIONS        := notice
86LOCAL_NOTICE_FILE               := $(LOCAL_PATH)/../../../NOTICE
87LOCAL_MODULE_TAGS               := optional
88LOCAL_PROPRIETARY_MODULE        := true
89LOCAL_CFLAGS                    := $(libmm-venc-def)
90LOCAL_C_INCLUDES                := $(libmm-venc-inc)
91LOCAL_ADDITIONAL_DEPENDENCIES   := $(libmm-venc-add-dep)
92
93LOCAL_PRELINK_MODULE      := false
94LOCAL_SHARED_LIBRARIES    := liblog libutils libbinder libcutils \
95                             libc2dcolorconvert libdl
96LOCAL_SHARED_LIBRARIES    += libqdMetaData
97LOCAL_HEADER_LIBRARIES    := copybit_headers gralloc_headers media_plugin_headers
98LOCAL_STATIC_LIBRARIES    := libOmxVidcCommon
99
100LOCAL_SRC_FILES   := src/omx_video_base.cpp
101LOCAL_SRC_FILES   += src/omx_video_encoder.cpp
102LOCAL_SRC_FILES   += src/video_encoder_device_v4l2.cpp
103
104include $(BUILD_SHARED_LIBRARY)
105
106ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_NEED_SW_VENC_MPEG4)),true)
107# ---------------------------------------------------------------------------------
108# 			Make the Shared library (libOmxSwVencMpeg4)
109# ---------------------------------------------------------------------------------
110
111include $(CLEAR_VARS)
112
113libmm-venc-inc      += $(TARGET_OUT_HEADERS)/mm-video/swvenc
114
115LOCAL_MODULE                    := libOmxSwVencMpeg4
116LOCAL_LICENSE_KINDS             := SPDX-license-identifier-BSD
117LOCAL_LICENSE_CONDITIONS        := notice
118LOCAL_NOTICE_FILE               := $(LOCAL_PATH)/../../../NOTICE
119
120LOCAL_MODULE_TAGS               := optional
121LOCAL_PROPRIETARY_MODULE        := true
122LOCAL_CFLAGS                    := $(libmm-venc-def)
123LOCAL_C_INCLUDES                := $(libmm-venc-inc)
124LOCAL_ADDITIONAL_DEPENDENCIES   := $(libmm-venc-add-dep)
125
126LOCAL_PRELINK_MODULE      := false
127LOCAL_SHARED_LIBRARIES    := liblog libutils libbinder libcutils \
128                             libc2dcolorconvert libdl
129LOCAL_SHARED_LIBRARIES    += libMpeg4SwEncoder
130LOCAL_STATIC_LIBRARIES    := libOmxVidcCommon
131
132LOCAL_SRC_FILES   := src/omx_video_base.cpp
133LOCAL_SRC_FILES   += src/omx_swvenc_mpeg4.cpp
134
135include $(BUILD_SHARED_LIBRARY)
136endif
137
138ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_NEED_SW_VENC_HEVC)),true)
139# ---------------------------------------------------------------------------------
140#                            Make the Shared library (libOmxSwVenc)
141# ---------------------------------------------------------------------------------
142include $(CLEAR_VARS)
143
144libmm-venc-inc      += $(TARGET_OUT_HEADERS)/mm-video/swVenc
145
146LOCAL_MODULE                    := libOmxSwVencHevc
147LOCAL_LICENSE_KINDS             := SPDX-license-identifier-BSD
148LOCAL_LICENSE_CONDITIONS        := notice
149LOCAL_NOTICE_FILE               := $(LOCAL_PATH)/../../../NOTICE
150LOCAL_MODULE_TAGS               := optional
151LOCAL_PROPRIETARY_MODULE        := true
152LOCAL_CFLAGS                    := $(libmm-venc-def)
153LOCAL_C_INCLUDES                := $(libmm-venc-inc)
154LOCAL_ADDITIONAL_DEPENDENCIES   := $(libmm-venc-add-dep)
155
156LOCAL_PRELINK_MODULE      := false
157LOCAL_SHARED_LIBRARIES    := liblog libutils libbinder libcutils \
158                             libc2dcolorconvert libdl
159LOCAL_SHARED_LIBRARIES    += libHevcSwEncoder
160LOCAL_HEADER_LIBRARIES    := media_plugin_headers
161LOCAL_STATIC_LIBRARIES    := libOmxVidcCommon
162
163LOCAL_SRC_FILES   := src/omx_video_base.cpp
164LOCAL_SRC_FILES   += src/omx_swvenc_hevc.cpp
165
166include $(BUILD_SHARED_LIBRARY)
167endif
168
169# ---------------------------------------------------------------------------------
170# 					END
171# ---------------------------------------------------------------------------------
172