Make Transceiver Negotation more consistent

Today a remote `recvonly` transceiver can be satisfied by a `sendonly`
or `sendrecv` transceiver. However a remote `sendonly` transceiver can
only be satisfied by a `recvonly` transceiver.

This PR updates the answer handling code to be more consistent.
This commit is contained in:
Sean DuBois
2023-02-09 14:44:28 -05:00
parent 9dd2c42999
commit 43d0c5b9b0
3 changed files with 6 additions and 4 deletions

View File

@@ -173,6 +173,7 @@ Slugalisk <slugalisk@gmail.com>
Somers Matthews <somersbmatthews@gmail.com>
soolaugust <soolaugust@gmail.com>
spaceCh1mp <drimboat@gmail.com>
Steffen Vogel <post@steffenvogel.de>
stephanrotolante <stephanrotolante@gmail.com>
Suhas Gaddam <suhas.g.2011@gmail.com>
Suzuki Takeo <takeo@stko.info>
@@ -188,6 +189,7 @@ Vicken Simonian <vsimon@gmail.com>
wattanakorn495 <wattanakorn.i@ku.th>
Will Forcey <wsforc3y@gmail.com>
Will Watson <william.a.watson@gmail.com>
WofWca <wofwca@protonmail.com>
Woodrow Douglass <wdouglass@carnegierobotics.com>
xsbchen <xsbchen@qq.com>
Yoon SeungYong <simon.y@hpcnt.com>

View File

@@ -1247,7 +1247,7 @@ func TestPeerConnection_TransceiverDirection(t *testing.T) {
"offer sendonly answer sendrecv",
RTPTransceiverDirectionSendonly,
RTPTransceiverDirectionSendrecv,
[]RTPTransceiverDirection{RTPTransceiverDirectionSendrecv, RTPTransceiverDirectionRecvonly},
[]RTPTransceiverDirection{RTPTransceiverDirectionSendrecv},
},
{
"offer recvonly answer sendrecv",
@@ -1259,7 +1259,7 @@ func TestPeerConnection_TransceiverDirection(t *testing.T) {
"offer sendrecv answer sendonly",
RTPTransceiverDirectionSendrecv,
RTPTransceiverDirectionSendonly,
[]RTPTransceiverDirection{RTPTransceiverDirectionSendonly, RTPTransceiverDirectionRecvonly},
[]RTPTransceiverDirection{RTPTransceiverDirectionSendrecv},
},
{
"offer sendonly answer sendonly",

View File

@@ -239,9 +239,9 @@ func satisfyTypeAndDirection(remoteKind RTPCodecType, remoteDirection RTPTransce
getPreferredDirections := func() []RTPTransceiverDirection {
switch remoteDirection {
case RTPTransceiverDirectionSendrecv:
return []RTPTransceiverDirection{RTPTransceiverDirectionRecvonly, RTPTransceiverDirectionSendrecv}
return []RTPTransceiverDirection{RTPTransceiverDirectionRecvonly, RTPTransceiverDirectionSendrecv, RTPTransceiverDirectionSendonly}
case RTPTransceiverDirectionSendonly:
return []RTPTransceiverDirection{RTPTransceiverDirectionRecvonly}
return []RTPTransceiverDirection{RTPTransceiverDirectionRecvonly, RTPTransceiverDirectionSendrecv}
case RTPTransceiverDirectionRecvonly:
return []RTPTransceiverDirection{RTPTransceiverDirectionSendonly, RTPTransceiverDirectionSendrecv}
default: