VoIP: clean files
This commit is contained in:
parent
efec711ced
commit
b998718142
|
@ -1,6 +1,6 @@
|
||||||
|
#Mon Dec 07 18:05:35 CET 2020
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=22449f5231796abd892c98b2a07c9ceebe4688d192cd2d6763f8e3bf8acbedeb
|
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
package org.matrix.android.sdk.api.session.call
|
package org.matrix.android.sdk.api.session.call
|
||||||
|
|
||||||
|
|
||||||
sealed class CallState {
|
sealed class CallState {
|
||||||
|
|
||||||
/** Idle, setting up objects */
|
/** Idle, setting up objects */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020 New Vector Ltd
|
* Copyright (c) 2020 The Matrix.org Foundation C.I.C.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -26,5 +26,5 @@ public enum MxPeerConnectionState {
|
||||||
CONNECTED,
|
CONNECTED,
|
||||||
DISCONNECTED,
|
DISCONNECTED,
|
||||||
FAILED,
|
FAILED,
|
||||||
CLOSED;
|
CLOSED
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020 New Vector Ltd
|
* Copyright (c) 2020 The Matrix.org Foundation C.I.C.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
|
@ -45,9 +45,9 @@ data class CallNegotiateContent(
|
||||||
/**
|
/**
|
||||||
* Required. The version of the VoIP specification this message adheres to.
|
* Required. The version of the VoIP specification this message adheres to.
|
||||||
*/
|
*/
|
||||||
@Json(name = "version") override val version: String?,
|
@Json(name = "version") override val version: String?
|
||||||
|
|
||||||
): CallSignallingContent {
|
): CallSignallingContent {
|
||||||
@JsonClass(generateAdapter = true)
|
@JsonClass(generateAdapter = true)
|
||||||
data class Description(
|
data class Description(
|
||||||
/**
|
/**
|
||||||
|
@ -59,6 +59,4 @@ data class CallNegotiateContent(
|
||||||
*/
|
*/
|
||||||
@Json(name = "sdp") val sdp: String?
|
@Json(name = "sdp") val sdp: String?
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,5 +36,5 @@ data class CallRejectContent(
|
||||||
/**
|
/**
|
||||||
* Required. The version of the VoIP specification this message adheres to.
|
* Required. The version of the VoIP specification this message adheres to.
|
||||||
*/
|
*/
|
||||||
@Json(name = "version") override val version: String?,
|
@Json(name = "version") override val version: String?
|
||||||
):CallSignallingContent
|
):CallSignallingContent
|
||||||
|
|
|
@ -40,5 +40,5 @@ data class CallSelectAnswerContent(
|
||||||
/**
|
/**
|
||||||
* Required. The version of the VoIP specification this message adheres to.
|
* Required. The version of the VoIP specification this message adheres to.
|
||||||
*/
|
*/
|
||||||
@Json(name = "version") override val version: String?,
|
@Json(name = "version") override val version: String?
|
||||||
): CallSignallingContent
|
): CallSignallingContent
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020 New Vector Ltd
|
* Copyright (c) 2020 The Matrix.org Foundation C.I.C.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020 New Vector Ltd
|
* Copyright (c) 2020 The Matrix.org Foundation C.I.C.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
|
@ -121,8 +121,8 @@ internal class MxCallImpl(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun reject() {
|
override fun reject() {
|
||||||
if(opponentVersion < 1){
|
if (opponentVersion < 1) {
|
||||||
Timber.v("Opponent version is less than 1 (${opponentVersion}): sending hangup instead of reject")
|
Timber.v("Opponent version is less than 1 ($opponentVersion): sending hangup instead of reject")
|
||||||
hangUp()
|
hangUp()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -203,5 +203,4 @@ internal class MxCallImpl(
|
||||||
)
|
)
|
||||||
.also { localEchoEventFactory.createLocalEcho(it) }
|
.also { localEchoEventFactory.createLocalEcho(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@ import android.view.View
|
||||||
import androidx.cardview.widget.CardView
|
import androidx.cardview.widget.CardView
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import im.vector.app.core.utils.DebouncedClickListener
|
import im.vector.app.core.utils.DebouncedClickListener
|
||||||
import im.vector.app.features.call.webrtc.WebRtcCallManager
|
|
||||||
import org.matrix.android.sdk.api.session.call.CallState
|
import org.matrix.android.sdk.api.session.call.CallState
|
||||||
import im.vector.app.features.call.utils.EglUtils
|
import im.vector.app.features.call.utils.EglUtils
|
||||||
import im.vector.app.features.call.webrtc.WebRtcCall
|
import im.vector.app.features.call.webrtc.WebRtcCall
|
||||||
|
|
|
@ -30,7 +30,6 @@ import im.vector.app.R
|
||||||
import kotlinx.android.synthetic.main.view_call_controls.view.*
|
import kotlinx.android.synthetic.main.view_call_controls.view.*
|
||||||
import org.matrix.android.sdk.api.session.call.CallState
|
import org.matrix.android.sdk.api.session.call.CallState
|
||||||
import org.matrix.android.sdk.api.session.call.MxPeerConnectionState
|
import org.matrix.android.sdk.api.session.call.MxPeerConnectionState
|
||||||
import org.webrtc.PeerConnection
|
|
||||||
|
|
||||||
class CallControlsView @JvmOverloads constructor(
|
class CallControlsView @JvmOverloads constructor(
|
||||||
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
|
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
|
||||||
|
|
|
@ -36,7 +36,6 @@ import org.matrix.android.sdk.api.session.call.MxPeerConnectionState
|
||||||
import org.matrix.android.sdk.api.session.call.TurnServerResponse
|
import org.matrix.android.sdk.api.session.call.TurnServerResponse
|
||||||
import org.matrix.android.sdk.api.util.MatrixItem
|
import org.matrix.android.sdk.api.util.MatrixItem
|
||||||
import org.matrix.android.sdk.api.util.toMatrixItem
|
import org.matrix.android.sdk.api.util.toMatrixItem
|
||||||
import timber.log.Timber
|
|
||||||
import java.util.Timer
|
import java.util.Timer
|
||||||
import java.util.TimerTask
|
import java.util.TimerTask
|
||||||
|
|
||||||
|
@ -141,7 +140,6 @@ class VectorCallViewModel @AssistedInject constructor(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -45,6 +45,4 @@ data class VectorCallViewState(
|
||||||
roomId = callArgs.roomId,
|
roomId = callArgs.roomId,
|
||||||
isVideoCall = callArgs.isVideoCall
|
isVideoCall = callArgs.isVideoCall
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,6 @@ class CallHeadsUpActionReceiver : BroadcastReceiver() {
|
||||||
?.webRtcCallManager()
|
?.webRtcCallManager()
|
||||||
?: return
|
?: return
|
||||||
|
|
||||||
|
|
||||||
when (intent?.getIntExtra(EXTRA_CALL_ACTION_KEY, 0)) {
|
when (intent?.getIntExtra(EXTRA_CALL_ACTION_KEY, 0)) {
|
||||||
CALL_ACTION_REJECT -> {
|
CALL_ACTION_REJECT -> {
|
||||||
val callId = intent.getStringExtra(EXTRA_CALL_ID) ?: return
|
val callId = intent.getStringExtra(EXTRA_CALL_ID) ?: return
|
||||||
|
|
|
@ -36,5 +36,3 @@ fun SdpType.asWebRTC(): SessionDescription.Type {
|
||||||
SessionDescription.Type.ANSWER
|
SessionDescription.Type.ANSWER
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -330,7 +330,7 @@ class WebRtcCall(val mxCall: MxCall,
|
||||||
// 2. Access camera (if video call) + microphone, create local stream
|
// 2. Access camera (if video call) + microphone, create local stream
|
||||||
createLocalStream()
|
createLocalStream()
|
||||||
attachViewRenderersInternal()
|
attachViewRenderersInternal()
|
||||||
Timber.v("## VOIP remoteCandidateSource ${remoteCandidateSource}")
|
Timber.v("## VOIP remoteCandidateSource $remoteCandidateSource")
|
||||||
remoteIceCandidateDisposable = remoteCandidateSource.subscribe({
|
remoteIceCandidateDisposable = remoteCandidateSource.subscribe({
|
||||||
Timber.v("## VOIP adding remote ice candidate $it")
|
Timber.v("## VOIP adding remote ice candidate $it")
|
||||||
peerConnection?.addIceCandidate(it)
|
peerConnection?.addIceCandidate(it)
|
||||||
|
@ -383,7 +383,7 @@ class WebRtcCall(val mxCall: MxCall,
|
||||||
createAnswer()?.also {
|
createAnswer()?.also {
|
||||||
mxCall.accept(it.description)
|
mxCall.accept(it.description)
|
||||||
}
|
}
|
||||||
Timber.v("## VOIP remoteCandidateSource ${remoteCandidateSource}")
|
Timber.v("## VOIP remoteCandidateSource $remoteCandidateSource")
|
||||||
remoteIceCandidateDisposable = remoteCandidateSource.subscribe({
|
remoteIceCandidateDisposable = remoteCandidateSource.subscribe({
|
||||||
Timber.v("## VOIP adding remote ice candidate $it")
|
Timber.v("## VOIP adding remote ice candidate $it")
|
||||||
peerConnection?.addIceCandidate(it)
|
peerConnection?.addIceCandidate(it)
|
||||||
|
@ -554,9 +554,9 @@ class WebRtcCall(val mxCall: MxCall,
|
||||||
for (transceiver in peerConnection?.transceivers ?: emptyList()) {
|
for (transceiver in peerConnection?.transceivers ?: emptyList()) {
|
||||||
val trackOnHold = transceiver.currentDirection == RtpTransceiver.RtpTransceiverDirection.INACTIVE
|
val trackOnHold = transceiver.currentDirection == RtpTransceiver.RtpTransceiverDirection.INACTIVE
|
||||||
|| transceiver.currentDirection == RtpTransceiver.RtpTransceiverDirection.RECV_ONLY
|
|| transceiver.currentDirection == RtpTransceiver.RtpTransceiverDirection.RECV_ONLY
|
||||||
if (!trackOnHold) callOnHold = false;
|
if (!trackOnHold) callOnHold = false
|
||||||
}
|
}
|
||||||
return callOnHold;
|
return callOnHold
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateRemoteOnHold(onHold: Boolean) {
|
fun updateRemoteOnHold(onHold: Boolean) {
|
||||||
|
@ -704,7 +704,7 @@ class WebRtcCall(val mxCall: MxCall,
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
mxCall.state = CallState.Terminated
|
mxCall.state = CallState.Terminated
|
||||||
//Close tracks ASAP
|
// Close tracks ASAP
|
||||||
localVideoTrack?.setEnabled(false)
|
localVideoTrack?.setEnabled(false)
|
||||||
localVideoTrack?.setEnabled(false)
|
localVideoTrack?.setEnabled(false)
|
||||||
cameraAvailabilityCallback?.let { cameraAvailabilityCallback ->
|
cameraAvailabilityCallback?.let { cameraAvailabilityCallback ->
|
||||||
|
@ -760,7 +760,7 @@ class WebRtcCall(val mxCall: MxCall,
|
||||||
val type = description?.type
|
val type = description?.type
|
||||||
val sdpText = description?.sdp
|
val sdpText = description?.sdp
|
||||||
if (type == null || sdpText == null) {
|
if (type == null || sdpText == null) {
|
||||||
Timber.i("Ignoring invalid m.call.negotiate event");
|
Timber.i("Ignoring invalid m.call.negotiate event")
|
||||||
return@launch
|
return@launch
|
||||||
}
|
}
|
||||||
val peerConnection = peerConnection ?: return@launch
|
val peerConnection = peerConnection ?: return@launch
|
||||||
|
|
|
@ -25,8 +25,6 @@ import im.vector.app.core.services.BluetoothHeadsetReceiver
|
||||||
import im.vector.app.core.services.CallService
|
import im.vector.app.core.services.CallService
|
||||||
import im.vector.app.core.services.WiredHeadsetStateReceiver
|
import im.vector.app.core.services.WiredHeadsetStateReceiver
|
||||||
import im.vector.app.features.call.CallAudioManager
|
import im.vector.app.features.call.CallAudioManager
|
||||||
import im.vector.app.features.call.CameraType
|
|
||||||
import im.vector.app.features.call.CaptureFormat
|
|
||||||
import im.vector.app.features.call.VectorCallActivity
|
import im.vector.app.features.call.VectorCallActivity
|
||||||
import im.vector.app.features.call.utils.EglUtils
|
import im.vector.app.features.call.utils.EglUtils
|
||||||
import im.vector.app.push.fcm.FcmHelper
|
import im.vector.app.push.fcm.FcmHelper
|
||||||
|
@ -46,7 +44,6 @@ import org.matrix.android.sdk.api.session.room.model.call.CallSelectAnswerConten
|
||||||
import org.webrtc.DefaultVideoDecoderFactory
|
import org.webrtc.DefaultVideoDecoderFactory
|
||||||
import org.webrtc.DefaultVideoEncoderFactory
|
import org.webrtc.DefaultVideoEncoderFactory
|
||||||
import org.webrtc.PeerConnectionFactory
|
import org.webrtc.PeerConnectionFactory
|
||||||
import org.webrtc.SurfaceViewRenderer
|
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
@ -230,7 +227,8 @@ class WebRtcCallManager @Inject constructor(
|
||||||
)
|
)
|
||||||
currentCall = webRtcCall
|
currentCall = webRtcCall
|
||||||
callsByCallId[mxCall.callId] = webRtcCall
|
callsByCallId[mxCall.callId] = webRtcCall
|
||||||
callsByRoomId.getOrPut(mxCall.roomId, { ArrayList() }).add(webRtcCall)
|
callsByRoomId.getOrPut(mxCall.roomId) { ArrayList() }
|
||||||
|
.add(webRtcCall)
|
||||||
return webRtcCall
|
return webRtcCall
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,7 +330,7 @@ class WebRtcCallManager @Inject constructor(
|
||||||
}
|
}
|
||||||
val selectedPartyId = callSelectAnswerContent.selectedPartyId
|
val selectedPartyId = callSelectAnswerContent.selectedPartyId
|
||||||
if (selectedPartyId != call.mxCall.ourPartyId) {
|
if (selectedPartyId != call.mxCall.ourPartyId) {
|
||||||
Timber.i("Got select_answer for party ID ${selectedPartyId}: we are party ID ${call.mxCall.ourPartyId}.");
|
Timber.i("Got select_answer for party ID $selectedPartyId: we are party ID ${call.mxCall.ourPartyId}.")
|
||||||
// The other party has picked somebody else's answer
|
// The other party has picked somebody else's answer
|
||||||
call.endCall(false)
|
call.endCall(false)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue