Skip to content

Commit c8e17c2

Browse files
committed
Updating library to build all supported archs, also initialize uninitialized variables.
1 parent 7bf4885 commit c8e17c2

File tree

8 files changed

+22
-21
lines changed

8 files changed

+22
-21
lines changed

README.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ iLBC Android
33

44
[Internet low bitrate codec](http://en.wikipedia.org/wiki/Internet_Low_Bit_Rate_Codec). This is a swc that wraps the base functionality of the iLBC codec now maintained by google as part of the [WebRTC](http://www.webrtc.org/) project.
55

6-
Based loosely on an android version of iLBC at http://code.google.com/p/android-ilbc.
7-
86
Changes
9-
* Built based on webrtc code instead of rfc
10-
* Adds option to use noise supression from webrtc in the encode method.
11-
* Uses 30ms mode only.
7+
* Built based on webrtc trunk
8+
* Adds option to use noise supression from webrtc in the encode method
9+
* Uses 30ms mode only
1210

1311
Building
14-
* Download webrtc into jni directory. svn co http://webrtc.googlecode.com/svn/trunk jni/webrtc
15-
* Download the android NDK and run ndk-build in the root directory.
12+
* svn co http://webrtc.googlecode.com/svn/trunk jni/webrtc
13+
* Download the android NDK
14+
* ndk-build NDK_APPLICATION_MK=jni/Applicaiton.mk

jni/Android.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ARCH_ARM_HAVE_ARMV7A := true
2-
TARGET_ARCH := arm
2+
#TARGET_ARCH := arm
33

44
# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
55
#
@@ -19,7 +19,7 @@ LOCAL_PATH := $(ILBC_WRAPPER_MAIN_PATH)
1919
include $(CLEAR_VARS)
2020

2121

22-
LOCAL_ARM_MODE := arm
22+
#LOCAL_ARM_MODE := arm
2323
LOCAL_MODULE_TAGS := optional
2424

2525
LOCAL_SRC_FILES :=\

jni/Applicaiton.mk

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# ARMv7 is significanly faster due to the use of the hardware FPU
21
APP_STL := gnustl_static
3-
APP_ABI := armeabi armeabi-v7a
2+
APP_ABI := all
43
APP_OPTIM := release
5-
APP_BUILD_SCRIPT := /Users/lukeweber/iLBC-android-wrapper/jni/Android.mk
6-
# APP_CPPFLAGS += -fexceptions -frtti
4+
APP_CFLAGS := -Werror

jni/iLBC_codec.c

+12-8
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
#define LOG_TAG "iLBC_codec"
1111

1212
#include <android/log.h>
13-
#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
14-
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG , LOG_TAG, __VA_ARGS__)
15-
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO , LOG_TAG, __VA_ARGS__)
16-
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN , LOG_TAG, __VA_ARGS__)
13+
#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
14+
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG , LOG_TAG, __VA_ARGS__)
15+
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO , LOG_TAG, __VA_ARGS__)
16+
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN , LOG_TAG, __VA_ARGS__)
1717
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR , LOG_TAG, __VA_ARGS__)
1818

1919
#define JNI_COPY 0
@@ -65,7 +65,9 @@ jint Java_com_tuenti_androidilbc_Codec_encode(JNIEnv *env, jobject this,
6565
jsize src_size, dest_size;
6666
jbyte *src_bytes, *dest_bytes;
6767

68-
int bytes_remaining, bytes_encoded, bytes;
68+
int bytes_remaining = 0;
69+
int bytes_encoded = 0;
70+
int bytes = 0;
6971

7072
encoding = 1;
7173
if(Enc_Inst == NULL){
@@ -133,14 +135,16 @@ jint Java_com_tuenti_androidilbc_Codec_resetDecoder(JNIEnv *env, jobject this){
133135
return 1;
134136
}
135137

136-
jint Java_com_tuenti_androidilbc_Codec_decode(JNIEnv *env, jobject this,
138+
jint Java_com_tuenti_androidilbc_Codec_decode(JNIEnv *env, jobject this,
137139
jbyteArray src, jint src_offset, jint src_len, jbyteArray dest)
138140
{
139141
jsize src_size, dest_size;
140142
jbyte *src_bytes, *dest_bytes;
141143

142-
int bytes_remaining, bytes_decoded, num_samples;
143-
short speechType;
144+
int bytes_remaining = 0;
145+
int bytes_decoded = 0;
146+
int num_samples = 0;
147+
short speechType = 0;
144148

145149
src_size = (*env)->GetArrayLength(env, src);
146150
src_bytes = (*env)->GetByteArrayElements(env, src, JNI_COPY);

libs/armeabi-v7a/libiLBC_codec.so

2.52 KB
Binary file not shown.

libs/armeabi/libiLBC_codec.so

2.79 KB
Binary file not shown.

libs/mips/libiLBC_codec.so

143 KB
Binary file not shown.

libs/x86/libiLBC_codec.so

131 KB
Binary file not shown.

0 commit comments

Comments
 (0)