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}
This commit is contained in:
Eldar Rello
2020-06-10 17:53:39 +03:00
committed by Commit Bot
parent de8a93599a
commit 9276e2c39b
6 changed files with 42 additions and 74 deletions

View File

@ -666,8 +666,6 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface {
// Whether network condition based codec switching is allowed. // Whether network condition based codec switching is allowed.
absl::optional<bool> allow_codec_switching; absl::optional<bool> allow_codec_switching;
bool enable_simulcast_stats = true;
// //
// Don't forget to update operator== if adding something. // Don't forget to update operator== if adding something.
// //

View File

@ -993,8 +993,7 @@ bool PeerConnectionInterface::RTCConfiguration::operator==(
offer_extmap_allow_mixed == o.offer_extmap_allow_mixed && offer_extmap_allow_mixed == o.offer_extmap_allow_mixed &&
turn_logging_id == o.turn_logging_id && turn_logging_id == o.turn_logging_id &&
enable_implicit_rollback == o.enable_implicit_rollback && enable_implicit_rollback == o.enable_implicit_rollback &&
allow_codec_switching == o.allow_codec_switching && allow_codec_switching == o.allow_codec_switching;
enable_simulcast_stats == o.enable_simulcast_stats;
} }
bool PeerConnectionInterface::RTCConfiguration::operator!=( bool PeerConnectionInterface::RTCConfiguration::operator!=(

View File

@ -397,7 +397,6 @@ void SetOutboundRTPStreamStatsFromVoiceSenderInfo(
void SetOutboundRTPStreamStatsFromVideoSenderInfo( void SetOutboundRTPStreamStatsFromVideoSenderInfo(
const std::string& mid, const std::string& mid,
const cricket::VideoSenderInfo& video_sender_info, const cricket::VideoSenderInfo& video_sender_info,
bool enable_simulcast_stats,
RTCOutboundRTPStreamStats* outbound_video) { RTCOutboundRTPStreamStats* outbound_video) {
SetOutboundRTPStreamStatsFromMediaSenderInfo(video_sender_info, SetOutboundRTPStreamStatsFromMediaSenderInfo(video_sender_info,
outbound_video); outbound_video);
@ -422,21 +421,19 @@ void SetOutboundRTPStreamStatsFromVideoSenderInfo(
rtc::kNumMillisecsPerSec; rtc::kNumMillisecsPerSec;
outbound_video->total_encoded_bytes_target = outbound_video->total_encoded_bytes_target =
video_sender_info.total_encoded_bytes_target; video_sender_info.total_encoded_bytes_target;
if (enable_simulcast_stats) { if (video_sender_info.send_frame_width > 0) {
if (video_sender_info.send_frame_width > 0) { outbound_video->frame_width =
outbound_video->frame_width = static_cast<uint32_t>(video_sender_info.send_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_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 = outbound_video->total_packet_send_delay =
static_cast<double>(video_sender_info.total_packet_send_delay_ms) / static_cast<double>(video_sender_info.total_packet_send_delay_ms) /
rtc::kNumMillisecsPerSec; rtc::kNumMillisecsPerSec;
@ -987,7 +984,6 @@ RTCStatsCollector::RTCStatsCollector(PeerConnectionInternal* pc,
RTC_DCHECK_GE(cache_lifetime_us_, 0); RTC_DCHECK_GE(cache_lifetime_us_, 0);
pc_->SignalDataChannelCreated().connect( pc_->SignalDataChannelCreated().connect(
this, &RTCStatsCollector::OnDataChannelCreated); this, &RTCStatsCollector::OnDataChannelCreated);
enable_simulcast_stats_ = pc_->GetConfiguration().enable_simulcast_stats;
} }
RTCStatsCollector::~RTCStatsCollector() { RTCStatsCollector::~RTCStatsCollector() {
@ -1663,16 +1659,14 @@ void RTCStatsCollector::ProduceVideoRTPStreamStats_n(
// Outbound // Outbound
std::map<std::string, RTCOutboundRTPStreamStats*> video_outbound_rtps; std::map<std::string, RTCOutboundRTPStreamStats*> video_outbound_rtps;
for (const cricket::VideoSenderInfo& video_sender_info : 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()->senders
: track_media_info_map.video_media_info()->aggregated_senders) {
if (!video_sender_info.connected()) if (!video_sender_info.connected())
continue; continue;
auto outbound_video = std::make_unique<RTCOutboundRTPStreamStats>( auto outbound_video = std::make_unique<RTCOutboundRTPStreamStats>(
RTCOutboundRTPStreamStatsIDFromSSRC(false, video_sender_info.ssrc()), RTCOutboundRTPStreamStatsIDFromSSRC(false, video_sender_info.ssrc()),
timestamp_us); timestamp_us);
SetOutboundRTPStreamStatsFromVideoSenderInfo( SetOutboundRTPStreamStatsFromVideoSenderInfo(mid, video_sender_info,
mid, video_sender_info, enable_simulcast_stats_, outbound_video.get()); outbound_video.get());
rtc::scoped_refptr<VideoTrackInterface> video_track = rtc::scoped_refptr<VideoTrackInterface> video_track =
track_media_info_map.GetVideoTrack(video_sender_info); track_media_info_map.GetVideoTrack(video_sender_info);
if (video_track) { if (video_track) {

View File

@ -288,7 +288,6 @@ class RTCStatsCollector : public virtual rtc::RefCountInterface,
std::set<uintptr_t> opened_data_channels; std::set<uintptr_t> opened_data_channels;
}; };
InternalRecord internal_record_; InternalRecord internal_record_;
bool enable_simulcast_stats_ = false;
}; };
const char* CandidateTypeToRTCIceCandidateTypeForTesting( const char* CandidateTypeToRTCIceCandidateTypeForTesting(

View File

@ -2075,13 +2075,11 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Video) {
expected_video.total_packet_send_delay = 10.0; expected_video.total_packet_send_delay = 10.0;
expected_video.quality_limitation_reason = "bandwidth"; expected_video.quality_limitation_reason = "bandwidth";
expected_video.quality_limitation_resolution_changes = 56u; expected_video.quality_limitation_resolution_changes = 56u;
if (pc_->GetConfiguration().enable_simulcast_stats) { expected_video.frame_width = 200u;
expected_video.frame_width = 200u; expected_video.frame_height = 100u;
expected_video.frame_height = 100u; expected_video.frames_per_second = 10.0;
expected_video.frames_per_second = 10.0; expected_video.frames_sent = 5;
expected_video.frames_sent = 5; expected_video.huge_frames_sent = 2;
expected_video.huge_frames_sent = 2;
}
// |expected_video.content_type| should be undefined. // |expected_video.content_type| should be undefined.
// |expected_video.qp_sum| should be undefined. // |expected_video.qp_sum| should be undefined.
// |expected_video.encoder_implementation| should be undefined. // |expected_video.encoder_implementation| should be undefined.

View File

@ -352,8 +352,7 @@ class RTCStatsReportVerifier {
explicit RTCStatsReportVerifier(const RTCStatsReport* report) explicit RTCStatsReportVerifier(const RTCStatsReport* report)
: report_(report) {} : report_(report) {}
void VerifyReport(std::vector<const char*> allowed_missing_stats, void VerifyReport(std::vector<const char*> allowed_missing_stats) {
bool enable_simulcast_stats) {
std::set<const char*> missing_stats = StatsTypes(); std::set<const char*> missing_stats = StatsTypes();
bool verify_successful = true; bool verify_successful = true;
std::vector<const RTCTransportStats*> transport_stats = std::vector<const RTCTransportStats*> transport_stats =
@ -396,7 +395,7 @@ class RTCStatsReportVerifier {
stats.cast_to<RTCInboundRTPStreamStats>()); stats.cast_to<RTCInboundRTPStreamStats>());
} else if (stats.type() == RTCOutboundRTPStreamStats::kType) { } else if (stats.type() == RTCOutboundRTPStreamStats::kType) {
verify_successful &= VerifyRTCOutboundRTPStreamStats( verify_successful &= VerifyRTCOutboundRTPStreamStats(
stats.cast_to<RTCOutboundRTPStreamStats>(), enable_simulcast_stats); stats.cast_to<RTCOutboundRTPStreamStats>());
} else if (stats.type() == RTCRemoteInboundRtpStreamStats::kType) { } else if (stats.type() == RTCRemoteInboundRtpStreamStats::kType) {
verify_successful &= VerifyRTCRemoteInboundRtpStreamStats( verify_successful &= VerifyRTCRemoteInboundRtpStreamStats(
stats.cast_to<RTCRemoteInboundRtpStreamStats>()); stats.cast_to<RTCRemoteInboundRtpStreamStats>());
@ -866,8 +865,7 @@ class RTCStatsReportVerifier {
} }
bool VerifyRTCOutboundRTPStreamStats( bool VerifyRTCOutboundRTPStreamStats(
const RTCOutboundRTPStreamStats& outbound_stream, const RTCOutboundRTPStreamStats& outbound_stream) {
bool enable_simulcast_stats) {
RTCStatsVerifier verifier(report_, &outbound_stream); RTCStatsVerifier verifier(report_, &outbound_stream);
VerifyRTCRTPStreamStats(outbound_stream, &verifier); VerifyRTCRTPStreamStats(outbound_stream, &verifier);
if (outbound_stream.media_type.is_defined() && if (outbound_stream.media_type.is_defined() &&
@ -912,33 +910,23 @@ class RTCStatsReportVerifier {
// this to be present. // this to be present.
verifier.MarkMemberTested(outbound_stream.content_type, true); verifier.MarkMemberTested(outbound_stream.content_type, true);
verifier.TestMemberIsDefined(outbound_stream.encoder_implementation); verifier.TestMemberIsDefined(outbound_stream.encoder_implementation);
if (enable_simulcast_stats) { // Unless an implementation-specific amount of time has passed and at
// Unless an implementation-specific amount of time has passed and at // least one frame has been encoded, undefined is reported. Because it
// 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.
// 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
// TODO(hbos): Update the tests to run until all implemented metrics // should be populated.
// should be populated. if (outbound_stream.frames_per_second.is_defined()) {
if (outbound_stream.frames_per_second.is_defined()) { verifier.TestMemberIsNonNegative<double>(
verifier.TestMemberIsNonNegative<double>( outbound_stream.frames_per_second);
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);
} else { } else {
verifier.TestMemberIsUndefined(outbound_stream.frames_per_second); 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 { } else {
verifier.TestMemberIsUndefined(outbound_stream.frames_encoded); verifier.TestMemberIsUndefined(outbound_stream.frames_encoded);
verifier.TestMemberIsUndefined(outbound_stream.key_frames_encoded); verifier.TestMemberIsUndefined(outbound_stream.key_frames_encoded);
@ -1053,9 +1041,7 @@ TEST_F(RTCStatsIntegrationTest, GetStatsFromCaller) {
StartCall(); StartCall();
rtc::scoped_refptr<const RTCStatsReport> report = GetStatsFromCaller(); rtc::scoped_refptr<const RTCStatsReport> report = GetStatsFromCaller();
RTCStatsReportVerifier(report.get()) RTCStatsReportVerifier(report.get()).VerifyReport({});
.VerifyReport({},
caller_->pc()->GetConfiguration().enable_simulcast_stats);
#if RTC_TRACE_EVENTS_ENABLED #if RTC_TRACE_EVENTS_ENABLED
EXPECT_EQ(report->ToJson(), RTCStatsReportTraceListener::last_trace()); EXPECT_EQ(report->ToJson(), RTCStatsReportTraceListener::last_trace());
@ -1066,9 +1052,7 @@ TEST_F(RTCStatsIntegrationTest, GetStatsFromCallee) {
StartCall(); StartCall();
rtc::scoped_refptr<const RTCStatsReport> report = GetStatsFromCallee(); rtc::scoped_refptr<const RTCStatsReport> report = GetStatsFromCallee();
RTCStatsReportVerifier(report.get()) RTCStatsReportVerifier(report.get()).VerifyReport({});
.VerifyReport({},
caller_->pc()->GetConfiguration().enable_simulcast_stats);
#if RTC_TRACE_EVENTS_ENABLED #if RTC_TRACE_EVENTS_ENABLED
EXPECT_EQ(report->ToJson(), RTCStatsReportTraceListener::last_trace()); EXPECT_EQ(report->ToJson(), RTCStatsReportTraceListener::last_trace());
@ -1092,9 +1076,7 @@ TEST_F(RTCStatsIntegrationTest, GetStatsWithSenderSelector) {
RTCMediaStreamStats::kType, RTCMediaStreamStats::kType,
RTCDataChannelStats::kType, RTCDataChannelStats::kType,
}; };
RTCStatsReportVerifier(report.get()) RTCStatsReportVerifier(report.get()).VerifyReport(allowed_missing_stats);
.VerifyReport(allowed_missing_stats,
caller_->pc()->GetConfiguration().enable_simulcast_stats);
EXPECT_TRUE(report->size()); EXPECT_TRUE(report->size());
} }
@ -1113,9 +1095,7 @@ TEST_F(RTCStatsIntegrationTest, GetStatsWithReceiverSelector) {
RTCMediaStreamStats::kType, RTCMediaStreamStats::kType,
RTCDataChannelStats::kType, RTCDataChannelStats::kType,
}; };
RTCStatsReportVerifier(report.get()) RTCStatsReportVerifier(report.get()).VerifyReport(allowed_missing_stats);
.VerifyReport(allowed_missing_stats,
caller_->pc()->GetConfiguration().enable_simulcast_stats);
EXPECT_TRUE(report->size()); EXPECT_TRUE(report->size());
} }