Move sample_counter.h to webrtc namespace
Bug: webrtc:42232595 Change-Id: I774efbe2bbe5d29e7eac500acf1fa4c99ebc74a8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/378041 Commit-Queue: Evan Shrubsole <eshr@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43936}
This commit is contained in:
parent
8175444111
commit
d650f3c6de
@ -17,7 +17,7 @@
|
|||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
#include "rtc_base/numerics/safe_conversions.h"
|
#include "rtc_base/numerics/safe_conversions.h"
|
||||||
|
|
||||||
namespace rtc {
|
namespace webrtc {
|
||||||
|
|
||||||
SampleCounter::SampleCounter() = default;
|
SampleCounter::SampleCounter() = default;
|
||||||
SampleCounter::~SampleCounter() = default;
|
SampleCounter::~SampleCounter() = default;
|
||||||
@ -117,4 +117,4 @@ void SampleCounterWithVariance::Reset() {
|
|||||||
*this = {};
|
*this = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace rtc
|
} // namespace webrtc
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
||||||
namespace rtc {
|
namespace webrtc {
|
||||||
|
|
||||||
// Simple utility class for counting basic statistics (max./avg./variance) on
|
// Simple utility class for counting basic statistics (max./avg./variance) on
|
||||||
// stream of samples.
|
// stream of samples.
|
||||||
@ -56,5 +56,12 @@ class SampleCounterWithVariance : public SampleCounter {
|
|||||||
int64_t sum_squared_ = 0;
|
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
|
} // namespace rtc
|
||||||
#endif // RTC_BASE_NUMERICS_SAMPLE_COUNTER_H_
|
#endif // RTC_BASE_NUMERICS_SAMPLE_COUNTER_H_
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
using ::testing::Eq;
|
using ::testing::Eq;
|
||||||
|
|
||||||
namespace rtc {
|
namespace webrtc {
|
||||||
|
|
||||||
TEST(SampleCounterTest, ProcessesNoSamples) {
|
TEST(SampleCounterTest, ProcessesNoSamples) {
|
||||||
constexpr int kMinSamples = 1;
|
constexpr int kMinSamples = 1;
|
||||||
@ -82,4 +82,4 @@ TEST(SampleCounterTest, AggregatesTwoCounters) {
|
|||||||
EXPECT_THAT(counter1.Variance(kMinSamples), Eq(2));
|
EXPECT_THAT(counter1.Variance(kMinSamples), Eq(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace rtc
|
} // namespace webrtc
|
||||||
|
|||||||
@ -129,7 +129,7 @@ class ReceiveStatisticsProxy : public VideoStreamBufferControllerStatsObserver,
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
struct QpCounters {
|
struct QpCounters {
|
||||||
rtc::SampleCounter vp8;
|
SampleCounter vp8;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ContentSpecificStats {
|
struct ContentSpecificStats {
|
||||||
@ -138,13 +138,13 @@ class ReceiveStatisticsProxy : public VideoStreamBufferControllerStatsObserver,
|
|||||||
|
|
||||||
void Add(const ContentSpecificStats& other);
|
void Add(const ContentSpecificStats& other);
|
||||||
|
|
||||||
rtc::SampleCounter e2e_delay_counter;
|
SampleCounter e2e_delay_counter;
|
||||||
rtc::SampleCounter interframe_delay_counter;
|
SampleCounter interframe_delay_counter;
|
||||||
int64_t flow_duration_ms = 0;
|
int64_t flow_duration_ms = 0;
|
||||||
int64_t total_media_bytes = 0;
|
int64_t total_media_bytes = 0;
|
||||||
rtc::SampleCounter received_width;
|
SampleCounter received_width;
|
||||||
rtc::SampleCounter received_height;
|
SampleCounter received_height;
|
||||||
rtc::SampleCounter qp_counter;
|
SampleCounter qp_counter;
|
||||||
FrameCounts frame_counts;
|
FrameCounts frame_counts;
|
||||||
rtc::HistogramPercentileCounter interframe_delay_percentiles;
|
rtc::HistogramPercentileCounter interframe_delay_percentiles;
|
||||||
webrtc_impl::RunningStatistics<double> corruption_score;
|
webrtc_impl::RunningStatistics<double> corruption_score;
|
||||||
@ -168,12 +168,12 @@ class ReceiveStatisticsProxy : public VideoStreamBufferControllerStatsObserver,
|
|||||||
RateStatistics renders_fps_estimator_ RTC_GUARDED_BY(main_thread_);
|
RateStatistics renders_fps_estimator_ RTC_GUARDED_BY(main_thread_);
|
||||||
rtc::RateTracker render_fps_tracker_ 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::RateTracker render_pixel_tracker_ RTC_GUARDED_BY(main_thread_);
|
||||||
rtc::SampleCounter sync_offset_counter_ RTC_GUARDED_BY(main_thread_);
|
SampleCounter sync_offset_counter_ RTC_GUARDED_BY(main_thread_);
|
||||||
rtc::SampleCounter decode_time_counter_ RTC_GUARDED_BY(main_thread_);
|
SampleCounter decode_time_counter_ RTC_GUARDED_BY(main_thread_);
|
||||||
rtc::SampleCounter jitter_delay_counter_ RTC_GUARDED_BY(main_thread_);
|
SampleCounter jitter_delay_counter_ RTC_GUARDED_BY(main_thread_);
|
||||||
rtc::SampleCounter target_delay_counter_ RTC_GUARDED_BY(main_thread_);
|
SampleCounter target_delay_counter_ RTC_GUARDED_BY(main_thread_);
|
||||||
rtc::SampleCounter current_delay_counter_ RTC_GUARDED_BY(main_thread_);
|
SampleCounter current_delay_counter_ RTC_GUARDED_BY(main_thread_);
|
||||||
rtc::SampleCounter oneway_delay_counter_ RTC_GUARDED_BY(main_thread_);
|
SampleCounter oneway_delay_counter_ RTC_GUARDED_BY(main_thread_);
|
||||||
std::unique_ptr<VideoQualityObserver> video_quality_observer_
|
std::unique_ptr<VideoQualityObserver> video_quality_observer_
|
||||||
RTC_GUARDED_BY(main_thread_);
|
RTC_GUARDED_BY(main_thread_);
|
||||||
mutable rtc::MovingMaxCounter<int> interframe_delay_max_moving_
|
mutable rtc::MovingMaxCounter<int> interframe_delay_max_moving_
|
||||||
|
|||||||
@ -76,10 +76,10 @@ class VideoQualityObserver {
|
|||||||
double sum_squared_interframe_delays_secs_;
|
double sum_squared_interframe_delays_secs_;
|
||||||
// An inter-frame delay is counted as a freeze if it's significantly longer
|
// An inter-frame delay is counted as a freeze if it's significantly longer
|
||||||
// than average inter-frame delay.
|
// than average inter-frame delay.
|
||||||
rtc::SampleCounter freezes_durations_;
|
SampleCounter freezes_durations_;
|
||||||
rtc::SampleCounter pauses_durations_;
|
SampleCounter pauses_durations_;
|
||||||
// Time between freezes.
|
// Time between freezes.
|
||||||
rtc::SampleCounter smooth_playback_durations_;
|
SampleCounter smooth_playback_durations_;
|
||||||
// Counters for time spent in different resolutions. Time between each two
|
// Counters for time spent in different resolutions. Time between each two
|
||||||
// Consecutive frames is counted to bin corresponding to the first frame
|
// Consecutive frames is counted to bin corresponding to the first frame
|
||||||
// resolution.
|
// resolution.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user