Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: webrtc/video/send_statistics_proxy.h

Issue 1433393002: Add separate send-side UMA stats for screenshare and video. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed use-after-free in test Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 20 matching lines...) Expand all
31 public RtcpStatisticsCallback, 31 public RtcpStatisticsCallback,
32 public RtcpPacketTypeCounterObserver, 32 public RtcpPacketTypeCounterObserver,
33 public StreamDataCountersCallback, 33 public StreamDataCountersCallback,
34 public BitrateStatisticsObserver, 34 public BitrateStatisticsObserver,
35 public FrameCountObserver, 35 public FrameCountObserver,
36 public VideoEncoderRateObserver, 36 public VideoEncoderRateObserver,
37 public SendSideDelayObserver { 37 public SendSideDelayObserver {
38 public: 38 public:
39 static const int kStatsTimeoutMs; 39 static const int kStatsTimeoutMs;
40 40
41 SendStatisticsProxy(Clock* clock, const VideoSendStream::Config& config); 41 SendStatisticsProxy(Clock* clock,
42 const VideoSendStream::Config& config,
43 const VideoEncoderConfig& encoder_config);
42 virtual ~SendStatisticsProxy(); 44 virtual ~SendStatisticsProxy();
43 45
44 VideoSendStream::Stats GetStats(); 46 VideoSendStream::Stats GetStats();
45 47
46 virtual void OnSendEncodedImage(const EncodedImage& encoded_image, 48 virtual void OnSendEncodedImage(const EncodedImage& encoded_image,
47 const RTPVideoHeader* rtp_video_header); 49 const RTPVideoHeader* rtp_video_header);
48 // Used to update incoming frame rate. 50 // Used to update incoming frame rate.
49 void OnIncomingFrame(int width, int height); 51 void OnIncomingFrame(int width, int height);
50 52
51 // Used to update encode time of frames. 53 // Used to update encode time of frames.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 void Add(bool sample); 107 void Add(bool sample);
106 int Percent(int min_required_samples) const; 108 int Percent(int min_required_samples) const;
107 int Permille(int min_required_samples) const; 109 int Permille(int min_required_samples) const;
108 110
109 private: 111 private:
110 int Fraction(int min_required_samples, float multiplier) const; 112 int Fraction(int min_required_samples, float multiplier) const;
111 int sum; 113 int sum;
112 int num_samples; 114 int num_samples;
113 }; 115 };
114 struct StatsUpdateTimes { 116 struct StatsUpdateTimes {
115 StatsUpdateTimes() : resolution_update_ms(0) {} 117 StatsUpdateTimes() : resolution_update_ms(0), bitrate_update_ms(0) {}
116 int64_t resolution_update_ms; 118 int64_t resolution_update_ms;
117 int64_t bitrate_update_ms; 119 int64_t bitrate_update_ms;
118 }; 120 };
119 void PurgeOldStats() EXCLUSIVE_LOCKS_REQUIRED(crit_); 121 void PurgeOldStats() EXCLUSIVE_LOCKS_REQUIRED(crit_);
120 VideoSendStream::StreamStats* GetStatsEntry(uint32_t ssrc) 122 VideoSendStream::StreamStats* GetStatsEntry(uint32_t ssrc)
121 EXCLUSIVE_LOCKS_REQUIRED(crit_); 123 EXCLUSIVE_LOCKS_REQUIRED(crit_);
124
122 void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_); 125 void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_);
123 126
124 Clock* const clock_; 127 Clock* const clock_;
125 const VideoSendStream::Config config_; 128 const VideoSendStream::Config config_;
126 mutable rtc::CriticalSection crit_; 129 mutable rtc::CriticalSection crit_;
127 VideoSendStream::Stats stats_ GUARDED_BY(crit_); 130 VideoSendStream::Stats stats_ GUARDED_BY(crit_);
131 const std::string uma_prefix_;
128 rtc::RateTracker input_frame_rate_tracker_ GUARDED_BY(crit_); 132 rtc::RateTracker input_frame_rate_tracker_ GUARDED_BY(crit_);
129 rtc::RateTracker sent_frame_rate_tracker_ GUARDED_BY(crit_); 133 rtc::RateTracker sent_frame_rate_tracker_ GUARDED_BY(crit_);
130 uint32_t last_sent_frame_timestamp_ GUARDED_BY(crit_); 134 uint32_t last_sent_frame_timestamp_ GUARDED_BY(crit_);
131 std::map<uint32_t, StatsUpdateTimes> update_times_ GUARDED_BY(crit_); 135 std::map<uint32_t, StatsUpdateTimes> update_times_ GUARDED_BY(crit_);
132 136
133 int max_sent_width_per_timestamp_ GUARDED_BY(crit_); 137 int max_sent_width_per_timestamp_ GUARDED_BY(crit_);
134 int max_sent_height_per_timestamp_ GUARDED_BY(crit_); 138 int max_sent_height_per_timestamp_ GUARDED_BY(crit_);
135 SampleCounter input_width_counter_ GUARDED_BY(crit_); 139 SampleCounter input_width_counter_ GUARDED_BY(crit_);
136 SampleCounter input_height_counter_ GUARDED_BY(crit_); 140 SampleCounter input_height_counter_ GUARDED_BY(crit_);
137 SampleCounter sent_width_counter_ GUARDED_BY(crit_); 141 SampleCounter sent_width_counter_ GUARDED_BY(crit_);
138 SampleCounter sent_height_counter_ GUARDED_BY(crit_); 142 SampleCounter sent_height_counter_ GUARDED_BY(crit_);
139 SampleCounter encode_time_counter_ GUARDED_BY(crit_); 143 SampleCounter encode_time_counter_ GUARDED_BY(crit_);
140 BoolSampleCounter key_frame_counter_ GUARDED_BY(crit_); 144 BoolSampleCounter key_frame_counter_ GUARDED_BY(crit_);
141 BoolSampleCounter quality_limited_frame_counter_ GUARDED_BY(crit_); 145 BoolSampleCounter quality_limited_frame_counter_ GUARDED_BY(crit_);
142 SampleCounter quality_downscales_counter_ GUARDED_BY(crit_); 146 SampleCounter quality_downscales_counter_ GUARDED_BY(crit_);
143 BoolSampleCounter bw_limited_frame_counter_ GUARDED_BY(crit_); 147 BoolSampleCounter bw_limited_frame_counter_ GUARDED_BY(crit_);
144 SampleCounter bw_resolutions_disabled_counter_ GUARDED_BY(crit_); 148 SampleCounter bw_resolutions_disabled_counter_ GUARDED_BY(crit_);
145 SampleCounter delay_counter_ GUARDED_BY(crit_); 149 SampleCounter delay_counter_ GUARDED_BY(crit_);
146 SampleCounter max_delay_counter_ GUARDED_BY(crit_); 150 SampleCounter max_delay_counter_ GUARDED_BY(crit_);
147 }; 151 };
148 152
149 } // namespace webrtc 153 } // namespace webrtc
150 #endif // WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_ 154 #endif // WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698