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

Unified Diff: media/audio/audio_system.h

Issue 2763383002: Switching AudioInputDeviceManager from using AudioManager interface to AudioSystem one. (Closed)
Patch Set: rebase Created 3 years, 8 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
« no previous file with comments | « media/audio/audio_manager.cc ('k') | media/audio/audio_system_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_system.h
diff --git a/media/audio/audio_system.h b/media/audio/audio_system.h
index 8a87e5a29b200c713e5cf1a55c8009dc3f89ed86..932151ed3b9fadb7fa9aff3aefc985654e6ae345 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
+ // AudioSystem is destroyed on. See http://crbug.com/705455.
static AudioSystem* Get();
virtual ~AudioSystem();
@@ -61,13 +66,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.
« no previous file with comments | « media/audio/audio_manager.cc ('k') | media/audio/audio_system_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698