Chromium Code Reviews| Index: media/audio/audio_manager.h |
| diff --git a/media/audio/audio_manager.h b/media/audio/audio_manager.h |
| index 5e49b8b399afd138c35f659d73823be06a0e9567..f9118b901481ab37b0928fe859b4fb4ae2076aa1 100644 |
| --- a/media/audio/audio_manager.h |
| +++ b/media/audio/audio_manager.h |
| @@ -21,13 +21,20 @@ class SingleThreadTaskRunner; |
| namespace media { |
| class AudioInputStream; |
| +class AudioManagerFactory; |
| class AudioOutputStream; |
| // 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(); |
| + |
| + // Used to override the defualt implementation. After this is called, all |
|
DaleCurtis
2015/04/23 16:18:25
default.
Add some more details about why this is
slan
2015/04/23 18:11:33
Done.
|
| + // static AudioManager::Create* methods will return an instance of |
| + // AudioManager provided by |factory|. This method takes ownership of |
| + // |factory|, which must not be NULL. |
| + static void SetFactory(AudioManagerFactory* factory); |
| // Construct the audio manager; only one instance is allowed. The manager |
| // will forward CreateAudioLog() calls to the provided AudioLogFactory; as |
| @@ -44,6 +51,10 @@ class MEDIA_EXPORT AudioManager { |
| // Similar to Create() except uses a FakeAudioLogFactory for testing. |
| static AudioManager* CreateForTesting(); |
| + // Should only be used for testing. Resets a previously-set |
| + // AudioManagerFactory. The instance of AudioManager is not affected. |
| + static void ResetFactory(); |
|
DaleCurtis
2015/04/23 16:18:25
Name it ResetFactoryForTesting, so presubmit catch
slan
2015/04/23 18:11:33
Done.
|
| + |
| // 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, |
| // like src/chrome. |
| @@ -130,7 +141,8 @@ class MEDIA_EXPORT AudioManager { |
| // Do not free the returned AudioInputStream. It is owned by AudioManager. |
| // When you are done with it, call |Stop()| and |Close()| to release it. |
| virtual AudioInputStream* MakeAudioInputStream( |
| - const AudioParameters& params, const std::string& device_id) = 0; |
| + const AudioParameters& params, |
| + const std::string& device_id) = 0; |
| // Returns the task runner used for audio IO. |
| virtual scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() = 0; |