aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEldar Rello <elrello@microsoft.com>2020-06-10 17:53:39 +0300
committerCommit Bot <commit-bot@chromium.org>2020-06-10 15:59:32 +0000
commit9276e2c39bda4f1589ac938406dd12fc5dd58e0c (patch)
tree83162259a86e415ed68c93db5a59a5d34ba09706
parentde8a93599a68510fa5d4ba700e5debabfae83ad8 (diff)
downloadwebrtc-9276e2c39bda4f1589ac938406dd12fc5dd58e0c.tar.gz
Remove enable_simulcast_stats config flag as not needed anymore
Bug: webrtc:9547 Change-Id: Ie50453aa3496d16bfadfc9fdd3e7e6982278cfba Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176841 Commit-Queue: Eldar Rello <elrello@microsoft.com> Reviewed-by: Henrik Boström <hbos@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31492}
-rw-r--r--api/peer_connection_interface.h2
-rw-r--r--pc/peer_connection.cc3
-rw-r--r--pc/rtc_stats_collector.cc36
-rw-r--r--pc/rtc_stats_collector.h1
-rw-r--r--pc/rtc_stats_collector_unittest.cc12
-rw-r--r--pc/rtc_stats_integrationtest.cc62
6 files changed, 42 insertions, 74 deletions
diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h
index 1d81de74d8..0ae47b2a2f 100644
--- a/api/peer_connection_interface.h
+++ b/api/peer_connection_interface.h
@@ -666,8 +666,6 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface {
// Whether network condition based codec switching is allowed.
absl::optional<bool> allow_codec_switching;
- bool enable_simulcast_stats = true;
-
//
// Don't forget to update operator== if adding something.
//
diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc
index bc4e0986d8..059d5dd9e0 100644
--- a/pc/peer_connection.cc
+++ b/pc/peer_connection.cc
@@ -993,8 +993,7 @@ bool PeerConnectionInterface::RTCConfiguration::operator==(
offer_extmap_allow_mixed == o.offer_extmap_allow_mixed &&
turn_logging_id == o.turn_logging_id &&
enable_implicit_rollback == o.enable_implicit_rollback &&
- allow_codec_switching == o.allow_codec_switching &&
- enable_simulcast_stats == o.enable_simulcast_stats;
+ allow_codec_switching == o.allow_codec_switching;
}
bool PeerConnectionInterface::RTCConfiguration::operator!=(
diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc
index 546feec76f..5d6792ceb3 100644
--- a/pc/rtc_stats_collector.cc
+++ b/pc/rtc_stats_collector.cc
@@ -397,7 +397,6 @@ void SetOutboundRTPStreamStatsFromVoiceSenderInfo(
void SetOutboundRTPStreamStatsFromVideoSenderInfo(
const std::string& mid,
const cricket::VideoSenderInfo& video_sender_info,
- bool enable_simulcast_stats,
RTCOutboundRTPStreamStats* outbound_video) {
SetOutboundRTPStreamStatsFromMediaSenderInfo(video_sender_info,
outbound_video);
@@ -422,21 +421,19 @@ void SetOutboundRTPStreamStatsFromVideoSenderInfo(
rtc::kNumMillisecsPerSec;
outbound_video->total_encoded_bytes_target =
video_sender_info.total_encoded_bytes_target;
- if (enable_simulcast_stats) {
- if (video_sender_info.send_frame_width > 0) {
- outbound_video->frame_width =
- static_cast<uint32_t>(video_sender_info.send_frame_width);
- }
- if (video_sender_info.send_frame_height > 0) {
- outbound_video->frame_height =
- static_cast<uint32_t>(video_sender_info.send_frame_height);
- }
- if (video_sender_info.framerate_sent > 0) {
- outbound_video->frames_per_second = video_sender_info.framerate_sent;
- }
- outbound_video->frames_sent = video_sender_info.frames_sent;
- outbound_video->huge_frames_sent = video_sender_info.huge_frames_sent;
+ if (video_sender_info.send_frame_width > 0) {
+ outbound_video->frame_width =
+ static_cast<uint32_t>(video_sender_info.send_frame_width);
}
+ if (video_sender_info.send_frame_height > 0) {
+ outbound_video->frame_height =
+ static_cast<uint32_t>(video_sender_info.send_frame_height);
+ }
+ if (video_sender_info.framerate_sent > 0) {
+ outbound_video->frames_per_second = video_sender_info.framerate_sent;
+ }
+ outbound_video->frames_sent = video_sender_info.frames_sent;
+ outbound_video->huge_frames_sent = video_sender_info.huge_frames_sent;
outbound_video->total_packet_send_delay =
static_cast<double>(video_sender_info.total_packet_send_delay_ms) /
rtc::kNumMillisecsPerSec;
@@ -987,7 +984,6 @@ RTCStatsCollector::RTCStatsCollector(PeerConnectionInternal* pc,
RTC_DCHECK_GE(cache_lifetime_us_, 0);
pc_->SignalDataChannelCreated().connect(
this, &RTCStatsCollector::OnDataChannelCreated);
- enable_simulcast_stats_ = pc_->GetConfiguration().enable_simulcast_stats;
}
RTCStatsCollector::~RTCStatsCollector() {
@@ -1663,16 +1659,14 @@ void RTCStatsCollector::ProduceVideoRTPStreamStats_n(
// Outbound
std::map<std::string, RTCOutboundRTPStreamStats*> video_outbound_rtps;
for (const cricket::VideoSenderInfo& video_sender_info :
- enable_simulcast_stats_
- ? track_media_info_map.video_media_info()->senders
- : track_media_info_map.video_media_info()->aggregated_senders) {
+ track_media_info_map.video_media_info()->senders) {
if (!video_sender_info.connected())
continue;
auto outbound_video = std::make_unique<RTCOutboundRTPStreamStats>(
RTCOutboundRTPStreamStatsIDFromSSRC(false, video_sender_info.ssrc()),
timestamp_us);
- SetOutboundRTPStreamStatsFromVideoSenderInfo(
- mid, video_sender_info, enable_simulcast_stats_, outbound_video.get());
+ SetOutboundRTPStreamStatsFromVideoSenderInfo(mid, video_sender_info,
+ outbound_video.get());
rtc::scoped_refptr<VideoTrackInterface> video_track =
track_media_info_map.GetVideoTrack(video_sender_info);
if (video_track) {
diff --git a/pc/rtc_stats_collector.h b/pc/rtc_stats_collector.h
index 7c85a35fe0..cd5ec21041 100644
--- a/pc/rtc_stats_collector.h
+++ b/pc/rtc_stats_collector.h
@@ -288,7 +288,6 @@ class RTCStatsCollector : public virtual rtc::RefCountInterface,
std::set<uintptr_t> opened_data_channels;
};
InternalRecord internal_record_;
- bool enable_simulcast_stats_ = false;
};
const char* CandidateTypeToRTCIceCandidateTypeForTesting(
diff --git a/pc/rtc_stats_collector_unittest.cc b/pc/rtc_stats_collector_unittest.cc
index 58d76c372d..e0965af56e 100644
--- a/pc/rtc_stats_collector_unittest.cc
+++ b/pc/rtc_stats_collector_unittest.cc
@@ -2075,13 +2075,11 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Video) {
expected_video.total_packet_send_delay = 10.0;
expected_video.quality_limitation_reason = "bandwidth";
expected_video.quality_limitation_resolution_changes = 56u;
- if (pc_->GetConfiguration().enable_simulcast_stats) {
- expected_video.frame_width = 200u;
- expected_video.frame_height = 100u;
- expected_video.frames_per_second = 10.0;
- expected_video.frames_sent = 5;
- expected_video.huge_frames_sent = 2;
- }
+ expected_video.frame_width = 200u;
+ expected_video.frame_height = 100u;
+ expected_video.frames_per_second = 10.0;
+ expected_video.frames_sent = 5;
+ expected_video.huge_frames_sent = 2;
// |expected_video.content_type| should be undefined.
// |expected_video.qp_sum| should be undefined.
// |expected_video.encoder_implementation| should be undefined.
diff --git a/pc/rtc_stats_integrationtest.cc b/pc/rtc_stats_integrationtest.cc
index f6b6922a76..a0fd2d0253 100644
--- a/pc/rtc_stats_integrationtest.cc
+++ b/pc/rtc_stats_integrationtest.cc
@@ -352,8 +352,7 @@ class RTCStatsReportVerifier {
explicit RTCStatsReportVerifier(const RTCStatsReport* report)
: report_(report) {}
- void VerifyReport(std::vector<const char*> allowed_missing_stats,
- bool enable_simulcast_stats) {
+ void VerifyReport(std::vector<const char*> allowed_missing_stats) {
std::set<const char*> missing_stats = StatsTypes();
bool verify_successful = true;
std::vector<const RTCTransportStats*> transport_stats =
@@ -396,7 +395,7 @@ class RTCStatsReportVerifier {
stats.cast_to<RTCInboundRTPStreamStats>());
} else if (stats.type() == RTCOutboundRTPStreamStats::kType) {
verify_successful &= VerifyRTCOutboundRTPStreamStats(
- stats.cast_to<RTCOutboundRTPStreamStats>(), enable_simulcast_stats);
+ stats.cast_to<RTCOutboundRTPStreamStats>());
} else if (stats.type() == RTCRemoteInboundRtpStreamStats::kType) {
verify_successful &= VerifyRTCRemoteInboundRtpStreamStats(
stats.cast_to<RTCRemoteInboundRtpStreamStats>());
@@ -866,8 +865,7 @@ class RTCStatsReportVerifier {
}
bool VerifyRTCOutboundRTPStreamStats(
- const RTCOutboundRTPStreamStats& outbound_stream,
- bool enable_simulcast_stats) {
+ const RTCOutboundRTPStreamStats& outbound_stream) {
RTCStatsVerifier verifier(report_, &outbound_stream);
VerifyRTCRTPStreamStats(outbound_stream, &verifier);
if (outbound_stream.media_type.is_defined() &&
@@ -912,33 +910,23 @@ class RTCStatsReportVerifier {
// this to be present.
verifier.MarkMemberTested(outbound_stream.content_type, true);
verifier.TestMemberIsDefined(outbound_stream.encoder_implementation);
- if (enable_simulcast_stats) {
- // Unless an implementation-specific amount of time has passed and at
- // least one frame has been encoded, undefined is reported. Because it
- // is hard to tell what is the case here, we treat FPS as optional.
- // TODO(hbos): Update the tests to run until all implemented metrics
- // should be populated.
- if (outbound_stream.frames_per_second.is_defined()) {
- verifier.TestMemberIsNonNegative<double>(
- outbound_stream.frames_per_second);
- } else {
- verifier.TestMemberIsUndefined(outbound_stream.frames_per_second);
- }
- verifier.TestMemberIsNonNegative<uint32_t>(
- outbound_stream.frame_height);
- verifier.TestMemberIsNonNegative<uint32_t>(outbound_stream.frame_width);
- verifier.TestMemberIsNonNegative<uint32_t>(outbound_stream.frames_sent);
- verifier.TestMemberIsNonNegative<uint32_t>(
- outbound_stream.huge_frames_sent);
- verifier.MarkMemberTested(outbound_stream.rid, true);
+ // Unless an implementation-specific amount of time has passed and at
+ // least one frame has been encoded, undefined is reported. Because it
+ // is hard to tell what is the case here, we treat FPS as optional.
+ // TODO(hbos): Update the tests to run until all implemented metrics
+ // should be populated.
+ if (outbound_stream.frames_per_second.is_defined()) {
+ verifier.TestMemberIsNonNegative<double>(
+ outbound_stream.frames_per_second);
} else {
verifier.TestMemberIsUndefined(outbound_stream.frames_per_second);
- verifier.TestMemberIsUndefined(outbound_stream.frame_height);
- verifier.TestMemberIsUndefined(outbound_stream.frame_width);
- verifier.TestMemberIsUndefined(outbound_stream.frames_sent);
- verifier.TestMemberIsUndefined(outbound_stream.huge_frames_sent);
- verifier.TestMemberIsUndefined(outbound_stream.rid);
}
+ verifier.TestMemberIsNonNegative<uint32_t>(outbound_stream.frame_height);
+ verifier.TestMemberIsNonNegative<uint32_t>(outbound_stream.frame_width);
+ verifier.TestMemberIsNonNegative<uint32_t>(outbound_stream.frames_sent);
+ verifier.TestMemberIsNonNegative<uint32_t>(
+ outbound_stream.huge_frames_sent);
+ verifier.MarkMemberTested(outbound_stream.rid, true);
} else {
verifier.TestMemberIsUndefined(outbound_stream.frames_encoded);
verifier.TestMemberIsUndefined(outbound_stream.key_frames_encoded);
@@ -1053,9 +1041,7 @@ TEST_F(RTCStatsIntegrationTest, GetStatsFromCaller) {
StartCall();
rtc::scoped_refptr<const RTCStatsReport> report = GetStatsFromCaller();
- RTCStatsReportVerifier(report.get())
- .VerifyReport({},
- caller_->pc()->GetConfiguration().enable_simulcast_stats);
+ RTCStatsReportVerifier(report.get()).VerifyReport({});
#if RTC_TRACE_EVENTS_ENABLED
EXPECT_EQ(report->ToJson(), RTCStatsReportTraceListener::last_trace());
@@ -1066,9 +1052,7 @@ TEST_F(RTCStatsIntegrationTest, GetStatsFromCallee) {
StartCall();
rtc::scoped_refptr<const RTCStatsReport> report = GetStatsFromCallee();
- RTCStatsReportVerifier(report.get())
- .VerifyReport({},
- caller_->pc()->GetConfiguration().enable_simulcast_stats);
+ RTCStatsReportVerifier(report.get()).VerifyReport({});
#if RTC_TRACE_EVENTS_ENABLED
EXPECT_EQ(report->ToJson(), RTCStatsReportTraceListener::last_trace());
@@ -1092,9 +1076,7 @@ TEST_F(RTCStatsIntegrationTest, GetStatsWithSenderSelector) {
RTCMediaStreamStats::kType,
RTCDataChannelStats::kType,
};
- RTCStatsReportVerifier(report.get())
- .VerifyReport(allowed_missing_stats,
- caller_->pc()->GetConfiguration().enable_simulcast_stats);
+ RTCStatsReportVerifier(report.get()).VerifyReport(allowed_missing_stats);
EXPECT_TRUE(report->size());
}
@@ -1113,9 +1095,7 @@ TEST_F(RTCStatsIntegrationTest, GetStatsWithReceiverSelector) {
RTCMediaStreamStats::kType,
RTCDataChannelStats::kType,
};
- RTCStatsReportVerifier(report.get())
- .VerifyReport(allowed_missing_stats,
- caller_->pc()->GetConfiguration().enable_simulcast_stats);
+ RTCStatsReportVerifier(report.get()).VerifyReport(allowed_missing_stats);
EXPECT_TRUE(report->size());
}