Clear current_direction when the RtpTransceiver is stopped
This is specified in the WebRTC specification: https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-currentdirection Bug: webrtc:7600 Change-Id: I4c3d434528f8c2aecad9d86dce38f13cf4fee560 Reviewed-on: https://webrtc-review.googlesource.com/55900 Reviewed-by: Seth Hampson <shampson@webrtc.org> Commit-Queue: Steve Anton <steveanton@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22112}
This commit is contained in:
parent
2f0d70287e
commit
54b8407ee5
@ -1228,4 +1228,19 @@ TEST_F(PeerConnectionJsepTest,
|
||||
|
||||
// TODO(bugs.webrtc.org/7932): Also test multi-stream case.
|
||||
|
||||
// Test that if an RtpTransceiver with a current_direction set is stopped, then
|
||||
// current_direction is changed to null.
|
||||
TEST_F(PeerConnectionJsepTest, CurrentDirectionResetWhenRtpTransceiverStopped) {
|
||||
auto caller = CreatePeerConnection();
|
||||
auto callee = CreatePeerConnection();
|
||||
|
||||
auto transceiver = caller->AddTransceiver(cricket::MEDIA_TYPE_AUDIO);
|
||||
|
||||
ASSERT_TRUE(caller->ExchangeOfferAnswerWith(callee.get()));
|
||||
|
||||
ASSERT_TRUE(transceiver->current_direction());
|
||||
transceiver->Stop();
|
||||
EXPECT_FALSE(transceiver->current_direction());
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -207,6 +207,7 @@ void RtpTransceiver::Stop() {
|
||||
receiver->internal()->Stop();
|
||||
}
|
||||
stopped_ = true;
|
||||
current_direction_ = rtc::nullopt;
|
||||
}
|
||||
|
||||
void RtpTransceiver::SetCodecPreferences(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user