Fix g729 codec enabling.
This commit is contained in:
parent
0c6723c721
commit
13cb131329
1 changed files with 20 additions and 20 deletions
|
@ -581,22 +581,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
|
||||||
|
@ -768,15 +768,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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue