Android.mk 8.74 KB
Newer Older
jehan's avatar
jehan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
##
## Android.mk -Android build script-
##
##
## Copyright (C) 2010  Belledonne Communications, Grenoble, France
##
##  This program is free software; you can redistribute it and/or modify
##  it under the terms of the GNU General Public License as published by
##  the Free Software Foundation; either version 2 of the License, or
##  (at your option) any later version.
##
##  This program is distributed in the hope that it will be useful,
##  but WITHOUT ANY WARRANTY; without even the implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##  GNU Library General Public License for more details.
##
##  You should have received a copy of the GNU General Public License
##  along with this program; if not, write to the Free Software
##  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##

LOCAL_PATH:= $(call my-dir)/../../src
include $(CLEAR_VARS)

25

26
LOCAL_ARM_MODE := arm
27 28 29

MEDIASTREAMER2_INCLUDES := \
	$(LOCAL_PATH)/../build/android \
Ghislain MARY's avatar
Ghislain MARY committed
30 31 32 33 34 35
	$(LOCAL_PATH)/base \
	$(LOCAL_PATH)/utils \
	$(LOCAL_PATH)/voip \
	$(LOCAL_PATH)/audiofilters \
	$(LOCAL_PATH)/otherfilters \
	$(LOCAL_PATH)/videofilters \
36 37 38 39 40 41 42 43
	$(LOCAL_PATH)/../include \
	$(LOCAL_PATH)/../../oRTP \
	$(LOCAL_PATH)/../../oRTP/include \
	$(LOCAL_PATH)/../../../externals/speex/include \
	$(LOCAL_PATH)/../../../externals/build/speex \
	$(LOCAL_PATH)/../../../externals/gsm/inc \
	$(LOCAL_PATH)/../../../externals/ffmpeg \
	$(LOCAL_PATH)/../../../externals/ \
Ghislain MARY's avatar
Ghislain MARY committed
44
	$(LOCAL_PATH)/../../../externals/build/ffmpeg/$(TARGET_ARCH) \
45
	$(LOCAL_PATH)/../../../externals/libvpx/
Simon Morlat's avatar
Simon Morlat committed
46

jehan's avatar
jehan committed
47 48 49
LOCAL_MODULE := libmediastreamer2

LOCAL_SRC_FILES = \
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
	android/androidsound.cpp \
	android/androidsound_depr.cpp \
	android/androidsound_opensles.cpp \
	android/AudioRecord.cpp \
	android/AudioSystem.cpp \
	android/AudioTrack.cpp \
	android/hardware_echo_canceller.cpp \
	android/loader.cpp \
	android/String8.cpp \
	audiofilters/aac-eld-android.cpp \
	audiofilters/alaw.c \
	audiofilters/audiomixer.c \
	audiofilters/devices.c \
	audiofilters/dtmfgen.c \
	audiofilters/equalizer.c \
	audiofilters/flowcontrol.c \
	audiofilters/g711.c \
	audiofilters/genericplc.c \
	audiofilters/l16.c \
	audiofilters/msfileplayer.c \
	audiofilters/msfilerec.c \
	audiofilters/msg722.c \
	audiofilters/msresample.c \
	audiofilters/msvaddtx.c \
	audiofilters/msvolume.c \
	audiofilters/tonedetector.c \
	audiofilters/ulaw.c \
	base/eventqueue.c \
Ghislain MARY's avatar
Ghislain MARY committed
78
	base/mscommon.c \
79
	base/msfactory.c \
Ghislain MARY's avatar
Ghislain MARY committed
80 81 82
	base/msfilter.c \
	base/msqueue.c \
	base/mssndcard.c \
83
	base/msticker.c \
84
	base/msvideopresets.c \
Ghislain MARY's avatar
Ghislain MARY committed
85
	base/mswebcam.c \
86
	base/mtu.c \
Gautier Pelloux-Prayer's avatar
Gautier Pelloux-Prayer committed
87 88 89
	crypto/dtls_srtp.c \
	crypto/ms_srtp.c \
	crypto/zrtp.c \
90 91 92 93 94 95 96 97 98 99 100 101 102
	otherfilters/itc.c \
	otherfilters/join.c \
	otherfilters/msrtp.c \
	otherfilters/tee.c \
	otherfilters/void.c \
	utils/audiodiff.c \
	utils/dsptools.c \
	utils/g722_decode.c \
	utils/g722_encode.c \
	utils/kiss_fft.c \
	utils/kiss_fftr.c \
	utils/msjava.c \
	utils/stream_regulator.c \
Ghislain MARY's avatar
Ghislain MARY committed
103 104 105 106
	voip/audioconference.c \
	voip/audiostream.c \
	voip/bitratecontrol.c \
	voip/bitratedriver.c \
