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