Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(635)

Unified Diff: webrtc/video/send_delay_stats.h

Issue 2013403002: Start integrating StatsCounter class. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/video/send_delay_stats.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/send_delay_stats.h
diff --git a/webrtc/video/send_delay_stats.h b/webrtc/video/send_delay_stats.h
index 20a97814c72e808b3acfd5a920290e01a993cc8d..8cac12343df6613e29e30f8ed603fdeac1285f03 100644
--- a/webrtc/video/send_delay_stats.h
+++ b/webrtc/video/send_delay_stats.h
@@ -20,6 +20,7 @@
#include "webrtc/common_types.h"
#include "webrtc/modules/include/module_common_types.h"
#include "webrtc/system_wrappers/include/clock.h"
+#include "webrtc/video/stats_counter.h"
#include "webrtc/video_send_stream.h"
namespace webrtc {
@@ -61,21 +62,11 @@ class SendDelayStats : public SendPacketObserver {
};
typedef std::map<uint16_t, Packet, SequenceNumberOlderThan> PacketMap;
- class SampleCounter {
- public:
- SampleCounter() : sum(0), num_samples(0) {}
- ~SampleCounter() {}
- void Add(int sample);
- int Avg(int min_required_samples) const;
-
- private:
- int sum;
- int num_samples;
- };
-
void UpdateHistograms();
void RemoveOld(int64_t now, PacketMap* packets)
EXCLUSIVE_LOCKS_REQUIRED(crit_);
+ AvgCounter* GetSendDelayCounter(uint32_t ssrc)
+ EXCLUSIVE_LOCKS_REQUIRED(crit_);
Clock* const clock_;
rtc::CriticalSection crit_;
@@ -85,8 +76,10 @@ class SendDelayStats : public SendPacketObserver {
size_t num_skipped_packets_ GUARDED_BY(crit_);
std::set<uint32_t> ssrcs_ GUARDED_BY(crit_);
- std::map<uint32_t, SampleCounter> send_delay_counters_
- GUARDED_BY(crit_); // Mapped by SSRC.
+
+ // Mapped by SSRC.
+ std::map<uint32_t, std::unique_ptr<AvgCounter>> send_delay_counters_
+ GUARDED_BY(crit_);
};
} // namespace webrtc
« no previous file with comments | « no previous file | webrtc/video/send_delay_stats.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698