- From: Michał Śledź via GitHub <sysbot+gh@w3.org>
- Date: Tue, 12 Dec 2023 09:09:09 +0000
- To: public-webrtc-logs@w3.org
Sorry for bumping the topic once again but shouldn't the `currentDirection` be determined as an intersection of `direction` (i.e. our preference) and the answerer's direction (remote capability)? Right now w3c says: ``` 2. Set transceiver.[[[CurrentDirection]]](https://www.w3.org/TR/webrtc/#dfn-currentdirection) to direction. ``` and JSEP 4.2.5 says the same ``` 4.2.5. currentDirection The currentDirection property indicates the last negotiated direction for the transceiver's associated "m=" section. More specifically, it indicates the direction attribute [RFC3264] of the associated "m=" section in the last applied answer (including provisional answers), with "send" and "recv" directions reversed if it was a remote answer. For example, if the direction attribute for the associated "m=" section in a remote answer is "recvonly", currentDirection is set to "sendonly". If an answer that references this transceiver has not yet been applied or if the transceiver is stopped, currentDirection is set to "null". ``` However, consider the scenario where we offer sendonly and receive sendonly. This is probably a protocol violation (according to section 5.10 of JSEP) but let's assume that someone did SDP munging incorrectly or there is a bug in a remote implementation ```js pc = new RTCPeerConnection() pc.addTransceiver('audio', {direction: 'sendonly'}) offer = await pc.createOffer() await pc.setLocalDescription(offer) pc2 = new RTCPeerConnection() await pc2.setRemoteDescription(offer) answer = await pc2.createAnswer() sdp = answer.sdp.replace('recvonly', 'sendonly'); await pc.setRemoteDescription(answer2) pc.getTransceivers() ``` This wil result in ``` currentDirection: "recvonly" direction: "sendonly" ``` while the more intuitive outcome, I belive, would be ``` currentDirection: "inactive" direction: "sendonly" ``` or an error. -- GitHub Notification of comment by mickel8 Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2751#issuecomment-1851583208 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 12 December 2023 09:09:11 UTC