| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef MEDIA_AUDIO_AUDIO_SYSTEM_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_SYSTEM_H_ |
| 6 #define MEDIA_AUDIO_AUDIO_SYSTEM_H_ | 6 #define MEDIA_AUDIO_AUDIO_SYSTEM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 using OnInputDeviceInfoCallback = base::OnceCallback< | 36 using OnInputDeviceInfoCallback = base::OnceCallback< |
| 37 void(const AudioParameters&, const AudioParameters&, const std::string&)>; | 37 void(const AudioParameters&, const AudioParameters&, const std::string&)>; |
| 38 | 38 |
| 39 // Must not be called on audio system thread if it differs from the one | 39 // Must not be called on audio system thread if it differs from the one |
| 40 // AudioSystem is destroyed on. See http://crbug.com/705455. | 40 // AudioSystem is destroyed on. See http://crbug.com/705455. |
| 41 static AudioSystem* Get(); | 41 static AudioSystem* Get(); |
| 42 | 42 |
| 43 virtual ~AudioSystem(); | 43 virtual ~AudioSystem(); |
| 44 | 44 |
| 45 // Callback may receive invalid parameters, it means the specified device is | 45 // Callback may receive invalid parameters, it means the specified device is |
| 46 // not found. This is best-effort: valid parameters do not guarantee existance | 46 // not found. This is best-effort: valid parameters do not guarantee existence |
| 47 // of the device. | 47 // of the device. |
| 48 // TODO(olka,tommi): fix all AudioManager implementations to return invalid | 48 // TODO(olka,tommi): fix all AudioManager implementations to return invalid |
| 49 // parameters if the device is not found. | 49 // parameters if the device is not found. |
| 50 virtual void GetInputStreamParameters( | 50 virtual void GetInputStreamParameters( |
| 51 const std::string& device_id, | 51 const std::string& device_id, |
| 52 OnAudioParamsCallback on_params_cb) const = 0; | 52 OnAudioParamsCallback on_params_cb) const = 0; |
| 53 | 53 |
| 54 // If media::AudioDeviceDescription::IsDefaultDevice(device_id) is true, | 54 // If media::AudioDeviceDescription::IsDefaultDevice(device_id) is true, |
| 55 // callback will receive the parameters of the default output device. | 55 // callback will receive the parameters of the default output device. |
| 56 // Callback may receive invalid parameters, it means the specified device is | 56 // Callback may receive invalid parameters, it means the specified device is |
| 57 // not found. This is best-effort: valid parameters do not guarantee existance | 57 // not found. This is best-effort: valid parameters do not guarantee existence |
| 58 // of the device. | 58 // of the device. |
| 59 // TODO(olka,tommi): fix all AudioManager implementations to return invalid | 59 // TODO(olka,tommi): fix all AudioManager implementations to return invalid |
| 60 // parameters if the device is not found. | 60 // parameters if the device is not found. |
| 61 virtual void GetOutputStreamParameters( | 61 virtual void GetOutputStreamParameters( |
| 62 const std::string& device_id, | 62 const std::string& device_id, |
| 63 OnAudioParamsCallback on_params_cb) const = 0; | 63 OnAudioParamsCallback on_params_cb) const = 0; |
| 64 | 64 |
| 65 virtual void HasInputDevices(OnBoolCallback on_has_devices_cb) const = 0; | 65 virtual void HasInputDevices(OnBoolCallback on_has_devices_cb) const = 0; |
| 66 | 66 |
| 67 virtual void HasOutputDevices(OnBoolCallback on_has_devices_cb) const = 0; | 67 virtual void HasOutputDevices(OnBoolCallback on_has_devices_cb) const = 0; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 90 // Sets the global AudioSystem pointer to the specified non-null value. | 90 // Sets the global AudioSystem pointer to the specified non-null value. |
| 91 static void SetInstance(AudioSystem* audio_system); | 91 static void SetInstance(AudioSystem* audio_system); |
| 92 | 92 |
| 93 // Sets the global AudioSystem pointer to null if it equals the specified one. | 93 // Sets the global AudioSystem pointer to null if it equals the specified one. |
| 94 static void ClearInstance(const AudioSystem* audio_system); | 94 static void ClearInstance(const AudioSystem* audio_system); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace media | 97 } // namespace media |
| 98 | 98 |
| 99 #endif // MEDIA_AUDIO_AUDIO_SYSTEM_H_ | 99 #endif // MEDIA_AUDIO_AUDIO_SYSTEM_H_ |
| OLD | NEW |