summaryrefslogtreecommitdiff
path: root/chromium/media/audio/audio_manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/media/audio/audio_manager.h')
-rw-r--r--chromium/media/audio/audio_manager.h38
1 files changed, 29 insertions, 9 deletions
diff --git a/chromium/media/audio/audio_manager.h b/chromium/media/audio/audio_manager.h
index 891d2a26589..0ca468ed4dd 100644
--- a/chromium/media/audio/audio_manager.h
+++ b/chromium/media/audio/audio_manager.h
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "media/audio/audio_device_name.h"
+#include "media/audio/audio_logging.h"
#include "media/audio/audio_parameters.h"
namespace base {
@@ -23,16 +24,19 @@ namespace media {
class AudioInputStream;
class AudioOutputStream;
-// Manages all audio resources. In particular it owns the AudioOutputStream
-// objects. Provides some convenience functions that avoid the need to provide
-// iterators over the existing streams.
+// Manages all audio resources. Provides some convenience functions that avoid
+// the need to provide iterators over the existing streams.
class MEDIA_EXPORT AudioManager {
- public:
- virtual ~AudioManager();
+ public:
+ virtual ~AudioManager();
- // Use to construct the audio manager.
- // NOTE: There should only be one instance.
- static AudioManager* Create();
+ // Construct the audio manager; only one instance is allowed. The manager
+ // will forward CreateAudioLog() calls to the provided AudioLogFactory; as
+ // such |audio_log_factory| must outlive the AudioManager.
+ static AudioManager* Create(AudioLogFactory* audio_log_factory);
+
+ // Similar to Create() except uses a FakeAudioLogFactory for testing.
+ static AudioManager* CreateForTesting();
// Returns the pointer to the last created instance, or NULL if not yet
// created. This is a utility method for the code outside of media directory,
@@ -50,7 +54,7 @@ class MEDIA_EXPORT AudioManager {
// Returns a human readable string for the model/make of the active audio
// input device for this computer.
- virtual string16 GetAudioInputDeviceModel() = 0;
+ virtual base::string16 GetAudioInputDeviceModel() = 0;
// Opens the platform default audio input settings UI.
// Note: This could invoke an external application/preferences pane, so
@@ -62,10 +66,16 @@ class MEDIA_EXPORT AudioManager {
// which must initially be empty. It is not guaranteed that all the
// devices in the list support all formats and sample rates for
// recording.
+ //
+ // Not threadsafe; in production this should only be called from the
+ // Audio IO thread (see GetMessageLoop).
virtual void GetAudioInputDeviceNames(AudioDeviceNames* device_names) = 0;
// Appends a list of available output devices to |device_names|,
// which must initially be empty.
+ //
+ // Not threadsafe; in production this should only be called from the
+ // Audio IO thread (see GetMessageLoop).
virtual void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) = 0;
// Factory for all the supported stream formats. |params| defines parameters
@@ -169,6 +179,16 @@ class MEDIA_EXPORT AudioManager {
virtual std::string GetAssociatedOutputDeviceID(
const std::string& input_device_id) = 0;
+ // Create a new AudioLog object for tracking the behavior for one or more
+ // instances of the given component. See AudioLogFactory for more details.
+ virtual scoped_ptr<AudioLog> CreateAudioLog(
+ AudioLogFactory::AudioComponent component) = 0;
+
+ // Called when a component has detected a OS level audio wedge. Shuts down
+ // all active audio streams and then restarts them transparently. See
+ // http://crbug.com/160920
+ virtual void FixWedgedAudio() = 0;
+
protected:
AudioManager();