Index: webrtc/video/send_statistics_proxy.h |
diff --git a/webrtc/video/send_statistics_proxy.h b/webrtc/video/send_statistics_proxy.h |
index 2939a671d10a7d41cd4b81e0128f40ea3821a700..9c7fe31cb8def7f5c190d45f8289a7249785461d 100644 |
--- a/webrtc/video/send_statistics_proxy.h |
+++ b/webrtc/video/send_statistics_proxy.h |
@@ -58,6 +58,8 @@ class SendStatisticsProxy : public CpuOveruseMetricsObserver, |
void OnSuspendChange(bool is_suspended); |
void OnInactiveSsrc(uint32_t ssrc); |
+ void SetCodecMode(VideoCodecMode mode); |
+ |
protected: |
// From CpuOveruseMetricsObserver. |
void CpuOveruseMetricsUpdated(const CpuOveruseMetrics& metrics) override; |
@@ -112,38 +114,53 @@ class SendStatisticsProxy : public CpuOveruseMetricsObserver, |
int num_samples; |
}; |
struct StatsUpdateTimes { |
- StatsUpdateTimes() : resolution_update_ms(0) {} |
+ StatsUpdateTimes() : resolution_update_ms(0), bitrate_update_ms(0) {} |
int64_t resolution_update_ms; |
int64_t bitrate_update_ms; |
}; |
void PurgeOldStats() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
VideoSendStream::StreamStats* GetStatsEntry(uint32_t ssrc) |
EXCLUSIVE_LOCKS_REQUIRED(crit_); |
- void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
Clock* const clock_; |
const VideoSendStream::Config config_; |
+ VideoCodecMode codec_mode_ GUARDED_BY(crit_); |
mutable rtc::CriticalSection crit_; |
VideoSendStream::Stats stats_ GUARDED_BY(crit_); |
- rtc::RateTracker input_frame_rate_tracker_ GUARDED_BY(crit_); |
- rtc::RateTracker sent_frame_rate_tracker_ GUARDED_BY(crit_); |
- uint32_t last_sent_frame_timestamp_ GUARDED_BY(crit_); |
- std::map<uint32_t, StatsUpdateTimes> update_times_ GUARDED_BY(crit_); |
- |
- int max_sent_width_per_timestamp_ GUARDED_BY(crit_); |
- int max_sent_height_per_timestamp_ GUARDED_BY(crit_); |
- SampleCounter input_width_counter_ GUARDED_BY(crit_); |
- SampleCounter input_height_counter_ GUARDED_BY(crit_); |
- SampleCounter sent_width_counter_ GUARDED_BY(crit_); |
- SampleCounter sent_height_counter_ GUARDED_BY(crit_); |
- SampleCounter encode_time_counter_ GUARDED_BY(crit_); |
- BoolSampleCounter key_frame_counter_ GUARDED_BY(crit_); |
- BoolSampleCounter quality_limited_frame_counter_ GUARDED_BY(crit_); |
- SampleCounter quality_downscales_counter_ GUARDED_BY(crit_); |
- BoolSampleCounter bw_limited_frame_counter_ GUARDED_BY(crit_); |
- SampleCounter bw_resolutions_disabled_counter_ GUARDED_BY(crit_); |
- SampleCounter delay_counter_ GUARDED_BY(crit_); |
- SampleCounter max_delay_counter_ GUARDED_BY(crit_); |
+ |
+ struct StatsSet { |
pbos-webrtc
2015/11/12 10:38:19
StatsSet sounds too generic, can you think of a na
sprang_webrtc
2015/11/12 11:01:25
Done.
|
+ explicit StatsSet(const char* prefix) |
pbos-webrtc
2015/11/12 10:38:19
Put constructor in .cc file.
sprang_webrtc
2015/11/12 11:01:25
Done.
|
+ : kPrefix(prefix), |
+ input_frame_rate_tracker_(100u, 10u), |
+ sent_frame_rate_tracker_(100u, 10u), |
+ last_sent_frame_timestamp_(0), |
+ max_sent_width_per_timestamp_(0), |
+ max_sent_height_per_timestamp_(0) {} |
+ const std::string kPrefix; |
pbos-webrtc
2015/11/12 10:38:19
stats_prefix_, "const" doesn't make it a "kConstan
sprang_webrtc
2015/11/12 11:01:25
Done.
|
+ rtc::RateTracker input_frame_rate_tracker_; |
+ rtc::RateTracker sent_frame_rate_tracker_; |
+ uint32_t last_sent_frame_timestamp_; |
+ std::map<uint32_t, StatsUpdateTimes> update_times_; |
+ |
+ int max_sent_width_per_timestamp_; |
+ int max_sent_height_per_timestamp_; |
+ SampleCounter input_width_counter_; |
+ SampleCounter input_height_counter_; |
+ SampleCounter sent_width_counter_; |
+ SampleCounter sent_height_counter_; |
+ SampleCounter encode_time_counter_; |
+ BoolSampleCounter key_frame_counter_; |
+ BoolSampleCounter quality_limited_frame_counter_; |
+ SampleCounter quality_downscales_counter_; |
+ BoolSampleCounter bw_limited_frame_counter_; |
+ SampleCounter bw_resolutions_disabled_counter_; |
+ SampleCounter delay_counter_; |
+ SampleCounter max_delay_counter_; |
+ |
+ void UpdateHistograms(); |
+ }; |
+ |
+ rtc::scoped_ptr<StatsSet> stats_set_ GUARDED_BY(crit_); |
pbos-webrtc
2015/11/12 10:38:19
Since this doesn't rely on a destructor being call
sprang_webrtc
2015/11/12 11:01:25
Ugh, that would mean I have to add copy assignment
pbos-webrtc
2015/11/12 11:09:40
They're not copy-constructible by default?
sprang_webrtc
2015/11/12 13:32:06
Nope. :(
|
}; |
} // namespace webrtc |