diff --git a/.gitmodules b/.gitmodules
index 7a386560f..a6fbc5c56 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -49,3 +49,6 @@
[submodule "submodules/mssilk"]
path = submodules/mssilk
url = git://git.linphone.org/mssilk.git
+[submodule "submodules/externals/vo-amrwbenc"]
+ path = submodules/externals/vo-amrwbenc
+ url = git://opencore-amr.git.sourceforge.net/gitroot/opencore-amr/vo-amrwbenc
diff --git a/README b/README
index 9d01b6ad4..bef6b6f95 100644
--- a/README
+++ b/README
@@ -13,10 +13,11 @@ To build liblinphone for Android, you must:
Some options can be passed to ndk-build, like "ndk-build SOME_OPTION=SOME_VALUE"
-Option Name | Possible values
----------------------------------------------------------------------------------
-BUILD_X264 0 (don't build x264) or 1 (build x264)
-BUILD_AMR 0 (don't build amr codec), light (try to use amr codec from android), full (build your own amr codec)
+Option Name | Possible values | Default value
+-------------------------------------------------------------------------------------------------------------------------------------------------------
+BUILD_X264 0 (don't build x264) or 1 (build x264)
+BUILD_AMRNB 0 (don't build amrnb codec), light (try to use amrnb codec from android), full (build your own amrnb codec) | light
+BUILD_AMRWB 0 (don't build amrwb codec), 1 (build your own amrwb codec) | 1
BUILD_GPLV3_ZRTP 0 (don't support ZRTP), 1 (support ZRTP and make the whole program GPLv3)
BUILD_SILK 0 (don't build silk plugin), 1 (build silk) [silk is Skype nonfree patented audio codec]
BUILD_TUNNEL 0 (don't build tunnel), 1 (build tunnel) [requires a tunnel implementation in submodules/linphone/tunnel]
diff --git a/jni/Android.mk b/jni/Android.mk
index 95fd7fd3f..b87084102 100755
--- a/jni/Android.mk
+++ b/jni/Android.mk
@@ -1,8 +1,15 @@
# script expect linphone-root-dir variable to be set by parent !
#default values
-BUILD_AMR=light
+ifeq ($(BUILD_AMRNB),)
+BUILD_AMRNB=light
+endif
+ifeq ($(BUILD_AMRWB),)
+BUILD_AMRWB=0
+endif
+ifeq ($(BUILD_AMRWB),)
BUILD_SRTP=1
+endif
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
BUILD_X264=1
@@ -13,7 +20,6 @@ BUILD_X264=0
endif
-
##ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
ifeq ($(BUILD_GPLV3_ZRTP), 1)
BUILD_SRTP=1
@@ -112,7 +118,20 @@ endif
include $(linphone-root-dir)/submodules/linphone/build/android/Android.mk
-ifneq ($(BUILD_AMR), 0)
+_BUILD_AMR=0
+ifneq ($(BUILD_AMRNB), 0)
+_BUILD_AMR=1
+endif
+
+ifneq ($(BUILD_AMRWB), 0)
+_BUILD_AMR=1
+endif
+
+ifneq ($(_BUILD_AMR), 0)
include $(linphone-root-dir)/submodules/externals/build/opencore-amr/Android.mk
include $(linphone-root-dir)/submodules/msamr/Android.mk
endif
+
+ifneq ($(BUILD_AMRWB), 0)
+include $(linphone-root-dir)/submodules/externals/build/vo-amrwbenc/Android.mk
+endif
diff --git a/jni/Application.mk b/jni/Application.mk
index bd23bae2a..5f1397cba 100644
--- a/jni/Application.mk
+++ b/jni/Application.mk
@@ -2,14 +2,38 @@ APP_PROJECT_PATH := $(call my-dir)/../
APP_MODULES :=libspeex libgsm libortp libosip2 libeXosip2 libmediastreamer2 liblinphone
APP_STL := stlport_static
+#default values
+ifeq ($(BUILD_AMRNB),)
+BUILD_AMRNB=light
+endif
+ifeq ($(BUILD_AMRWB),)
+BUILD_AMRWB=0
+endif
+ifeq ($(BUILD_AMRWB),)
+BUILD_SRTP=1
+endif
+
ifeq ($(LINPHONE_VIDEO),1)
APP_MODULES += libavutil libavcore libavcodec libswscale libvpx
endif
-ifeq ($(BUILD_AMR),1)
+_BUILD_AMR=0
+ifneq ($(BUILD_AMRNB), 0)
+_BUILD_AMR=1
+endif
+
+ifneq ($(BUILD_AMRWB), 0)
+_BUILD_AMR=1
+endif
+
+ifneq ($(_BUILD_AMR), 0)
APP_MODULES += libopencoreamr libmsamr
endif
+ifneq ($(BUILD_AMRWB), 0)
+APP_MODULES += libvoamrwbenc
+endif
+
ifeq ($(BUILD_X264),1)
APP_MODULES +=libx264 libmsx264
endif
diff --git a/res/values/non_localizable_strings.xml b/res/values/non_localizable_strings.xml
index 0bf0c07b6..f152b64c5 100644
--- a/res/values/non_localizable_strings.xml
+++ b/res/values/non_localizable_strings.xml
@@ -55,6 +55,7 @@
pref_codec_gsm_key
pref_codec_g722_key
pref_codec_amr_key
+ pref_codec_amrwb_key
pref_codec_ilbc_key
pref_codec_speex8_key
pref_codec_speex16_key
diff --git a/res/values/strings.xml b/res/values/strings.xml
index fc549ffa6..14fe29bf1 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -150,6 +150,7 @@
gsm
g722
amr
+ amr-wb
ilbc
speex 8 Khz
speex 16 Khz
diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml
index 476ed1b69..caa02b9fe 100644
--- a/res/xml/preferences.xml
+++ b/res/xml/preferences.xml
@@ -77,6 +77,10 @@
android:title="@string/pref_codec_amr"
android:defaultValue="true"
android:shouldDisableView="true" />
+