Chromium Code Reviews| 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 "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "media/base/audio_parameters.h" | 9 #include "media/base/audio_parameters.h" |
| 10 #include "media/base/media_export.h" | 10 #include "media/base/media_export.h" |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 | 23 |
| 24 static AudioSystem* Get(); | 24 static AudioSystem* Get(); |
| 25 | 25 |
| 26 virtual ~AudioSystem(); | 26 virtual ~AudioSystem(); |
| 27 | 27 |
| 28 // Callback will receive invalid parameters if the device is not found. | 28 // Callback will receive invalid parameters if the device is not found. |
| 29 virtual void GetInputStreamParameters( | 29 virtual void GetInputStreamParameters( |
| 30 const std::string& device_id, | 30 const std::string& device_id, |
| 31 OnAudioParamsCallback on_params_cb) const = 0; | 31 OnAudioParamsCallback on_params_cb) const = 0; |
| 32 | 32 |
| 33 // If media::AudioDeviceDescription::IsDefaultDevice(device_id) is true, | |
| 34 // callback will receive the parameters of the default output device. | |
| 35 // Callback will receive invalid parameters if the device (default or not) is | |
|
o1ka
2017/02/14 11:37:03
guidou@:
AudioOutputAuthorizationHandler will fall
| |
| 36 // not found. | |
| 37 virtual void GetOutputStreamParameters( | |
| 38 const std::string& device_id, | |
| 39 OnAudioParamsCallback on_params_cb) const = 0; | |
| 40 | |
| 33 virtual void HasInputDevices(OnBoolCallback on_has_devices_cb) const = 0; | 41 virtual void HasInputDevices(OnBoolCallback on_has_devices_cb) const = 0; |
| 34 | 42 |
| 35 // Must not be used for anything but stream creation. | 43 // Must not be used for anything but stream creation. |
| 36 virtual AudioManager* GetAudioManager() const = 0; | 44 virtual AudioManager* GetAudioManager() const = 0; |
| 37 | 45 |
| 38 protected: | 46 protected: |
| 39 // Sets the global AudioSystem pointer to the specified non-null value. | 47 // Sets the global AudioSystem pointer to the specified non-null value. |
| 40 static void SetInstance(AudioSystem* audio_system); | 48 static void SetInstance(AudioSystem* audio_system); |
| 41 | 49 |
| 42 // Sets the global AudioSystem pointer to null if it equals the specified one. | 50 // Sets the global AudioSystem pointer to null if it equals the specified one. |
| 43 static void ClearInstance(const AudioSystem* audio_system); | 51 static void ClearInstance(const AudioSystem* audio_system); |
| 44 }; | 52 }; |
| 45 | 53 |
| 46 } // namespace media | 54 } // namespace media |
| 47 | 55 |
| 48 #endif // MEDIA_AUDIO_AUDIO_SYSTEM_H_ | 56 #endif // MEDIA_AUDIO_AUDIO_SYSTEM_H_ |
| OLD | NEW |