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:
Steve Anton 2018-02-20 15:19:52 -08:00 committed by Commit Bot
parent 2f0d70287e
commit 54b8407ee5
2 changed files with 16 additions and 0 deletions

View File

@ -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

View File

@ -207,6 +207,7 @@ void RtpTransceiver::Stop() {
receiver->internal()->Stop();
}
stopped_ = true;
current_direction_ = rtc::nullopt;
}
void RtpTransceiver::SetCodecPreferences(