107 108
	voip/ice.c \
	voip/mediastream.c \
François Grisez's avatar
François Grisez committed
109
	voip/msmediaplayer.c \
110 111 112 113
	voip/msvoip.c \
	voip/qosanalyzer.c \
	voip/qualityindicator.c \
	voip/ringstream.c \
Gautier Pelloux-Prayer's avatar
Gautier Pelloux-Prayer committed
114
	voip/stun.c \
115
	voip/stun_udp.c
Yann Diorcet's avatar
Yann Diorcet committed
116

117
LOCAL_STATIC_LIBRARIES :=
jehan's avatar
jehan committed
118

119 120
LOCAL_CFLAGS += -D_XOPEN_SOURCE=600

jehan's avatar
jehan committed
121 122
##if BUILD_ALSA
ifeq ($(strip $(BOARD_USES_ALSA_AUDIO)),true)
Ghislain MARY's avatar
Ghislain MARY committed
123
LOCAL_SRC_FILES += audiofilters/alsa.c
jehan's avatar
jehan committed
124 125 126
LOCAL_CFLAGS += -D__ALSA_ENABLED__
endif

127 128
ifeq ($(BUILD_SRTP), 1)
	LOCAL_C_INCLUDES += $(SRTP_C_INCLUDE)
129
	LOCAL_CFLAGS += -DHAVE_SRTP
130 131
else

132 133
endif

jehan's avatar
jehan committed
134 135
LOCAL_STATIC_LIBRARIES += polarssl
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../../externals/polarssl/include
jehan's avatar
jehan committed
136
LOCAL_CFLAGS += -DHAVE_POLARSSL_SSL_H=1 -DHAVE_DTLS=1
jehan's avatar
jehan committed
137

Simon Morlat's avatar
Simon Morlat committed
138
ifeq ($(_BUILD_VIDEO),1)
Simon Morlat's avatar
Simon Morlat committed
139
LOCAL_SRC_FILES += \
140
	voip/video_preset_high_fps.c \
Ghislain MARY's avatar
Ghislain MARY committed
141
	voip/videostarter.c \
Ghislain MARY's avatar
Ghislain MARY committed
142 143
	voip/videostream.c \
	voip/rfc3984.c \
144
	voip/vp8rtpfmt.c \
Ghislain MARY's avatar
Ghislain MARY committed
145 146 147
	voip/layouts.c \
	utils/shaders.c \
	utils/opengles_display.c \
Simon Morlat's avatar
Simon Morlat committed
148
	utils/ffmpeg-priv.c \
Ghislain MARY's avatar
Ghislain MARY committed
149 150 151 152 153 154 155 156 157 158 159 160 161
	videofilters/videoenc.c \
	videofilters/videodec.c \
	videofilters/pixconv.c  \
	videofilters/sizeconv.c \
	videofilters/nowebcam.c \
	videofilters/h264dec.c \
	videofilters/mire.c \
	videofilters/vp8.c \
	videofilters/jpegwriter.c \
	android/android-display.c \
	android/android-display-bad.cpp \
	android/androidvideo.cpp \
	android/android-opengl-display.c
162 163

ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
164
	LOCAL_CFLAGS += -DVIDEO_ENABLED
165
LOCAL_SRC_FILES+= \
Ghislain MARY's avatar
Ghislain MARY committed
166 167 168 169
	voip/scaler.c.neon \
	voip/scaler_arm.S.neon \
	voip/msvideo.c \
	voip/msvideo_neon.c.neon
170
else
171 172 173
ifeq ($(TARGET_ARCH), x86)
	LOCAL_CFLAGS += -DVIDEO_ENABLED
endif
Yann Diorcet's avatar
Yann Diorcet committed
174 175 176 177
LOCAL_SRC_FILES+= \
	voip/scaler.c \
	voip/msvideo.c
endif
178 179

ifeq ($(BUILD_MATROSKA), 1)
180 181 182 183 184 185 186 187
LOCAL_CFLAGS += \
	-DHAVE_MATROSKA \
	-DCONFIG_EBML_WRITING \
	-DCONFIG_EBML_UNICODE \
	-DCONFIG_STDIO \
	-DCONFIG_FILEPOS_64 \
	-DNDEBUG

188
LOCAL_C_INCLUDES += \
189
	$(LOCAL_PATH)/../../../externals/libmatroska \
190 191 192
	$(LOCAL_PATH)/../../../externals/libmatroska/corec \
	$(LOCAL_PATH)/../../../externals/libmatroska/libebml2 \
	$(LOCAL_PATH)/../../../externals/libmatroska/libmatroska2
