Skip to content

Commit bc94cec

Browse files
Taylor BrandstetterWebRTC LUCI CQ
authored andcommitted
[Merge M93] - Revert "Modify Bundle logic to not add & destroy extra transport at add-track"
This reverts commit 7a2db8a. After this commit, the PeerConnection would assume that any new m= sections will be added to the first existing BUNDLE group. This is true of JSEP endpoints (if they don't do SDP munging), but is not necessarily true for non-JSEP endpoints. This breaks the following scenarios: * Remote offer adding a new m= section that's not part of any BUNDLE group. * Remote offer adding a m= section to the second BUNDLE group. The latter is specifically problematic for any application that wants to bundle all audio streams in one group and all video streams in another group when using Unified Plan SDP, to replicate the behavior of using now-deprecated Plan B without bundling. [email protected] Bug: webrtc:12837, webrtc:12906, chromium:1236202 Change-Id: I97a348c96443dee95e2b42792b73ab7b101fd64c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227681 Reviewed-by: Taylor Brandstetter <[email protected]> Reviewed-by: Harald Alvestrand <[email protected]> Commit-Queue: Taylor Brandstetter <[email protected]> Cr-Commit-Position: refs/branch-heads/4577@{#2} Cr-Branched-From: 5196931-refs/heads/master@{#34463}
1 parent fdd8e9c commit bc94cec

File tree

5 files changed

+5
-55
lines changed

5 files changed

+5
-55
lines changed

pc/jsep_transport_controller.cc

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -551,17 +551,6 @@ RTCError JsepTransportController::ApplyDescription_n(
551551
MergeEncryptedHeaderExtensionIdsForBundles(description);
552552
}
553553

554-
// Because the creation of transports depends on whether
555-
// certain mids are present, we have to process rejection
556-
// before we try to create transports.
557-
for (size_t i = 0; i < description->contents().size(); ++i) {
558-
const cricket::ContentInfo& content_info = description->contents()[i];
559-
if (content_info.rejected) {
560-
// This may cause groups to be removed from |bundles_.bundle_groups()|.
561-
HandleRejectedContent(content_info);
562-
}
563-
}
564-
565554
for (const cricket::ContentInfo& content_info : description->contents()) {
566555
// Don't create transports for rejected m-lines and bundled m-lines.
567556
if (content_info.rejected ||
@@ -580,8 +569,9 @@ RTCError JsepTransportController::ApplyDescription_n(
580569
const cricket::ContentInfo& content_info = description->contents()[i];
581570
const cricket::TransportInfo& transport_info =
582571
description->transport_infos()[i];
583-
584572
if (content_info.rejected) {
573+
// This may cause groups to be removed from |bundles_.bundle_groups()|.
574+
HandleRejectedContent(content_info);
585575
continue;
586576
}
587577

@@ -987,21 +977,7 @@ RTCError JsepTransportController::MaybeCreateJsepTransport(
987977
if (transport) {
988978
return RTCError::OK();
989979
}
990-
// If we have agreed to a bundle, the new mid will be added to the bundle
991-
// according to JSEP, and the responder can't move it out of the group
992-
// according to BUNDLE. So don't create a transport.
993-
// The MID will be added to the bundle elsewhere in the code.
994-
if (bundles_.bundle_groups().size() > 0) {
995-
const auto& default_bundle_group = bundles_.bundle_groups()[0];
996-
if (default_bundle_group->content_names().size() > 0) {
997-
auto bundle_transport =
998-
GetJsepTransportByName(default_bundle_group->content_names()[0]);
999-
if (bundle_transport) {
1000-
transports_.SetTransportForMid(content_info.name, bundle_transport);
1001-
return RTCError::OK();
1002-
}
1003-
}
1004-
}
980+
1005981
const cricket::MediaContentDescription* content_desc =
1006982
content_info.media_description();
1007983
if (certificate_ && !content_desc->cryptos().empty()) {

pc/jsep_transport_controller_unittest.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,6 +2051,7 @@ TEST_F(JsepTransportControllerTest, ChangeTaggedMediaSectionMaxBundle) {
20512051
EXPECT_TRUE(transport_controller_
20522052
->SetLocalDescription(SdpType::kOffer, local_reoffer.get())
20532053
.ok());
2054+
20542055
std::unique_ptr<cricket::SessionDescription> remote_reanswer(
20552056
local_reoffer->Clone());
20562057
EXPECT_TRUE(

pc/peer_connection_integrationtest.cc

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3639,20 +3639,6 @@ TEST_P(PeerConnectionIntegrationInteropTest,
36393639
ASSERT_TRUE(ExpectNewFrames(media_expectations));
36403640
}
36413641

3642-
TEST_P(PeerConnectionIntegrationTest, NewTracksDoNotCauseNewCandidates) {
3643-
ASSERT_TRUE(CreatePeerConnectionWrappers());
3644-
ConnectFakeSignaling();
3645-
caller()->AddAudioVideoTracks();
3646-
caller()->CreateAndSetAndSignalOffer();
3647-
ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
3648-
ASSERT_TRUE_WAIT(DtlsConnected(), kDefaultTimeout);
3649-
caller()->ExpectCandidates(0);
3650-
callee()->ExpectCandidates(0);
3651-
caller()->AddAudioTrack();
3652-
caller()->CreateAndSetAndSignalOffer();
3653-
ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
3654-
}
3655-
36563642
INSTANTIATE_TEST_SUITE_P(
36573643
PeerConnectionIntegrationTest,
36583644
PeerConnectionIntegrationInteropTest,

pc/rtcp_mux_filter.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ bool RtcpMuxFilter::SetAnswer(bool answer_enable, ContentSource src) {
9191
}
9292

9393
if (!ExpectAnswer(src)) {
94-
RTC_LOG(LS_ERROR) << "Invalid state for RTCP mux answer, state is "
95-
<< state_ << ", source is " << src;
94+
RTC_LOG(LS_ERROR) << "Invalid state for RTCP mux answer";
9695
return false;
9796
}
9897

pc/test/integration_test_helpers.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
#include <algorithm>
1919
#include <functional>
20-
#include <limits>
2120
#include <list>
2221
#include <map>
2322
#include <memory>
@@ -705,11 +704,6 @@ class PeerConnectionIntegrationWrapper : public webrtc::PeerConnectionObserver,
705704
audio_concealed_stat_ = *track_stats->concealed_samples;
706705
}
707706

708-
// Sets number of candidates expected
709-
void ExpectCandidates(int candidate_count) {
710-
candidates_expected_ = candidate_count;
711-
}
712-
713707
private:
714708
explicit PeerConnectionIntegrationWrapper(const std::string& debug_name)
715709
: debug_name_(debug_name) {}
@@ -1095,9 +1089,6 @@ class PeerConnectionIntegrationWrapper : public webrtc::PeerConnectionObserver,
10951089
}
10961090
}
10971091

1098-
// Check if we expected to have a candidate.
1099-
EXPECT_GT(candidates_expected_, 1);
1100-
candidates_expected_--;
11011092
std::string ice_sdp;
11021093
EXPECT_TRUE(candidate->ToString(&ice_sdp));
11031094
if (signaling_message_receiver_ == nullptr || !signal_ice_candidates_) {
@@ -1181,9 +1172,6 @@ class PeerConnectionIntegrationWrapper : public webrtc::PeerConnectionObserver,
11811172
peer_connection_signaling_state_history_;
11821173
webrtc::FakeRtcEventLogFactory* event_log_factory_;
11831174

1184-
// Number of ICE candidates expected. The default is no limit.
1185-
int candidates_expected_ = std::numeric_limits<int>::max();
1186-
11871175
// Variables for tracking delay stats on an audio track
11881176
int audio_packets_stat_ = 0;
11891177
double audio_delay_stat_ = 0.0;

0 commit comments

Comments
 (0)