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

Side by Side Diff: media/audio/audio_manager.h

Issue 10704154: Small refactor to media architecture in order to allow end-to-end tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_H_
6 #define MEDIA_AUDIO_AUDIO_MANAGER_H_ 6 #define MEDIA_AUDIO_AUDIO_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 17 matching lines...) Expand all
28 // objects. Provides some convenience functions that avoid the need to provide 28 // objects. Provides some convenience functions that avoid the need to provide
29 // iterators over the existing streams. 29 // iterators over the existing streams.
30 class MEDIA_EXPORT AudioManager { 30 class MEDIA_EXPORT AudioManager {
31 public: 31 public:
32 virtual ~AudioManager(); 32 virtual ~AudioManager();
33 33
34 // Use to construct the audio manager. 34 // Use to construct the audio manager.
35 // NOTE: There should only be one instance. 35 // NOTE: There should only be one instance.
36 static AudioManager* Create(); 36 static AudioManager* Create();
37 37
38 // For testing purposes only: sets the testing AudioManager that will be
39 // returned by subsequent invocations of the Create method.
40 static void set_audio_manager_for_tests(AudioManager* audio_manager);
tommi (sloooow) - chröme 2012/07/11 09:59:08 Can you explain why you need this? I would like to
41
38 // Returns true if the OS reports existence of audio devices. This does not 42 // Returns true if the OS reports existence of audio devices. This does not
39 // guarantee that the existing devices support all formats and sample rates. 43 // guarantee that the existing devices support all formats and sample rates.
40 virtual bool HasAudioOutputDevices() = 0; 44 virtual bool HasAudioOutputDevices() = 0;
41 45
42 // Returns true if the OS reports existence of audio recording devices. This 46 // Returns true if the OS reports existence of audio recording devices. This
43 // does not guarantee that the existing devices support all formats and 47 // does not guarantee that the existing devices support all formats and
44 // sample rates. 48 // sample rates.
45 virtual bool HasAudioInputDevices() = 0; 49 virtual bool HasAudioInputDevices() = 0;
46 50
47 // Returns a human readable string for the model/make of the active audio 51 // Returns a human readable string for the model/make of the active audio
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // Returns message loop used for audio IO. 121 // Returns message loop used for audio IO.
118 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() = 0; 122 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() = 0;
119 123
120 protected: 124 protected:
121 AudioManager(); 125 AudioManager();
122 126
123 // Called from Create() to initialize the instance. 127 // Called from Create() to initialize the instance.
124 virtual void Init() = 0; 128 virtual void Init() = 0;
125 129
126 private: 130 private:
131 static AudioManager* audio_manager_for_tests_;
132
127 DISALLOW_COPY_AND_ASSIGN(AudioManager); 133 DISALLOW_COPY_AND_ASSIGN(AudioManager);
128 }; 134 };
129 135
130 } // namespace media 136 } // namespace media
131 137
132 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ 138 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698