Remove SdpSemantics::kDefault
This adds confusion to the native API and is only needed for Chromium UMA metrics, so the appropriate metrics have been moved upstream and kDefault option removed. Bug: chromium:811683 Change-Id: I666d7f7793765b8d6edcd99416c8b6c957766f00 Reviewed-on: https://webrtc-review.googlesource.com/59261 Commit-Queue: Steve Anton <steveanton@webrtc.org> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Reviewed-by: Seth Hampson <shampson@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22864}
This commit is contained in:
@ -3003,27 +3003,6 @@ void PeerConnection::RegisterUMAObserver(UMAObserver* observer) {
|
||||
kEnumCounterAddressFamily, kPeerConnection_IPv4,
|
||||
kPeerConnectionAddressFamilyCounter_Max);
|
||||
}
|
||||
// Send information about the requested SDP semantics.
|
||||
switch (configuration_.sdp_semantics) {
|
||||
case SdpSemantics::kDefault:
|
||||
uma_observer_->IncrementEnumCounter(kEnumCounterSdpSemanticRequested,
|
||||
kSdpSemanticRequestDefault,
|
||||
kSdpSemanticRequestMax);
|
||||
|
||||
break;
|
||||
case SdpSemantics::kPlanB:
|
||||
uma_observer_->IncrementEnumCounter(kEnumCounterSdpSemanticRequested,
|
||||
kSdpSemanticRequestPlanB,
|
||||
kSdpSemanticRequestMax);
|
||||
break;
|
||||
case SdpSemantics::kUnifiedPlan:
|
||||
uma_observer_->IncrementEnumCounter(kEnumCounterSdpSemanticRequested,
|
||||
kSdpSemanticRequestUnifiedPlan,
|
||||
kSdpSemanticRequestMax);
|
||||
break;
|
||||
default:
|
||||
RTC_NOTREACHED();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1146,9 +1146,7 @@ class PeerConnectionIntegrationBaseTest : public testing::Test {
|
||||
if (config) {
|
||||
modified_config = *config;
|
||||
}
|
||||
if (modified_config.sdp_semantics == SdpSemantics::kDefault) {
|
||||
modified_config.sdp_semantics = sdp_semantics_;
|
||||
}
|
||||
modified_config.sdp_semantics = sdp_semantics_;
|
||||
if (!cert_generator) {
|
||||
cert_generator = rtc::MakeUnique<FakeRTCCertificateGenerator>();
|
||||
}
|
||||
@ -1168,6 +1166,25 @@ class PeerConnectionIntegrationBaseTest : public testing::Test {
|
||||
PeerConnectionInterface::RTCConfiguration());
|
||||
}
|
||||
|
||||
bool CreatePeerConnectionWrappersWithSdpSemantics(
|
||||
SdpSemantics caller_semantics,
|
||||
SdpSemantics callee_semantics) {
|
||||
// Can't specify the sdp_semantics in the passed-in configuration since it
|
||||
// will be overwritten by CreatePeerConnectionWrapper with whatever is
|
||||
// stored in sdp_semantics_. So get around this by modifying the instance
|
||||
// variable before calling CreatePeerConnectionWrapper for the caller and
|
||||
// callee PeerConnections.
|
||||
SdpSemantics original_semantics = sdp_semantics_;
|
||||
sdp_semantics_ = caller_semantics;
|
||||
caller_ = CreatePeerConnectionWrapper("Caller", nullptr, nullptr, nullptr,
|
||||
nullptr);
|
||||
sdp_semantics_ = callee_semantics;
|
||||
callee_ = CreatePeerConnectionWrapper("Callee", nullptr, nullptr, nullptr,
|
||||
nullptr);
|
||||
sdp_semantics_ = original_semantics;
|
||||
return caller_ && callee_;
|
||||
}
|
||||
|
||||
bool CreatePeerConnectionWrappersWithConstraints(
|
||||
MediaConstraintsInterface* caller_constraints,
|
||||
MediaConstraintsInterface* callee_constraints) {
|
||||
@ -1415,7 +1432,7 @@ class PeerConnectionIntegrationBaseTest : public testing::Test {
|
||||
}
|
||||
|
||||
protected:
|
||||
const SdpSemantics sdp_semantics_;
|
||||
SdpSemantics sdp_semantics_;
|
||||
|
||||
private:
|
||||
// |ss_| is used by |network_thread_| so it must be destroyed later.
|
||||
@ -4187,16 +4204,13 @@ class PeerConnectionIntegrationInteropTest
|
||||
// because we specify not to use the test semantics when creating
|
||||
// PeerConnectionWrappers.
|
||||
PeerConnectionIntegrationInteropTest()
|
||||
: PeerConnectionIntegrationBaseTest(SdpSemantics::kDefault),
|
||||
: PeerConnectionIntegrationBaseTest(SdpSemantics::kPlanB),
|
||||
caller_semantics_(std::get<0>(GetParam())),
|
||||
callee_semantics_(std::get<1>(GetParam())) {}
|
||||
|
||||
bool CreatePeerConnectionWrappersWithSemantics() {
|
||||
RTCConfiguration caller_config;
|
||||
caller_config.sdp_semantics = caller_semantics_;
|
||||
RTCConfiguration callee_config;
|
||||
callee_config.sdp_semantics = callee_semantics_;
|
||||
return CreatePeerConnectionWrappersWithConfig(caller_config, callee_config);
|
||||
return CreatePeerConnectionWrappersWithSdpSemantics(caller_semantics_,
|
||||
callee_semantics_);
|
||||
}
|
||||
|
||||
const SdpSemantics caller_semantics_;
|
||||
@ -4304,13 +4318,8 @@ INSTANTIATE_TEST_CASE_P(
|
||||
// Test that if the Unified Plan side offers two video tracks then the Plan B
|
||||
// side will only see the first one and ignore the second.
|
||||
TEST_F(PeerConnectionIntegrationTestPlanB, TwoVideoUnifiedPlanToNoMediaPlanB) {
|
||||
RTCConfiguration caller_config;
|
||||
caller_config.sdp_semantics = SdpSemantics::kUnifiedPlan;
|
||||
RTCConfiguration callee_config;
|
||||
callee_config.sdp_semantics = SdpSemantics::kPlanB;
|
||||
ASSERT_TRUE(
|
||||
CreatePeerConnectionWrappersWithConfig(caller_config, callee_config));
|
||||
|
||||
ASSERT_TRUE(CreatePeerConnectionWrappersWithSdpSemantics(
|
||||
SdpSemantics::kUnifiedPlan, SdpSemantics::kPlanB));
|
||||
ConnectFakeSignaling();
|
||||
auto first_sender = caller()->AddVideoTrack();
|
||||
caller()->AddVideoTrack();
|
||||
|
Reference in New Issue
Block a user