Reland "Remove sent framerate and bitrate calculations from MediaOptimization."

TBR=sprang@webrtc.org

This is a reland of af721b72cc1bdc5d945629ad78fbea701b6f82b9
Original change's description:
> Remove sent framerate and bitrate calculations from MediaOptimization.
> 
> Add RateTracker for sent framerate and bitrate in SendStatisticsProxy.
> 
> Store sent frame info in map to solve potential issue where sent framerate statistics could be
> incorrect.
> 
> Bug: webrtc:8375
> Change-Id: I4a6e3956013438a711b8c2e73a8cd90c52dd1210
> Reviewed-on: https://webrtc-review.googlesource.com/7880
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Åsa Persson <asapersson@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20225}

Bug: webrtc:8375
Change-Id: I06ea90ae8646ba11ddd8ddceb82ea82d75ae2109
Reviewed-on: https://webrtc-review.googlesource.com/11320
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20308}
This commit is contained in:
Åsa Persson
2017-10-16 12:19:23 +02:00
committed by Commit Bot
parent 919dc2e843
commit 0122e8443b
8 changed files with 120 additions and 171 deletions

View File

@ -57,22 +57,12 @@ class MediaOptimization {
// InputFrameRate 0 = no frame rate estimate available.
uint32_t InputFrameRate();
uint32_t SentFrameRate();
uint32_t SentBitRate();
private:
enum { kFrameCountHistorySize = 90 };
enum { kFrameHistoryWinMs = 2000 };
enum { kBitrateAverageWinMs = 1000 };
struct EncodedFrameSample;
typedef std::list<EncodedFrameSample> FrameSampleList;
void UpdateIncomingFrameRate() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
void PurgeOldFrameSamples(int64_t threshold_ms)
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
void UpdateSentFramerate() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
void ProcessIncomingFrameRate(int64_t now)
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
@ -88,8 +78,6 @@ class MediaOptimization {
uint32_t InputFrameRateInternal() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
uint32_t SentFrameRateInternal() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_);
// Protect all members.
rtc::CriticalSection crit_sect_;
@ -101,9 +89,6 @@ class MediaOptimization {
float incoming_frame_rate_ RTC_GUARDED_BY(crit_sect_);
int64_t incoming_frame_times_[kFrameCountHistorySize] RTC_GUARDED_BY(
crit_sect_);
std::list<EncodedFrameSample> encoded_frame_samples_
RTC_GUARDED_BY(crit_sect_);
uint32_t avg_sent_framerate_ RTC_GUARDED_BY(crit_sect_);
};
} // namespace media_optimization
} // namespace webrtc