Allow single-mline offers without BUNDLE group when using max-bundle

since BUNDLE is not meaningful for those cases.
This matches Firefox behavior.

BUG=chromium:1444615

Change-Id: Id841b7e30a1c920efd977caebc71ab25d084577a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305640
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40151}
This commit is contained in:
Philipp Hancke 2023-05-17 12:23:53 +02:00 committed by WebRTC LUCI CQ
parent dff6e25f9e
commit 5f38949c54
2 changed files with 18 additions and 1 deletions

View File

@ -813,7 +813,8 @@ RTCError JsepTransportController::ValidateAndMaybeUpdateBundleGroups(
if (config_.bundle_policy ==
PeerConnectionInterface::kBundlePolicyMaxBundle &&
!description->HasGroup(cricket::GROUP_TYPE_BUNDLE)) {
!description->HasGroup(cricket::GROUP_TYPE_BUNDLE) &&
description->contents().size() > 1) {
return RTCError(RTCErrorType::INVALID_PARAMETER,
"max-bundle is used but no bundle group found.");
}

View File

@ -2727,4 +2727,20 @@ TEST_F(JsepTransportControllerTest, BundleOnlySectionDoesNotNeedRtcpMux) {
.ok());
}
// Test that with max-bundle a single unbundled m-line is accepted.
TEST_F(JsepTransportControllerTest,
MaxBundleDoesNotRequireBundleForFirstMline) {
auto config = JsepTransportController::Config();
config.bundle_policy = PeerConnectionInterface::kBundlePolicyMaxBundle;
CreateJsepTransportController(std::move(config));
auto offer = std::make_unique<cricket::SessionDescription>();
AddAudioSection(offer.get(), kAudioMid1, kIceUfrag1, kIcePwd1,
cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS,
nullptr);
EXPECT_TRUE(
transport_controller_->SetRemoteDescription(SdpType::kOffer, offer.get())
.ok());
}
} // namespace webrtc