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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 AudioParameters MockAudioManager::GetInputStreamParameters( | 109 AudioParameters MockAudioManager::GetInputStreamParameters( |
110 const std::string& device_id) { | 110 const std::string& device_id) { |
111 DCHECK(GetTaskRunner()->BelongsToCurrentThread()); | 111 DCHECK(GetTaskRunner()->BelongsToCurrentThread()); |
112 return input_params_; | 112 return input_params_; |
113 } | 113 } |
114 | 114 |
115 std::string MockAudioManager::GetAssociatedOutputDeviceID( | 115 std::string MockAudioManager::GetAssociatedOutputDeviceID( |
116 const std::string& input_device_id) { | 116 const std::string& input_device_id) { |
117 DCHECK(GetTaskRunner()->BelongsToCurrentThread()); | 117 DCHECK(GetTaskRunner()->BelongsToCurrentThread()); |
118 return std::string(); | 118 return get_associated_output_device_id_cb_.is_null() |
| 119 ? std::string() |
| 120 : get_associated_output_device_id_cb_.Run(input_device_id); |
119 } | 121 } |
120 | 122 |
121 std::unique_ptr<AudioLog> MockAudioManager::CreateAudioLog( | 123 std::unique_ptr<AudioLog> MockAudioManager::CreateAudioLog( |
122 AudioLogFactory::AudioComponent component) { | 124 AudioLogFactory::AudioComponent component) { |
123 return nullptr; | 125 return nullptr; |
124 } | 126 } |
125 | 127 |
126 void MockAudioManager::InitializeOutputDebugRecording( | 128 void MockAudioManager::InitializeOutputDebugRecording( |
127 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner) {} | 129 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner) {} |
128 | 130 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 void MockAudioManager::SetInputDeviceDescriptionsCallback( | 162 void MockAudioManager::SetInputDeviceDescriptionsCallback( |
161 GetDeviceDescriptionsCallback callback) { | 163 GetDeviceDescriptionsCallback callback) { |
162 get_input_device_descriptions_cb_ = std::move(callback); | 164 get_input_device_descriptions_cb_ = std::move(callback); |
163 } | 165 } |
164 | 166 |
165 void MockAudioManager::SetOutputDeviceDescriptionsCallback( | 167 void MockAudioManager::SetOutputDeviceDescriptionsCallback( |
166 GetDeviceDescriptionsCallback callback) { | 168 GetDeviceDescriptionsCallback callback) { |
167 get_output_device_descriptions_cb_ = std::move(callback); | 169 get_output_device_descriptions_cb_ = std::move(callback); |
168 } | 170 } |
169 | 171 |
| 172 void MockAudioManager::SetAssociatedOutputDeviceIDCallback( |
| 173 GetAssociatedOutputDeviceIDCallback callback) { |
| 174 get_associated_output_device_id_cb_ = std::move(callback); |
| 175 } |
| 176 |
170 } // namespace media. | 177 } // namespace media. |
OLD | NEW |