diff --git a/.gitmodules b/.gitmodules
index 0b37b3c3e..88ea29f34 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -46,3 +46,6 @@
[submodule "submodules/externals/srtp"]
path = submodules/externals/srtp
url = git://git.linphone.org/srtp.git
+[submodule "submodules/mssilk"]
+ path = submodules/mssilk
+ url = git://git.linphone.org/mssilk.git
diff --git a/README b/README
index 159a833c5..9ac244430 100644
--- a/README
+++ b/README
@@ -18,6 +18,7 @@ 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)
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]
diff --git a/jni/Android.mk b/jni/Android.mk
index 8f2ed924d..b2218a002 100755
--- a/jni/Android.mk
+++ b/jni/Android.mk
@@ -61,11 +61,17 @@ include $(linphone-root-dir)/submodules/linphone/mediastreamer2/build/android/An
include $(linphone-root-dir)/submodules/linphone/mediastreamer2/tests/Android.mk
+ifeq ($(BUILD_SILK), 1)
+$(info Build proprietary SILK plugin for mediastreamer2)
+include $(linphone-root-dir)/submodules/mssilk/Android.mk
+endif
+
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
include $(linphone-root-dir)/submodules/msilbc/Android.mk
ifeq ($(BUILD_X264), 1)
+$(info Build X264 plugin for mediastreamer2)
include $(linphone-root-dir)/submodules/msx264/Android.mk
ifeq ($(wildcard $(linphone-root-dir)/submodules/externals/prebuilts/x264.mk),)
include $(linphone-root-dir)/submodules/externals/build/x264/Android.mk
@@ -74,7 +80,6 @@ include $(linphone-root-dir)/submodules/externals/prebuilts/x264.mk
endif
endif
-
ifeq ($(wildcard $(linphone-root-dir)/submodules/externals/prebuilts/ffmpeg.mk),)
include $(linphone-root-dir)/submodules/externals/build/ffmpeg/Android.mk
else
@@ -86,6 +91,7 @@ endif #armeabi-v7a
ifeq ($(BUILD_GPLV3_ZRTP), 1)
+$(info Build ZRTP support - makes application GPLv3)
ifeq ($(wildcard $(linphone-root-dir)/submodules/externals/prebuilts/zrtpcpp.mk),)
include $(linphone-root-dir)/submodules/externals/build/libzrtpcpp/Android.mk
else
diff --git a/jni/Application.mk b/jni/Application.mk
index 9eb68e381..88e0e64f0 100644
--- a/jni/Application.mk
+++ b/jni/Application.mk
@@ -22,6 +22,10 @@ ifeq ($(BUILD_X264),1)
APP_MODULES +=libx264 libmsx264
endif
+ifeq ($(BUILD_SILK),1)
+APP_MODULES +=libmssilk
+endif
+
ifeq ($(RING),yes)
APP_MODULES += libring
endif
@@ -40,5 +44,6 @@ linphone-root-dir:=$(APP_PROJECT_PATH)
APP_BUILD_SCRIPT:=$(call my-dir)/Android.mk
APP_PLATFORM := android-8
+#APP_ABI := armeabi-v7a
APP_ABI := armeabi-v7a armeabi
APP_CFLAGS:=-DDISABLE_NEON
diff --git a/prepare_sources.sh b/prepare_sources.sh
index 93ecd83c8..bb3aab619 100755
--- a/prepare_sources.sh
+++ b/prepare_sources.sh
@@ -8,11 +8,13 @@ if test -z "`git status | grep neon`" ; then
cd $topdir
patch -p0 < ${topdir}/patches/ffmpeg_scalar_product_remove_alignment_hints.patch
fi
-cd $topdir
-cd submodules/libilbc-rfc3951 && ./autogen.sh && ./configure && make || ( echo "iLBC prepare stage failed" ; exit 1 )
+cd $topdir/submodules/libilbc-rfc3951 && ./autogen.sh && ./configure && make || ( echo "iLBC prepare stage failed" ; exit 1 )
cd $topdir/submodules/externals/build/libvpx && ./asm_conversion.sh && cp *.asm *.h ../../libvpx/ || ( echo "VP8 prepare stage failed." ; exit 1 )
+cd $topdir/submodules/mssilk && ./autogen.sh && ./configure && cd downloads && make || ( echo "SILK audio plugin prepare state failed." ; exit 1 )
+
+
# As a memo, the config.h for zrtpcpp is generated using the command
# cmake -Denable-ccrtp=false submodules/externals/libzrtpcpp
diff --git a/res/values/non_localizable_strings.xml b/res/values/non_localizable_strings.xml
index 082eb68c6..cd385b680 100644
--- a/res/values/non_localizable_strings.xml
+++ b/res/values/non_localizable_strings.xml
@@ -42,6 +42,10 @@
pref_codec_speex8_key
pref_codec_speex16_key
pref_codec_speex32_key
+ pref_codec_silk8_key
+ pref_codec_silk12_key
+ pref_codec_silk16_key
+ pref_codec_silk24_key
pref_codecs_key
pref_stun_server_key
pref_video_codec_vp8_key
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 3cf5e0c86..e8c7d15f4 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -130,6 +130,10 @@
ilbc
speex 8 Khz
speex 16 Khz
+ silk 8 Khz
+ silk 12 Khz
+ silk 16 Khz
+ silk 24 Khz
Codecs
Place a call
Debug
diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml
index b6f689f0c..7e19d07b9 100644
--- a/res/xml/preferences.xml
+++ b/res/xml/preferences.xml
@@ -66,6 +66,14 @@
+
+
+
+