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

Unified Diff: media/audio/mock_audio_manager.cc

Issue 2761273003: Switching MediaStreamsManager from using AudioManager interface to AudioSystem one. (Closed)
Patch Set: passing device descriptions by value Created 3 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« media/audio/audio_system.h ('K') | « media/audio/mock_audio_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mock_audio_manager.cc
diff --git a/media/audio/mock_audio_manager.cc b/media/audio/mock_audio_manager.cc
index 26fc563fc422d187e02b7c5e4e15a5185dad6763..b89cb5e1a8f89179670b8b7126f42e18352ade25 100644
--- a/media/audio/mock_audio_manager.cc
+++ b/media/audio/mock_audio_manager.cc
@@ -52,11 +52,17 @@ void MockAudioManager::ShowAudioInputSettings() {
void MockAudioManager::GetAudioInputDeviceDescriptions(
AudioDeviceDescriptions* device_descriptions) {
DCHECK(GetTaskRunner()->BelongsToCurrentThread());
+ if (get_input_device_descriptions_cb_.is_null())
+ return;
+ get_input_device_descriptions_cb_.Run(device_descriptions);
}
void MockAudioManager::GetAudioOutputDeviceDescriptions(
AudioDeviceDescriptions* device_descriptions) {
DCHECK(GetTaskRunner()->BelongsToCurrentThread());
+ if (get_output_device_descriptions_cb_.is_null())
+ return;
+ get_output_device_descriptions_cb_.Run(device_descriptions);
}
media::AudioOutputStream* MockAudioManager::MakeAudioOutputStream(
@@ -151,4 +157,14 @@ void MockAudioManager::SetHasOutputDevices(bool has_output_devices) {
has_output_devices_ = has_output_devices;
}
+void MockAudioManager::SetInputDeviceDescriptionsCallback(
+ GetDeviceDescriptionsCallback callback) {
+ get_input_device_descriptions_cb_ = std::move(callback);
+}
+
+void MockAudioManager::SetOutputDeviceDescriptionsCallback(
+ GetDeviceDescriptionsCallback callback) {
+ get_output_device_descriptions_cb_ = std::move(callback);
+}
+
} // namespace media.
« media/audio/audio_system.h ('K') | « media/audio/mock_audio_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698