diff --git a/rtc_base/numerics/sample_counter.cc b/rtc_base/numerics/sample_counter.cc index 50e9f2a10a..c76e609e03 100644 --- a/rtc_base/numerics/sample_counter.cc +++ b/rtc_base/numerics/sample_counter.cc @@ -17,7 +17,7 @@ #include "rtc_base/checks.h" #include "rtc_base/numerics/safe_conversions.h" -namespace rtc { +namespace webrtc { SampleCounter::SampleCounter() = default; SampleCounter::~SampleCounter() = default; @@ -117,4 +117,4 @@ void SampleCounterWithVariance::Reset() { *this = {}; } -} // namespace rtc +} // namespace webrtc diff --git a/rtc_base/numerics/sample_counter.h b/rtc_base/numerics/sample_counter.h index fa58ce1c7e..767b8683f4 100644 --- a/rtc_base/numerics/sample_counter.h +++ b/rtc_base/numerics/sample_counter.h @@ -15,7 +15,7 @@ #include -namespace rtc { +namespace webrtc { // Simple utility class for counting basic statistics (max./avg./variance) on // stream of samples. @@ -56,5 +56,12 @@ class SampleCounterWithVariance : public SampleCounter { int64_t sum_squared_ = 0; }; +} // namespace webrtc + +// Re-export symbols from the webrtc namespace for backwards compatibility. +// TODO(bugs.webrtc.org/4222596): Remove once all references are updated. +namespace rtc { +using ::webrtc::SampleCounter; +using ::webrtc::SampleCounterWithVariance; } // namespace rtc #endif // RTC_BASE_NUMERICS_SAMPLE_COUNTER_H_ diff --git a/rtc_base/numerics/sample_counter_unittest.cc b/rtc_base/numerics/sample_counter_unittest.cc index 82e61fde2e..64ef6cad56 100644 --- a/rtc_base/numerics/sample_counter_unittest.cc +++ b/rtc_base/numerics/sample_counter_unittest.cc @@ -18,7 +18,7 @@ using ::testing::Eq; -namespace rtc { +namespace webrtc { TEST(SampleCounterTest, ProcessesNoSamples) { constexpr int kMinSamples = 1; @@ -82,4 +82,4 @@ TEST(SampleCounterTest, AggregatesTwoCounters) { EXPECT_THAT(counter1.Variance(kMinSamples), Eq(2)); } -} // namespace rtc +} // namespace webrtc diff --git a/video/receive_statistics_proxy.h b/video/receive_statistics_proxy.h index 7af28fd982..2c11c0f097 100644 --- a/video/receive_statistics_proxy.h +++ b/video/receive_statistics_proxy.h @@ -129,7 +129,7 @@ class ReceiveStatisticsProxy : public VideoStreamBufferControllerStatsObserver, private: struct QpCounters { - rtc::SampleCounter vp8; + SampleCounter vp8; }; struct ContentSpecificStats { @@ -138,13 +138,13 @@ class ReceiveStatisticsProxy : public VideoStreamBufferControllerStatsObserver, void Add(const ContentSpecificStats& other); - rtc::SampleCounter e2e_delay_counter; - rtc::SampleCounter interframe_delay_counter; + SampleCounter e2e_delay_counter; + SampleCounter interframe_delay_counter; int64_t flow_duration_ms = 0; int64_t total_media_bytes = 0; - rtc::SampleCounter received_width; - rtc::SampleCounter received_height; - rtc::SampleCounter qp_counter; + SampleCounter received_width; + SampleCounter received_height; + SampleCounter qp_counter; FrameCounts frame_counts; rtc::HistogramPercentileCounter interframe_delay_percentiles; webrtc_impl::RunningStatistics corruption_score; @@ -168,12 +168,12 @@ class ReceiveStatisticsProxy : public VideoStreamBufferControllerStatsObserver, RateStatistics renders_fps_estimator_ RTC_GUARDED_BY(main_thread_); rtc::RateTracker render_fps_tracker_ RTC_GUARDED_BY(main_thread_); rtc::RateTracker render_pixel_tracker_ RTC_GUARDED_BY(main_thread_); - rtc::SampleCounter sync_offset_counter_ RTC_GUARDED_BY(main_thread_); - rtc::SampleCounter decode_time_counter_ RTC_GUARDED_BY(main_thread_); - rtc::SampleCounter jitter_delay_counter_ RTC_GUARDED_BY(main_thread_); - rtc::SampleCounter target_delay_counter_ RTC_GUARDED_BY(main_thread_); - rtc::SampleCounter current_delay_counter_ RTC_GUARDED_BY(main_thread_); - rtc::SampleCounter oneway_delay_counter_ RTC_GUARDED_BY(main_thread_); + SampleCounter sync_offset_counter_ RTC_GUARDED_BY(main_thread_); + SampleCounter decode_time_counter_ RTC_GUARDED_BY(main_thread_); + SampleCounter jitter_delay_counter_ RTC_GUARDED_BY(main_thread_); + SampleCounter target_delay_counter_ RTC_GUARDED_BY(main_thread_); + SampleCounter current_delay_counter_ RTC_GUARDED_BY(main_thread_); + SampleCounter oneway_delay_counter_ RTC_GUARDED_BY(main_thread_); std::unique_ptr video_quality_observer_ RTC_GUARDED_BY(main_thread_); mutable rtc::MovingMaxCounter interframe_delay_max_moving_ diff --git a/video/video_quality_observer2.h b/video/video_quality_observer2.h index 00650b59de..87dff9b434 100644 --- a/video/video_quality_observer2.h +++ b/video/video_quality_observer2.h @@ -76,10 +76,10 @@ class VideoQualityObserver { double sum_squared_interframe_delays_secs_; // An inter-frame delay is counted as a freeze if it's significantly longer // than average inter-frame delay. - rtc::SampleCounter freezes_durations_; - rtc::SampleCounter pauses_durations_; + SampleCounter freezes_durations_; + SampleCounter pauses_durations_; // Time between freezes. - rtc::SampleCounter smooth_playback_durations_; + SampleCounter smooth_playback_durations_; // Counters for time spent in different resolutions. Time between each two // Consecutive frames is counted to bin corresponding to the first frame // resolution.