add ilbc
This commit is contained in:
parent
17853e10d7
commit
d3f39b9e34
9 changed files with 101 additions and 78 deletions
66
.project
66
.project
|
@ -1,33 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>linphone-android</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>linphone-android</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
BIN
libs/armeabi-v7a/liblinphone.so
Normal file
BIN
libs/armeabi-v7a/liblinphone.so
Normal file
Binary file not shown.
Binary file not shown.
|
@ -30,6 +30,7 @@ ringer_dev_id=ANDROID SND: Android Sound card
|
|||
capture_dev_id=ANDROID SND: Android Sound card
|
||||
remote_ring=/data/data/org.linphone/files/ringback.wav
|
||||
local_ring=/data/data/org.linphone/files/oldphone_mono.wav
|
||||
ec_delay=200
|
||||
ec_delay=250
|
||||
ec_tail_len=300
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="pref_ilbc_summary">ILBC codec not avalaible on old phone</string>
|
||||
<string name="pref_echo_cancellation">Echo cancellation</string>
|
||||
<string name="pref_echo_cancellation_key">pref_echo_cancellation_key</string>
|
||||
<string name="pref_handle_outcall_summarry">If set cellular call are redirected to voip when possible</string>
|
||||
|
@ -52,7 +53,7 @@
|
|||
<string name="yes">Yes</string>
|
||||
<string name="no">No</string>
|
||||
<string name="never_remind">Never remind me</string>
|
||||
<string name="config_error">%s, do you want to return to the settings page ?</string>
|
||||
<string name="config_error">%s, do you want to go to the settings page ?</string>
|
||||
<string name="initial_config_error">No initial config found, do you want to return to the settings page ?</string>
|
||||
<string name="warning_already_incall">Cannot initiate a new call because a call is already engaged</string>
|
||||
<string name="tab_history">History</string>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<CheckBoxPreference android:key="@string/pref_codec_speex16_key"
|
||||
android:title="@string/pref_codec_speex16" android:defaultValue="true"></CheckBoxPreference>
|
||||
<CheckBoxPreference android:key="@string/pref_codec_speex8_key"
|
||||
android:title="@string/pref_codec_speex8" android:defaultValue="true"></CheckBoxPreference>
|
||||
android:title="@string/pref_codec_speex8" android:defaultValue="true"></CheckBoxPreference><CheckBoxPreference android:key="@string/pref_codec_ilbc_key" android:title="@string/pref_codec_ilbc" android:enabled="false" android:shouldDisableView="true" android:defaultValue="true"></CheckBoxPreference>
|
||||
<!-- CheckBoxPreference android:key="@string/pref_codec_ilbc_key"
|
||||
android:title="@string/pref_codec_ilbc" android:enabled="true"></CheckBoxPreference-->
|
||||
<CheckBoxPreference android:key="@string/pref_codec_gsm_key"
|
||||
|
@ -25,7 +25,7 @@
|
|||
android:title="@string/pref_codec_pcmu" android:defaultValue="true"></CheckBoxPreference>
|
||||
<CheckBoxPreference android:key="@string/pref_codec_pcma_key"
|
||||
android:title="@string/pref_codec_pcma" android:defaultValue="true"></CheckBoxPreference>
|
||||
</PreferenceScreen><CheckBoxPreference android:title="@string/pref_autostart" android:defaultValue="true" android:key="@string/pref_autostart_key"></CheckBoxPreference>
|
||||
</PreferenceScreen><CheckBoxPreference android:title="@string/pref_autostart" android:key="@string/pref_autostart_key" android:defaultValue="false"></CheckBoxPreference>
|
||||
<CheckBoxPreference android:title="@string/pref_handle_outcall" android:key="@string/pref_handle_outcall_key" android:summary="@string/pref_handle_outcall_summarry"></CheckBoxPreference><CheckBoxPreference android:key="@string/pref_echo_cancellation_key" android:title="@string/pref_echo_cancellation"></CheckBoxPreference><EditTextPreference android:title="@string/pref_prefix"
|
||||
android:key="@string/pref_prefix_key"></EditTextPreference>
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
package org.linphone;
|
||||
|
||||
|
||||
import android.os.Build;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.util.Log;
|
||||
|
@ -29,8 +29,23 @@ public class LinphonePreferencesActivity extends PreferenceActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
boolean enableIlbc=false;
|
||||
if (LinphoneService.isready()) {
|
||||
enableIlbc = LinphoneService.instance().getLinphoneCore().findPayloadType("iLBC", 8000)!=null?true:false;;
|
||||
if (enableIlbc && !getPreferenceManager().getSharedPreferences().contains(getString(R.string.pref_echo_cancellation_key))) {
|
||||
getPreferenceManager().getSharedPreferences().edit().putBoolean(getString(R.string.pref_echo_cancellation_key), true).commit();
|
||||
}
|
||||
if (!enableIlbc) {
|
||||
getPreferenceManager().getSharedPreferences().edit().putBoolean(getString(R.string.pref_codec_ilbc_key), false).commit();
|
||||
}
|
||||
|
||||
}
|
||||
// Load the preferences from an XML resource
|
||||
addPreferencesFromResource(R.xml.preferences);
|
||||
if (enableIlbc) {
|
||||
getPreferenceScreen().findPreference(getString(R.string.pref_codec_ilbc_key)).setEnabled(enableIlbc);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -92,7 +92,7 @@ public class LinphoneService extends Service implements LinphoneCoreListener {
|
|||
super.onCreate();
|
||||
theLinphone = this;
|
||||
|
||||
mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
mNotification = new Notification(R.drawable.status_level
|
||||
, ""
|
||||
, System.currentTimeMillis());
|
||||
|
@ -254,7 +254,49 @@ public class LinphoneService extends Service implements LinphoneCoreListener {
|
|||
boolean lIsDebug = mPref.getBoolean(getString(R.string.pref_debug_key), false);
|
||||
LinphoneCoreFactory.instance().setDebugMode(lIsDebug);
|
||||
|
||||
|
||||
try {
|
||||
//codec config
|
||||
PayloadType lPt = mLinphoneCore.findPayloadType("speex", 32000);
|
||||
if (lPt !=null) {
|
||||
boolean enable= mPref.getBoolean(getString(R.string.pref_codec_speex32_key),false);
|
||||
mLinphoneCore.enablePayloadType(lPt, enable);
|
||||
}
|
||||
lPt = mLinphoneCore.findPayloadType("speex", 16000);
|
||||
if (lPt !=null) {
|
||||
boolean enable= mPref.getBoolean(getString(R.string.pref_codec_speex16_key),false);
|
||||
mLinphoneCore.enablePayloadType(lPt, enable);
|
||||
}
|
||||
lPt = mLinphoneCore.findPayloadType("speex", 8000);
|
||||
if (lPt !=null) {
|
||||
boolean enable= mPref.getBoolean(getString(R.string.pref_codec_speex8_key),false);
|
||||
mLinphoneCore.enablePayloadType(lPt, enable);
|
||||
}
|
||||
lPt = mLinphoneCore.findPayloadType("iLBC", 8000);
|
||||
if (lPt !=null) {
|
||||
boolean enable= mPref.getBoolean(getString(R.string.pref_codec_ilbc_key),false);
|
||||
mLinphoneCore.enablePayloadType(lPt, enable);
|
||||
}
|
||||
lPt = mLinphoneCore.findPayloadType("GSM", 8000);
|
||||
if (lPt !=null) {
|
||||
boolean enable= mPref.getBoolean(getString(R.string.pref_codec_gsm_key),false);
|
||||
mLinphoneCore.enablePayloadType(lPt, enable);
|
||||
}
|
||||
lPt = mLinphoneCore.findPayloadType("PCMU", 8000);
|
||||
if (lPt !=null) {
|
||||
boolean enable= mPref.getBoolean(getString(R.string.pref_codec_pcmu_key),false);
|
||||
mLinphoneCore.enablePayloadType(lPt, enable);
|
||||
}
|
||||
lPt = mLinphoneCore.findPayloadType("PCMA", 8000);
|
||||
if (lPt !=null) {
|
||||
boolean enable= mPref.getBoolean(getString(R.string.pref_codec_pcma_key),false);
|
||||
mLinphoneCore.enablePayloadType(lPt, enable);
|
||||
}
|
||||
|
||||
|
||||
mLinphoneCore.enableEchoCancellation(mPref.getBoolean(getString(R.string.pref_echo_cancellation_key),false));
|
||||
} catch (LinphoneCoreException e) {
|
||||
throw new LinphoneConfigException(getString(R.string.wrong_settings),e);
|
||||
}
|
||||
//1 read proxy config from preferences
|
||||
String lUserName = mPref.getString(getString(R.string.pref_username_key), null);
|
||||
if (lUserName == null || lUserName.length()==0) {
|
||||
|
@ -316,43 +358,7 @@ public class LinphoneService extends Service implements LinphoneCoreListener {
|
|||
|
||||
}
|
||||
|
||||
//codec config
|
||||
PayloadType lPt = mLinphoneCore.findPayloadType("speex", 32000);
|
||||
if (lPt !=null) {
|
||||
boolean enable= mPref.getBoolean(getString(R.string.pref_codec_speex32_key),false);
|
||||
mLinphoneCore.enablePayloadType(lPt, enable);
|
||||
}
|
||||
lPt = mLinphoneCore.findPayloadType("speex", 16000);
|
||||
if (lPt !=null) {
|
||||
boolean enable= mPref.getBoolean(getString(R.string.pref_codec_speex16_key),false);
|
||||
mLinphoneCore.enablePayloadType(lPt, enable);
|
||||
}
|
||||
lPt = mLinphoneCore.findPayloadType("speex", 8000);
|
||||
if (lPt !=null) {
|
||||
boolean enable= mPref.getBoolean(getString(R.string.pref_codec_speex8_key),false);
|
||||
mLinphoneCore.enablePayloadType(lPt, enable);
|
||||
}
|
||||
lPt = mLinphoneCore.findPayloadType("GSM", 8000);
|
||||
if (lPt !=null) {
|
||||
boolean enable= mPref.getBoolean(getString(R.string.pref_codec_gsm_key),false);
|
||||
mLinphoneCore.enablePayloadType(lPt, enable);
|
||||
}
|
||||
lPt = mLinphoneCore.findPayloadType("PCMU", 8000);
|
||||
if (lPt !=null) {
|
||||
boolean enable= mPref.getBoolean(getString(R.string.pref_codec_pcmu_key),false);
|
||||
mLinphoneCore.enablePayloadType(lPt, enable);
|
||||
}
|
||||
lPt = mLinphoneCore.findPayloadType("PCMA", 8000);
|
||||
if (lPt !=null) {
|
||||
boolean enable= mPref.getBoolean(getString(R.string.pref_codec_pcma_key),false);
|
||||
mLinphoneCore.enablePayloadType(lPt, enable);
|
||||
}
|
||||
|
||||
if (!mPref.contains(getString(R.string.pref_echo_cancellation_key)) && Integer.parseInt(Build.VERSION.SDK) > 4 /*donuts*/) {
|
||||
mPref.edit().putBoolean(getString(R.string.pref_echo_cancellation_key), true).commit();
|
||||
}
|
||||
|
||||
mLinphoneCore.enableEchoCancellation(mPref.getBoolean(getString(R.string.pref_echo_cancellation_key),false));
|
||||
|
||||
|
||||
//init network state
|
||||
ConnectivityManager lConnectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 94fdd26f225d63a2be2fb2bb1ef4e27275431ac7
|
||||
Subproject commit 94b38f943d37072154c55094ed2a6d7b4cecbe0e
|
Loading…
Reference in a new issue