Index: media/audio/audio_manager_base.h |
diff --git a/media/audio/audio_manager_base.h b/media/audio/audio_manager_base.h |
index bc13ee5a1677b46c89d08d47321b23bcd59606d8..77b49bc39ef7fcb16874ed5fe9826d5fcf8cda75 100644 |
--- a/media/audio/audio_manager_base.h |
+++ b/media/audio/audio_manager_base.h |
@@ -23,6 +23,7 @@ |
namespace media { |
+class AudioInputProxy; |
class AudioOutputDispatcher; |
// AudioManagerBase provides AudioManager functions common for all platforms. |
@@ -150,6 +151,17 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager { |
const std::string& output_device_id, |
const AudioParameters& input_params) = 0; |
+ // Returns the preferred hardware audio output parameters for opening input |
+ // streams. If the users inject a valid |input_params|, each AudioManager |
+ // will decide if they should return the values from |input_params| or the |
+ // default hardware values. If the |input_params| is invalid, it will return |
+ // the default hardware audio parameters. |
+ // If |input_device_id| is empty, the implementation must treat that as |
+ // a request for the default output device. |
+ virtual AudioParameters GetPreferredInputStreamParameters( |
+ const std::string& input_device_id, |
+ const AudioParameters& input_params) = 0; |
+ |
// Returns the ID of the default audio output device. |
// Implementations that don't yet support this should return an empty string. |
virtual std::string GetDefaultOutputDeviceID(); |
@@ -157,12 +169,18 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager { |
private: |
struct DispatcherParams; |
typedef ScopedVector<DispatcherParams> AudioOutputDispatchers; |
+ typedef ScopedVector<AudioInputProxy> AudioInputProxies; |
class CompareByParams; |
// Called by Shutdown(). |
void ShutdownOnAudioThread(); |
+ // Helper for MakeAudioInputStream() to get the supported hardware |
+ // format for the new stream. |
+ AudioParameters GetSupportedInputHardwareParameters( |
+ const std::string& device_id, const AudioParameters& preferred_params); |
+ |
// Max number of open output streams, modified by |
// SetMaxOutputStreamsAllowed(). |
int max_num_output_streams_; |
@@ -187,10 +205,14 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager { |
// and GetTaskRunner() starts returning NULL. |
scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
- // Map of cached AudioOutputDispatcher instances. Must only be touched |
- // from the audio thread (no locking). |
+ // Vector of cached AudioOutputDispatcher instances. Must only be touched |
+ // on the audio thread (no locking). |
AudioOutputDispatchers output_dispatchers_; |
+ // Vector of cached AudioInputProxy instances. Must only be touched on |
+ // the audio thread. |
+ AudioInputProxies input_proxies_; |
+ |
// Proxy for creating AudioLog objects. |
AudioLogFactory* const audio_log_factory_; |