Chromium Code Reviews| Index: media/audio/audio_system.h |
| diff --git a/media/audio/audio_system.h b/media/audio/audio_system.h |
| index 66dc622db267575d189e74adc5fb4729c6fbc6c7..857a343d75a066d38d6a820f49b37bea0b881305 100644 |
| --- a/media/audio/audio_system.h |
| +++ b/media/audio/audio_system.h |
| @@ -23,13 +23,18 @@ class AudioManager; |
| class MEDIA_EXPORT AudioSystem { |
| public: |
| // Replies are asynchronously sent from audio system thread to the thread the |
| - // call is issued on. Attention! Since audio system thread may outlive all the |
| - // others, callbacks must always be bound to weak pointers! |
| + // call is issued on. Attention! Audio system thread may outlive the client |
| + // objects; bind callbacks with care. |
| using OnAudioParamsCallback = base::Callback<void(const AudioParameters&)>; |
| using OnBoolCallback = base::Callback<void(bool)>; |
| using OnDeviceDescriptionsCallback = |
| base::Callback<void(AudioDeviceDescriptions)>; |
| + using OnDeviceIdCallback = base::Callback<void(const std::string&)>; |
| + using OnInputDeviceInfoCallback = base::Callback< |
| + void(const AudioParameters&, const AudioParameters&, const std::string&)>; |
| + // Must not be called on audio system thread if it differs from the one |
|
DaleCurtis
2017/04/06 18:37:17
I'd prefer not to land this without resolving this
o1ka
2017/04/07 12:22:17
It's just a comment describing the current situati
|
| + // AudioSystem is destroyed on. |
| static AudioSystem* Get(); |
| virtual ~AudioSystem(); |
| @@ -59,13 +64,22 @@ class MEDIA_EXPORT AudioSystem { |
| // Replies with device descriptions of input audio devices if |for_input| is |
| // true, and of output audio devices otherwise. |
| virtual void GetDeviceDescriptions( |
| - OnDeviceDescriptionsCallback on_descriptions_cp, |
| + OnDeviceDescriptionsCallback on_descriptions_cb, |
| bool for_input) = 0; |
| - virtual base::SingleThreadTaskRunner* GetTaskRunner() const = 0; |
| + // Replies with an empty string if there is no associated output device found. |
| + virtual void GetAssociatedOutputDeviceID( |
| + const std::string& input_device_id, |
| + OnDeviceIdCallback on_device_id_cb) = 0; |
| + |
| + // Replies with audio parameters for the specified input device and audio |
| + // parameters and device ID of the associated output device, if any (otherwise |
| + // it's AudioParameters() and an empty string). |
| + virtual void GetInputDeviceInfo( |
| + const std::string& input_device_id, |
| + OnInputDeviceInfoCallback on_input_device_info_cb) = 0; |
| - // Must not be used for anything but stream creation. |
| - virtual AudioManager* GetAudioManager() const = 0; |
| + virtual base::SingleThreadTaskRunner* GetTaskRunner() const = 0; |
| protected: |
| // Sets the global AudioSystem pointer to the specified non-null value. |