OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 public: | 66 public: |
67 TestAudioSource() | 67 TestAudioSource() |
68 : SineWaveAudioSource(kParams.channel_layout(), | 68 : SineWaveAudioSource(kParams.channel_layout(), |
69 200.0, | 69 200.0, |
70 kParams.sample_rate()), | 70 kParams.sample_rate()), |
71 data_pulled_(base::WaitableEvent::ResetPolicy::AUTOMATIC, | 71 data_pulled_(base::WaitableEvent::ResetPolicy::AUTOMATIC, |
72 base::WaitableEvent::InitialState::NOT_SIGNALED) {} | 72 base::WaitableEvent::InitialState::NOT_SIGNALED) {} |
73 | 73 |
74 ~TestAudioSource() override {} | 74 ~TestAudioSource() override {} |
75 | 75 |
76 int OnMoreData(AudioBus* audio_bus, | 76 int OnMoreData(base::TimeTicks target_playout_time, |
77 uint32_t total_bytes_delay, | 77 int prior_frames_skipped, |
78 uint32_t frames_skipped) override { | 78 AudioBus* dest) override { |
79 const int ret = SineWaveAudioSource::OnMoreData( | 79 const int ret = SineWaveAudioSource::OnMoreData(target_playout_time, |
80 audio_bus, total_bytes_delay, frames_skipped); | 80 prior_frames_skipped, dest); |
81 data_pulled_.Signal(); | 81 data_pulled_.Signal(); |
82 return ret; | 82 return ret; |
83 } | 83 } |
84 | 84 |
85 void WaitForDataPulls() { | 85 void WaitForDataPulls() { |
86 for (int i = 0; i < 3; ++i) { | 86 for (int i = 0; i < 3; ++i) { |
87 data_pulled_.Wait(); | 87 data_pulled_.Wait(); |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 } | 348 } |
349 RUN_ON_AUDIO_THREAD(Close); | 349 RUN_ON_AUDIO_THREAD(Close); |
350 WaitUntilClosed(); | 350 WaitUntilClosed(); |
351 } | 351 } |
352 | 352 |
353 INSTANTIATE_TEST_CASE_P(SingleVersusMultithreaded, | 353 INSTANTIATE_TEST_CASE_P(SingleVersusMultithreaded, |
354 VirtualAudioInputStreamTest, | 354 VirtualAudioInputStreamTest, |
355 ::testing::Values(false, true)); | 355 ::testing::Values(false, true)); |
356 | 356 |
357 } // namespace media | 357 } // namespace media |
OLD | NEW |