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

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: Add metrics sliced on AlrExperiment group 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
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/optional.h"
22 #include "webrtc/rtc_base/rate_statistics.h" 23 #include "webrtc/rtc_base/rate_statistics.h"
23 #include "webrtc/rtc_base/ratetracker.h" 24 #include "webrtc/rtc_base/ratetracker.h"
24 #include "webrtc/rtc_base/thread_annotations.h" 25 #include "webrtc/rtc_base/thread_annotations.h"
25 #include "webrtc/video/quality_threshold.h" 26 #include "webrtc/video/quality_threshold.h"
26 #include "webrtc/video/report_block_stats.h" 27 #include "webrtc/video/report_block_stats.h"
27 #include "webrtc/video/stats_counter.h" 28 #include "webrtc/video/stats_counter.h"
28 #include "webrtc/video/video_stream_decoder.h" 29 #include "webrtc/video/video_stream_decoder.h"
29 30
30 namespace webrtc { 31 namespace webrtc {
31 32
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 uint32_t ssrc) override; 91 uint32_t ssrc) override;
91 92
92 // Implements CallStatsObserver. 93 // Implements CallStatsObserver.
93 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; 94 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override;
94 95
95 private: 96 private:
96 struct SampleCounter { 97 struct SampleCounter {
97 SampleCounter() : sum(0), num_samples(0) {} 98 SampleCounter() : sum(0), num_samples(0) {}
98 void Add(int sample); 99 void Add(int sample);
99 int Avg(int64_t min_required_samples) const; 100 int Avg(int64_t min_required_samples) const;
101 int Max() const;
100 void Reset(); 102 void Reset();
101 103
102 private: 104 private:
103 int64_t sum; 105 int64_t sum;
104 int64_t num_samples; 106 int64_t num_samples;
107 rtc::Optional<int> max;
105 }; 108 };
106 struct QpCounters { 109 struct QpCounters {
107 SampleCounter vp8; 110 SampleCounter vp8;
108 }; 111 };
109 112
113 struct ContentSpecificStats {
114 SampleCounter e2e_delay_counter;
115 SampleCounter interframe_delay_counter;
sprang_webrtc 2017/08/24 09:13:16 Thinking more about this, I think it would be good
ilnik 2017/08/25 12:35:07 qp, media bitrate, and resolution are added sliced
116 };
117
110 void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_); 118 void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_);
111 119
112 void QualitySample() EXCLUSIVE_LOCKS_REQUIRED(crit_); 120 void QualitySample() EXCLUSIVE_LOCKS_REQUIRED(crit_);
113 121
114 // Removes info about old frames and then updates the framerate. 122 // Removes info about old frames and then updates the framerate.
115 void UpdateFramerate(int64_t now_ms) const EXCLUSIVE_LOCKS_REQUIRED(crit_); 123 void UpdateFramerate(int64_t now_ms) const EXCLUSIVE_LOCKS_REQUIRED(crit_);
116 124
117 Clock* const clock_; 125 Clock* const clock_;
118 // Ownership of this object lies with the owner of the ReceiveStatisticsProxy 126 // Ownership of this object lies with the owner of the ReceiveStatisticsProxy
119 // instance. Lifetime is guaranteed to outlive |this|. 127 // instance. Lifetime is guaranteed to outlive |this|.
(...skipping 20 matching lines...) Expand all
140 rtc::RateTracker render_pixel_tracker_ GUARDED_BY(crit_); 148 rtc::RateTracker render_pixel_tracker_ GUARDED_BY(crit_);
141 rtc::RateTracker total_byte_tracker_ GUARDED_BY(crit_); 149 rtc::RateTracker total_byte_tracker_ GUARDED_BY(crit_);
142 SampleCounter render_width_counter_ GUARDED_BY(crit_); 150 SampleCounter render_width_counter_ GUARDED_BY(crit_);
143 SampleCounter render_height_counter_ GUARDED_BY(crit_); 151 SampleCounter render_height_counter_ GUARDED_BY(crit_);
144 SampleCounter sync_offset_counter_ GUARDED_BY(crit_); 152 SampleCounter sync_offset_counter_ GUARDED_BY(crit_);
145 SampleCounter decode_time_counter_ GUARDED_BY(crit_); 153 SampleCounter decode_time_counter_ GUARDED_BY(crit_);
146 SampleCounter jitter_buffer_delay_counter_ GUARDED_BY(crit_); 154 SampleCounter jitter_buffer_delay_counter_ GUARDED_BY(crit_);
147 SampleCounter target_delay_counter_ GUARDED_BY(crit_); 155 SampleCounter target_delay_counter_ GUARDED_BY(crit_);
148 SampleCounter current_delay_counter_ GUARDED_BY(crit_); 156 SampleCounter current_delay_counter_ GUARDED_BY(crit_);
149 SampleCounter delay_counter_ GUARDED_BY(crit_); 157 SampleCounter delay_counter_ GUARDED_BY(crit_);
150 SampleCounter e2e_delay_counter_video_ GUARDED_BY(crit_); 158 std::map<VideoContentType, ContentSpecificStats> content_specific_stats_
151 SampleCounter e2e_delay_counter_screenshare_ GUARDED_BY(crit_); 159 GUARDED_BY(crit_);
152 SampleCounter interframe_delay_counter_video_ GUARDED_BY(crit_);
153 SampleCounter interframe_delay_counter_screenshare_ GUARDED_BY(crit_);
154 int64_t e2e_delay_max_ms_video_ GUARDED_BY(crit_);
155 int64_t e2e_delay_max_ms_screenshare_ GUARDED_BY(crit_);
156 int64_t interframe_delay_max_ms_video_ GUARDED_BY(crit_);
157 int64_t interframe_delay_max_ms_screenshare_ GUARDED_BY(crit_);
158 MaxCounter freq_offset_counter_ GUARDED_BY(crit_); 160 MaxCounter freq_offset_counter_ GUARDED_BY(crit_);
159 int64_t first_report_block_time_ms_ GUARDED_BY(crit_); 161 int64_t first_report_block_time_ms_ GUARDED_BY(crit_);
160 ReportBlockStats report_block_stats_ GUARDED_BY(crit_); 162 ReportBlockStats report_block_stats_ GUARDED_BY(crit_);
161 QpCounters qp_counters_; // Only accessed on the decoding thread. 163 QpCounters qp_counters_; // Only accessed on the decoding thread.
162 std::map<uint32_t, StreamDataCounters> rtx_stats_ GUARDED_BY(crit_); 164 std::map<uint32_t, StreamDataCounters> rtx_stats_ GUARDED_BY(crit_);
163 int64_t avg_rtt_ms_ GUARDED_BY(crit_); 165 int64_t avg_rtt_ms_ GUARDED_BY(crit_);
164 mutable std::map<int64_t, size_t> frame_window_ GUARDED_BY(&crit_); 166 mutable std::map<int64_t, size_t> frame_window_ GUARDED_BY(&crit_);
165 VideoContentType last_content_type_ GUARDED_BY(&crit_); 167 VideoContentType last_content_type_ GUARDED_BY(&crit_);
166 rtc::Optional<int64_t> last_decoded_frame_time_ms_ GUARDED_BY(&crit_); 168 rtc::Optional<int64_t> last_decoded_frame_time_ms_ GUARDED_BY(&crit_);
167 rtc::Optional<TimingFrameInfo> timing_frame_info_ GUARDED_BY(&crit_); 169 rtc::Optional<TimingFrameInfo> timing_frame_info_ GUARDED_BY(&crit_);
168 }; 170 };
169 171
170 } // namespace webrtc 172 } // namespace webrtc
171 #endif // WEBRTC_VIDEO_RECEIVE_STATISTICS_PROXY_H_ 173 #endif // WEBRTC_VIDEO_RECEIVE_STATISTICS_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698