mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-17 02:15:17 +08:00
VoIP: fix call candidate parsing
This commit is contained in:
parent
4a3f0c8898
commit
7af82af935
@ -24,13 +24,13 @@ data class CallCandidate(
|
||||
/**
|
||||
* Required. The SDP media type this candidate is intended for.
|
||||
*/
|
||||
@Json(name = "sdpMid") val sdpMid: String,
|
||||
@Json(name = "sdpMid") val sdpMid: String? = null,
|
||||
/**
|
||||
* Required. The index of the SDP 'm' line this candidate is intended for.
|
||||
*/
|
||||
@Json(name = "sdpMLineIndex") val sdpMLineIndex: Int,
|
||||
@Json(name = "sdpMLineIndex") val sdpMLineIndex: Int = 0,
|
||||
/**
|
||||
* Required. The SDP 'a' line of the candidate.
|
||||
*/
|
||||
@Json(name = "candidate") val candidate: String
|
||||
@Json(name = "candidate") val candidate: String? = null
|
||||
)
|
||||
|
@ -105,6 +105,7 @@ internal class MxCallImpl(
|
||||
}
|
||||
|
||||
override fun sendLocalIceCandidates(candidates: List<CallCandidate>) {
|
||||
Timber.v("Send local ice canditates $callId: $candidates")
|
||||
CallCandidatesContent(
|
||||
callId = callId,
|
||||
partyId = ourPartyId,
|
||||
|
@ -729,6 +729,9 @@ class WebRtcCall(val mxCall: MxCall,
|
||||
fun onCallIceCandidateReceived(iceCandidatesContent: CallCandidatesContent) {
|
||||
GlobalScope.launch(dispatcher) {
|
||||
iceCandidatesContent.candidates.forEach {
|
||||
if (it.sdpMid.isNullOrEmpty() || it.candidate.isNullOrEmpty()) {
|
||||
return@forEach
|
||||
}
|
||||
Timber.v("## VOIP onCallIceCandidateReceived for call ${mxCall.callId} sdp: ${it.candidate}")
|
||||
val iceCandidate = IceCandidate(it.sdpMid, it.sdpMLineIndex, it.candidate)
|
||||
remoteCandidateSource.onNext(iceCandidate)
|
||||
|
Loading…
Reference in New Issue
Block a user