193 194

LOCAL_SRC_FILES += \
195
	utils/mkv_reader.c \
196
	videofilters/mkv.c
197

198

199 200 201
LOCAL_STATIC_LIBRARIES += \
	libmatroska2

202 203 204
endif #BUILD_MATROSKA

endif #_BUILD_VIDEO
Yann Diorcet's avatar
Yann Diorcet committed
205

206 207 208 209 210 211
ifeq ($(BUILD_NON_FREE_CODECS),1)
LOCAL_CFLAGS += -DHAVE_NON_FREE_CODECS=1
else
LOCAL_CFLAGS += -DHAVE_NON_FREE_CODECS=0
endif

jehan's avatar
jehan committed
212 213 214
ifeq ($(BUILD_OPUS),1)
LOCAL_CFLAGS += -DHAVE_OPUS
LOCAL_SRC_FILES += \
215
	audiofilters/msopus.c
jehan's avatar
jehan committed
216 217

LOCAL_C_INCLUDES += \
218
	$(LOCAL_PATH)/../../../externals/opus/include
jehan's avatar
jehan committed
219 220
endif

Yann Diorcet's avatar
Yann Diorcet committed
221 222 223 224 225 226 227 228 229 230 231 232 233
ifeq ($(BUILD_UPNP),1)
LOCAL_CFLAGS += -DBUILD_UPNP -DPTHREAD_MUTEX_RECURSIVE=PTHREAD_MUTEX_RECURSIVE
LOCAL_SRC_FILES += \
	upnp/upnp_igd.c \
	upnp/upnp_igd_cmd.c \
	upnp/upnp_igd_utils.c \

LOCAL_C_INCLUDES += \
	$(LOCAL_PATH)/../../../externals/build/libupnp/inc \
	$(LOCAL_PATH)/../../../externals/libupnp/upnp/inc \
        $(LOCAL_PATH)/../../../externals/libupnp/threadutil/inc \
	$(LOCAL_PATH)/../../../externals/libupnp/ixml/inc \

234
LOCAL_STATIC_LIBRARIES += libupnp
Yann Diorcet's avatar
Yann Diorcet committed
235

236
endif
jehan's avatar
jehan committed
237

Ghislain MARY's avatar
Ghislain MARY committed
238
#LOCAL_SRC_FILES += voip/videostream.c
jehan's avatar
jehan committed
239 240
#
##if BUILD_THEORA
Ghislain MARY's avatar
Ghislain MARY committed
241
#LOCAL_SRC_FILES += videofilters/theora.c
jehan's avatar
jehan committed
242 243 244

#if BUILD_SPEEX
LOCAL_SRC_FILES += \
Ghislain MARY's avatar
Ghislain MARY committed
245 246
	audiofilters/msspeex.c \
	audiofilters/speexec.c
jehan's avatar
jehan committed
247 248

##if BUILD_GSM
Ghislain MARY's avatar
Ghislain MARY committed
249
LOCAL_SRC_FILES += audiofilters/gsm.c
jehan's avatar
jehan committed
250 251 252 253

LOCAL_CFLAGS += \
	-UHAVE_CONFIG_H \
	-include $(LOCAL_PATH)/../build/android/libmediastreamer2_AndroidConfig.h \
254
	-DMS2_INTERNAL \
Ghislain MARY's avatar
Ghislain MARY committed
255
	-DMS2_FILTERS \
256 257
	-D_POSIX_SOURCE \
	-Wall -Werror -Wno-error=strict-aliasing -Wuninitialized
jehan's avatar
jehan committed
258

Simon Morlat's avatar
Simon Morlat committed
259
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
260
	LOCAL_CFLAGS += -DUSE_HARDWARE_RATE=1
Simon Morlat's avatar
Simon Morlat committed
261 262 263
endif


jehan's avatar
jehan committed
264 265 266
#LOCAL_CFLAGS += -DDEBUG

LOCAL_C_INCLUDES += \
267
	$(MEDIASTREAMER2_INCLUDES)
jehan's avatar
jehan committed
268

Yann Diorcet's avatar
Yann Diorcet committed
269
LOCAL_STATIC_LIBRARIES += \
jehan's avatar
jehan committed
270
	libortp \
271 272
	libspeex \
	libspeexdsp
Simon Morlat's avatar
Simon Morlat committed
273

274 275
ifeq ($(BUILD_ZRTP), 1)
LOCAL_STATIC_LIBRARIES += libbzrtp
276
LOCAL_CFLAGS += -DHAVE_ZRTP
277 278 279
LOCAL_C_INCLUDES += $(ZRTP_C_INCLUDE)
endif #ZRTP

