Fixed a miscalculation of sent bitrate caused by mixup of time units
Bug: webrtc:7949
Change-Id: Ia57fdd3d1de0952b80e77c30b0a6cfe44515eff2
Reviewed-on: https://chromium-review.googlesource.com/561460
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18917}
diff --git a/webrtc/modules/video_coding/media_optimization.h b/webrtc/modules/video_coding/media_optimization.h
index dcca61b..ffc3209 100644
--- a/webrtc/modules/video_coding/media_optimization.h
+++ b/webrtc/modules/video_coding/media_optimization.h
@@ -74,9 +74,10 @@
typedef std::list<EncodedFrameSample> FrameSampleList;
void UpdateIncomingFrameRate() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
- void PurgeOldFrameSamples(int64_t now_ms)
+ void PurgeOldFrameSamples(int64_t threshold_ms)
EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
- void UpdateSentBitrate(int64_t now_ms) EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
+ // Updates the sent bitrate field, a call to PurgeOldFrameSamples must preceed
+ int GetSentBitrate(int64_t now_ms) EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
void UpdateSentFramerate() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
void ProcessIncomingFrameRate(int64_t now)
@@ -116,7 +117,6 @@
float incoming_frame_rate_ GUARDED_BY(crit_sect_);
int64_t incoming_frame_times_[kFrameCountHistorySize] GUARDED_BY(crit_sect_);
std::list<EncodedFrameSample> encoded_frame_samples_ GUARDED_BY(crit_sect_);
- uint32_t avg_sent_bit_rate_bps_ GUARDED_BY(crit_sect_);
uint32_t avg_sent_framerate_ GUARDED_BY(crit_sect_);
int num_layers_ GUARDED_BY(crit_sect_);
};