| 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/smooth_event_sampler.h" | 5 #include "device/capture/content/smooth_event_sampler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace media { | 14 namespace device { |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 bool AddEventAndConsiderSampling(SmoothEventSampler* sampler, | 18 bool AddEventAndConsiderSampling(SmoothEventSampler* sampler, |
| 19 base::TimeTicks event_time) { | 19 base::TimeTicks event_time) { |
| 20 sampler->ConsiderPresentationEvent(event_time); | 20 sampler->ConsiderPresentationEvent(event_time); |
| 21 return sampler->ShouldSample(); | 21 return sampler->ShouldSample(); |
| 22 } | 22 } |
| 23 | 23 |
| 24 void SteadyStateSampleAndAdvance(base::TimeDelta vsync, | 24 void SteadyStateSampleAndAdvance(base::TimeDelta vsync, |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 {false, 0}, | 607 {false, 0}, |
| 608 {true, 33.441}, | 608 {true, 33.441}, |
| 609 {false, 16.72}, | 609 {false, 16.72}, |
| 610 {true, 16.72}, | 610 {true, 16.72}, |
| 611 {true, 50.16}}; | 611 {true, 50.16}}; |
| 612 | 612 |
| 613 SmoothEventSampler sampler(base::TimeDelta::FromSeconds(1) / 30); | 613 SmoothEventSampler sampler(base::TimeDelta::FromSeconds(1) / 30); |
| 614 ReplayCheckingSamplerDecisions(data_points, arraysize(data_points), &sampler); | 614 ReplayCheckingSamplerDecisions(data_points, arraysize(data_points), &sampler); |
| 615 } | 615 } |
| 616 | 616 |
| 617 } // namespace media | 617 } // namespace device |
| OLD | NEW |