mirror of
https://github.com/pion/webrtc.git
synced 2025-09-26 19:21:12 +08:00
Disallow incompatible transceiver directions
This effectively reverts part of https://github.com/pion/webrtc/pull/2412. The answer was incorrect under the following conditions - Answer side added a track, it created a new transceicer with Sendrecv direction. - When the remote offer comes in later, SetRemoteDescription tries to find an existing tranceiver by type and direction. It ends up picking what was added above even if the remote side is using `sendonly`. - That results in answer marking the section as `sendrecv` which is incompatible with the offer.
This commit is contained in:

committed by
Raja Subramanian

parent
2299a71701
commit
469ca2cf1b
@@ -1209,7 +1209,7 @@ func TestPeerConnection_TransceiverDirection(t *testing.T) {
|
||||
"offer sendonly answer sendrecv",
|
||||
RTPTransceiverDirectionSendonly,
|
||||
RTPTransceiverDirectionSendrecv,
|
||||
[]RTPTransceiverDirection{RTPTransceiverDirectionSendrecv},
|
||||
[]RTPTransceiverDirection{RTPTransceiverDirectionSendrecv, RTPTransceiverDirectionRecvonly},
|
||||
},
|
||||
{
|
||||
"offer recvonly answer sendrecv",
|
||||
|
@@ -277,7 +277,7 @@ func satisfyTypeAndDirection(
|
||||
RTPTransceiverDirectionSendonly,
|
||||
}
|
||||
case RTPTransceiverDirectionSendonly:
|
||||
return []RTPTransceiverDirection{RTPTransceiverDirectionRecvonly, RTPTransceiverDirectionSendrecv}
|
||||
return []RTPTransceiverDirection{RTPTransceiverDirectionRecvonly}
|
||||
case RTPTransceiverDirectionRecvonly:
|
||||
return []RTPTransceiverDirection{RTPTransceiverDirectionSendonly, RTPTransceiverDirectionSendrecv}
|
||||
default:
|
||||
|
Reference in New Issue
Block a user