Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: webrtc/pc/peerconnection_integrationtest.cc

Issue 2810733003: Fix SDP stream ID mismatch issue when a track's stream changes. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« webrtc/pc/mediasession.cc ('K') | « webrtc/pc/mediasession.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/peerconnection_integrationtest.cc
diff --git a/webrtc/pc/peerconnection_integrationtest.cc b/webrtc/pc/peerconnection_integrationtest.cc
index d818300c23f1fe4846d899b3eab589ced74fe771..e13d289722462523df5e04d26b2d9e7c0fbab774 100644
--- a/webrtc/pc/peerconnection_integrationtest.cc
+++ b/webrtc/pc/peerconnection_integrationtest.cc
@@ -217,6 +217,10 @@ class PeerConnectionWrapper : public webrtc::PeerConnectionObserver,
return client;
}
+ webrtc::PeerConnectionFactoryInterface* pc_factory() const {
+ return peer_connection_factory_.get();
+ }
+
webrtc::PeerConnectionInterface* pc() const { return peer_connection_.get(); }
// If a signaling message receiver is set (via ConnectFakeSignaling), this
@@ -2773,6 +2777,38 @@ TEST_F(PeerConnectionIntegrationTest, GetSources) {
contributing_sources[0].source_id());
}
+// Test that if a track is removed and added again with a different stream ID,
+// the new stream ID is successfully communicated in SDP and media continues to
+// flow end-to-end.
+TEST_F(PeerConnectionIntegrationTest, AddTrackWithDifferentStreamId) {
+ ASSERT_TRUE(CreatePeerConnectionWrappers());
+ ConnectFakeSignaling();
+
+ rtc::scoped_refptr<MediaStreamInterface> stream_1 =
+ caller()->pc_factory()->CreateLocalMediaStream("stream_1");
+ rtc::scoped_refptr<MediaStreamInterface> stream_2 =
+ caller()->pc_factory()->CreateLocalMediaStream("stream_2");
+
+ // Add track using stream 1, do offer/answer.
+ rtc::scoped_refptr<webrtc::AudioTrackInterface> track =
+ caller()->CreateLocalAudioTrack();
+ rtc::scoped_refptr<webrtc::RtpSenderInterface> sender =
+ caller()->pc()->AddTrack(track, {stream_1.get()});
+ caller()->CreateAndSetAndSignalOffer();
+ ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
+ // Wait for one audio frame to be received by the callee.
+ ExpectNewFramesReceivedWithWait(0, 0, 1, 0, kMaxWaitForFramesMs);
+
+ // Remove the sender, and create a new one with the new stream.
+ caller()->pc()->RemoveTrack(sender);
+ sender = caller()->pc()->AddTrack(track, {stream_2.get()});
+ caller()->CreateAndSetAndSignalOffer();
+ ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
+ // Wait for additional audio frames to be received by the callee.
+ ExpectNewFramesReceivedWithWait(0, 0, kDefaultExpectedAudioFrameCount, 0,
+ kMaxWaitForFramesMs);
+}
+
} // namespace
#endif // if !defined(THREAD_SANITIZER)
« webrtc/pc/mediasession.cc ('K') | « webrtc/pc/mediasession.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698