| 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 "media/audio/mock_audio_manager.h" | 5 #include "media/audio/mock_audio_manager.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "media/base/audio_parameters.h" | 10 #include "media/base/audio_parameters.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 DCHECK(GetTaskRunner()->BelongsToCurrentThread()); | 45 DCHECK(GetTaskRunner()->BelongsToCurrentThread()); |
| 46 return base::string16(); | 46 return base::string16(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void MockAudioManager::ShowAudioInputSettings() { | 49 void MockAudioManager::ShowAudioInputSettings() { |
| 50 } | 50 } |
| 51 | 51 |
| 52 void MockAudioManager::GetAudioInputDeviceDescriptions( | 52 void MockAudioManager::GetAudioInputDeviceDescriptions( |
| 53 AudioDeviceDescriptions* device_descriptions) { | 53 AudioDeviceDescriptions* device_descriptions) { |
| 54 DCHECK(GetTaskRunner()->BelongsToCurrentThread()); | 54 DCHECK(GetTaskRunner()->BelongsToCurrentThread()); |
| 55 if (get_input_device_descriptions_cb_.is_null()) |
| 56 return; |
| 57 get_input_device_descriptions_cb_.Run(device_descriptions); |
| 55 } | 58 } |
| 56 | 59 |
| 57 void MockAudioManager::GetAudioOutputDeviceDescriptions( | 60 void MockAudioManager::GetAudioOutputDeviceDescriptions( |
| 58 AudioDeviceDescriptions* device_descriptions) { | 61 AudioDeviceDescriptions* device_descriptions) { |
| 59 DCHECK(GetTaskRunner()->BelongsToCurrentThread()); | 62 DCHECK(GetTaskRunner()->BelongsToCurrentThread()); |
| 63 if (get_output_device_descriptions_cb_.is_null()) |
| 64 return; |
| 65 get_output_device_descriptions_cb_.Run(device_descriptions); |
| 60 } | 66 } |
| 61 | 67 |
| 62 media::AudioOutputStream* MockAudioManager::MakeAudioOutputStream( | 68 media::AudioOutputStream* MockAudioManager::MakeAudioOutputStream( |
| 63 const media::AudioParameters& params, | 69 const media::AudioParameters& params, |
| 64 const std::string& device_id, | 70 const std::string& device_id, |
| 65 const LogCallback& log_callback) { | 71 const LogCallback& log_callback) { |
| 66 NOTREACHED(); | 72 NOTREACHED(); |
| 67 return NULL; | 73 return NULL; |
| 68 } | 74 } |
| 69 | 75 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 } | 150 } |
| 145 | 151 |
| 146 void MockAudioManager::SetHasInputDevices(bool has_input_devices) { | 152 void MockAudioManager::SetHasInputDevices(bool has_input_devices) { |
| 147 has_input_devices_ = has_input_devices; | 153 has_input_devices_ = has_input_devices; |
| 148 } | 154 } |
| 149 | 155 |
| 150 void MockAudioManager::SetHasOutputDevices(bool has_output_devices) { | 156 void MockAudioManager::SetHasOutputDevices(bool has_output_devices) { |
| 151 has_output_devices_ = has_output_devices; | 157 has_output_devices_ = has_output_devices; |
| 152 } | 158 } |
| 153 | 159 |
| 160 void MockAudioManager::SetInputDeviceDescriptionsCallback( |
| 161 GetDeviceDescriptionsCallback callback) { |
| 162 get_input_device_descriptions_cb_ = std::move(callback); |
| 163 } |
| 164 |
| 165 void MockAudioManager::SetOutputDeviceDescriptionsCallback( |
| 166 GetDeviceDescriptionsCallback callback) { |
| 167 get_output_device_descriptions_cb_ = std::move(callback); |
| 168 } |
| 169 |
| 154 } // namespace media. | 170 } // namespace media. |
| OLD | NEW |