Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: media/audio/virtual_audio_input_stream_unittest.cc

Issue 1538563002: Forward the number of skipped frames by the OS in audio playout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review fix. git cl format. Rebase. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/audio/sounds/audio_stream_handler.cc ('k') | media/audio/virtual_audio_output_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <list> 5 #include <list>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/rand_util.h" 9 #include "base/rand_util.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 class TestAudioSource : public SineWaveAudioSource { 60 class TestAudioSource : public SineWaveAudioSource {
61 public: 61 public:
62 TestAudioSource() 62 TestAudioSource()
63 : SineWaveAudioSource( 63 : SineWaveAudioSource(
64 kParams.channel_layout(), 200.0, kParams.sample_rate()), 64 kParams.channel_layout(), 200.0, kParams.sample_rate()),
65 data_pulled_(false, false) {} 65 data_pulled_(false, false) {}
66 66
67 ~TestAudioSource() override {} 67 ~TestAudioSource() override {}
68 68
69 int OnMoreData(AudioBus* audio_bus, uint32 total_bytes_delay) override { 69 int OnMoreData(AudioBus* audio_bus,
70 const int ret = SineWaveAudioSource::OnMoreData(audio_bus, 70 uint32_t total_bytes_delay,
71 total_bytes_delay); 71 uint32_t frames_skipped) override {
72 const int ret = SineWaveAudioSource::OnMoreData(
73 audio_bus, total_bytes_delay, frames_skipped);
72 data_pulled_.Signal(); 74 data_pulled_.Signal();
73 return ret; 75 return ret;
74 } 76 }
75 77
76 void WaitForDataPulls() { 78 void WaitForDataPulls() {
77 for (int i = 0; i < 3; ++i) { 79 for (int i = 0; i < 3; ++i) {
78 data_pulled_.Wait(); 80 data_pulled_.Wait();
79 } 81 }
80 } 82 }
81 83
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 } 339 }
338 RUN_ON_AUDIO_THREAD(Close); 340 RUN_ON_AUDIO_THREAD(Close);
339 WaitUntilClosed(); 341 WaitUntilClosed();
340 } 342 }
341 343
342 INSTANTIATE_TEST_CASE_P(SingleVersusMultithreaded, 344 INSTANTIATE_TEST_CASE_P(SingleVersusMultithreaded,
343 VirtualAudioInputStreamTest, 345 VirtualAudioInputStreamTest,
344 ::testing::Values(false, true)); 346 ::testing::Values(false, true));
345 347
346 } // namespace media 348 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/sounds/audio_stream_handler.cc ('k') | media/audio/virtual_audio_output_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698