forked from sailfishos/droidmedia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Android.mk
406 lines (349 loc) · 14.5 KB
/
Android.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
LOCAL_PATH:= $(call my-dir)
ANDROID_MAJOR :=
ANDROID_MINOR :=
ANDROID_MICRO :=
FORCE_HAL_PARAM :=
include $(LOCAL_PATH)/env.mk
ifdef FORCE_HAL
FORCE_HAL_PARAM := -DFORCE_HAL=$(FORCE_HAL)
endif
ifdef LEGACY_ANDROID_13_REVISION
LEGACY_ANDROID_13_PARAM := -DLEGACY_ANDROID_13_REVISION=$(LEGACY_ANDROID_13_REVISION)
endif
ifndef ANDROID_MAJOR
# First check if version_defaults.mk was already loaded.
ifndef PLATFORM_VERSION
include build/core/version_defaults.mk
endif
ifeq ($(strip $(PLATFORM_VERSION)),)
$error(*** Cannot get Android platform version)
endif
ANDROID_MAJOR = $(shell echo $(PLATFORM_VERSION) | cut -d . -f 1)
ANDROID_MINOR = $(shell echo $(PLATFORM_VERSION) | cut -d . -f 2)
ANDROID_MICRO = $(shell echo $(PLATFORM_VERSION) | cut -d . -f 3)
endif
ifeq ($(strip $(ANDROID_MAJOR)),)
$(error *** ANDROID_MAJOR undefined)
endif
ifeq ($(strip $(ANDROID_MINOR)),)
$(error *** ANDROID_MINOR undefined)
endif
ifeq ($(strip $(ANDROID_MINOR)),)
$(warning *** ANDROID_MICRO undefined. Assuming 0)
ANDROID_MINOR = 0
endif
ifeq ($(strip $(ANDROID_MICRO)),)
$(warning *** ANDROID_MICRO undefined. Assuming 0)
ANDROID_MICRO = 0
endif
ifeq ($(shell test $(ANDROID_MAJOR) -le 11 && echo true),true)
ifneq (,$(wildcard frameworks/av/media/mediaserver/Android.mk))
DROIDMEDIA_32 := $(shell cat frameworks/av/media/mediaserver/Android.mk |grep "LOCAL_32_BIT_ONLY[[:space:]]*:=[[:space:]]*" |grep -o "true\|1\|false\|0")
else
ifeq ($(shell test $(ANDROID_MAJOR) -le 11 && echo true),true)
ifneq (,$(wildcard frameworks/av/media/mediaserver/Android.bp))
DROIDMEDIA_32 := $(shell cat frameworks/av/media/mediaserver/Android.bp | grep compile_multilib | grep -wo "32" | sed "s/32/true/")
endif
else
ifneq (,$(wildcard frameworks/av/media/mediaserver/Android.bp))
DROIDMEDIA_32 := $(shell cat frameworks/av/media/mediaserver/Android.bp | grep "^ compile_multilib" | grep -wo "prefer32" | sed "s/prefer32/true/")
endif
endif
endif
endif
include $(CLEAR_VARS)
LOCAL_SRC_FILES := droidmedia.cpp \
droidmediacamera.cpp \
droidmediaconstants.cpp \
droidmediacodec.cpp \
droidmediaconvert.cpp \
droidmediarecorder.cpp \
allocator.cpp \
droidmediabuffer.cpp \
private.cpp
ifeq ($(shell test $(ANDROID_MAJOR) -ge 7 && echo true),true)
LOCAL_SRC_FILES += AsyncCodecSource.cpp
endif
LOCAL_SHARED_LIBRARIES := libc \
libdl \
libutils \
libcutils \
libcamera_client \
libgui \
libui \
libbinder \
libstagefright \
libstagefright_foundation \
libmedia
ifeq ($(shell test $(ANDROID_MAJOR) -ge 8 && echo true),true)
LOCAL_SHARED_LIBRARIES += liblog
endif
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),9))
LOCAL_SHARED_LIBRARIES += libmediaextractor
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 9 && echo true),true)
LOCAL_SHARED_LIBRARIES += [email protected] \
libmedia_omx
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 11 && echo true),true)
LOCAL_SHARED_LIBRARIES += libmedia_codeclist
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 12 && echo true),true)
LOCAL_SHARED_LIBRARIES += libactivitymanager_aidl \
libbatterystats_aidl \
libmediautils \
libpermission
endif
LOCAL_CPPFLAGS=-DANDROID_MAJOR=$(ANDROID_MAJOR) -DANDROID_MINOR=$(ANDROID_MINOR) -DANDROID_MICRO=$(ANDROID_MICRO) $(FORCE_HAL_PARAM) $(LEGACY_ANDROID_13_PARAM) -Wno-unused-parameter
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libdroidmedia
ifeq ($(shell test $(ANDROID_MAJOR) -ge 7 && echo true),true)
LOCAL_C_INCLUDES := frameworks/native/include/media/openmax \
frameworks/native/include/media/hardware
ifeq ($(shell test $(ANDROID_MAJOR) -ge 8 && echo true),true)
LOCAL_C_INCLUDES += frameworks/native/libs/nativewindow/include \
frameworks/av/media/libstagefright/omx/include \
frameworks/av/media/libstagefright/xmlparser/include
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 11 && echo true),true)
LOCAL_C_INCLUDES += frameworks/av/media/libmediametrics/include \
frameworks/av/media/libstagefright/include \
frameworks/av/drm/libmediadrm/interface
endif
else
LOCAL_C_INCLUDES := frameworks/native/include/media/openmax
endif
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),9))
LOCAL_C_INCLUDES += frameworks/av/media/libmediaextractor/include
endif
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := minimedia.cpp
LOCAL_C_INCLUDES := frameworks/av/services/camera/libcameraservice \
system/media/camera/include \
$(call include-path-for, audio-utils) \
frameworks/av/media/libaaudio/include \
frameworks/av/media/libaaudio/src \
frameworks/av/media/libaaudio/src/binding \
frameworks/av/media/libmedia \
frameworks/av/services/audioflinger
LOCAL_SHARED_LIBRARIES := libcameraservice \
libcamera_client \
libutils \
libmedia \
libbinder \
libgui \
libcutils \
libui
ifeq ($(shell test $(ANDROID_MAJOR) -le 11 && echo true),true)
LOCAL_C_INCLUDES += frameworks/av/media/libmediaplayerservice
LOCAL_SHARED_LIBRARIES += libmediaplayerservice
endif
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),5))
LOCAL_C_INCLUDES += frameworks/av/services/audiopolicy
else
LOCAL_C_INCLUDES += frameworks/av/services/audiopolicy \
frameworks/av/services/audiopolicy/common/include \
frameworks/av/services/audiopolicy/common/managerdefinitions/include \
frameworks/av/services/audiopolicy/engine/interface \
frameworks/av/services/audiopolicy/managerdefault \
frameworks/av/services/audiopolicy/service
endif
# libmedia was split into libmedia and libaudioclient starting with A8
ifeq ($(shell test $(ANDROID_MAJOR) -ge 8 && echo true),true)
LOCAL_SHARED_LIBRARIES += libaudioclient
else
LOCAL_SHARED_LIBRARIES += libmedia
endif
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),8 9))
LOCAL_SHARED_LIBRARIES += [email protected]
endif
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),10))
LOCAL_SHARED_LIBRARIES += [email protected]
endif
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),11))
LOCAL_SHARED_LIBRARIES += [email protected]
endif
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),12 13))
LOCAL_SHARED_LIBRARIES += [email protected]
LOCAL_C_INCLUDES += frameworks/native/libs/binder/include_activitymanager \
frameworks/native/libs/binder/include_batterystats \
frameworks/native/libs/binder/include_processinfo
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 12 && echo true),true)
LOCAL_C_INCLUDES += frameworks/av/media/libaudiohal/include \
frameworks/av/media/libheadtracking/include \
external/eigen
LOCAL_SHARED_LIBRARIES += libactivitymanager_aidl \
libbatterystats_aidl \
libmediautils \
libpermission \
audiopolicy-aidl-cpp
endif
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),13))
LOCAL_SHARED_LIBRARIES += android.hardware.camera.provider-V1-ndk
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 10 && echo true),true)
LOCAL_SHARED_LIBRARIES += [email protected] \
libsensorprivacy
LOCAL_AIDL_INCLUDES := frameworks/native/libs/sensorprivacy/aidl
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 12 && echo true),true)
LOCAL_SHARED_LIBRARIES += [email protected]
endif
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),13))
LOCAL_SHARED_LIBRARIES += android.hardware.camera.device-V1-ndk
LOCAL_AIDL_INCLUDES += hardware/interfaces/camera/device/aidl \
hardware/interfaces/camera/provider/aidl
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 8 && echo true),true)
LOCAL_C_INCLUDES += frameworks/native/libs/sensor/include \
frameworks/av/media/libstagefright/omx/include
LOCAL_SHARED_LIBRARIES += liblog \
libhidlbase \
libsensor \
ifeq ($(shell test $(ANDROID_MAJOR) -le 9 && echo true),true)
LOCAL_SHARED_LIBRARIES += libhidltransport \
libhwbinder
endif
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 9 && echo true),true)
LOCAL_SHARED_LIBRARIES += [email protected]
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 11 && echo true),true)
LOCAL_SHARED_LIBRARIES += libmedia_codeclist \
libbinder_ndk
ifeq ($(shell test $(ANDROID_MAJOR) -le 11 && echo true),true)
LOCAL_SHARED_LIBRARIES += libresourcemanagerservice
endif
endif
LOCAL_MODULE_TAGS := optional
LOCAL_CPPFLAGS=-DANDROID_MAJOR=$(ANDROID_MAJOR) -DANDROID_MINOR=$(ANDROID_MINOR) -DANDROID_MICRO=$(ANDROID_MICRO) -Wno-unused-parameter
ifeq ($(MINIMEDIA_SENSORSERVER_DISABLE),1)
LOCAL_CPPFLAGS += -DSENSORSERVER_DISABLE
endif
ifeq ($(AUDIOPOLICY_MTK_AUDIO_ADD),1)
LOCAL_CPPFLAGS += -DAUDIOPOLICY_MTK_AUDIO_ADD
endif
ifeq ($(shell grep -q listAudioSessions frameworks/av/services/audiopolicy/service/AudioPolicyService.h && echo true),true)
LOCAL_CPPFLAGS += -DAUDIOPOLICY_LINEAGE_AUDIOSESSIONINFO
endif
LOCAL_MODULE := minimediaservice
ifeq ($(shell test $(ANDROID_MAJOR) -le 11 && echo true),true)
ifeq ($(strip $(DROIDMEDIA_32)), true)
LOCAL_32_BIT_ONLY := true
endif
endif
include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := minisf.cpp allocator.cpp
LOCAL_SHARED_LIBRARIES := libutils \
libbinder \
libmedia \
libgui \
libcutils \
libui
ifeq ($(shell test $(ANDROID_MAJOR) -ge 8 && echo true),true)
LOCAL_C_INCLUDES := frameworks/native/libs/sensor/include \
frameworks/native/include
LOCAL_SHARED_LIBRARIES += liblog \
libhidlbase \
libsensor \
ifeq ($(shell test $(ANDROID_MAJOR) -le 9 && echo true),true)
LOCAL_SHARED_LIBRARIES += libhidltransport \
libhwbinder
endif
endif
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),9))
LOCAL_SHARED_LIBRARIES += [email protected]
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 10 && echo true),true)
LOCAL_SHARED_LIBRARIES += libsensorprivacy
LOCAL_AIDL_INCLUDES := frameworks/native/libs/sensorprivacy/aidl
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 12 && echo true),true)
LOCAL_C_INCLUDES += frameworks/native/libs/binder/include_activitymanager \
frameworks/native/libs/binder/include_batterystats \
frameworks/native/libs/binder/include_processinfo
endif
LOCAL_MODULE_TAGS := optional
LOCAL_CPPFLAGS := -DANDROID_MAJOR=$(ANDROID_MAJOR) -DANDROID_MINOR=$(ANDROID_MINOR) -DANDROID_MICRO=$(ANDROID_MICRO) -Wno-unused-parameter
ifneq ($(CM_BUILD),)
LOCAL_CPPFLAGS += -DCM_BUILD
endif
ifneq ($(shell cat frameworks/native/services/surfaceflinger/SurfaceFlinger.h |grep getDisplayInfoEx),)
LOCAL_CPPFLAGS += -DUSE_SERVICES_VENDOR_EXTENSION
endif
LOCAL_MODULE := minisfservice
ifeq ($(shell test $(ANDROID_MAJOR) -le 11 && echo true),true)
ifeq ($(strip $(DROIDMEDIA_32)), true)
LOCAL_32_BIT_ONLY := true
endif
endif
include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := libminisf.cpp allocator.cpp
LOCAL_SHARED_LIBRARIES := libutils \
libbinder \
libmedia \
libgui \
libcutils \
libui
LOCAL_MODULE_TAGS := optional
LOCAL_CPPFLAGS := -DANDROID_MAJOR=$(ANDROID_MAJOR) -DANDROID_MINOR=$(ANDROID_MINOR) -DANDROID_MICRO=$(ANDROID_MICRO) -Wno-unused-parameter
ifneq ($(CM_BUILD),)
LOCAL_CPPFLAGS += -DCM_BUILD
endif
ifneq ($(shell cat frameworks/native/services/surfaceflinger/SurfaceFlinger.h |grep getDisplayInfoEx),)
LOCAL_CPPFLAGS += -DUSE_SERVICES_VENDOR_EXTENSION
endif
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),8 9))
LOCAL_SHARED_LIBRARIES += [email protected]
endif
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),10))
LOCAL_SHARED_LIBRARIES += [email protected]
endif
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),11))
LOCAL_SHARED_LIBRARIES += [email protected]
endif
ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),12 13))
LOCAL_SHARED_LIBRARIES += [email protected]
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 12 && echo true),true)
LOCAL_SHARED_LIBRARIES += libactivitymanager_aidl \
libbatterystats_aidl \
libmediautils \
libpermission
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 10 && echo true),true)
LOCAL_SHARED_LIBRARIES += [email protected] \
libsensorprivacy
LOCAL_AIDL_INCLUDES := frameworks/native/libs/sensorprivacy/aidl
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 8 && echo true),true)
LOCAL_SHARED_LIBRARIES += liblog \
libcamera_client \
libhidlbase \
libsensor \
ifeq ($(shell test $(ANDROID_MAJOR) -le 9 && echo true),true)
LOCAL_SHARED_LIBRARIES += libhidltransport \
libhwbinder
endif
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 9 && echo true),true)
LOCAL_SHARED_LIBRARIES += [email protected]
endif
ifeq ($(shell test $(ANDROID_MAJOR) -ge 12 && echo true),true)
LOCAL_C_INCLUDES += frameworks/native/libs/binder/include_activitymanager \
frameworks/native/libs/binder/include_batterystats \
frameworks/native/libs/binder/include_processinfo
endif
LOCAL_MODULE := libminisf
include $(BUILD_SHARED_LIBRARY)