Skip to content
This repository has been archived by the owner on Apr 5, 2019. It is now read-only.

Commit

Permalink
everything is compiling and running fine, including the speex codec
Browse files Browse the repository at this point in the history
  • Loading branch information
fcecagno committed Aug 30, 2011
1 parent 6f9e4a0 commit 8ec6d8a
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 31 deletions.
1 change: 1 addition & 0 deletions jni/Android.mk
Expand Up @@ -88,6 +88,7 @@ include $(BUILD_SHARED_LIBRARY)

SILK := silk
LOCAL_MODULE := silkcommon
LOCAL_MODULE_FILENAME := silkcommon
LOCAL_SRC_FILES := $(SILK)/src/SKP_Silk_A2NLSF.c \
$(SILK)/src/SKP_Silk_CNG.c \
$(SILK)/src/SKP_Silk_HP_variable_cutoff_FIX.c \
Expand Down
2 changes: 1 addition & 1 deletion jni/Application.mk
@@ -1,4 +1,4 @@
APP_PROJECT_PATH := $(call my-dir)
#APP_PROJECT_PATH := $(call my-dir)
APP_MODULES := OSNetworkSystem
APP_MODULES += speex_jni
APP_MODULES += bv16_jni
Expand Down
Binary file added libs/armeabi/libOSNetworkSystem.so
Binary file not shown.
Binary file added libs/armeabi/libbv16_jni.so
Binary file not shown.
Binary file added libs/armeabi/libg722_jni.so
Binary file not shown.
Binary file added libs/armeabi/libgsm_jni.so
Binary file not shown.
Binary file added libs/armeabi/libspeex_jni.so
Binary file not shown.
2 changes: 1 addition & 1 deletion src/org/sipdroid/codecs/Codecs.java
Expand Up @@ -95,7 +95,7 @@ public class Codecs {
* according to the user */
if (c != null) {
codecs.remove(c);
codecs.add(c);
codecs.insertElementAt(c, 0);
}
} catch (Exception e) {
// do nothing (expecting
Expand Down
8 changes: 6 additions & 2 deletions src/org/sipdroid/media/RtpStreamReceiver.java
Expand Up @@ -163,8 +163,12 @@ public int speaker(int mode) {
setMode(speakermode = mode);
setCodec();
restoreVolume();
if (mode == AudioManager.MODE_NORMAL && Thread.currentThread().getName().equals("main"))
Toast.makeText(Receiver.mContext, R.string.help_speakerphone, Toast.LENGTH_LONG).show();
/**
* Modified by the Mconf team
* we don't want to show a toast everytime the user enables the loudspeaker
*/
// if (mode == AudioManager.MODE_NORMAL && Thread.currentThread().getName().equals("main"))
// Toast.makeText(Receiver.mContext, R.string.help_speakerphone, Toast.LENGTH_LONG).show();
return old;
}

Expand Down
35 changes: 30 additions & 5 deletions src/org/sipdroid/media/RtpStreamSender.java
Expand Up @@ -81,8 +81,12 @@ public class RtpStreamSender extends Thread {
int sync_adj = 0;

/** Whether it is running */
boolean running = false;
boolean muted = false;
boolean running = false;
/**
* Modified by the Mconf team
* the sender begins muted
*/
boolean muted = true;

//DTMF change
String dtmf = "";
Expand Down Expand Up @@ -303,6 +307,11 @@ public void run() {
} else {
if (frame_size == 960) frame_size = 320;
if (frame_size == 1024) frame_size *= 2;
/**
* Modified by the Mconf team
* this parameter is to avoid the log message "RecordThread: buffer overflow"
*/
min *= 2;
}
frame_rate = p_type.codec.samp_rate()/frame_size;
long frame_period = 1000 / frame_rate;
Expand Down Expand Up @@ -353,14 +362,30 @@ record = null;
if (muted || Receiver.call_state == UserAgent.UA_STATE_HOLD) {
if (Receiver.call_state == UserAgent.UA_STATE_HOLD)
RtpStreamReceiver.restoreMode();
record.stop();
record.stop();
/**
* Modified by the Mconf team
* record must be released after stop
*/
record.release();
record = null;
while (running && (muted || Receiver.call_state == UserAgent.UA_STATE_HOLD)) {
try {
sleep(1000);
/**
* Modified by the Mconf team
* the sleep time is reduced
*/
// sleep(1000);
sleep(50);
} catch (InterruptedException e1) {
}
}
record.startRecording();
/**
* Modified by the Mconf team
* instead of start recording here, it will go back to the beginning loop
*/
// record.startRecording();
continue;
}
//DTMF change start
if (dtmf.length() != 0) {
Expand Down
70 changes: 48 additions & 22 deletions src/org/zoolu/tools/Log.java
Expand Up @@ -95,12 +95,16 @@ public Log(PrintStream out_stream, String log_tag, int verbose_level) {
*/
public Log(String file_name, String log_tag, int verbose_level) {
PrintStream os = null;
if (verbose_level > 0) {
try {
os = new PrintStream(new FileOutputStream(file_name));
} catch (IOException e) {
e.printStackTrace();
}
if (verbose_level > 0) {
/**
* Modified by the Mconf team
* removed the log in a file
*/
// try {
// os = new PrintStream(new FileOutputStream(file_name));
// } catch (IOException e) {
// e.printStackTrace();
// }
init(os, log_tag, verbose_level, MAX_SIZE);
}
}
Expand All @@ -114,11 +118,15 @@ public Log(String file_name, String log_tag, int verbose_level,
long max_size) {
PrintStream os = null;
if (verbose_level > 0) {
try {
os = new PrintStream(new FileOutputStream(file_name));
} catch (IOException e) {
e.printStackTrace();
}
/**
* Modified by the Mconf team
* removed the log in a file
*/
// try {
// os = new PrintStream(new FileOutputStream(file_name));
// } catch (IOException e) {
// e.printStackTrace();
// }
init(os, log_tag, verbose_level, max_size);
} else {
init(null, log_tag, 0, 0);
Expand All @@ -135,11 +143,15 @@ public Log(String file_name, String log_tag, int verbose_level,
long max_size, boolean append) {
PrintStream os = null;
if (verbose_level > 0) {
try {
os = new PrintStream(new FileOutputStream(file_name, append));
} catch (IOException e) {
e.printStackTrace();
}
/**
* Modified by the Mconf team
* removed the log in a file
*/
// try {
// os = new PrintStream(new FileOutputStream(file_name, append));
// } catch (IOException e) {
// e.printStackTrace();
// }
init(os, log_tag, verbose_level, max_size);
} else {
init(null, log_tag, 0, 0);
Expand Down Expand Up @@ -167,8 +179,12 @@ protected void init(PrintStream out_stream, String log_tag,

/** Flushes */
protected Log flush() {
if (verbose_level > 0)
out_stream.flush();
/**
* Modified by the Mconf team
* removed the log in a file
*/
// if (verbose_level > 0)
// out_stream.flush();
return this;
}

Expand All @@ -177,7 +193,11 @@ protected Log flush() {
/** Closes the log */
public void close() {
do_log = false;
out_stream.close();
/**
* Modified by the Mconf team
* removed the log in a file
*/
// out_stream.close();
}

/** Logs the Exception */
Expand Down Expand Up @@ -230,10 +250,16 @@ public Log print(String message) {
*/
public Log print(String message, int level) {
if (do_log && level <= verbose_level) {
/**
* Modified by the Mconf team
* removed the log in a file
*/
if (log_tag != null)
out_stream.print(log_tag + ": " + message);
android.util.Log.d(log_tag, message);
// out_stream.print(log_tag + ": " + message);
else
out_stream.print(message);
android.util.Log.d("sipdroid", message);
// out_stream.print(message);

if (max_size >= 0) {
counter += tag_size + message.length();
Expand All @@ -247,4 +273,4 @@ public Log print(String message, int level) {
return this;
}

}
}

0 comments on commit 8ec6d8a

Please sign in to comment.