|
@@ -260,13 +260,21 @@ class LinphoneManager private constructor(private val context: Context) {
|
|
|
if (LinphoneUtils.checkIfNetworkHasLowBandwidth(context)) {
|
|
|
Log.w(TAG, "[Context] Enabling low bandwidth mode!")
|
|
|
params?.enableLowBandwidth(true)
|
|
|
+
|
|
|
+ //params?.isLowBandwidthEnabled = true
|
|
|
}
|
|
|
if (isVideoCall) {
|
|
|
params?.enableVideo(true)
|
|
|
core.enableVideoCapture(true)
|
|
|
core.enableVideoDisplay(true)
|
|
|
+
|
|
|
+ //params?.isVideoEnabled = true
|
|
|
+ //core.isVideoCaptureEnabled = true
|
|
|
+ //core.isVideoDisplayEnabled = true
|
|
|
} else {
|
|
|
params?.enableVideo(false)
|
|
|
+
|
|
|
+ //params?.isVideoEnabled = false
|
|
|
}
|
|
|
if (params != null) {
|
|
|
core.inviteAddressWithParams(addressToCall!!, params)
|
|
@@ -294,9 +302,13 @@ class LinphoneManager private constructor(private val context: Context) {
|
|
|
if (LinphoneUtils.checkIfNetworkHasLowBandwidth(context)) {
|
|
|
Log.w(TAG, "[Context] Enabling low bandwidth mode!")
|
|
|
params?.enableLowBandwidth(true)
|
|
|
+
|
|
|
+ //params?.isLowBandwidthEnabled = true
|
|
|
}
|
|
|
if (supportVideo) {
|
|
|
params?.enableVideo(isVideoCall(call))
|
|
|
+
|
|
|
+ //params?.isVideoEnabled = isVideoCall(call)
|
|
|
}
|
|
|
call.acceptWithParams(params)
|
|
|
}
|
|
@@ -340,6 +352,8 @@ class LinphoneManager private constructor(private val context: Context) {
|
|
|
|
|
|
fun micEnabled() = core.micEnabled()
|
|
|
|
|
|
+ //fun micEnabled() = core.isMicEnabled
|
|
|
+
|
|
|
fun speakerEnabled() = core.outputAudioDevice?.type == AudioDevice.Type.Speaker
|
|
|
|
|
|
/**
|
|
@@ -348,6 +362,8 @@ class LinphoneManager private constructor(private val context: Context) {
|
|
|
*/
|
|
|
fun enableMic(micEnabled: Boolean) {
|
|
|
core.enableMic(micEnabled)
|
|
|
+
|
|
|
+ //core.isMicEnabled = micEnabled
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -382,6 +398,8 @@ class LinphoneManager private constructor(private val context: Context) {
|
|
|
fun isVideoCall(call: Call): Boolean {
|
|
|
val remoteParams = call.remoteParams
|
|
|
return remoteParams != null && remoteParams.videoEnabled()
|
|
|
+
|
|
|
+ //return remoteParams != null && remoteParams.isVideoEnabled
|
|
|
}
|
|
|
|
|
|
|
|
@@ -396,6 +414,8 @@ class LinphoneManager private constructor(private val context: Context) {
|
|
|
}
|
|
|
if (videoPreview != null) {
|
|
|
core.enableVideoPreview(true)
|
|
|
+
|
|
|
+ //core.isVideoPreviewEnabled = true
|
|
|
core.nativePreviewWindowId = videoPreview
|
|
|
}
|
|
|
}
|
|
@@ -449,6 +469,10 @@ class LinphoneManager private constructor(private val context: Context) {
|
|
|
//core.isVibrationOnIncomingCallEnabled = true
|
|
|
core.enableEchoCancellation(true) //回声消除
|
|
|
core.enableAdaptiveRateControl(true) //自适应码率控制
|
|
|
+
|
|
|
+ //core.isEchoCancellationEnabled = true
|
|
|
+ //core.isAdaptiveRateControlEnabled = true
|
|
|
+
|
|
|
//core.micGainDb = -3.0f
|
|
|
//val micGain = SettingConfig.getSipMicGain(BaseApplication.appContext)
|
|
|
//Log.e("Sip", "mic gain db: $micGain")
|