Delete unused method VCMReceiveStatisticsCallback::OnReceiveRatesUpdated
Only interesting call deleted in cl
https://codereview.webrtc.org/2704183002.
Move call to QualitySample (used for bad call detection) to
OnRenderedFrame
Bug: webrtc:7408
Change-Id: I0e9ae2ed62fe19a282377cb840e38bd2aae8f3e6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128768
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27243}
diff --git a/modules/video_coding/frame_buffer2_unittest.cc b/modules/video_coding/frame_buffer2_unittest.cc
index 7dc8cb2..5348269 100644
--- a/modules/video_coding/frame_buffer2_unittest.cc
+++ b/modules/video_coding/frame_buffer2_unittest.cc
@@ -95,8 +95,6 @@
class VCMReceiveStatisticsCallbackMock : public VCMReceiveStatisticsCallback {
public:
- MOCK_METHOD2(OnReceiveRatesUpdated,
- void(uint32_t bitRate, uint32_t frameRate));
MOCK_METHOD3(OnCompleteFrame,
void(bool is_keyframe,
size_t size_bytes,
diff --git a/modules/video_coding/include/video_coding_defines.h b/modules/video_coding/include/video_coding_defines.h
index dc9060c..81ec68d 100644
--- a/modules/video_coding/include/video_coding_defines.h
+++ b/modules/video_coding/include/video_coding_defines.h
@@ -81,7 +81,6 @@
// rate.
class VCMReceiveStatisticsCallback {
public:
- virtual void OnReceiveRatesUpdated(uint32_t bitRate, uint32_t frameRate) = 0;
virtual void OnCompleteFrame(bool is_keyframe,
size_t size_bytes,
VideoContentType content_type) = 0;
diff --git a/modules/video_coding/video_receiver.cc b/modules/video_coding/video_receiver.cc
index db9ceb8..1f3fac3e 100644
--- a/modules/video_coding/video_receiver.cc
+++ b/modules/video_coding/video_receiver.cc
@@ -79,9 +79,6 @@
// ReceiveStatisticsProxy::QualitySample.
if (_receiveStatsTimer.TimeUntilProcess() == 0) {
_receiveStatsTimer.Processed();
- if (_receiveStatsCallback != nullptr) {
- _receiveStatsCallback->OnReceiveRatesUpdated(0, 0);
- }
}
// Key frame requests
diff --git a/video/receive_statistics_proxy.cc b/video/receive_statistics_proxy.cc
index b3f0710..4927b99 100644
--- a/video/receive_statistics_proxy.cc
+++ b/video/receive_statistics_proxy.cc
@@ -488,8 +488,6 @@
}
void ReceiveStatisticsProxy::QualitySample() {
- RTC_DCHECK_RUN_ON(&network_thread_);
-
int64_t now = clock_->TimeInMilliseconds();
if (last_sample_time_ + kMinSampleLengthMs > now)
return;
@@ -607,13 +605,6 @@
rtc::CritScope lock(&crit_);
stats_.decoder_implementation_name = implementation_name;
}
-void ReceiveStatisticsProxy::OnIncomingRate(unsigned int framerate,
- unsigned int bitrate_bps) {
- RTC_DCHECK_RUN_ON(&network_thread_);
- rtc::CritScope lock(&crit_);
- if (stats_.rtp_stats.first_packet_time_ms != -1)
- QualitySample();
-}
void ReceiveStatisticsProxy::OnFrameBufferTimingsUpdated(
int decode_ms,
@@ -808,6 +799,7 @@
content_specific_stats->e2e_delay_counter.Add(delay_ms);
}
}
+ QualitySample();
}
void ReceiveStatisticsProxy::OnSyncOffsetUpdated(int64_t sync_offset_ms,
@@ -825,9 +817,6 @@
freq_offset_counter_.Add(offset_khz);
}
-void ReceiveStatisticsProxy::OnReceiveRatesUpdated(uint32_t bitRate,
- uint32_t frameRate) {}
-
void ReceiveStatisticsProxy::OnCompleteFrame(bool is_keyframe,
size_t size_bytes,
VideoContentType content_type) {
diff --git a/video/receive_statistics_proxy.h b/video/receive_statistics_proxy.h
index 723dc27..8d54f49 100644
--- a/video/receive_statistics_proxy.h
+++ b/video/receive_statistics_proxy.h
@@ -56,7 +56,6 @@
void OnRenderedFrame(const VideoFrame& frame);
void OnIncomingPayloadType(int payload_type);
void OnDecoderImplementationName(const char* implementation_name);
- void OnIncomingRate(unsigned int framerate, unsigned int bitrate_bps);
void OnPreDecode(VideoCodecType codec_type, int qp);
@@ -66,7 +65,6 @@
void OnStreamInactive();
// Overrides VCMReceiveStatisticsCallback.
- void OnReceiveRatesUpdated(uint32_t bitRate, uint32_t frameRate) override;
void OnFrameCountsUpdated(const FrameCounts& frame_counts) override;
void OnDiscardedPacketsUpdated(int discarded_packets) override;
void OnCompleteFrame(bool is_keyframe,
diff --git a/video/receive_statistics_proxy_unittest.cc b/video/receive_statistics_proxy_unittest.cc
index 41a279d..9af5db4 100644
--- a/video/receive_statistics_proxy_unittest.cc
+++ b/video/receive_statistics_proxy_unittest.cc
@@ -565,16 +565,18 @@
// then 10 certainly bad states. There has to be 10 certain states before
// any histograms are recorded.
const int kNumBadSamples = 17;
+ // We only count one sample per second.
+ const int kBadFameIntervalMs = 1100;
StreamDataCounters counters;
counters.first_packet_time_ms = fake_clock_.TimeInMilliseconds();
statistics_proxy_->DataCountersUpdated(counters, config_.rtp.remote_ssrc);
+ webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight);
+
for (int i = 0; i < kNumBadSamples; ++i) {
- // Since OnRenderedFrame is never called the fps in each sample will be 0,
- // i.e. bad
- fake_clock_.AdvanceTimeMilliseconds(1000);
- statistics_proxy_->OnIncomingRate(0, 0);
+ fake_clock_.AdvanceTimeMilliseconds(kBadFameIntervalMs);
+ statistics_proxy_->OnRenderedFrame(frame);
}
// Histograms are updated when the statistics_proxy_ is deleted.
statistics_proxy_.reset();
diff --git a/video/video_stream_decoder.cc b/video/video_stream_decoder.cc
index fad7da8..69c10ed 100644
--- a/video/video_stream_decoder.cc
+++ b/video/video_stream_decoder.cc
@@ -86,11 +86,6 @@
receive_stats_callback_->OnDecoderImplementationName(implementation_name);
}
-void VideoStreamDecoder::OnReceiveRatesUpdated(uint32_t bit_rate,
- uint32_t frame_rate) {
- receive_stats_callback_->OnIncomingRate(frame_rate, bit_rate);
-}
-
void VideoStreamDecoder::OnDiscardedPacketsUpdated(int discarded_packets) {
receive_stats_callback_->OnDiscardedPacketsUpdated(discarded_packets);
}
diff --git a/video/video_stream_decoder.h b/video/video_stream_decoder.h
index b029407..efaa8cc 100644
--- a/video/video_stream_decoder.h
+++ b/video/video_stream_decoder.h
@@ -53,7 +53,6 @@
void OnDecoderImplementationName(const char* implementation_name) override;
// Implements VCMReceiveStatisticsCallback.
- void OnReceiveRatesUpdated(uint32_t bit_rate, uint32_t frame_rate) override;
void OnDiscardedPacketsUpdated(int discarded_packets) override;
void OnFrameCountsUpdated(const FrameCounts& frame_counts) override;
void OnCompleteFrame(bool is_keyframe,