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

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

Issue 2304363002: Let ViEEncoder express resolution requests as Sinkwants (Closed)
Patch Set: Fix broken test RunOnTqNormalUsage. Created 4 years, 2 months 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 22 matching lines...) Expand all
33 33
34 class SendStatisticsProxy : public CpuOveruseMetricsObserver, 34 class SendStatisticsProxy : public CpuOveruseMetricsObserver,
35 public RtcpStatisticsCallback, 35 public RtcpStatisticsCallback,
36 public RtcpPacketTypeCounterObserver, 36 public RtcpPacketTypeCounterObserver,
37 public StreamDataCountersCallback, 37 public StreamDataCountersCallback,
38 public BitrateStatisticsObserver, 38 public BitrateStatisticsObserver,
39 public FrameCountObserver, 39 public FrameCountObserver,
40 public SendSideDelayObserver { 40 public SendSideDelayObserver {
41 public: 41 public:
42 static const int kStatsTimeoutMs; 42 static const int kStatsTimeoutMs;
43 // Number of required UMA samples to be collected before a metric is added
åsapersson 2016/10/24 07:54:06 Number of required samples..
perkj_webrtc 2016/10/26 16:40:17 Done.
44 // to a UMA histogram.
åsapersson 2016/10/24 07:54:06 UMA histogram -> rtc histogram
perkj_webrtc 2016/10/26 16:40:17 Done.
45 static const int kMinRequiredUMASamples = 200;
åsapersson 2016/10/24 07:54:06 maybe MinRequiredMetricsSamples
perkj_webrtc 2016/10/26 16:40:17 Done.
43 46
44 SendStatisticsProxy(Clock* clock, 47 SendStatisticsProxy(Clock* clock,
45 const VideoSendStream::Config& config, 48 const VideoSendStream::Config& config,
46 VideoEncoderConfig::ContentType content_type); 49 VideoEncoderConfig::ContentType content_type);
47 virtual ~SendStatisticsProxy(); 50 virtual ~SendStatisticsProxy();
48 51
49 VideoSendStream::Stats GetStats(); 52 VideoSendStream::Stats GetStats();
50 53
51 virtual void OnSendEncodedImage(const EncodedImage& encoded_image, 54 virtual void OnSendEncodedImage(const EncodedImage& encoded_image,
52 const CodecSpecificInfo* codec_info); 55 const CodecSpecificInfo* codec_info);
53 // Used to update incoming frame rate. 56 // Used to update incoming frame rate.
54 void OnIncomingFrame(int width, int height); 57 void OnIncomingFrame(int width, int height, bool is_cpu_restricted);
58
59 void SetCpuRestrictedResolution(bool cpu_restricted);
60 void OnCpuRestrictedResolutionChanged(bool cpu_restricted_resolution);
55 61
56 void OnEncoderStatsUpdate(uint32_t framerate, uint32_t bitrate); 62 void OnEncoderStatsUpdate(uint32_t framerate, uint32_t bitrate);
57 void OnSuspendChange(bool is_suspended); 63 void OnSuspendChange(bool is_suspended);
58 void OnInactiveSsrc(uint32_t ssrc); 64 void OnInactiveSsrc(uint32_t ssrc);
59 65
60 // Used to indicate change in content type, which may require a change in 66 // Used to indicate change in content type, which may require a change in
61 // how stats are collected and set the configured preferred media bitrate. 67 // how stats are collected and set the configured preferred media bitrate.
62 void OnEncoderReconfigured(const VideoEncoderConfig& encoder_config, 68 void OnEncoderReconfigured(const VideoEncoderConfig& encoder_config,
63 uint32_t preferred_bitrate_bps); 69 uint32_t preferred_bitrate_bps);
64 70
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 int max_sent_width_per_timestamp_; 169 int max_sent_width_per_timestamp_;
164 int max_sent_height_per_timestamp_; 170 int max_sent_height_per_timestamp_;
165 SampleCounter input_width_counter_; 171 SampleCounter input_width_counter_;
166 SampleCounter input_height_counter_; 172 SampleCounter input_height_counter_;
167 SampleCounter sent_width_counter_; 173 SampleCounter sent_width_counter_;
168 SampleCounter sent_height_counter_; 174 SampleCounter sent_height_counter_;
169 SampleCounter encode_time_counter_; 175 SampleCounter encode_time_counter_;
170 BoolSampleCounter key_frame_counter_; 176 BoolSampleCounter key_frame_counter_;
171 BoolSampleCounter quality_limited_frame_counter_; 177 BoolSampleCounter quality_limited_frame_counter_;
172 SampleCounter quality_downscales_counter_; 178 SampleCounter quality_downscales_counter_;
179 BoolSampleCounter cpu_limited_frame_counter_;
173 BoolSampleCounter bw_limited_frame_counter_; 180 BoolSampleCounter bw_limited_frame_counter_;
174 SampleCounter bw_resolutions_disabled_counter_; 181 SampleCounter bw_resolutions_disabled_counter_;
175 SampleCounter delay_counter_; 182 SampleCounter delay_counter_;
176 SampleCounter max_delay_counter_; 183 SampleCounter max_delay_counter_;
177 rtc::RateTracker input_frame_rate_tracker_; 184 rtc::RateTracker input_frame_rate_tracker_;
178 rtc::RateTracker sent_frame_rate_tracker_; 185 rtc::RateTracker sent_frame_rate_tracker_;
179 int64_t first_rtcp_stats_time_ms_; 186 int64_t first_rtcp_stats_time_ms_;
180 int64_t first_rtp_stats_time_ms_; 187 int64_t first_rtp_stats_time_ms_;
181 ReportBlockStats report_block_stats_; 188 ReportBlockStats report_block_stats_;
182 const VideoSendStream::Stats start_stats_; 189 const VideoSendStream::Stats start_stats_;
183 std::map<int, QpCounters> 190 std::map<int, QpCounters>
184 qp_counters_; // QP counters mapped by spatial idx. 191 qp_counters_; // QP counters mapped by spatial idx.
185 }; 192 };
186 193
187 std::unique_ptr<UmaSamplesContainer> uma_container_ GUARDED_BY(crit_); 194 std::unique_ptr<UmaSamplesContainer> uma_container_ GUARDED_BY(crit_);
188 }; 195 };
189 196
190 } // namespace webrtc 197 } // namespace webrtc
191 #endif // WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_ 198 #endif // WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698