Optimize execution time of RTPSender::UpdateDelayStatistics

Bug: webrtc:9439
Change-Id: I908e9ced10031c614678a89657d089cb9a66b9ce
Reviewed-on: https://webrtc-review.googlesource.com/92391
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24295}
This commit is contained in:
Bjorn Terelius
2018-08-15 14:47:41 +02:00
committed by Commit Bot
parent cdb87f1a65
commit 733df738e3
3 changed files with 133 additions and 17 deletions

View File

@ -239,6 +239,7 @@ class RTPSender {
const PacketOptions& options,
const PacedPacketInfo& pacing_info);
void RecomputeMaxSendDelay() RTC_EXCLUSIVE_LOCKS_REQUIRED(statistics_crit_);
void UpdateDelayStatistics(int64_t capture_time_ms, int64_t now_ms);
void UpdateOnSendPacket(int packet_id,
int64_t capture_time_ms,
@ -296,6 +297,8 @@ class RTPSender {
// Statistics
rtc::CriticalSection statistics_crit_;
SendDelayMap send_delays_ RTC_GUARDED_BY(statistics_crit_);
SendDelayMap::const_iterator max_delay_it_ RTC_GUARDED_BY(statistics_crit_);
int64_t sum_delays_ms_ RTC_GUARDED_BY(statistics_crit_);
FrameCounts frame_counts_ RTC_GUARDED_BY(statistics_crit_);
StreamDataCounters rtp_stats_ RTC_GUARDED_BY(statistics_crit_);
StreamDataCounters rtx_rtp_stats_ RTC_GUARDED_BY(statistics_crit_);