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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 } | 243 } |
244 // Remove any old frames up to current. | 244 // Remove any old frames up to current. |
245 // Old frames have been skipped by the capture process thread. | 245 // Old frames have been skipped by the capture process thread. |
246 // TODO(asapersson): Consider measuring time from first frame in list. | 246 // TODO(asapersson): Consider measuring time from first frame in list. |
247 last_processing_time_ms_ = now - (*it).second; | 247 last_processing_time_ms_ = now - (*it).second; |
248 frame_times_.erase(frame_times_.begin(), ++it); | 248 frame_times_.erase(frame_times_.begin(), ++it); |
249 return last_processing_time_ms_; | 249 return last_processing_time_ms_; |
250 } | 250 } |
251 | 251 |
252 void Reset() { frame_times_.clear(); } | 252 void Reset() { frame_times_.clear(); } |
253 int NumFrames() const { return frame_times_.size(); } | 253 int NumFrames() const { return static_cast<int>(frame_times_.size()); } |
254 int last_processing_time_ms() const { return last_processing_time_ms_; } | 254 int last_processing_time_ms() const { return last_processing_time_ms_; } |
255 | 255 |
256 private: | 256 private: |
257 // Captured frames mapped by the capture time. | 257 // Captured frames mapped by the capture time. |
258 std::map<int64_t, int64_t> frame_times_; | 258 std::map<int64_t, int64_t> frame_times_; |
259 int last_processing_time_ms_; | 259 int last_processing_time_ms_; |
260 }; | 260 }; |
261 | 261 |
262 // TODO(asapersson): Remove this class. Not used. | 262 // TODO(asapersson): Remove this class. Not used. |
263 // Class for calculating the capture queue delay change. | 263 // Class for calculating the capture queue delay change. |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 bool underusing = false; | 574 bool underusing = false; |
575 if (options_.enable_capture_jitter_method) { | 575 if (options_.enable_capture_jitter_method) { |
576 underusing = capture_deltas_.StdDev() < | 576 underusing = capture_deltas_.StdDev() < |
577 options_.low_capture_jitter_threshold_ms; | 577 options_.low_capture_jitter_threshold_ms; |
578 } else if (options_.enable_encode_usage_method) { | 578 } else if (options_.enable_encode_usage_method) { |
579 underusing = usage_->Value() < options_.low_encode_usage_threshold_percent; | 579 underusing = usage_->Value() < options_.low_encode_usage_threshold_percent; |
580 } | 580 } |
581 return underusing; | 581 return underusing; |
582 } | 582 } |
583 } // namespace webrtc | 583 } // namespace webrtc |
OLD | NEW |