OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/audio/fake_audio_manager.h" | 5 #include "media/audio/fake_audio_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
| 10 #include "base/bind.h" |
| 11 |
10 namespace media { | 12 namespace media { |
11 | 13 |
12 namespace { | 14 namespace { |
13 | 15 |
14 const int kDefaultInputBufferSize = 1024; | 16 const int kDefaultInputBufferSize = 1024; |
15 const int kDefaultSampleRate = 48000; | 17 const int kDefaultSampleRate = 48000; |
16 | 18 |
| 19 std::unique_ptr<AudioFileWriter> CreateAudioFileWriterDummy( |
| 20 const AudioParameters& params) { |
| 21 return nullptr; |
| 22 } |
| 23 |
17 } // namespace | 24 } // namespace |
18 | 25 |
19 FakeAudioManager::FakeAudioManager( | 26 FakeAudioManager::FakeAudioManager( |
20 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 27 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
21 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, | 28 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, |
22 AudioLogFactory* audio_log_factory) | 29 AudioLogFactory* audio_log_factory) |
23 : AudioManagerBase(std::move(task_runner), | 30 : AudioManagerBase(std::move(task_runner), |
24 std::move(worker_task_runner), | 31 std::move(worker_task_runner), |
25 audio_log_factory) { | 32 audio_log_factory, |
26 } | 33 base::Bind(&CreateAudioFileWriterDummy)) {} |
27 | 34 |
28 FakeAudioManager::~FakeAudioManager() { | 35 FakeAudioManager::~FakeAudioManager() { |
29 Shutdown(); | 36 Shutdown(); |
30 } | 37 } |
31 | 38 |
32 // Implementation of AudioManager. | 39 // Implementation of AudioManager. |
33 bool FakeAudioManager::HasAudioOutputDevices() { return false; } | 40 bool FakeAudioManager::HasAudioOutputDevices() { return false; } |
34 | 41 |
35 bool FakeAudioManager::HasAudioInputDevices() { return false; } | 42 bool FakeAudioManager::HasAudioInputDevices() { return false; } |
36 | 43 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 94 } |
88 | 95 |
89 AudioParameters FakeAudioManager::GetInputStreamParameters( | 96 AudioParameters FakeAudioManager::GetInputStreamParameters( |
90 const std::string& device_id) { | 97 const std::string& device_id) { |
91 return AudioParameters( | 98 return AudioParameters( |
92 AudioParameters::AUDIO_PCM_LOW_LATENCY, CHANNEL_LAYOUT_STEREO, | 99 AudioParameters::AUDIO_PCM_LOW_LATENCY, CHANNEL_LAYOUT_STEREO, |
93 kDefaultSampleRate, 16, kDefaultInputBufferSize); | 100 kDefaultSampleRate, 16, kDefaultInputBufferSize); |
94 } | 101 } |
95 | 102 |
96 } // namespace media | 103 } // namespace media |
OLD | NEW |