| 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 "content/browser/media/capture/animated_content_sampler.h" | 5 #include "media/capture/animated_content_sampler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 namespace content { | 9 namespace media { |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 // These specify the minimum/maximum amount of recent event history to examine | 13 // These specify the minimum/maximum amount of recent event history to examine |
| 14 // to detect animated content. If the values are too low, there is a greater | 14 // to detect animated content. If the values are too low, there is a greater |
| 15 // risk of false-positive detections and low accuracy. If they are too high, | 15 // risk of false-positive detections and low accuracy. If they are too high, |
| 16 // the the implementation will be slow to lock-in/out, and also will not react | 16 // the the implementation will be slow to lock-in/out, and also will not react |
| 17 // well to mildly-variable frame rate content (e.g., 25 +/- 1 FPS). | 17 // well to mildly-variable frame rate content (e.g., 25 +/- 1 FPS). |
| 18 // | 18 // |
| 19 // These values were established by experimenting with a wide variety of | 19 // These values were established by experimenting with a wide variety of |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 sampling_period = ratio * animation_period; | 283 sampling_period = ratio * animation_period; |
| 284 } else { | 284 } else { |
| 285 sampling_period = (ratio + 1) * animation_period; | 285 sampling_period = (ratio + 1) * animation_period; |
| 286 } | 286 } |
| 287 } else { | 287 } else { |
| 288 sampling_period = animation_period; | 288 sampling_period = animation_period; |
| 289 } | 289 } |
| 290 return std::max(sampling_period, min_capture_period); | 290 return std::max(sampling_period, min_capture_period); |
| 291 } | 291 } |
| 292 | 292 |
| 293 } // namespace content | 293 } // namespace media |
| OLD | NEW |