OLD | NEW |
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" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "media/audio/audio_device_name.h" | 13 #include "media/audio/audio_device_name.h" |
14 #include "media/audio/audio_parameters.h" | 14 #include "media/audio/audio_parameters.h" |
15 | 15 |
16 class AudioInputStream; | |
17 class AudioOutputStream; | |
18 class MessageLoop; | 16 class MessageLoop; |
| 17 |
19 namespace base { | 18 namespace base { |
20 class MessageLoopProxy; | 19 class MessageLoopProxy; |
21 } | 20 } |
22 | 21 |
| 22 namespace media { |
| 23 |
| 24 class AudioInputStream; |
| 25 class AudioOutputStream; |
| 26 |
23 // Manages all audio resources. In particular it owns the AudioOutputStream | 27 // Manages all audio resources. In particular it owns the AudioOutputStream |
24 // objects. Provides some convenience functions that avoid the need to provide | 28 // objects. Provides some convenience functions that avoid the need to provide |
25 // iterators over the existing streams. | 29 // iterators over the existing streams. |
26 class MEDIA_EXPORT AudioManager { | 30 class MEDIA_EXPORT AudioManager { |
27 public: | 31 public: |
28 virtual ~AudioManager(); | 32 virtual ~AudioManager(); |
29 | 33 |
30 // Use to construct the audio manager. | 34 // Use to construct the audio manager. |
31 // NOTE: There should only be one instance. | 35 // NOTE: There should only be one instance. |
32 static AudioManager* Create(); | 36 static AudioManager* Create(); |
(...skipping 17 matching lines...) Expand all Loading... |
50 | 54 |
51 // Opens the platform default audio input settings UI. | 55 // Opens the platform default audio input settings UI. |
52 // Note: This could invoke an external application/preferences pane, so | 56 // Note: This could invoke an external application/preferences pane, so |
53 // ideally must not be called from the UI thread or other time sensitive | 57 // ideally must not be called from the UI thread or other time sensitive |
54 // threads to avoid blocking the rest of the application. | 58 // threads to avoid blocking the rest of the application. |
55 virtual void ShowAudioInputSettings() = 0; | 59 virtual void ShowAudioInputSettings() = 0; |
56 | 60 |
57 // Appends a list of available input devices. It is not guaranteed that | 61 // Appends a list of available input devices. It is not guaranteed that |
58 // all the devices in the list support all formats and sample rates for | 62 // all the devices in the list support all formats and sample rates for |
59 // recording. | 63 // recording. |
60 virtual void GetAudioInputDeviceNames( | 64 virtual void GetAudioInputDeviceNames(AudioDeviceNames* device_names) = 0; |
61 media::AudioDeviceNames* device_names) = 0; | |
62 | 65 |
63 // Factory for all the supported stream formats. |params| defines parameters | 66 // Factory for all the supported stream formats. |params| defines parameters |
64 // of the audio stream to be created. | 67 // of the audio stream to be created. |
65 // | 68 // |
66 // |params.sample_per_packet| is the requested buffer allocation which the | 69 // |params.sample_per_packet| is the requested buffer allocation which the |
67 // audio source thinks it can usually fill without blocking. Internally two | 70 // audio source thinks it can usually fill without blocking. Internally two |
68 // or three buffers are created, one will be locked for playback and one will | 71 // or three buffers are created, one will be locked for playback and one will |
69 // be ready to be filled in the call to AudioSourceCallback::OnMoreData(). | 72 // be ready to be filled in the call to AudioSourceCallback::OnMoreData(). |
70 // | 73 // |
71 // Returns NULL if the combination of the parameters is not supported, or if | 74 // Returns NULL if the combination of the parameters is not supported, or if |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 protected: | 120 protected: |
118 AudioManager(); | 121 AudioManager(); |
119 | 122 |
120 // Called from Create() to initialize the instance. | 123 // Called from Create() to initialize the instance. |
121 virtual void Init() = 0; | 124 virtual void Init() = 0; |
122 | 125 |
123 private: | 126 private: |
124 DISALLOW_COPY_AND_ASSIGN(AudioManager); | 127 DISALLOW_COPY_AND_ASSIGN(AudioManager); |
125 }; | 128 }; |
126 | 129 |
| 130 } // namespace media |
| 131 |
127 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ | 132 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ |
OLD | NEW |