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_
22
23TARGETS_THAT_USE_FLAG_MSM8226 := msm8226 msm8916 msm8909
24TARGETS_THAT_NEED_SW_VENC_MPEG4 := msm8909 msm8937 sdm845 msmpeafowl sdm710 qcs605
25TARGETS_THAT_NEED_SW_VENC_HEVC := msm8992
26TARGETS_THAT_SUPPORT_UBWC := msm8996 msm8998 sdm845 msmpeafowl sdm710 qcs605
27TARGETS_THAT_SUPPORT_VQZIP := msm8996 msm8998
28TARGETS_THAT_SUPPORT_SW_VENC_ROTATION := sdm845 msmpeafowl sdm710 qcs605
29
30ifeq ($(TARGET_BOARD_PLATFORM),msm8610)
31libmm-venc-def += -D_MSM8610_
32endif
33
34ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_SUPPORT_UBWC)),true)
35libmm-venc-def += -D_UBWC_
36endif
37
38ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_SUPPORT_VQZIP)),true)
39libmm-venc-def += -D_VQZIP_
40endif
41
42ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_USE_FLAG_MSM8226)),true)
43libmm-venc-def += -D_MSM8226_
44endif
45
46ifeq ($(TARGET_USES_ION),true)
47libmm-venc-def += -DUSE_ION
48endif
49
50libmm-venc-def += -DUSE_NATIVE_HANDLE_SOURCE
51
52ifeq ($(call is-board-platform-in-list, $(MASTER_SIDE_CP_TARGET_LIST)),true)
53libmm-venc-def += -DMASTER_SIDE_CP
54endif
55
56libmm-venc-def += -DUSE_CAMERA_METABUFFER_UTILS
57
58# Common Includes
59libmm-venc-inc      := $(LOCAL_PATH)/inc
60libmm-venc-inc      += $(QCOM_MEDIA_ROOT)/mm-video-v4l2/vidc/common/inc
61libmm-venc-inc      += $(QCOM_MEDIA_ROOT)/mm-core/inc
62libmm-venc-inc      += $(QCOM_MEDIA_ROOT)/libstagefrighthw
63libmm-venc-inc      += $(QCOM_MEDIA_ROOT)/libplatformconfig
64libmm-venc-inc      += $(TARGET_OUT_HEADERS)/qcom/display
65libmm-venc-inc      += $(TARGET_OUT_HEADERS)/adreno
66libmm-venc-inc      += $(QCOM_MEDIA_ROOT)/libc2dcolorconvert
67libmm-venc-inc      += $(TARGET_OUT_HEADERS)/libvqzip
68libmm-venc-inc      += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
69
70ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_SUPPORT_SW_VENC_ROTATION)),true)
71libmm-venc-inc      += hardware/libhardware/include/hardware
72endif
73
74# Common Dependencies
75libmm-venc-add-dep  := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
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_VENDOR_MODULE             := true
89LOCAL_CFLAGS                    := $(libmm-venc-def)
90
91LOCAL_HEADER_LIBRARIES := \
92        media_plugin_headers \
93        libnativebase_headers \
94        libcutils_headers \
95        libutils_headers \
96        libhardware_headers \
97
98LOCAL_C_INCLUDES                := $(libmm-venc-inc)
99LOCAL_ADDITIONAL_DEPENDENCIES   := $(libmm-venc-add-dep)
100
101LOCAL_PRELINK_MODULE      := false
102LOCAL_SHARED_LIBRARIES    := liblog libcutils libdl libplatformconfig
103LOCAL_SHARED_LIBRARIES    += libnativewindow
104
105# ifeq ($(BOARD_USES_ADRENO), true)
106LOCAL_SHARED_LIBRARIES    += libc2dcolorconvert
107# endif # ($(BOARD_USES_ADRENO), true)
108LOCAL_SHARED_LIBRARIES += libqdMetaData
109LOCAL_STATIC_LIBRARIES    := libOmxVidcCommon
110LOCAL_HEADER_LIBRARIES    := media_plugin_headers
111LOCAL_HEADER_LIBRARIES    += libhardware_headers
112
113LOCAL_SRC_FILES   := src/omx_video_base.cpp
114LOCAL_SRC_FILES   += src/omx_video_encoder.cpp
115LOCAL_SRC_FILES   += src/video_encoder_device_v4l2.cpp
116
117# Suppress warnings until they are fixed in video_encoder_device_v4l2.cpp
118LOCAL_CFLAGS += -Wno-error=implicit-fallthrough
119
120include $(BUILD_SHARED_LIBRARY)
121
122ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_NEED_SW_VENC_MPEG4)),true)
123# ---------------------------------------------------------------------------------
124# 			Make the Shared library (libOmxSwVencMpeg4)
125# ---------------------------------------------------------------------------------
126
127include $(CLEAR_VARS)
128
129libmm-venc-inc      += $(TARGET_OUT_HEADERS)/mm-video/swvenc
130
131LOCAL_MODULE                    := libOmxSwVencMpeg4
132LOCAL_LICENSE_KINDS             := SPDX-license-identifier-BSD
133LOCAL_LICENSE_CONDITIONS        := notice
134LOCAL_NOTICE_FILE               := $(LOCAL_PATH)/../../../NOTICE
135
136LOCAL_MODULE_TAGS               := optional
137LOCAL_VENDOR_MODULE             := true
138LOCAL_CFLAGS                    := $(libmm-venc-def)
139
140LOCAL_HEADER_LIBRARIES := \
141        media_plugin_headers \
142        libnativebase_headers \
143        libutils_headers \
144        libhardware_headers \
145
146LOCAL_C_INCLUDES                := $(libmm-venc-inc)
147LOCAL_ADDITIONAL_DEPENDENCIES   := $(libmm-venc-add-dep)
148
149LOCAL_PRELINK_MODULE      := false
150LOCAL_SHARED_LIBRARIES    := liblog libcutils libdl libplatformconfig libMpeg4SwEncoder
151LOCAL_SHARED_LIBRARIES    += libnativewindow
152LOCAL_SHARED_LIBRARIES    += libqdMetaData
153
154ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_SUPPORT_SW_VENC_ROTATION)),true)
155LOCAL_SHARED_LIBRARIES += libui
156LOCAL_SHARED_LIBRARIES += libutils
157endif
158
159LOCAL_HEADER_LIBRARIES    := media_plugin_headers
160
161# ifeq ($(BOARD_USES_ADRENO), true)
162LOCAL_SHARED_LIBRARIES    += libc2dcolorconvert
163# endif # ($(BOARD_USES_ADRENO), true)
164LOCAL_STATIC_LIBRARIES    := libOmxVidcCommon
165
166LOCAL_SRC_FILES   := src/omx_video_base.cpp
167LOCAL_SRC_FILES   += src/omx_swvenc_mpeg4.cpp
168
169include $(BUILD_SHARED_LIBRARY)
170endif
171
172
173# ---------------------------------------------------------------------------------
174# 					END
175# ---------------------------------------------------------------------------------
176