Reland of Properly report number of quality downscales in stats. (patchset #1 id:1 of https://codereview.webrtc.org/2586783003/ )

Reason for revert:
Bug affecting perf tests has been fixed. The issue was that I had accidentally disabled cpu overuse adaptation based on the encoders ScalingSettings, not just quality-based scaling.

Original issue's description:
> Revert of Properly report number of quality downscales in stats. (patchset #11 id:220001 of https://codereview.webrtc.org/2564373002/ )
>
> Reason for revert:
> Breaks perf tests
>
> Original issue's description:
> > Properly report number of quality downscales in stats.
> >
> > A regression was introduced in 876222f that caused these stats to
> > be reported incorrectly. This used to be only implemented for VP8
> > but should now be available for all codecs.
> >
> > BUG=webrtc:6860
> >
> > Review-Url: https://codereview.webrtc.org/2564373002
> > Cr-Commit-Position: refs/heads/master@{#15673}
> > Committed: 0c8c538835
>
> TBR=asapersson@webrtc.org,stefan@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6860
>
> Review-Url: https://codereview.webrtc.org/2586783003
> Cr-Commit-Position: refs/heads/master@{#15678}
> Committed: fe04bd43cc

TBR=asapersson@webrtc.org,stefan@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6860

Review-Url: https://codereview.webrtc.org/2588743002
Cr-Commit-Position: refs/heads/master@{#15680}
This commit is contained in:
kthelgason
2016-12-19 06:32:16 -08:00
committed by Commit bot
parent 8c1dd8d32f
commit 0cd27ba088
7 changed files with 64 additions and 49 deletions

View File

@ -58,8 +58,10 @@ class SendStatisticsProxy : public CpuOveruseMetricsObserver,
void OnIncomingFrame(int width, int height);
void OnCpuRestrictedResolutionChanged(bool cpu_restricted_resolution);
void OnQualityRestrictedResolutionChanged(bool restricted);
void SetResolutionRestrictionStats(bool bandwidth, bool cpu);
void OnQualityRestrictedResolutionChanged(int num_quality_downscales);
void SetResolutionRestrictionStats(bool scaling_enabled,
bool cpu_restricted,
int num_quality_downscales);
void OnEncoderStatsUpdate(uint32_t framerate, uint32_t bitrate);
void OnSuspendChange(bool is_suspended);
@ -154,6 +156,7 @@ class SendStatisticsProxy : public CpuOveruseMetricsObserver,
uint32_t last_sent_frame_timestamp_ GUARDED_BY(crit_);
std::map<uint32_t, StatsUpdateTimes> update_times_ GUARDED_BY(crit_);
rtc::ExpFilter encode_time_ GUARDED_BY(crit_);
int quality_downscales_ GUARDED_BY(crit_) = 0;
// Contains stats used for UMA histograms. These stats will be reset if
// content type changes between real-time video and screenshare, since these