blob: e690803899be205371584fd330fe6c19e2185205 [file] [log] [blame]
sprang@webrtc.orgccd42842014-01-07 09:54:34 +00001/*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef VIDEO_SEND_STATISTICS_PROXY_H_
12#define VIDEO_SEND_STATISTICS_PROXY_H_
sprang@webrtc.orgccd42842014-01-07 09:54:34 +000013
Evan Shrubsolecc62b162019-09-09 11:26:45 +020014#include <array>
mflodmand1590b22015-12-09 07:07:59 -080015#include <map>
kwiberg27f982b2016-03-01 11:52:33 -080016#include <memory>
sprang@webrtc.orgccd42842014-01-07 09:54:34 +000017#include <string>
Pera48ddb72016-09-29 11:48:50 +020018#include <vector>
sprang@webrtc.orgccd42842014-01-07 09:54:34 +000019
Evan Shrubsolecc62b162019-09-09 11:26:45 +020020#include "api/video/video_codec_constants.h"
Niels Möller213618e2018-07-24 09:29:58 +020021#include "api/video/video_stream_encoder_observer.h"
Evan Shrubsolecc62b162019-09-09 11:26:45 +020022#include "api/video_codecs/video_encoder_config.h"
Yves Gerey665174f2018-06-19 15:03:05 +020023#include "call/video_send_stream.h"
Danil Chapovalov7c067772019-10-07 12:56:24 +020024#include "modules/include/module_common_types_public.h"
Henrik Boström87e3f9d2019-05-27 10:44:24 +020025#include "modules/rtp_rtcp/include/report_block_data.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020026#include "modules/video_coding/include/video_codec_interface.h"
27#include "modules/video_coding/include/video_coding_defines.h"
Steve Anton10542f22019-01-11 09:11:00 -080028#include "rtc_base/critical_section.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020029#include "rtc_base/numerics/exp_filter.h"
Steve Anton10542f22019-01-11 09:11:00 -080030#include "rtc_base/rate_tracker.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020031#include "rtc_base/thread_annotations.h"
32#include "system_wrappers/include/clock.h"
Henrik Boströmce33b6a2019-05-28 17:42:38 +020033#include "video/quality_limitation_reason_tracker.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020034#include "video/report_block_stats.h"
35#include "video/stats_counter.h"
sprang@webrtc.orgccd42842014-01-07 09:54:34 +000036
37namespace webrtc {
38
Niels Möller213618e2018-07-24 09:29:58 +020039class SendStatisticsProxy : public VideoStreamEncoderObserver,
pbos@webrtc.org3e6e2712015-02-26 12:19:31 +000040 public RtcpStatisticsCallback,
Henrik Boström87e3f9d2019-05-27 10:44:24 +020041 public ReportBlockDataObserver,
pbos@webrtc.org1d0fa5d2015-02-19 12:47:00 +000042 public RtcpPacketTypeCounterObserver,
sprang@webrtc.orgccd42842014-01-07 09:54:34 +000043 public StreamDataCountersCallback,
44 public BitrateStatisticsObserver,
45 public FrameCountObserver,
stefan@webrtc.org168f23f2014-07-11 13:44:02 +000046 public SendSideDelayObserver {
sprang@webrtc.orgccd42842014-01-07 09:54:34 +000047 public:
pbos@webrtc.org273a4142014-12-01 15:23:21 +000048 static const int kStatsTimeoutMs;
perkj803d97f2016-11-01 11:45:46 -070049 // Number of required samples to be collected before a metric is added
50 // to a rtc histogram.
51 static const int kMinRequiredMetricsSamples = 200;
pbos@webrtc.org273a4142014-12-01 15:23:21 +000052
sprangb4a1ae52015-12-03 08:10:08 -080053 SendStatisticsProxy(Clock* clock,
54 const VideoSendStream::Config& config,
55 VideoEncoderConfig::ContentType content_type);
Stefan Holmerdbdb3a02018-07-17 16:03:46 +020056 ~SendStatisticsProxy() override;
sprang@webrtc.orgccd42842014-01-07 09:54:34 +000057
sprangc5d62e22017-04-02 23:53:04 -070058 virtual VideoSendStream::Stats GetStats();
pbos@webrtc.org273a4142014-12-01 15:23:21 +000059
Stefan Holmerdbdb3a02018-07-17 16:03:46 +020060 void OnSendEncodedImage(const EncodedImage& encoded_image,
Niels Möller213618e2018-07-24 09:29:58 +020061 const CodecSpecificInfo* codec_info) override;
Erik Språnge2fd86a2018-10-24 11:32:39 +020062
63 void OnEncoderImplementationChanged(
64 const std::string& implementation_name) override;
65
perkj@webrtc.orgaf612d52015-03-18 09:51:05 +000066 // Used to update incoming frame rate.
Niels Möller213618e2018-07-24 09:29:58 +020067 void OnIncomingFrame(int width, int height) override;
sprang@webrtc.orgccd42842014-01-07 09:54:34 +000068
Ilya Nikolaevskiyd79314f2017-10-23 10:45:37 +020069 // Dropped frame stats.
Niels Möller213618e2018-07-24 09:29:58 +020070 void OnFrameDropped(DropReason) override;
Ilya Nikolaevskiyd79314f2017-10-23 10:45:37 +020071
asapersson09f05612017-05-15 23:40:18 -070072 // Adaptation stats.
Niels Möller213618e2018-07-24 09:29:58 +020073 void OnAdaptationChanged(AdaptationReason reason,
74 const AdaptationSteps& cpu_counts,
75 const AdaptationSteps& quality_counts) override;
perkj803d97f2016-11-01 11:45:46 -070076
Evan Shrubsolecc62b162019-09-09 11:26:45 +020077 void OnBitrateAllocationUpdated(
78 const VideoCodec& codec,
79 const VideoBitrateAllocation& allocation) override;
80
Niels Möller213618e2018-07-24 09:29:58 +020081 void OnMinPixelLimitReached() override;
82 void OnInitialQualityResolutionAdaptDown() override;
83
84 void OnSuspendChange(bool is_suspended) override;
Peter Boström20f3f942015-05-15 11:33:39 +020085 void OnInactiveSsrc(uint32_t ssrc);
86
sprangb4a1ae52015-12-03 08:10:08 -080087 // Used to indicate change in content type, which may require a change in
Niels Möller97e04882018-05-25 09:43:26 +020088 // how stats are collected.
Pera48ddb72016-09-29 11:48:50 +020089 void OnEncoderReconfigured(const VideoEncoderConfig& encoder_config,
Niels Möller213618e2018-07-24 09:29:58 +020090 const std::vector<VideoStream>& streams) override;
sprangb4a1ae52015-12-03 08:10:08 -080091
perkjf5b2e512016-07-05 08:34:04 -070092 // Used to update the encoder target rate.
93 void OnSetEncoderTargetRate(uint32_t bitrate_bps);
Peter Boströme4499152016-02-05 11:13:28 +010094
95 // Implements CpuOveruseMetricsObserver.
96 void OnEncodedFrameTimeMeasured(int encode_time_ms,
Niels Möller213618e2018-07-24 09:29:58 +020097 int encode_usage_percent) override;
Peter Boströme4499152016-02-05 11:13:28 +010098
Niels Möller213618e2018-07-24 09:29:58 +020099 int GetInputFrameRate() const override;
Per69b332d2016-06-02 15:45:42 +0200100 int GetSendFrameRate() const;
101
sprang@webrtc.orgccd42842014-01-07 09:54:34 +0000102 protected:
103 // From RtcpStatisticsCallback.
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000104 void StatisticsUpdated(const RtcpStatistics& statistics,
105 uint32_t ssrc) override;
Henrik Boström87e3f9d2019-05-27 10:44:24 +0200106 // From ReportBlockDataObserver.
107 void OnReportBlockDataUpdated(ReportBlockData report_block_data) override;
asaperssond89920b2015-07-22 06:52:00 -0700108 // From RtcpPacketTypeCounterObserver.
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000109 void RtcpPacketTypesCounterUpdated(
pbos@webrtc.org1d0fa5d2015-02-19 12:47:00 +0000110 uint32_t ssrc,
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000111 const RtcpPacketTypeCounter& packet_counter) override;
sprang@webrtc.orgccd42842014-01-07 09:54:34 +0000112 // From StreamDataCountersCallback.
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000113 void DataCountersUpdated(const StreamDataCounters& counters,
114 uint32_t ssrc) override;
sprang@webrtc.orgccd42842014-01-07 09:54:34 +0000115
116 // From BitrateStatisticsObserver.
sprangcd349d92016-07-13 09:11:28 -0700117 void Notify(uint32_t total_bitrate_bps,
118 uint32_t retransmit_bitrate_bps,
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000119 uint32_t ssrc) override;
sprang@webrtc.orgccd42842014-01-07 09:54:34 +0000120
121 // From FrameCountObserver.
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000122 void FrameCountUpdated(const FrameCounts& frame_counts,
123 uint32_t ssrc) override;
sprang@webrtc.orgccd42842014-01-07 09:54:34 +0000124
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000125 void SendSideDelayUpdated(int avg_delay_ms,
126 int max_delay_ms,
Henrik Boström9fe18342019-05-16 18:38:20 +0200127 uint64_t total_delay_ms,
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +0000128 uint32_t ssrc) override;
stefan@webrtc.org168f23f2014-07-11 13:44:02 +0000129
sprang@webrtc.orgccd42842014-01-07 09:54:34 +0000130 private:
asaperssonda535c42015-10-19 23:32:41 -0700131 class SampleCounter {
132 public:
asaperssond89920b2015-07-22 06:52:00 -0700133 SampleCounter() : sum(0), num_samples(0) {}
asaperssonda535c42015-10-19 23:32:41 -0700134 ~SampleCounter() {}
asaperssond89920b2015-07-22 06:52:00 -0700135 void Add(int sample);
asapersson66d4b372016-12-19 06:50:53 -0800136 int Avg(int64_t min_required_samples) const;
asaperssond89920b2015-07-22 06:52:00 -0700137
138 private:
asapersson66d4b372016-12-19 06:50:53 -0800139 int64_t sum;
140 int64_t num_samples;
asaperssond89920b2015-07-22 06:52:00 -0700141 };
asaperssonda535c42015-10-19 23:32:41 -0700142 class BoolSampleCounter {
143 public:
asaperssondec5ebf2015-10-05 02:36:17 -0700144 BoolSampleCounter() : sum(0), num_samples(0) {}
asaperssonda535c42015-10-19 23:32:41 -0700145 ~BoolSampleCounter() {}
asaperssondec5ebf2015-10-05 02:36:17 -0700146 void Add(bool sample);
asapersson66d4b372016-12-19 06:50:53 -0800147 void Add(bool sample, int64_t count);
148 int Percent(int64_t min_required_samples) const;
149 int Permille(int64_t min_required_samples) const;
asaperssondec5ebf2015-10-05 02:36:17 -0700150
151 private:
asapersson66d4b372016-12-19 06:50:53 -0800152 int Fraction(int64_t min_required_samples, float multiplier) const;
153 int64_t sum;
154 int64_t num_samples;
asaperssondec5ebf2015-10-05 02:36:17 -0700155 };
pbos@webrtc.org273a4142014-12-01 15:23:21 +0000156 struct StatsUpdateTimes {
sprangb4a1ae52015-12-03 08:10:08 -0800157 StatsUpdateTimes() : resolution_update_ms(0), bitrate_update_ms(0) {}
pbos@webrtc.org273a4142014-12-01 15:23:21 +0000158 int64_t resolution_update_ms;
Peter Boström20f3f942015-05-15 11:33:39 +0200159 int64_t bitrate_update_ms;
pbos@webrtc.org273a4142014-12-01 15:23:21 +0000160 };
asapersson66d4b372016-12-19 06:50:53 -0800161 struct TargetRateUpdates {
162 TargetRateUpdates()
163 : pause_resume_events(0), last_paused_or_resumed(false), last_ms(-1) {}
164 int pause_resume_events;
165 bool last_paused_or_resumed;
166 int64_t last_ms;
167 };
asapersson8d75ac72017-09-15 06:41:15 -0700168 struct FallbackEncoderInfo {
Mirko Bonadei8fdcac32018-08-28 16:30:18 +0200169 FallbackEncoderInfo();
asapersson8d75ac72017-09-15 06:41:15 -0700170 bool is_possible = true;
171 bool is_active = false;
172 int on_off_events = 0;
173 int64_t elapsed_ms = 0;
Danil Chapovalovb9b146c2018-06-15 12:28:07 +0200174 absl::optional<int64_t> last_update_ms;
asapersson8d75ac72017-09-15 06:41:15 -0700175 const int max_frame_diff_ms = 2000;
176 };
Åsa Perssonc3ed6302017-11-16 14:04:52 +0100177 struct FallbackEncoderInfoDisabled {
178 bool is_possible = true;
179 bool min_pixel_limit_reached = false;
180 };
asapersson6eca98b2017-04-04 23:40:50 -0700181 struct StatsTimer {
182 void Start(int64_t now_ms);
183 void Stop(int64_t now_ms);
184 void Restart(int64_t now_ms);
185 int64_t start_ms = -1;
186 int64_t total_ms = 0;
187 };
asapersson118ef002016-03-31 00:00:19 -0700188 struct QpCounters {
asapersson6eca98b2017-04-04 23:40:50 -0700189 SampleCounter vp8; // QP range: 0-127.
190 SampleCounter vp9; // QP range: 0-255.
191 SampleCounter h264; // QP range: 0-51.
asapersson118ef002016-03-31 00:00:19 -0700192 };
Åsa Persson875841d2018-01-08 08:49:53 +0100193 struct AdaptChanges {
194 int down = 0;
195 int up = 0;
196 };
Åsa Persson0122e842017-10-16 12:19:23 +0200197
198 // Map holding encoded frames (mapped by timestamp).
199 // If simulcast layers are encoded on different threads, there is no guarantee
200 // that one frame of all layers are encoded before the next start.
201 struct TimestampOlderThan {
202 bool operator()(uint32_t ts1, uint32_t ts2) const {
203 return IsNewerTimestamp(ts2, ts1);
204 }
205 };
206 struct Frame {
Niels Möllerd3b8c632018-08-27 15:33:42 +0200207 Frame(int64_t send_ms, uint32_t width, uint32_t height, int simulcast_idx)
Åsa Perssonaa329e72017-12-15 15:54:44 +0100208 : send_ms(send_ms),
209 max_width(width),
210 max_height(height),
211 max_simulcast_idx(simulcast_idx) {}
Åsa Persson0122e842017-10-16 12:19:23 +0200212 const int64_t
213 send_ms; // Time when first frame with this timestamp is sent.
214 uint32_t max_width; // Max width with this timestamp.
215 uint32_t max_height; // Max height with this timestamp.
Niels Möllerd3b8c632018-08-27 15:33:42 +0200216 int max_simulcast_idx; // Max simulcast index with this timestamp.
Åsa Persson0122e842017-10-16 12:19:23 +0200217 };
218 typedef std::map<uint32_t, Frame, TimestampOlderThan> EncodedFrameMap;
219
danilchapa37de392017-09-09 04:17:22 -0700220 void PurgeOldStats() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
pbos@webrtc.org09c77b92015-02-25 10:42:16 +0000221 VideoSendStream::StreamStats* GetStatsEntry(uint32_t ssrc)
danilchapa37de392017-09-09 04:17:22 -0700222 RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
sprang@webrtc.orgccd42842014-01-07 09:54:34 +0000223
Niels Möller213618e2018-07-24 09:29:58 +0200224 void SetAdaptTimer(const AdaptationSteps& counts, StatsTimer* timer)
225 RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
Ilya Nikolaevskiy5963c7c2019-10-09 18:06:58 +0200226 void UpdateAdaptationStats() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
Åsa Persson875841d2018-01-08 08:49:53 +0100227 void TryUpdateInitialQualityResolutionAdaptUp(
Niels Möller213618e2018-07-24 09:29:58 +0200228 const AdaptationSteps& quality_counts)
Åsa Persson875841d2018-01-08 08:49:53 +0100229 RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
asapersson09f05612017-05-15 23:40:18 -0700230
Åsa Persson45bbc8a2017-11-13 10:16:47 +0100231 void UpdateEncoderFallbackStats(const CodecSpecificInfo* codec_info,
Niels Möllerd3b8c632018-08-27 15:33:42 +0200232 int pixels,
233 int simulcast_index)
asapersson8d75ac72017-09-15 06:41:15 -0700234 RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
Åsa Perssonc3ed6302017-11-16 14:04:52 +0100235 void UpdateFallbackDisabledStats(const CodecSpecificInfo* codec_info,
Niels Möllerd3b8c632018-08-27 15:33:42 +0200236 int pixels,
237 int simulcast_index)
Åsa Perssonc3ed6302017-11-16 14:04:52 +0100238 RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_);
asapersson8d75ac72017-09-15 06:41:15 -0700239
pbos@webrtc.org273a4142014-12-01 15:23:21 +0000240 Clock* const clock_;
perkj26091b12016-09-01 01:17:40 -0700241 const std::string payload_name_;
Stefan Holmerdbdb3a02018-07-17 16:03:46 +0200242 const RtpConfig rtp_config_;
Danil Chapovalovb9b146c2018-06-15 12:28:07 +0200243 const absl::optional<int> fallback_max_pixels_;
244 const absl::optional<int> fallback_max_pixels_disabled_;
pbos5ad935c2016-01-25 03:52:44 -0800245 rtc::CriticalSection crit_;
danilchapa37de392017-09-09 04:17:22 -0700246 VideoEncoderConfig::ContentType content_type_ RTC_GUARDED_BY(crit_);
asapersson4374a092016-07-27 00:39:09 -0700247 const int64_t start_ms_;
danilchapa37de392017-09-09 04:17:22 -0700248 VideoSendStream::Stats stats_ RTC_GUARDED_BY(crit_);
danilchapa37de392017-09-09 04:17:22 -0700249 std::map<uint32_t, StatsUpdateTimes> update_times_ RTC_GUARDED_BY(crit_);
250 rtc::ExpFilter encode_time_ RTC_GUARDED_BY(crit_);
251 int quality_downscales_ RTC_GUARDED_BY(crit_);
252 int cpu_downscales_ RTC_GUARDED_BY(crit_);
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200253 QualityLimitationReasonTracker quality_limitation_reason_tracker_
254 RTC_GUARDED_BY(crit_);
Åsa Persson0122e842017-10-16 12:19:23 +0200255 rtc::RateTracker media_byte_rate_tracker_ RTC_GUARDED_BY(crit_);
256 rtc::RateTracker encoded_frame_rate_tracker_ RTC_GUARDED_BY(crit_);
asaperssond89920b2015-07-22 06:52:00 -0700257
Danil Chapovalovb9b146c2018-06-15 12:28:07 +0200258 absl::optional<int64_t> last_outlier_timestamp_ RTC_GUARDED_BY(crit_);
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100259
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200260 int last_num_spatial_layers_ RTC_GUARDED_BY(crit_);
261 int last_num_simulcast_streams_ RTC_GUARDED_BY(crit_);
262 std::array<bool, kMaxSpatialLayers> last_spatial_layer_use_
263 RTC_GUARDED_BY(crit_);
Ilya Nikolaevskiy5963c7c2019-10-09 18:06:58 +0200264 // Indicates if the latest bitrate allocation had layers disabled by low
265 // available bandwidth.
266 bool bw_limited_layers_ RTC_GUARDED_BY(crit_);
267 AdaptationSteps cpu_counts_ RTC_GUARDED_BY(crit_);
268 AdaptationSteps quality_counts_ RTC_GUARDED_BY(crit_);
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200269
Erik Språnge2fd86a2018-10-24 11:32:39 +0200270 struct EncoderChangeEvent {
271 std::string previous_encoder_implementation;
272 std::string new_encoder_implementation;
273 };
274 // Stores the last change in encoder implementation in an optional, so that
275 // the event can be consumed.
276 absl::optional<EncoderChangeEvent> encoder_changed_;
277
sprangb4a1ae52015-12-03 08:10:08 -0800278 // Contains stats used for UMA histograms. These stats will be reset if
279 // content type changes between real-time video and screenshare, since these
280 // will be reported separately.
281 struct UmaSamplesContainer {
sprang07fb9be2016-02-24 07:55:00 -0800282 UmaSamplesContainer(const char* prefix,
283 const VideoSendStream::Stats& start_stats,
284 Clock* clock);
sprangb4a1ae52015-12-03 08:10:08 -0800285 ~UmaSamplesContainer();
286
Stefan Holmerdbdb3a02018-07-17 16:03:46 +0200287 void UpdateHistograms(const RtpConfig& rtp_config,
sprang07fb9be2016-02-24 07:55:00 -0800288 const VideoSendStream::Stats& current_stats);
sprangb4a1ae52015-12-03 08:10:08 -0800289
asapersson93e1e232017-02-06 05:18:35 -0800290 void InitializeBitrateCounters(const VideoSendStream::Stats& stats);
291
Åsa Perssonaa329e72017-12-15 15:54:44 +0100292 bool InsertEncodedFrame(const EncodedImage& encoded_frame,
Niels Möllerd3b8c632018-08-27 15:33:42 +0200293 int simulcast_idx,
Åsa Perssonaa329e72017-12-15 15:54:44 +0100294 bool* is_limited_in_resolution);
295 void RemoveOld(int64_t now_ms, bool* is_limited_in_resolution);
Åsa Persson0122e842017-10-16 12:19:23 +0200296
sprangb4a1ae52015-12-03 08:10:08 -0800297 const std::string uma_prefix_;
sprang07fb9be2016-02-24 07:55:00 -0800298 Clock* const clock_;
sprangb4a1ae52015-12-03 08:10:08 -0800299 SampleCounter input_width_counter_;
300 SampleCounter input_height_counter_;
301 SampleCounter sent_width_counter_;
302 SampleCounter sent_height_counter_;
303 SampleCounter encode_time_counter_;
304 BoolSampleCounter key_frame_counter_;
305 BoolSampleCounter quality_limited_frame_counter_;
306 SampleCounter quality_downscales_counter_;
perkj803d97f2016-11-01 11:45:46 -0700307 BoolSampleCounter cpu_limited_frame_counter_;
sprangb4a1ae52015-12-03 08:10:08 -0800308 BoolSampleCounter bw_limited_frame_counter_;
309 SampleCounter bw_resolutions_disabled_counter_;
310 SampleCounter delay_counter_;
311 SampleCounter max_delay_counter_;
312 rtc::RateTracker input_frame_rate_tracker_;
asapersson320e45a2016-11-29 01:40:35 -0800313 RateCounter input_fps_counter_;
314 RateCounter sent_fps_counter_;
asapersson93e1e232017-02-06 05:18:35 -0800315 RateAccCounter total_byte_counter_;
316 RateAccCounter media_byte_counter_;
317 RateAccCounter rtx_byte_counter_;
318 RateAccCounter padding_byte_counter_;
319 RateAccCounter retransmit_byte_counter_;
320 RateAccCounter fec_byte_counter_;
sprange2d83d62016-02-19 09:03:26 -0800321 int64_t first_rtcp_stats_time_ms_;
Erik Språng22c2b482016-03-01 09:40:42 +0100322 int64_t first_rtp_stats_time_ms_;
asapersson09f05612017-05-15 23:40:18 -0700323 StatsTimer cpu_adapt_timer_;
324 StatsTimer quality_adapt_timer_;
asapersson66d4b372016-12-19 06:50:53 -0800325 BoolSampleCounter paused_time_counter_;
326 TargetRateUpdates target_rate_updates_;
asapersson8d75ac72017-09-15 06:41:15 -0700327 BoolSampleCounter fallback_active_counter_;
328 FallbackEncoderInfo fallback_info_;
Åsa Perssonc3ed6302017-11-16 14:04:52 +0100329 FallbackEncoderInfoDisabled fallback_info_disabled_;
sprange2d83d62016-02-19 09:03:26 -0800330 ReportBlockStats report_block_stats_;
sprang07fb9be2016-02-24 07:55:00 -0800331 const VideoSendStream::Stats start_stats_;
Åsa Perssonaa329e72017-12-15 15:54:44 +0100332 size_t num_streams_; // Number of configured streams to encoder.
333 size_t num_pixels_highest_stream_;
Åsa Persson0122e842017-10-16 12:19:23 +0200334 EncodedFrameMap encoded_frames_;
Åsa Persson875841d2018-01-08 08:49:53 +0100335 AdaptChanges initial_quality_changes_;
sprangc5d62e22017-04-02 23:53:04 -0700336
asapersson118ef002016-03-31 00:00:19 -0700337 std::map<int, QpCounters>
338 qp_counters_; // QP counters mapped by spatial idx.
sprangb4a1ae52015-12-03 08:10:08 -0800339 };
340
danilchapa37de392017-09-09 04:17:22 -0700341 std::unique_ptr<UmaSamplesContainer> uma_container_ RTC_GUARDED_BY(crit_);
sprang@webrtc.orgccd42842014-01-07 09:54:34 +0000342};
343
344} // namespace webrtc
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200345#endif // VIDEO_SEND_STATISTICS_PROXY_H_