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:
@ -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.
|
||||
//
|
||||
|
||||
@ -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!=(
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user