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

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

Issue 2986893002: Piggybacking simulcast id and ALR experiment id into video content type extension. (Closed)
Patch Set: use namespace instead of struct Created 3 years, 3 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
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/video/receive_statistics_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 #ifndef WEBRTC_VIDEO_RECEIVE_STATISTICS_PROXY_H_ 11 #ifndef WEBRTC_VIDEO_RECEIVE_STATISTICS_PROXY_H_
12 #define WEBRTC_VIDEO_RECEIVE_STATISTICS_PROXY_H_ 12 #define WEBRTC_VIDEO_RECEIVE_STATISTICS_PROXY_H_
13 13
14 #include <map> 14 #include <map>
15 #include <string> 15 #include <string>
16 16
17 #include "webrtc/call/video_receive_stream.h" 17 #include "webrtc/call/video_receive_stream.h"
18 #include "webrtc/common_types.h" 18 #include "webrtc/common_types.h"
19 #include "webrtc/common_video/include/frame_callback.h" 19 #include "webrtc/common_video/include/frame_callback.h"
20 #include "webrtc/modules/video_coding/include/video_coding_defines.h" 20 #include "webrtc/modules/video_coding/include/video_coding_defines.h"
21 #include "webrtc/rtc_base/criticalsection.h" 21 #include "webrtc/rtc_base/criticalsection.h"
22 #include "webrtc/rtc_base/moving_max_counter.h" 22 #include "webrtc/rtc_base/moving_max_counter.h"
23 #include "webrtc/rtc_base/optional.h"
23 #include "webrtc/rtc_base/rate_statistics.h" 24 #include "webrtc/rtc_base/rate_statistics.h"
24 #include "webrtc/rtc_base/ratetracker.h" 25 #include "webrtc/rtc_base/ratetracker.h"
25 #include "webrtc/rtc_base/thread_annotations.h" 26 #include "webrtc/rtc_base/thread_annotations.h"
26 #include "webrtc/video/quality_threshold.h" 27 #include "webrtc/video/quality_threshold.h"
27 #include "webrtc/video/report_block_stats.h" 28 #include "webrtc/video/report_block_stats.h"
28 #include "webrtc/video/stats_counter.h" 29 #include "webrtc/video/stats_counter.h"
29 #include "webrtc/video/video_stream_decoder.h" 30 #include "webrtc/video/video_stream_decoder.h"
30 31
31 namespace webrtc { 32 namespace webrtc {
32 33
(...skipping 26 matching lines...) Expand all
59 void OnPreDecode(const EncodedImage& encoded_image, 60 void OnPreDecode(const EncodedImage& encoded_image,
60 const CodecSpecificInfo* codec_specific_info); 61 const CodecSpecificInfo* codec_specific_info);
61 62
62 // Indicates video stream has been paused (no incoming packets). 63 // Indicates video stream has been paused (no incoming packets).
63 void OnStreamInactive(); 64 void OnStreamInactive();
64 65
65 // Overrides VCMReceiveStatisticsCallback. 66 // Overrides VCMReceiveStatisticsCallback.
66 void OnReceiveRatesUpdated(uint32_t bitRate, uint32_t frameRate) override; 67 void OnReceiveRatesUpdated(uint32_t bitRate, uint32_t frameRate) override;
67 void OnFrameCountsUpdated(const FrameCounts& frame_counts) override; 68 void OnFrameCountsUpdated(const FrameCounts& frame_counts) override;
68 void OnDiscardedPacketsUpdated(int discarded_packets) override; 69 void OnDiscardedPacketsUpdated(int discarded_packets) override;
69 void OnCompleteFrame(bool is_keyframe, size_t size_bytes) override; 70 void OnCompleteFrame(bool is_keyframe,
71 size_t size_bytes,
72 VideoContentType content_type) override;
70 void OnFrameBufferTimingsUpdated(int decode_ms, 73 void OnFrameBufferTimingsUpdated(int decode_ms,
71 int max_decode_ms, 74 int max_decode_ms,
72 int current_delay_ms, 75 int current_delay_ms,
73 int target_delay_ms, 76 int target_delay_ms,
74 int jitter_buffer_ms, 77 int jitter_buffer_ms,
75 int min_playout_delay_ms, 78 int min_playout_delay_ms,
76 int render_delay_ms) override; 79 int render_delay_ms) override;
77 80
78 void OnTimingFrameInfoUpdated(const TimingFrameInfo& info) override; 81 void OnTimingFrameInfoUpdated(const TimingFrameInfo& info) override;
79 82
(...skipping 11 matching lines...) Expand all
91 uint32_t ssrc) override; 94 uint32_t ssrc) override;
92 95
93 // Implements CallStatsObserver. 96 // Implements CallStatsObserver.
94 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; 97 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override;
95 98
96 private: 99 private:
97 struct SampleCounter { 100 struct SampleCounter {
98 SampleCounter() : sum(0), num_samples(0) {} 101 SampleCounter() : sum(0), num_samples(0) {}
99 void Add(int sample); 102 void Add(int sample);
100 int Avg(int64_t min_required_samples) const; 103 int Avg(int64_t min_required_samples) const;
104 int Max() const;
101 void Reset(); 105 void Reset();
106 void Add(const SampleCounter& other);
102 107
103 private: 108 private:
104 int64_t sum; 109 int64_t sum;
105 int64_t num_samples; 110 int64_t num_samples;
111 rtc::Optional<int> max;
106 }; 112 };
113
107 struct QpCounters { 114 struct QpCounters {
108 SampleCounter vp8; 115 SampleCounter vp8;
109 }; 116 };
110 117
118 struct ContentSpecificStats {
119 void Add(const ContentSpecificStats& other);
120
121 SampleCounter e2e_delay_counter;
122 SampleCounter interframe_delay_counter;
123 int64_t flow_duration_ms = 0;
124 int64_t total_media_bytes = 0;
125 SampleCounter received_width;
126 SampleCounter received_height;
127 SampleCounter qp_counter;
128 FrameCounts frame_counts;
129 };
130
111 void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_); 131 void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_);
112 132
113 void QualitySample() EXCLUSIVE_LOCKS_REQUIRED(crit_); 133 void QualitySample() EXCLUSIVE_LOCKS_REQUIRED(crit_);
114 134
115 // Removes info about old frames and then updates the framerate. 135 // Removes info about old frames and then updates the framerate.
116 void UpdateFramerate(int64_t now_ms) const EXCLUSIVE_LOCKS_REQUIRED(crit_); 136 void UpdateFramerate(int64_t now_ms) const EXCLUSIVE_LOCKS_REQUIRED(crit_);
117 137
118 Clock* const clock_; 138 Clock* const clock_;
119 // Ownership of this object lies with the owner of the ReceiveStatisticsProxy 139 // Ownership of this object lies with the owner of the ReceiveStatisticsProxy
120 // instance. Lifetime is guaranteed to outlive |this|. 140 // instance. Lifetime is guaranteed to outlive |this|.
(...skipping 12 matching lines...) Expand all
133 QualityThreshold variance_threshold_ GUARDED_BY(crit_); 153 QualityThreshold variance_threshold_ GUARDED_BY(crit_);
134 SampleCounter qp_sample_ GUARDED_BY(crit_); 154 SampleCounter qp_sample_ GUARDED_BY(crit_);
135 int num_bad_states_ GUARDED_BY(crit_); 155 int num_bad_states_ GUARDED_BY(crit_);
136 int num_certain_states_ GUARDED_BY(crit_); 156 int num_certain_states_ GUARDED_BY(crit_);
137 mutable VideoReceiveStream::Stats stats_ GUARDED_BY(crit_); 157 mutable VideoReceiveStream::Stats stats_ GUARDED_BY(crit_);
138 RateStatistics decode_fps_estimator_ GUARDED_BY(crit_); 158 RateStatistics decode_fps_estimator_ GUARDED_BY(crit_);
139 RateStatistics renders_fps_estimator_ GUARDED_BY(crit_); 159 RateStatistics renders_fps_estimator_ GUARDED_BY(crit_);
140 rtc::RateTracker render_fps_tracker_ GUARDED_BY(crit_); 160 rtc::RateTracker render_fps_tracker_ GUARDED_BY(crit_);
141 rtc::RateTracker render_pixel_tracker_ GUARDED_BY(crit_); 161 rtc::RateTracker render_pixel_tracker_ GUARDED_BY(crit_);
142 rtc::RateTracker total_byte_tracker_ GUARDED_BY(crit_); 162 rtc::RateTracker total_byte_tracker_ GUARDED_BY(crit_);
143 SampleCounter render_width_counter_ GUARDED_BY(crit_);
144 SampleCounter render_height_counter_ GUARDED_BY(crit_);
145 SampleCounter sync_offset_counter_ GUARDED_BY(crit_); 163 SampleCounter sync_offset_counter_ GUARDED_BY(crit_);
146 SampleCounter decode_time_counter_ GUARDED_BY(crit_); 164 SampleCounter decode_time_counter_ GUARDED_BY(crit_);
147 SampleCounter jitter_buffer_delay_counter_ GUARDED_BY(crit_); 165 SampleCounter jitter_buffer_delay_counter_ GUARDED_BY(crit_);
148 SampleCounter target_delay_counter_ GUARDED_BY(crit_); 166 SampleCounter target_delay_counter_ GUARDED_BY(crit_);
149 SampleCounter current_delay_counter_ GUARDED_BY(crit_); 167 SampleCounter current_delay_counter_ GUARDED_BY(crit_);
150 SampleCounter delay_counter_ GUARDED_BY(crit_); 168 SampleCounter delay_counter_ GUARDED_BY(crit_);
151 SampleCounter e2e_delay_counter_video_ GUARDED_BY(crit_);
152 SampleCounter e2e_delay_counter_screenshare_ GUARDED_BY(crit_);
153 SampleCounter interframe_delay_counter_video_ GUARDED_BY(crit_);
154 SampleCounter interframe_delay_counter_screenshare_ GUARDED_BY(crit_);
155 int64_t e2e_delay_max_ms_video_ GUARDED_BY(crit_);
156 int64_t e2e_delay_max_ms_screenshare_ GUARDED_BY(crit_);
157 int64_t interframe_delay_max_ms_video_ GUARDED_BY(crit_);
158 int64_t interframe_delay_max_ms_screenshare_ GUARDED_BY(crit_);
159 mutable rtc::MovingMaxCounter<int> interframe_delay_max_moving_ 169 mutable rtc::MovingMaxCounter<int> interframe_delay_max_moving_
160 GUARDED_BY(crit_); 170 GUARDED_BY(crit_);
171 std::map<VideoContentType, ContentSpecificStats> content_specific_stats_
172 GUARDED_BY(crit_);
161 MaxCounter freq_offset_counter_ GUARDED_BY(crit_); 173 MaxCounter freq_offset_counter_ GUARDED_BY(crit_);
162 int64_t first_report_block_time_ms_ GUARDED_BY(crit_); 174 int64_t first_report_block_time_ms_ GUARDED_BY(crit_);
163 ReportBlockStats report_block_stats_ GUARDED_BY(crit_); 175 ReportBlockStats report_block_stats_ GUARDED_BY(crit_);
164 QpCounters qp_counters_; // Only accessed on the decoding thread. 176 QpCounters qp_counters_; // Only accessed on the decoding thread.
165 std::map<uint32_t, StreamDataCounters> rtx_stats_ GUARDED_BY(crit_); 177 std::map<uint32_t, StreamDataCounters> rtx_stats_ GUARDED_BY(crit_);
166 int64_t avg_rtt_ms_ GUARDED_BY(crit_); 178 int64_t avg_rtt_ms_ GUARDED_BY(crit_);
167 mutable std::map<int64_t, size_t> frame_window_ GUARDED_BY(&crit_); 179 mutable std::map<int64_t, size_t> frame_window_ GUARDED_BY(&crit_);
168 VideoContentType last_content_type_ GUARDED_BY(&crit_); 180 VideoContentType last_content_type_ GUARDED_BY(&crit_);
169 rtc::Optional<int64_t> last_decoded_frame_time_ms_ GUARDED_BY(&crit_); 181 rtc::Optional<int64_t> last_decoded_frame_time_ms_ GUARDED_BY(&crit_);
170 rtc::Optional<TimingFrameInfo> timing_frame_info_ GUARDED_BY(&crit_); 182 rtc::Optional<TimingFrameInfo> timing_frame_info_ GUARDED_BY(&crit_);
171 }; 183 };
172 184
173 } // namespace webrtc 185 } // namespace webrtc
174 #endif // WEBRTC_VIDEO_RECEIVE_STATISTICS_PROXY_H_ 186 #endif // WEBRTC_VIDEO_RECEIVE_STATISTICS_PROXY_H_
OLDNEW
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/video/receive_statistics_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698