Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rtc/src/peer_connection/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ where
}

/// Helper to trigger a negotiation needed.
pub(super) fn trigger_negotiation_needed(&mut self) {
pub(crate) fn trigger_negotiation_needed(&mut self) {
if !self.do_negotiation_needed() {
return;
}
Expand Down
3 changes: 0 additions & 3 deletions rtc/src/rtp_transceiver/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,6 @@ where

if direction != previous_direction {
trace!("Changing direction of transceiver from {previous_direction} to {direction}");

//TODO: https://www.w3.org/TR/webrtc/#dom-rtcrtptransceiver-direction
// Update the negotiation-needed flag for connection.
}
}

Expand Down
5 changes: 5 additions & 0 deletions rtc/src/rtp_transceiver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,12 @@ where
pub fn set_direction(&mut self, direction: RTCRtpTransceiverDirection) {
// peer_connection is mutable borrow, its rtp_transceivers won't be resized,
// so, [self.id] here is safe.
let previous = self.peer_connection.rtp_transceivers[self.id].direction();
self.peer_connection.rtp_transceivers[self.id].set_direction(direction);
// Per W3C WebRTC §5.5: changing direction must trigger renegotiation.
if direction != previous {
self.peer_connection.trigger_negotiation_needed();
}
}

/// Returns the negotiated direction of the transceiver.
Expand Down