VoIP: clean files

This commit is contained in:
ganfra 2020-12-07 18:12:59 +01:00
parent efec711ced
commit b998718142
18 changed files with 23 additions and 38 deletions

View File

@ -1,6 +1,6 @@
#Mon Dec 07 18:05:35 CET 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=22449f5231796abd892c98b2a07c9ceebe4688d192cd2d6763f8e3bf8acbedeb
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip

View File

@ -16,7 +16,6 @@
package org.matrix.android.sdk.api.session.call
sealed class CallState {
/** Idle, setting up objects */

View File

@ -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");
* you may not use this file except in compliance with the License.
@ -26,5 +26,5 @@ public enum MxPeerConnectionState {
CONNECTED,
DISCONNECTED,
FAILED,
CLOSED;
CLOSED
}

View File

@ -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");
* you may not use this file except in compliance with the License.

View File

@ -35,7 +35,7 @@ data class CallNegotiateContent(
/**
* Required. The time in milliseconds that the negotiation is valid for. Once exceeded the sender
* of the negotiate event should consider the negotiation failed (timed out) and the recipient should ignore it.
**/
**/
@Json(name = "lifetime") val lifetime: Int?,
/**
* Required. The session description object
@ -45,9 +45,9 @@ data class CallNegotiateContent(
/**
* 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)
data class Description(
/**
@ -59,6 +59,4 @@ data class CallNegotiateContent(
*/
@Json(name = "sdp") val sdp: String?
)
}

View File

@ -36,5 +36,5 @@ data class CallRejectContent(
/**
* 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

View File

@ -40,5 +40,5 @@ data class CallSelectAnswerContent(
/**
* 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

View File

@ -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");
* you may not use this file except in compliance with the License.

View File

@ -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");
* you may not use this file except in compliance with the License.

View File

@ -121,8 +121,8 @@ internal class MxCallImpl(
}
override fun reject() {
if(opponentVersion < 1){
Timber.v("Opponent version is less than 1 (${opponentVersion}): sending hangup instead of reject")
if (opponentVersion < 1) {
Timber.v("Opponent version is less than 1 ($opponentVersion): sending hangup instead of reject")
hangUp()
return
}
@ -203,5 +203,4 @@ internal class MxCallImpl(
)
.also { localEchoEventFactory.createLocalEcho(it) }
}
}

View File

@ -20,7 +20,6 @@ import android.view.View
import androidx.cardview.widget.CardView
import androidx.core.view.isVisible
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 im.vector.app.features.call.utils.EglUtils
import im.vector.app.features.call.webrtc.WebRtcCall

View File

@ -30,7 +30,6 @@ import im.vector.app.R
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.MxPeerConnectionState
import org.webrtc.PeerConnection
class CallControlsView @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0

View File

@ -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.util.MatrixItem
import org.matrix.android.sdk.api.util.toMatrixItem
import timber.log.Timber
import java.util.Timer
import java.util.TimerTask
@ -141,7 +140,6 @@ class VectorCallViewModel @AssistedInject constructor(
)
}
}
}
init {

View File

@ -45,6 +45,4 @@ data class VectorCallViewState(
roomId = callArgs.roomId,
isVideoCall = callArgs.isVideoCall
)
}

View File

@ -37,7 +37,6 @@ class CallHeadsUpActionReceiver : BroadcastReceiver() {
?.webRtcCallManager()
?: return
when (intent?.getIntExtra(EXTRA_CALL_ACTION_KEY, 0)) {
CALL_ACTION_REJECT -> {
val callId = intent.getStringExtra(EXTRA_CALL_ID) ?: return

View File

@ -36,5 +36,3 @@ fun SdpType.asWebRTC(): SessionDescription.Type {
SessionDescription.Type.ANSWER
}
}

View File

@ -330,7 +330,7 @@ class WebRtcCall(val mxCall: MxCall,
// 2. Access camera (if video call) + microphone, create local stream
createLocalStream()
attachViewRenderersInternal()
Timber.v("## VOIP remoteCandidateSource ${remoteCandidateSource}")
Timber.v("## VOIP remoteCandidateSource $remoteCandidateSource")
remoteIceCandidateDisposable = remoteCandidateSource.subscribe({
Timber.v("## VOIP adding remote ice candidate $it")
peerConnection?.addIceCandidate(it)
@ -383,7 +383,7 @@ class WebRtcCall(val mxCall: MxCall,
createAnswer()?.also {
mxCall.accept(it.description)
}
Timber.v("## VOIP remoteCandidateSource ${remoteCandidateSource}")
Timber.v("## VOIP remoteCandidateSource $remoteCandidateSource")
remoteIceCandidateDisposable = remoteCandidateSource.subscribe({
Timber.v("## VOIP adding remote ice candidate $it")
peerConnection?.addIceCandidate(it)
@ -554,9 +554,9 @@ class WebRtcCall(val mxCall: MxCall,
for (transceiver in peerConnection?.transceivers ?: emptyList()) {
val trackOnHold = transceiver.currentDirection == RtpTransceiver.RtpTransceiverDirection.INACTIVE
|| transceiver.currentDirection == RtpTransceiver.RtpTransceiverDirection.RECV_ONLY
if (!trackOnHold) callOnHold = false;
if (!trackOnHold) callOnHold = false
}
return callOnHold;
return callOnHold
}
fun updateRemoteOnHold(onHold: Boolean) {
@ -704,7 +704,7 @@ class WebRtcCall(val mxCall: MxCall,
return
}
mxCall.state = CallState.Terminated
//Close tracks ASAP
// Close tracks ASAP
localVideoTrack?.setEnabled(false)
localVideoTrack?.setEnabled(false)
cameraAvailabilityCallback?.let { cameraAvailabilityCallback ->
@ -760,7 +760,7 @@ class WebRtcCall(val mxCall: MxCall,
val type = description?.type
val sdpText = description?.sdp
if (type == null || sdpText == null) {
Timber.i("Ignoring invalid m.call.negotiate event");
Timber.i("Ignoring invalid m.call.negotiate event")
return@launch
}
val peerConnection = peerConnection ?: return@launch

View File

@ -25,8 +25,6 @@ import im.vector.app.core.services.BluetoothHeadsetReceiver
import im.vector.app.core.services.CallService
import im.vector.app.core.services.WiredHeadsetStateReceiver
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.utils.EglUtils
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.DefaultVideoEncoderFactory
import org.webrtc.PeerConnectionFactory
import org.webrtc.SurfaceViewRenderer
import timber.log.Timber
import java.util.concurrent.Executors
import javax.inject.Inject
@ -230,7 +227,8 @@ class WebRtcCallManager @Inject constructor(
)
currentCall = webRtcCall
callsByCallId[mxCall.callId] = webRtcCall
callsByRoomId.getOrPut(mxCall.roomId, { ArrayList() }).add(webRtcCall)
callsByRoomId.getOrPut(mxCall.roomId) { ArrayList() }
.add(webRtcCall)
return webRtcCall
}
@ -332,7 +330,7 @@ class WebRtcCallManager @Inject constructor(
}
val selectedPartyId = callSelectAnswerContent.selectedPartyId
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
call.endCall(false)
}