OLD | NEW |
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 int64_t num_samples; | 97 int64_t num_samples; |
98 }; | 98 }; |
99 struct QpCounters { | 99 struct QpCounters { |
100 SampleCounter vp8; | 100 SampleCounter vp8; |
101 }; | 101 }; |
102 | 102 |
103 void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_); | 103 void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
104 | 104 |
105 void QualitySample() EXCLUSIVE_LOCKS_REQUIRED(crit_); | 105 void QualitySample() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
106 | 106 |
107 // Removes info about old frames and then updates the framerate/bitrate. | 107 // Removes info about old frames and then updates the framerate. |
108 void UpdateFrameAndBitrate(int64_t now_ms) const | 108 void UpdateFramerate(int64_t now_ms) const EXCLUSIVE_LOCKS_REQUIRED(crit_); |
109 EXCLUSIVE_LOCKS_REQUIRED(crit_); | |
110 | 109 |
111 Clock* const clock_; | 110 Clock* const clock_; |
112 // Ownership of this object lies with the owner of the ReceiveStatisticsProxy | 111 // Ownership of this object lies with the owner of the ReceiveStatisticsProxy |
113 // instance. Lifetime is guaranteed to outlive |this|. | 112 // instance. Lifetime is guaranteed to outlive |this|. |
114 // TODO(tommi): In practice the config_ reference is only used for accessing | 113 // TODO(tommi): In practice the config_ reference is only used for accessing |
115 // config_.rtp.ulpfec.ulpfec_payload_type. Instead of holding a pointer back, | 114 // config_.rtp.ulpfec.ulpfec_payload_type. Instead of holding a pointer back, |
116 // we could just store the value of ulpfec_payload_type and change the | 115 // we could just store the value of ulpfec_payload_type and change the |
117 // ReceiveStatisticsProxy() ctor to accept a const& of Config (since we'll | 116 // ReceiveStatisticsProxy() ctor to accept a const& of Config (since we'll |
118 // then no longer store a pointer to the object). | 117 // then no longer store a pointer to the object). |
119 const VideoReceiveStream::Config& config_; | 118 const VideoReceiveStream::Config& config_; |
120 const int64_t start_ms_; | 119 const int64_t start_ms_; |
121 | 120 |
122 rtc::CriticalSection crit_; | 121 rtc::CriticalSection crit_; |
123 int64_t last_sample_time_ GUARDED_BY(crit_); | 122 int64_t last_sample_time_ GUARDED_BY(crit_); |
124 QualityThreshold fps_threshold_ GUARDED_BY(crit_); | 123 QualityThreshold fps_threshold_ GUARDED_BY(crit_); |
125 QualityThreshold qp_threshold_ GUARDED_BY(crit_); | 124 QualityThreshold qp_threshold_ GUARDED_BY(crit_); |
126 QualityThreshold variance_threshold_ GUARDED_BY(crit_); | 125 QualityThreshold variance_threshold_ GUARDED_BY(crit_); |
127 SampleCounter qp_sample_ GUARDED_BY(crit_); | 126 SampleCounter qp_sample_ GUARDED_BY(crit_); |
128 int num_bad_states_ GUARDED_BY(crit_); | 127 int num_bad_states_ GUARDED_BY(crit_); |
129 int num_certain_states_ GUARDED_BY(crit_); | 128 int num_certain_states_ GUARDED_BY(crit_); |
130 mutable VideoReceiveStream::Stats stats_ GUARDED_BY(crit_); | 129 mutable VideoReceiveStream::Stats stats_ GUARDED_BY(crit_); |
131 RateStatistics decode_fps_estimator_ GUARDED_BY(crit_); | 130 RateStatistics decode_fps_estimator_ GUARDED_BY(crit_); |
132 RateStatistics renders_fps_estimator_ GUARDED_BY(crit_); | 131 RateStatistics renders_fps_estimator_ GUARDED_BY(crit_); |
133 rtc::RateTracker render_fps_tracker_ GUARDED_BY(crit_); | 132 rtc::RateTracker render_fps_tracker_ GUARDED_BY(crit_); |
134 rtc::RateTracker render_pixel_tracker_ GUARDED_BY(crit_); | 133 rtc::RateTracker render_pixel_tracker_ GUARDED_BY(crit_); |
| 134 rtc::RateTracker total_byte_tracker_ GUARDED_BY(crit_); |
135 SampleCounter render_width_counter_ GUARDED_BY(crit_); | 135 SampleCounter render_width_counter_ GUARDED_BY(crit_); |
136 SampleCounter render_height_counter_ GUARDED_BY(crit_); | 136 SampleCounter render_height_counter_ GUARDED_BY(crit_); |
137 SampleCounter sync_offset_counter_ GUARDED_BY(crit_); | 137 SampleCounter sync_offset_counter_ GUARDED_BY(crit_); |
138 SampleCounter decode_time_counter_ GUARDED_BY(crit_); | 138 SampleCounter decode_time_counter_ GUARDED_BY(crit_); |
139 SampleCounter jitter_buffer_delay_counter_ GUARDED_BY(crit_); | 139 SampleCounter jitter_buffer_delay_counter_ GUARDED_BY(crit_); |
140 SampleCounter target_delay_counter_ GUARDED_BY(crit_); | 140 SampleCounter target_delay_counter_ GUARDED_BY(crit_); |
141 SampleCounter current_delay_counter_ GUARDED_BY(crit_); | 141 SampleCounter current_delay_counter_ GUARDED_BY(crit_); |
142 SampleCounter delay_counter_ GUARDED_BY(crit_); | 142 SampleCounter delay_counter_ GUARDED_BY(crit_); |
143 SampleCounter e2e_delay_counter_ GUARDED_BY(crit_); | 143 SampleCounter e2e_delay_counter_ GUARDED_BY(crit_); |
144 MaxCounter freq_offset_counter_ GUARDED_BY(crit_); | 144 MaxCounter freq_offset_counter_ GUARDED_BY(crit_); |
145 int64_t first_report_block_time_ms_ GUARDED_BY(crit_); | 145 int64_t first_report_block_time_ms_ GUARDED_BY(crit_); |
146 ReportBlockStats report_block_stats_ GUARDED_BY(crit_); | 146 ReportBlockStats report_block_stats_ GUARDED_BY(crit_); |
147 QpCounters qp_counters_; // Only accessed on the decoding thread. | 147 QpCounters qp_counters_; // Only accessed on the decoding thread. |
148 std::map<uint32_t, StreamDataCounters> rtx_stats_ GUARDED_BY(crit_); | 148 std::map<uint32_t, StreamDataCounters> rtx_stats_ GUARDED_BY(crit_); |
149 int64_t avg_rtt_ms_ GUARDED_BY(crit_); | 149 int64_t avg_rtt_ms_ GUARDED_BY(crit_); |
150 mutable std::map<int64_t, size_t> frame_window_ GUARDED_BY(&crit_); | 150 mutable std::map<int64_t, size_t> frame_window_ GUARDED_BY(&crit_); |
151 mutable size_t frame_window_accumulated_bytes_ GUARDED_BY(&crit_); | |
152 }; | 151 }; |
153 | 152 |
154 } // namespace webrtc | 153 } // namespace webrtc |
155 #endif // WEBRTC_VIDEO_RECEIVE_STATISTICS_PROXY_H_ | 154 #endif // WEBRTC_VIDEO_RECEIVE_STATISTICS_PROXY_H_ |
OLD | NEW |