280 281 282 283
ifneq ($(BUILD_WEBRTC_AECM)$(BUILD_WEBRTC_ISAC), 00)
LOCAL_CFLAGS += -DHAVE_WEBRTC
LOCAL_STATIC_LIBRARIES += libmswebrtc
endif
284

285
ifneq ($(BUILD_WEBRTC_AECM), 0)
Ghislain MARY's avatar
Ghislain MARY committed
286 287 288 289 290 291 292 293 294 295 296 297
LOCAL_STATIC_LIBRARIES += \
	libwebrtc_aecm \
	libwebrtc_apm_utility \
	libwebrtc_spl \
	libwebrtc_system_wrappers
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
LOCAL_STATIC_LIBRARIES += \
	libwebrtc_aecm_neon \
	libwebrtc_spl_neon
endif
endif

298
ifneq ($(BUILD_WEBRTC_ISAC), 0)
299
LOCAL_STATIC_LIBRARIES += libwebrtc_spl libwebrtc_isacfix
300 301
endif

jehan's avatar
jehan committed
302 303 304 305 306

ifeq ($(strip $(BOARD_USES_ALSA_AUDIO)),true)
LOCAL_SHARED_LIBRARIES += libasound
endif

307
LOCAL_STATIC_LIBRARIES += cpufeatures
jehan's avatar
jehan committed
308

309
ifeq ($(BUILD_MEDIASTREAMER2_SDK), 1)
310
	LOCAL_SRC_FILES += \
Sylvain Berfini's avatar
Sylvain Berfini committed
311
		../tools/common.c \
Ghislain MARY's avatar
Ghislain MARY committed
312
		../tools/mediastream.c
313

314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332
	ifneq ($(_BUILD_AMR), 0)
		LOCAL_CFLAGS += -DHAVE_AMR
		LOCAL_STATIC_LIBRARIES += libmsamr libopencoreamr
	endif
	ifneq ($(BUILD_AMRWB), 0)
		LOCAL_STATIC_LIBRARIES += libvoamrwbenc
	endif
	ifeq ($(BUILD_SILK),1)
		LOCAL_CFLAGS += -DHAVE_SILK
		LOCAL_STATIC_LIBRARIES += libmssilk
	endif
	LOCAL_STATIC_LIBRARIES += libgsm
	ifeq ($(BUILD_OPUS),1)
		LOCAL_STATIC_LIBRARIES += libopus
	endif
	ifeq ($(BUILD_G729),1)
		LOCAL_CFLAGS += -DHAVE_G729
		LOCAL_STATIC_LIBRARIES += libbcg729 libmsbcg729
	endif
333 334 335 336
	ifeq ($(BUILD_CODEC2),1)
		LOCAL_CFLAGS += -DHAVE_CODEC2
		LOCAL_STATIC_LIBRARIES += libcodec2 libmscodec2
	endif
Simon Morlat's avatar
Simon Morlat committed
337
	ifeq ($(_BUILD_VIDEO),1)
338 339 340 341
		LOCAL_STATIC_LIBRARIES += libvpx
		ifeq ($(BUILD_X264),1)
			LOCAL_STATIC_LIBRARIES += libmsx264 libx264
		endif
342
		ifeq ($(BUILD_OPENH264),1)
343
			LOCAL_STATIC_LIBRARIES += libmsopenh264 libopenh264
344
		endif
345
		LOCAL_SHARED_LIBRARIES += \
Sylvain Berfini's avatar
Sylvain Berfini committed
346
			libffmpeg-linphone
347
		LOCAL_LDLIBS += -lGLESv2
348
	endif
349
	ifeq ($(BUILD_SRTP),1)
350 351 352 353 354
		LOCAL_SHARED_LIBRARIES += libsrtp
	endif
	ifeq ($(BUILD_GPLV3_ZRTP),1)
		LOCAL_SHARED_LIBRARIES += libssl-linphone libcrypto-linphone
		LOCAL_SHARED_LIBRARIES += libzrtpcpp
355 356
	endif

357
	LOCAL_LDLIBS += -llog -ldl
358
	LOCAL_MODULE_FILENAME := libmediastreamer2-$(TARGET_ARCH_ABI)
359 360 361 362
	include $(BUILD_SHARED_LIBRARY)
else
	include $(BUILD_STATIC_LIBRARY)
endif
363 364
LOCAL_CPPFLAGS = $(LOCAL_CLFAGS)
LOCAL_CFLAGS += -Wdeclaration-after-statement
jehan's avatar
jehan committed
365

366
$(call import-module,android/cpufeatures)
Sylvain Berfini's avatar
Sylvain Berfini committed
367