- Moved audio settings to its own activity.
- Added AEC Extented Filter audio setting.
This commit is contained in:
@@ -83,6 +83,12 @@
|
|||||||
android:label="@string/configuration"
|
android:label="@string/configuration"
|
||||||
android:parentActivityName=".MainActivity" >
|
android:parentActivityName=".MainActivity" >
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".AudioActivity"
|
||||||
|
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||||
|
android:label="@string/audio"
|
||||||
|
android:parentActivityName=".ConfigActivity" >
|
||||||
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".CallsActivity"
|
android:name=".CallsActivity"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ opus_inbandfec yes
|
|||||||
opus_application voip
|
opus_application voip
|
||||||
opus_stereo no
|
opus_stereo no
|
||||||
opus_sprop_stereo no
|
opus_sprop_stereo no
|
||||||
|
webrtc_aec_extended_filter yes
|
||||||
ice_turn no
|
ice_turn no
|
||||||
ice_nomination regular
|
ice_nomination regular
|
||||||
zrtp_hash yes
|
zrtp_hash yes
|
||||||
|
|||||||
@@ -0,0 +1,253 @@
|
|||||||
|
package com.tutpro.baresip
|
||||||
|
|
||||||
|
import android.graphics.Color
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.util.TypedValue
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.Menu
|
||||||
|
import android.view.MenuItem
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.*
|
||||||
|
|
||||||
|
class AudioActivity : AppCompatActivity() {
|
||||||
|
|
||||||
|
internal lateinit var opusBitRate: EditText
|
||||||
|
internal lateinit var opusPacketLoss: EditText
|
||||||
|
internal lateinit var aec: CheckBox
|
||||||
|
internal lateinit var extentedFilter: CheckBox
|
||||||
|
|
||||||
|
private var save = false
|
||||||
|
private var reload = false
|
||||||
|
private var oldAudioModules = mutableMapOf<String, Boolean>()
|
||||||
|
private var oldOpusBitrate = ""
|
||||||
|
private var oldOpusPacketLoss = ""
|
||||||
|
private var oldAec = false
|
||||||
|
private var oldExtendedFilter = false
|
||||||
|
private val audioModules = listOf("opus", "amr", "ilbc", "g722", "g7221", "g726", "g711")
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
setContentView(R.layout.activity_audio)
|
||||||
|
|
||||||
|
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||||
|
|
||||||
|
val audioModulesList = findViewById(R.id.AudioModulesList) as LinearLayout
|
||||||
|
var id = 1000
|
||||||
|
for (module in audioModules) {
|
||||||
|
val rl = RelativeLayout(this)
|
||||||
|
val rlParams = RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
|
||||||
|
RelativeLayout.LayoutParams.WRAP_CONTENT)
|
||||||
|
rlParams.marginStart = 16
|
||||||
|
rl.layoutParams = rlParams
|
||||||
|
val tv = TextView(this)
|
||||||
|
tv.id = id++
|
||||||
|
val tvParams = RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
|
||||||
|
RelativeLayout.LayoutParams.WRAP_CONTENT)
|
||||||
|
tvParams.addRule(RelativeLayout.ALIGN_PARENT_START)
|
||||||
|
tvParams.addRule(RelativeLayout.CENTER_VERTICAL)
|
||||||
|
tvParams.addRule(RelativeLayout.START_OF, id)
|
||||||
|
tv.layoutParams = tvParams
|
||||||
|
tv.text = "\u2022 $module"
|
||||||
|
tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18f)
|
||||||
|
tv.setTextColor(Color.BLACK)
|
||||||
|
rl.addView(tv)
|
||||||
|
val cb = CheckBox(this)
|
||||||
|
cb.id = id++
|
||||||
|
val cbParams = RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
|
||||||
|
RelativeLayout.LayoutParams.WRAP_CONTENT)
|
||||||
|
cbParams.addRule(RelativeLayout.ALIGN_PARENT_END)
|
||||||
|
cbParams.addRule(RelativeLayout.CENTER_VERTICAL)
|
||||||
|
cb.layoutParams = cbParams
|
||||||
|
cb.gravity = Gravity.END
|
||||||
|
cb.isChecked = Config.variable("module $module.so").size > 0
|
||||||
|
oldAudioModules.put(module, cb.isChecked)
|
||||||
|
rl.addView(cb)
|
||||||
|
audioModulesList.addView(rl)
|
||||||
|
}
|
||||||
|
|
||||||
|
opusBitRate = findViewById(R.id.OpusBitRate) as EditText
|
||||||
|
val obCv = Config.variable("opus_bitrate")
|
||||||
|
oldOpusBitrate = if (obCv.size == 0) "28000" else obCv[0]
|
||||||
|
opusBitRate.setText(oldOpusBitrate)
|
||||||
|
|
||||||
|
opusPacketLoss = findViewById(R.id.OpusPacketLoss) as EditText
|
||||||
|
val oplCv = Config.variable("opus_packet_loss")
|
||||||
|
oldOpusPacketLoss = if (oplCv.size == 0) "0" else oplCv[0]
|
||||||
|
opusPacketLoss.setText(oldOpusPacketLoss)
|
||||||
|
|
||||||
|
aec = findViewById(R.id.Aec) as CheckBox
|
||||||
|
val aecCv = Config.variable("module")
|
||||||
|
oldAec = aecCv.contains("webrtc_aec.so")
|
||||||
|
aec.isChecked = oldAec
|
||||||
|
|
||||||
|
extentedFilter = findViewById(R.id.ExtendedFilter) as CheckBox
|
||||||
|
oldExtendedFilter = Config.variable("webrtc_aec_extended_filter")[0] == "yes"
|
||||||
|
extentedFilter.isChecked = oldExtendedFilter
|
||||||
|
|
||||||
|
Utils.addActivity("audio")
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||||
|
|
||||||
|
super.onCreateOptionsMenu(menu)
|
||||||
|
val inflater = menuInflater
|
||||||
|
inflater.inflate(R.menu.check_icon, menu)
|
||||||
|
return true
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
|
|
||||||
|
if (BaresipService.activities.indexOf("audio") == -1)
|
||||||
|
return true
|
||||||
|
|
||||||
|
when (item.itemId) {
|
||||||
|
|
||||||
|
R.id.checkIcon -> {
|
||||||
|
|
||||||
|
var id = 1001
|
||||||
|
for (module in audioModules) {
|
||||||
|
val box = findViewById<CheckBox>(id++)
|
||||||
|
if (box.isChecked && !oldAudioModules[module]!!) {
|
||||||
|
if (Api.module_load("$module.so") != 0) {
|
||||||
|
Utils.alertView(this, getString(R.string.error),
|
||||||
|
"${getString(R.string.failed_to_load_module)}: $module.so")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
Config.addLine("module $module.so")
|
||||||
|
save = true
|
||||||
|
}
|
||||||
|
if (!box.isChecked && oldAudioModules[module]!!) {
|
||||||
|
Api.module_unload("$module.so")
|
||||||
|
Config.removeLine("module $module.so")
|
||||||
|
for (ua in UserAgent.uas()) ua.account.removeAudioCodecs(module)
|
||||||
|
AccountsActivity.saveAccounts()
|
||||||
|
save = true
|
||||||
|
}
|
||||||
|
id++
|
||||||
|
}
|
||||||
|
|
||||||
|
val opusBitRate = opusBitRate.text.toString().trim()
|
||||||
|
if (opusBitRate != oldOpusBitrate) {
|
||||||
|
if (!checkOpusBitRate(opusBitRate)) {
|
||||||
|
Utils.alertView(this, getString(R.string.notice),
|
||||||
|
"${getString(R.string.invalid_opus_bitrate)}: $opusBitRate.")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
Config.removeVariable("opus_bitrate")
|
||||||
|
Config.addLine("opus_bitrate $opusBitRate")
|
||||||
|
reload = true
|
||||||
|
save = true
|
||||||
|
}
|
||||||
|
|
||||||
|
val opusPacketLoss = opusPacketLoss.text.toString().trim()
|
||||||
|
if (opusPacketLoss != oldOpusPacketLoss) {
|
||||||
|
if (!checkOpusPacketLoss(opusPacketLoss)) {
|
||||||
|
Utils.alertView(this, getString(R.string.notice),
|
||||||
|
"${getString(R.string.invalid_opus_packet_loss)}: $opusPacketLoss")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
Config.removeVariable("opus_inbandfec")
|
||||||
|
Config.removeVariable("opus_packet_loss")
|
||||||
|
if (opusPacketLoss != "0") {
|
||||||
|
Config.addLine("opus_inbandfec yes")
|
||||||
|
Config.addLine("opus_packet_loss $opusPacketLoss")
|
||||||
|
}
|
||||||
|
reload = true
|
||||||
|
save = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aec.isChecked != oldAec) {
|
||||||
|
Config.removeLine("module webrtc_aec.so")
|
||||||
|
if (aec.isChecked) {
|
||||||
|
Config.addLine("module webrtc_aec.so")
|
||||||
|
if (Api.module_load("webrtc_aec.so") != 0) {
|
||||||
|
Utils.alertView(this, getString(R.string.error),
|
||||||
|
getString(R.string.failed_to_load_module))
|
||||||
|
aec.isChecked = false
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Api.module_unload("webrtc_aec.so")
|
||||||
|
}
|
||||||
|
save = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (extentedFilter.isChecked != oldExtendedFilter) {
|
||||||
|
Config.removeVariable("webrtc_aec_extended_filter")
|
||||||
|
if (extentedFilter.isChecked)
|
||||||
|
Config.addLine("webrtc_aec_extended_filter yes")
|
||||||
|
else
|
||||||
|
Config.addLine("webrtc_aec_extended_filter no")
|
||||||
|
reload = true
|
||||||
|
save = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (save) Config.save()
|
||||||
|
|
||||||
|
if (reload) Api.reload_config()
|
||||||
|
|
||||||
|
BaresipService.activities.remove("audio")
|
||||||
|
finish()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
android.R.id.home -> {
|
||||||
|
onBackPressed()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBackPressed() {
|
||||||
|
BaresipService.activities.remove("audio")
|
||||||
|
finish()
|
||||||
|
super.onBackPressed()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onClick(v: View) {
|
||||||
|
when (v) {
|
||||||
|
findViewById(R.id.AudioModulesTitle) as TextView -> {
|
||||||
|
Utils.alertView(this, getString(R.string.audio_modules_title),
|
||||||
|
getString(R.string.audio_modules_help))
|
||||||
|
}
|
||||||
|
findViewById(R.id.OpusBitRateTitle) as TextView-> {
|
||||||
|
Utils.alertView(this, getString(R.string.opus_bit_rate),
|
||||||
|
getString(R.string.opus_bit_rate_help))
|
||||||
|
}
|
||||||
|
findViewById(R.id.OpusPacketLossTitle) as TextView-> {
|
||||||
|
Utils.alertView(this, getString(R.string.opus_packet_loss),
|
||||||
|
getString(R.string.opus_packet_loss_help))
|
||||||
|
}
|
||||||
|
findViewById(R.id.AecTitle) as TextView-> {
|
||||||
|
Utils.alertView(this, getString(R.string.aec),
|
||||||
|
getString(R.string.aec_help))
|
||||||
|
}
|
||||||
|
findViewById(R.id.ExtendedFilterTitle) as TextView-> {
|
||||||
|
Utils.alertView(this, getString(R.string.aec),
|
||||||
|
getString(R.string.aec_extented_filter_help))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun checkOpusBitRate(opusBitRate: String): Boolean {
|
||||||
|
val number = opusBitRate.toIntOrNull()
|
||||||
|
if (number == null) return false
|
||||||
|
return (number >= 6000) && (number <= 510000)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun checkOpusPacketLoss(opusPacketLoss: String): Boolean {
|
||||||
|
val number = opusPacketLoss.toIntOrNull()
|
||||||
|
if (number == null) return false
|
||||||
|
return (number >= 0) && (number <= 100)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -47,6 +47,10 @@ object Config {
|
|||||||
config = "${config}opus_sprop_stereo no\n"
|
config = "${config}opus_sprop_stereo no\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!config.contains("webrtc_aec_extended_filter")) {
|
||||||
|
config = "${config}webrtc_aec_extended_filter yes\n"
|
||||||
|
}
|
||||||
|
|
||||||
if (!config.contains("log_level")) {
|
if (!config.contains("log_level")) {
|
||||||
config = "${config}log_level 2\n"
|
config = "${config}log_level 2\n"
|
||||||
Log.logLevel = Log.LogLevel.WARN
|
Log.logLevel = Log.LogLevel.WARN
|
||||||
|
|||||||
@@ -22,9 +22,6 @@ class ConfigActivity : AppCompatActivity() {
|
|||||||
internal lateinit var dnsServers: EditText
|
internal lateinit var dnsServers: EditText
|
||||||
internal lateinit var certificateFile: CheckBox
|
internal lateinit var certificateFile: CheckBox
|
||||||
internal lateinit var caFile: CheckBox
|
internal lateinit var caFile: CheckBox
|
||||||
internal lateinit var aec: CheckBox
|
|
||||||
internal lateinit var opusBitRate: EditText
|
|
||||||
internal lateinit var opusPacketLoss: EditText
|
|
||||||
internal lateinit var debug: CheckBox
|
internal lateinit var debug: CheckBox
|
||||||
internal lateinit var reset: CheckBox
|
internal lateinit var reset: CheckBox
|
||||||
|
|
||||||
@@ -33,15 +30,10 @@ class ConfigActivity : AppCompatActivity() {
|
|||||||
private var oldDnsServers = ""
|
private var oldDnsServers = ""
|
||||||
private var oldCertificateFile = false
|
private var oldCertificateFile = false
|
||||||
private var oldCAFile = false
|
private var oldCAFile = false
|
||||||
private var oldAudioModules = mutableMapOf<String, Boolean>()
|
|
||||||
private var oldAec = false
|
|
||||||
private var oldOpusBitrate = ""
|
|
||||||
private var oldOpusPacketLoss = ""
|
|
||||||
private var oldLogLevel = ""
|
private var oldLogLevel = ""
|
||||||
private var callVolume = BaresipService.callVolume
|
private var callVolume = BaresipService.callVolume
|
||||||
private var save = false
|
private var save = false
|
||||||
private var restart = false
|
private var restart = false
|
||||||
private val audioModules = listOf("opus", "amr", "ilbc", "g722", "g7221", "g726", "g711")
|
|
||||||
private var menu: Menu? = null
|
private var menu: Menu? = null
|
||||||
|
|
||||||
private val READ_CERT_PERMISSION_CODE = 1
|
private val READ_CERT_PERMISSION_CODE = 1
|
||||||
@@ -84,52 +76,6 @@ class ConfigActivity : AppCompatActivity() {
|
|||||||
oldCAFile = Config.variable("sip_cafile").isNotEmpty()
|
oldCAFile = Config.variable("sip_cafile").isNotEmpty()
|
||||||
caFile.isChecked = oldCAFile
|
caFile.isChecked = oldCAFile
|
||||||
|
|
||||||
val audioModulesList = findViewById(R.id.AudioModulesList) as LinearLayout
|
|
||||||
var id = 1000
|
|
||||||
for (module in audioModules) {
|
|
||||||
val rl = RelativeLayout(this)
|
|
||||||
val rlParams = LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)
|
|
||||||
rlParams.marginStart = 16
|
|
||||||
rl.layoutParams = rlParams
|
|
||||||
val tv = TextView(this)
|
|
||||||
tv.id = id++
|
|
||||||
val tvParams = LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)
|
|
||||||
tvParams.addRule(RelativeLayout.ALIGN_PARENT_START)
|
|
||||||
tvParams.addRule(RelativeLayout.CENTER_VERTICAL)
|
|
||||||
tvParams.addRule(RelativeLayout.START_OF, id)
|
|
||||||
tv.layoutParams = tvParams
|
|
||||||
tv.text = "\u2022 $module"
|
|
||||||
tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18f)
|
|
||||||
tv.setTextColor(Color.BLACK)
|
|
||||||
rl.addView(tv)
|
|
||||||
val cb = CheckBox(this)
|
|
||||||
cb.id = id++
|
|
||||||
val cbParams = LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)
|
|
||||||
cbParams.addRule(RelativeLayout.ALIGN_PARENT_END)
|
|
||||||
cbParams.addRule(RelativeLayout.CENTER_VERTICAL)
|
|
||||||
cb.layoutParams = cbParams
|
|
||||||
cb.gravity = Gravity.END
|
|
||||||
cb.isChecked = Config.variable("module $module.so").size > 0
|
|
||||||
oldAudioModules.put(module, cb.isChecked)
|
|
||||||
rl.addView(cb)
|
|
||||||
audioModulesList.addView(rl)
|
|
||||||
}
|
|
||||||
|
|
||||||
aec = findViewById(R.id.Aec) as CheckBox
|
|
||||||
val aecCv = Config.variable("module")
|
|
||||||
oldAec = aecCv.contains("webrtc_aec.so")
|
|
||||||
aec.isChecked = oldAec
|
|
||||||
|
|
||||||
opusBitRate = findViewById(R.id.OpusBitRate) as EditText
|
|
||||||
val obCv = Config.variable("opus_bitrate")
|
|
||||||
oldOpusBitrate = if (obCv.size == 0) "28000" else obCv[0]
|
|
||||||
opusBitRate.setText(oldOpusBitrate)
|
|
||||||
|
|
||||||
opusPacketLoss = findViewById(R.id.OpusPacketLoss) as EditText
|
|
||||||
val oplCv = Config.variable("opus_packet_loss")
|
|
||||||
oldOpusPacketLoss = if (oplCv.size == 0) "0" else oplCv[0]
|
|
||||||
opusPacketLoss.setText(oldOpusPacketLoss)
|
|
||||||
|
|
||||||
val callVolSpinner = findViewById(R.id.VolumeSpinner) as Spinner
|
val callVolSpinner = findViewById(R.id.VolumeSpinner) as Spinner
|
||||||
val volKeys = arrayListOf("None", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
|
val volKeys = arrayListOf("None", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
|
||||||
val volVals = arrayListOf(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
|
val volVals = arrayListOf(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
|
||||||
@@ -280,73 +226,6 @@ class ConfigActivity : AppCompatActivity() {
|
|||||||
restart = true
|
restart = true
|
||||||
}
|
}
|
||||||
|
|
||||||
var id = 1001
|
|
||||||
for (module in audioModules) {
|
|
||||||
val box = findViewById<CheckBox>(id++)
|
|
||||||
if (box.isChecked && !oldAudioModules[module]!!) {
|
|
||||||
if (Api.module_load("$module.so") != 0) {
|
|
||||||
Utils.alertView(this, getString(R.string.error),
|
|
||||||
"${getString(R.string.failed_to_load_module)}: $module.so")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
Config.addLine("module $module.so")
|
|
||||||
save = true
|
|
||||||
}
|
|
||||||
if (!box.isChecked && oldAudioModules[module]!!) {
|
|
||||||
Api.module_unload("$module.so")
|
|
||||||
Config.removeLine("module $module.so")
|
|
||||||
for (ua in UserAgent.uas()) ua.account.removeAudioCodecs(module)
|
|
||||||
AccountsActivity.saveAccounts()
|
|
||||||
save = true
|
|
||||||
}
|
|
||||||
id++
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aec.isChecked != oldAec) {
|
|
||||||
Config.removeLine("module webrtc_aec.so")
|
|
||||||
if (aec.isChecked) {
|
|
||||||
Config.addLine("module webrtc_aec.so")
|
|
||||||
if (Api.module_load("webrtc_aec.so") != 0) {
|
|
||||||
Utils.alertView(this, getString(R.string.error),
|
|
||||||
getString(R.string.failed_to_load_module))
|
|
||||||
aec.isChecked = false
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Api.module_unload("webrtc_aec.so")
|
|
||||||
}
|
|
||||||
save = true
|
|
||||||
}
|
|
||||||
|
|
||||||
val opusBitRate = opusBitRate.text.toString().trim()
|
|
||||||
if (opusBitRate != oldOpusBitrate) {
|
|
||||||
if (!checkOpusBitRate(opusBitRate)) {
|
|
||||||
Utils.alertView(this, getString(R.string.notice),
|
|
||||||
"${getString(R.string.invalid_opus_bitrate)}: $opusBitRate.")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
Config.removeVariable("opus_bitrate")
|
|
||||||
Config.addLine("opus_bitrate $opusBitRate")
|
|
||||||
save = true
|
|
||||||
restart = true
|
|
||||||
}
|
|
||||||
|
|
||||||
val opusPacketLoss = opusPacketLoss.text.toString().trim()
|
|
||||||
if (opusPacketLoss != oldOpusPacketLoss) {
|
|
||||||
if (!checkOpusPacketLoss(opusPacketLoss)) {
|
|
||||||
Utils.alertView(this, getString(R.string.notice),
|
|
||||||
"${getString(R.string.invalid_opus_packet_loss)}: $opusPacketLoss")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
Config.removeVariable("opus_inbandfec")
|
|
||||||
Config.removeVariable("opus_packet_loss")
|
|
||||||
if (opusPacketLoss != "0") {
|
|
||||||
Config.addLine("opus_inbandfec yes")
|
|
||||||
Config.addLine("opus_packet_loss $opusPacketLoss")
|
|
||||||
}
|
|
||||||
save = true
|
|
||||||
restart = true
|
|
||||||
}
|
|
||||||
|
|
||||||
if (BaresipService.callVolume != callVolume) {
|
if (BaresipService.callVolume != callVolume) {
|
||||||
BaresipService.callVolume = callVolume
|
BaresipService.callVolume = callVolume
|
||||||
@@ -447,21 +326,9 @@ class ConfigActivity : AppCompatActivity() {
|
|||||||
Utils.alertView(this, getString(R.string.tls_ca_file),
|
Utils.alertView(this, getString(R.string.tls_ca_file),
|
||||||
getString(R.string.tls_ca_file_help))
|
getString(R.string.tls_ca_file_help))
|
||||||
}
|
}
|
||||||
findViewById(R.id.AudioModulesTitle) as TextView -> {
|
findViewById(R.id.AudioTitle) as TextView -> {
|
||||||
Utils.alertView(this, getString(R.string.audio_modules_title),
|
val i = Intent(this, AudioActivity::class.java)
|
||||||
getString(R.string.audio_modules_help))
|
startActivity(i)
|
||||||
}
|
|
||||||
findViewById(R.id.AecTitle) as TextView-> {
|
|
||||||
Utils.alertView(this, getString(R.string.aec),
|
|
||||||
getString(R.string.aec_help))
|
|
||||||
}
|
|
||||||
findViewById(R.id.OpusBitRateTitle) as TextView-> {
|
|
||||||
Utils.alertView(this, getString(R.string.opus_bit_rate),
|
|
||||||
getString(R.string.opus_bit_rate_help))
|
|
||||||
}
|
|
||||||
findViewById(R.id.OpusPacketLossTitle) as TextView-> {
|
|
||||||
Utils.alertView(this, getString(R.string.opus_packet_loss),
|
|
||||||
getString(R.string.opus_packet_loss_help))
|
|
||||||
}
|
}
|
||||||
findViewById(R.id.VolumeTitle) as TextView-> {
|
findViewById(R.id.VolumeTitle) as TextView-> {
|
||||||
Utils.alertView(this, getString(R.string.default_call_volume),
|
Utils.alertView(this, getString(R.string.default_call_volume),
|
||||||
@@ -484,18 +351,6 @@ class ConfigActivity : AppCompatActivity() {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkOpusBitRate(opusBitRate: String): Boolean {
|
|
||||||
val number = opusBitRate.toIntOrNull()
|
|
||||||
if (number == null) return false
|
|
||||||
return (number >= 6000) && (number <= 510000)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun checkOpusPacketLoss(opusPacketLoss: String): Boolean {
|
|
||||||
val number = opusPacketLoss.toIntOrNull()
|
|
||||||
if (number == null) return false
|
|
||||||
return (number >= 0) && (number <= 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun addMissingPorts(addressList: String): String {
|
private fun addMissingPorts(addressList: String): String {
|
||||||
if (addressList == "") return ""
|
if (addressList == "") return ""
|
||||||
var result = ""
|
var result = ""
|
||||||
|
|||||||
@@ -140,117 +140,17 @@
|
|||||||
</CheckBox>
|
</CheckBox>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="12dp"
|
|
||||||
android:orientation="vertical" >
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/AudioModulesTitle"
|
android:id="@+id/AudioTitle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
android:onClick="onClick"
|
android:onClick="onClick"
|
||||||
android:text="@string/audio_modules_title" >
|
android:text="@string/audio" >
|
||||||
</TextView>
|
</TextView>
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/AudioModulesList"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginTop="24dp"
|
|
||||||
android:orientation="vertical" >
|
|
||||||
</LinearLayout>
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="12dp" >
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/AecTitle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_toStartOf="@id/Aec"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:onClick="onClick"
|
|
||||||
android:text="@string/aec" >
|
|
||||||
</TextView>
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/Aec"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_gravity="end"
|
|
||||||
android:checked="false" >
|
|
||||||
</CheckBox>
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="0dp"
|
|
||||||
android:orientation="horizontal" >
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/OpusBitRateTitle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:onClick="onClick"
|
|
||||||
android:text="@string/opus_bit_rate" >
|
|
||||||
</TextView>
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/OpusBitRate"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_toEndOf="@+id/OpusBitRateTitle"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:scrollHorizontally="true"
|
|
||||||
android:inputType="numberDecimal"
|
|
||||||
android:hint="@string/_28000"
|
|
||||||
android:importantForAutofill="no" >
|
|
||||||
</EditText>
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="12dp"
|
|
||||||
android:orientation="horizontal" >
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/OpusPacketLossTitle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:onClick="onClick"
|
|
||||||
android:text="@string/opus_packet_loss" >
|
|
||||||
</TextView>
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/OpusPacketLoss"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_toEndOf="@+id/OpusPacketLossTitle"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:scrollHorizontally="true"
|
|
||||||
android:inputType="numberDecimal"
|
|
||||||
android:hint="@string/_0"
|
|
||||||
android:importantForAutofill="no" >
|
|
||||||
</EditText>
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -230,13 +230,18 @@
|
|||||||
TLS-varmenninauktoriteettien julkiset varmentimen, on joko jo ladattu tai tullaan lataamaan
|
TLS-varmenninauktoriteettien julkiset varmentimen, on joko jo ladattu tai tullaan lataamaan
|
||||||
Download-hakemistosta.
|
Download-hakemistosta.
|
||||||
</string>
|
</string>
|
||||||
|
<string name="audio">Audio</string>
|
||||||
<string name="audio_modules_title">Audio-modulit</string>
|
<string name="audio_modules_title">Audio-modulit</string>
|
||||||
<string name="audio_modules_help">Merkittyjen modulien tarjoamat audio-koodekit ovat tilien
|
<string name="audio_modules_help">Merkittyjen modulien tarjoamat audio-koodekit ovat tilien
|
||||||
käytettävissä.
|
käytettävissä.
|
||||||
</string>
|
</string>
|
||||||
<string name="failed_to_load_module">Modulin lataaminen epäonnistui.</string>
|
<string name="failed_to_load_module">Modulin lataaminen epäonnistui.</string>
|
||||||
<string name="aec">Akustinen kaiun poisto</string>
|
<string name="aec">Akustinen kaiun poisto (AKP)</string>
|
||||||
<string name="aec_help">Jos merkitty, kaikua yritetään poistaa puheluiden aikana.</string>
|
<string name="aec_help">Jos merkitty, kaikua yritetään poistaa puheluiden aikana.</string>
|
||||||
|
<string name="aec_extented_filter">AKP laajennettu suodatin</string>
|
||||||
|
<string name="aec_extented_filter_help">Jos merkitty, kaiun poistossa käytetään laajennettua
|
||||||
|
suodatinta.
|
||||||
|
</string>
|
||||||
<string name="opus_bit_rate">Opus-koodekin bittinopeus</string>
|
<string name="opus_bit_rate">Opus-koodekin bittinopeus</string>
|
||||||
<string name="opus_bit_rate_help">Opus-koodekin käyttämä
|
<string name="opus_bit_rate_help">Opus-koodekin käyttämä
|
||||||
keskimääräinen enimmäisnopeus. Mahdollisia arvoja ovat
|
keskimääräinen enimmäisnopeus. Mahdollisia arvoja ovat
|
||||||
|
|||||||
@@ -200,12 +200,15 @@
|
|||||||
<string name="tls_ca_file">TLS CA File</string>
|
<string name="tls_ca_file">TLS CA File</string>
|
||||||
<string name="tls_ca_file_help">If checked, file \'ca_certs.crt\' containing TLS certificates
|
<string name="tls_ca_file_help">If checked, file \'ca_certs.crt\' containing TLS certificates
|
||||||
of Certificate Authorities has been or will be loaded from Download directory.</string>
|
of Certificate Authorities has been or will be loaded from Download directory.</string>
|
||||||
|
<string name="audio">Audio</string>
|
||||||
<string name="audio_modules_title">Audio Modules</string>
|
<string name="audio_modules_title">Audio Modules</string>
|
||||||
<string name="audio_modules_help">Audio codecs provided by the checked modules are
|
<string name="audio_modules_help">Audio codecs provided by the checked modules are
|
||||||
available for use by the accounts.</string>
|
available for use by the accounts.</string>
|
||||||
<string name="failed_to_load_module">Failed to load module.</string>
|
<string name="failed_to_load_module">Failed to load module.</string>
|
||||||
<string name="aec">Acoustic Echo Cancellation</string>
|
<string name="aec">Acoustic Echo Cancellation</string>
|
||||||
<string name="aec_help">If checked, echo cancellation is attempted on call audio.</string>
|
<string name="aec_help">If checked, echo cancellation is attempted on call audio.</string>
|
||||||
|
<string name="aec_extented_filter">AEC Extented Filter</string>
|
||||||
|
<string name="aec_extented_filter_help">If checked, echo cancellation is using extended filter.</string>
|
||||||
<string name="opus_bit_rate">Opus Bit Rate</string>
|
<string name="opus_bit_rate">Opus Bit Rate</string>
|
||||||
<string name="opus_bit_rate_help">Average maximum bit rate used by Opus audio stream.
|
<string name="opus_bit_rate_help">Average maximum bit rate used by Opus audio stream.
|
||||||
Valid values are 6000-510000. Factory default is 28000.</string>
|
Valid values are 6000-510000. Factory default is 28000.</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user