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}
This commit is contained in:
@ -95,8 +95,6 @@ class FrameObjectFake : public EncodedFrame {
|
||||
|
||||
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,
|
||||
|
||||
@ -81,7 +81,6 @@ class VCMReceiveCallback {
|
||||
// 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;
|
||||
|
||||
@ -79,9 +79,6 @@ void VideoReceiver::Process() {
|
||||
// ReceiveStatisticsProxy::QualitySample.
|
||||
if (_receiveStatsTimer.TimeUntilProcess() == 0) {
|
||||
_receiveStatsTimer.Processed();
|
||||
if (_receiveStatsCallback != nullptr) {
|
||||
_receiveStatsCallback->OnReceiveRatesUpdated(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Key frame requests
|
||||
|
||||
@ -488,8 +488,6 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
|
||||
}
|
||||
|
||||
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 @@ void ReceiveStatisticsProxy::OnDecoderImplementationName(
|
||||
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 @@ void ReceiveStatisticsProxy::OnRenderedFrame(const VideoFrame& frame) {
|
||||
content_specific_stats->e2e_delay_counter.Add(delay_ms);
|
||||
}
|
||||
}
|
||||
QualitySample();
|
||||
}
|
||||
|
||||
void ReceiveStatisticsProxy::OnSyncOffsetUpdated(int64_t sync_offset_ms,
|
||||
@ -825,9 +817,6 @@ void ReceiveStatisticsProxy::OnSyncOffsetUpdated(int64_t sync_offset_ms,
|
||||
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) {
|
||||
|
||||
@ -56,7 +56,6 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback,
|
||||
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 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback,
|
||||
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,
|
||||
|
||||
@ -565,16 +565,18 @@ TEST_F(ReceiveStatisticsProxyTest, BadCallHistogramsAreUpdated) {
|
||||
// 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();
|
||||
|
||||
@ -86,11 +86,6 @@ void VideoStreamDecoder::OnDecoderImplementationName(
|
||||
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);
|
||||
}
|
||||
|
||||
@ -53,7 +53,6 @@ class VideoStreamDecoder : public VCMReceiveCallback,
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user