Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/capture/content/video_capture_oracle.h" | 5 #include "media/capture/content/video_capture_oracle.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 296 frame_number, delta.InMicroseconds(), | 296 frame_number, delta.InMicroseconds(), |
| 297 100.0 * FractionFromExpectedFrameRate(delta, 30), | 297 100.0 * FractionFromExpectedFrameRate(delta, 30), |
| 298 100.0 * FractionFromExpectedFrameRate(delta, 25), | 298 100.0 * FractionFromExpectedFrameRate(delta, 25), |
| 299 100.0 * FractionFromExpectedFrameRate(delta, 24)); | 299 100.0 * FractionFromExpectedFrameRate(delta, 24)); |
| 300 } | 300 } |
| 301 } | 301 } |
| 302 | 302 |
| 303 return true; | 303 return true; |
| 304 } | 304 } |
| 305 | 305 |
| 306 bool VideoCaptureOracle::IsAnimationActive() const { | |
| 307 base::TimeDelta duration = | |
| 308 base::TimeTicks::Now() - last_time_animation_was_detected_; | |
| 309 return duration.InMicroseconds() < kDebouncingPeriodForAnimatedContentMicros; | |
|
miu
2015/12/01 21:15:27
I don't think this does what you intended. The kD
Irfan
2015/12/02 22:32:44
As discussed, this has the same intention. Will be
| |
| 310 } | |
| 311 | |
| 306 void VideoCaptureOracle::RecordConsumerFeedback(int frame_number, | 312 void VideoCaptureOracle::RecordConsumerFeedback(int frame_number, |
| 307 double resource_utilization) { | 313 double resource_utilization) { |
| 308 if (!auto_throttling_enabled_) | 314 if (!auto_throttling_enabled_) |
| 309 return; | 315 return; |
| 310 | 316 |
| 311 if (!std::isfinite(resource_utilization)) { | 317 if (!std::isfinite(resource_utilization)) { |
| 312 LOG(DFATAL) << "Non-finite utilization provided by consumer for frame #" | 318 LOG(DFATAL) << "Non-finite utilization provided by consumer for frame #" |
| 313 << frame_number << ": " << resource_utilization; | 319 << frame_number << ": " << resource_utilization; |
| 314 return; | 320 return; |
| 315 } | 321 } |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 525 // Content is not animating, so permit an immediate increase in the capture | 531 // Content is not animating, so permit an immediate increase in the capture |
| 526 // area. This allows the system to quickly improve the quality of | 532 // area. This allows the system to quickly improve the quality of |
| 527 // non-animating content (frame drops are not much of a concern). | 533 // non-animating content (frame drops are not much of a concern). |
| 528 VLOG(2) << "Proposing a " | 534 VLOG(2) << "Proposing a " |
| 529 << (100.0 * (increased_area - current_area) / current_area) | 535 << (100.0 * (increased_area - current_area) / current_area) |
| 530 << "% increase in capture area for non-animating content. :-)"; | 536 << "% increase in capture area for non-animating content. :-)"; |
| 531 return increased_area; | 537 return increased_area; |
| 532 } | 538 } |
| 533 | 539 |
| 534 } // namespace media | 540 } // namespace media |
| OLD | NEW |