Chromium Code Reviews| Index: media/audio/audio_system.h |
| diff --git a/media/audio/audio_system.h b/media/audio/audio_system.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3827e69c85fc8134f6e5c7e5b5705b4cb2dbb442 |
| --- /dev/null |
| +++ b/media/audio/audio_system.h |
| @@ -0,0 +1,40 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_AUDIO_AUDIO_SYSTEM_H_ |
| +#define MEDIA_AUDIO_AUDIO_SYSTEM_H_ |
| + |
| +#include "base/callback.h" |
| +#include "media/audio/audio_device_description.h" |
| +#include "media/base/audio_parameters.h" |
| +#include "media/base/media_export.h" |
| + |
| +namespace base { |
| +class SingleThreadTaskRunner; |
| +} |
| + |
| +namespace media { |
| +class AudioManager; |
| + |
| +// Work in progress: Provides asynchronous interface to AudioManager. All the |
| +// AudioManager clients will be switched to it, in preparation for moving |
| +// to Mojo audio service. |
| +class MEDIA_EXPORT AudioSystem { |
| + public: |
| + // Replies are asynchronously sent to the thread the call is issued on. |
| + using OnAudioParamsCallback = base::Callback<void(const AudioParameters&)>; |
| + |
| + virtual base::SingleThreadTaskRunner* GetTaskRunner() const = 0; |
| + |
| + // Callback will receive invalid parameters if the device is not found. |
| + virtual void GetInputStreamParameters(const std::string& device_id, |
|
tommi (sloooow) - chröme
2017/02/05 20:14:54
Since we're making a new interface, would it make
o1ka
2017/02/06 12:06:08
Right! Done.
|
| + OnAudioParamsCallback on_params_cb) = 0; |
| + |
| + // Must not be used for anything but stream creation. |
| + virtual AudioManager* GetAudioManager() = 0; |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_AUDIO_AUDIO_SYSTEM_H_ |