Merge branch 'newUI' of git.linphone.org:linphone-android into newUI

This commit is contained in:
Sylvain Berfini 2012-08-28 12:16:39 +02:00
commit a7ed31eac2
4 changed files with 44 additions and 44 deletions

View file

@ -617,19 +617,19 @@ public final class LinphoneManager implements LinphoneCoreListener {
if (!proxy.startsWith("sip:")) { if (!proxy.startsWith("sip:")) {
proxy = "sip:" + proxy; proxy = "sip:" + proxy;
} }
LinphoneProxyConfig defaultProxyConfig = LinphoneCoreFactory.instance().createProxyConfig(identity, proxy, null, true); LinphoneProxyConfig proxycon = LinphoneCoreFactory.instance().createProxyConfig(identity, proxy, null, true);
mLc.addProxyConfig(defaultProxyConfig); mLc.addProxyConfig(proxycon);
//outbound proxy //outbound proxy
if (getPrefBoolean(getString(R.string.pref_enable_outbound_proxy_key) + key, false)) { if (getPrefBoolean(getString(R.string.pref_enable_outbound_proxy_key) + key, false)) {
defaultProxyConfig.setRoute(proxy); proxycon.setRoute(proxy);
} else { } else {
defaultProxyConfig.setRoute(null); proxycon.setRoute(null);
} }
defaultProxyConfig.done(); proxycon.done();
if (defaultAccount) { if (defaultAccount) {
mLc.setDefaultProxyConfig(defaultProxyConfig); mLc.setDefaultProxyConfig(proxycon);
} }
} }
} }
@ -648,22 +648,22 @@ public final class LinphoneManager implements LinphoneCoreListener {
try { try {
// Configure audio codecs // Configure audio codecs
// enableDisableAudioCodec("speex", 32000, R.string.pref_codec_speex32_key); // enableDisableAudioCodec("speex", 32000, 1, R.string.pref_codec_speex32_key);
enableDisableAudioCodec("speex", 32000, false); enableDisableAudioCodec("speex", 32000, 1, false);
enableDisableAudioCodec("speex", 16000, R.string.pref_codec_speex16_key); enableDisableAudioCodec("speex", 16000, 1, R.string.pref_codec_speex16_key);
enableDisableAudioCodec("speex", 8000, R.string.pref_codec_speex8_key); enableDisableAudioCodec("speex", 8000, 1, R.string.pref_codec_speex8_key);
enableDisableAudioCodec("iLBC", 8000, R.string.pref_codec_ilbc_key); enableDisableAudioCodec("iLBC", 8000, 1, R.string.pref_codec_ilbc_key);
enableDisableAudioCodec("GSM", 8000, R.string.pref_codec_gsm_key); enableDisableAudioCodec("GSM", 8000, 1, R.string.pref_codec_gsm_key);
enableDisableAudioCodec("G722", 8000, R.string.pref_codec_g722_key); enableDisableAudioCodec("G722", 8000, 1, R.string.pref_codec_g722_key);
enableDisableAudioCodec("G729", 8000, R.string.pref_codec_g729_key); enableDisableAudioCodec("G729", 8000, 1, R.string.pref_codec_g729_key);
enableDisableAudioCodec("PCMU", 8000, R.string.pref_codec_pcmu_key); enableDisableAudioCodec("PCMU", 8000, 1, R.string.pref_codec_pcmu_key);
enableDisableAudioCodec("PCMA", 8000, R.string.pref_codec_pcma_key); enableDisableAudioCodec("PCMA", 8000, 1, R.string.pref_codec_pcma_key);
enableDisableAudioCodec("AMR", 8000, R.string.pref_codec_amr_key); enableDisableAudioCodec("AMR", 8000, 1, R.string.pref_codec_amr_key);
enableDisableAudioCodec("AMR-WB", 16000, R.string.pref_codec_amrwb_key); enableDisableAudioCodec("AMR-WB", 16000, 1, R.string.pref_codec_amrwb_key);
enableDisableAudioCodec("SILK", 24000, R.string.pref_codec_silk24_key); enableDisableAudioCodec("SILK", 24000, 1, R.string.pref_codec_silk24_key);
enableDisableAudioCodec("SILK", 16000, R.string.pref_codec_silk16_key); enableDisableAudioCodec("SILK", 16000, 1, R.string.pref_codec_silk16_key);
enableDisableAudioCodec("SILK", 12000, R.string.pref_codec_silk12_key); enableDisableAudioCodec("SILK", 12000, 1, R.string.pref_codec_silk12_key);
enableDisableAudioCodec("SILK", 8000, R.string.pref_codec_silk8_key); enableDisableAudioCodec("SILK", 8000, 1, R.string.pref_codec_silk8_key);
// Configure video codecs // Configure video codecs
@ -744,15 +744,15 @@ public final class LinphoneManager implements LinphoneCoreListener {
mLc.setSignalingTransportPorts(ports); mLc.setSignalingTransportPorts(ports);
} }
private void enableDisableAudioCodec(String codec, int rate, int key) throws LinphoneCoreException { private void enableDisableAudioCodec(String codec, int rate, int channels, int key) throws LinphoneCoreException {
PayloadType pt = mLc.findPayloadType(codec, rate); PayloadType pt = mLc.findPayloadType(codec, rate, channels);
if (pt !=null) { if (pt !=null) {
boolean enable= getPrefBoolean(key,false); boolean enable= getPrefBoolean(key,false);
mLc.enablePayloadType(pt, enable); mLc.enablePayloadType(pt, enable);
} }
} }
private void enableDisableAudioCodec(String codec, int rate, boolean enable) throws LinphoneCoreException { private void enableDisableAudioCodec(String codec, int rate, int channels, boolean enable) throws LinphoneCoreException {
PayloadType pt = mLc.findPayloadType(codec, rate); PayloadType pt = mLc.findPayloadType(codec, rate, channels);
if (pt !=null) { if (pt !=null) {
mLc.enablePayloadType(pt, enable); mLc.enablePayloadType(pt, enable);
} }
@ -1122,19 +1122,19 @@ public final class LinphoneManager implements LinphoneCoreListener {
e.putBoolean(getString(pref_codec_speex32_key), fastCpu); e.putBoolean(getString(pref_codec_speex32_key), fastCpu);
boolean ilbc = LinphoneService.isReady() && LinphoneManager.getLc() boolean ilbc = LinphoneService.isReady() && LinphoneManager.getLc()
.findPayloadType("iLBC", 8000)!=null; .findPayloadType("iLBC", 8000, 1)!=null;
e.putBoolean(getString(pref_codec_ilbc_key), ilbc); e.putBoolean(getString(pref_codec_ilbc_key), ilbc);
boolean amr = LinphoneService.isReady() && LinphoneManager.getLc() boolean amr = LinphoneService.isReady() && LinphoneManager.getLc()
.findPayloadType("AMR", 8000)!=null; .findPayloadType("AMR", 8000, 1)!=null;
e.putBoolean(getString(pref_codec_amr_key), amr); e.putBoolean(getString(pref_codec_amr_key), amr);
boolean amrwb = LinphoneService.isReady() && LinphoneManager.getLc() boolean amrwb = LinphoneService.isReady() && LinphoneManager.getLc()
.findPayloadType("AMR-WB", 16000)!=null; .findPayloadType("AMR-WB", 16000, 1)!=null;
e.putBoolean(getString(pref_codec_amrwb_key), amrwb); e.putBoolean(getString(pref_codec_amrwb_key), amrwb);
boolean g729 = LinphoneService.isReady() && LinphoneManager.getLc() boolean g729 = LinphoneService.isReady() && LinphoneManager.getLc()
.findPayloadType("G729", 8000)!=null; .findPayloadType("G729", 8000, 1)!=null;
e.putBoolean(getString(R.string.pref_codec_g729_key), g729); e.putBoolean(getString(R.string.pref_codec_g729_key), g729);
if (Version.sdkStrictlyBelow(5) || !Version.hasNeon() || !Hacks.hasCamera()) { if (Version.sdkStrictlyBelow(5) || !Version.hasNeon() || !Hacks.hasCamera()) {

View file

@ -85,8 +85,8 @@ public class PreferencesActivity extends LinphonePreferencesActivity implements
return (CheckBoxPreference) findPreference(getString(key)); return (CheckBoxPreference) findPreference(getString(key));
} }
private void detectAudioCodec(int id, String mime, int rate, boolean hide) { private void detectAudioCodec(int id, String mime, int rate, int channels, boolean hide) {
boolean enable = LinphoneService.isReady() && LinphoneManager.getLc().findPayloadType(mime, rate)!=null; boolean enable = LinphoneService.isReady() && LinphoneManager.getLc().findPayloadType(mime, rate, channels)!=null;
Preference cb = findPreference(id); Preference cb = findPreference(id);
cb.setEnabled(enable); cb.setEnabled(enable);
if (hide && !enable) { if (hide && !enable) {
@ -241,7 +241,7 @@ public class PreferencesActivity extends LinphonePreferencesActivity implements
boolean fastCpu = Version.hasFastCpu(); boolean fastCpu = Version.hasFastCpu();
if (fastCpu) { if (fastCpu) {
detectAudioCodec(pref_codec_ilbc_key, "iLBC", 8000, false); detectAudioCodec(pref_codec_ilbc_key, "iLBC", 8000, 1, false);
findPreference(pref_codec_speex16_key).setEnabled(true); findPreference(pref_codec_speex16_key).setEnabled(true);
//findPreference(pref_codec_speex32_key)).setEnabled(enableIlbc); //findPreference(pref_codec_speex32_key)).setEnabled(enableIlbc);
} }
@ -249,13 +249,13 @@ public class PreferencesActivity extends LinphonePreferencesActivity implements
initializeMediaEncryptionPreferences(); initializeMediaEncryptionPreferences();
detectAudioCodec(pref_codec_amr_key,"AMR", 8000, false); detectAudioCodec(pref_codec_amr_key,"AMR", 8000, 1, false);
detectAudioCodec(pref_codec_amrwb_key,"AMR-WB", 16000, false); detectAudioCodec(pref_codec_amrwb_key,"AMR-WB", 16000, 1, false);
//detectAudioCodec(R.string.pref_codec_silk8_key,"SILK",8000, true); //detectAudioCodec(R.string.pref_codec_silk8_key,"SILK",8000, 1, true);
//detectAudioCodec(R.string.pref_codec_silk12_key,"SILK",12000, true); //detectAudioCodec(R.string.pref_codec_silk12_key,"SILK",12000, 1, true);
detectAudioCodec(R.string.pref_codec_silk16_key,"SILK",16000, true); detectAudioCodec(R.string.pref_codec_silk16_key,"SILK",16000, 1, true);
detectAudioCodec(R.string.pref_codec_silk24_key,"SILK",24000, true); detectAudioCodec(R.string.pref_codec_silk24_key,"SILK",24000, 1, true);
detectAudioCodec(R.string.pref_codec_g729_key,"G729",8000, true); detectAudioCodec(R.string.pref_codec_g729_key,"G729",8000, 1, true);
// No video // No video
if (!Version.isVideoCapable()) { if (!Version.isVideoCapable()) {

View file

@ -56,7 +56,7 @@ class LinphoneCoreImpl implements LinphoneCore {
private native void sendDtmf(long nativePtr,char dtmf); private native void sendDtmf(long nativePtr,char dtmf);
private native void clearCallLogs(long nativePtr); private native void clearCallLogs(long nativePtr);
private native boolean isMicMuted(long nativePtr); private native boolean isMicMuted(long nativePtr);
private native long findPayloadType(long nativePtr, String mime, int clockRate); private native long findPayloadType(long nativePtr, String mime, int clockRate, int channels);
private native int enablePayloadType(long nativePtr, long payloadType, boolean enable); private native int enablePayloadType(long nativePtr, long payloadType, boolean enable);
private native void enableEchoCancellation(long nativePtr,boolean enable); private native void enableEchoCancellation(long nativePtr,boolean enable);
private native boolean isEchoCancellationEnabled(long nativePtr); private native boolean isEchoCancellationEnabled(long nativePtr);
@ -255,9 +255,9 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized boolean isMicMuted() { public synchronized boolean isMicMuted() {
return isMicMuted(nativePtr); return isMicMuted(nativePtr);
} }
public synchronized PayloadType findPayloadType(String mime, int clockRate) { public synchronized PayloadType findPayloadType(String mime, int clockRate, int channels) {
isValid(); isValid();
long playLoadType = findPayloadType(nativePtr, mime, clockRate); long playLoadType = findPayloadType(nativePtr, mime, clockRate, channels);
if (playLoadType == 0) { if (playLoadType == 0) {
return null; return null;
} else { } else {

@ -1 +1 @@
Subproject commit 29100967ae8e680a2de6ce6a6ac2743ad1a1d904 Subproject commit 976711219328335b36d21c3f3d233a8efce170e6