OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_OUTPUT_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_H_ |
6 #define MEDIA_AUDIO_AUDIO_OUTPUT_H_ | 6 #define MEDIA_AUDIO_AUDIO_OUTPUT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 // Low-level audio output support. To make sound there are 3 objects involved: | 10 // Low-level audio output support. To make sound there are 3 objects involved: |
(...skipping 23 matching lines...) Expand all Loading... |
34 // The primary client of this facility is audio coming from several tabs. | 34 // The primary client of this facility is audio coming from several tabs. |
35 // Specifically for this case we avoid supporting complex formats such as MP3 | 35 // Specifically for this case we avoid supporting complex formats such as MP3 |
36 // or WMA. Complex format decoding should be done by the renderers. | 36 // or WMA. Complex format decoding should be done by the renderers. |
37 | 37 |
38 | 38 |
39 // Models an audio stream that gets rendered to the audio hardware output. | 39 // Models an audio stream that gets rendered to the audio hardware output. |
40 // Because we support more audio streams than physically available channels | 40 // Because we support more audio streams than physically available channels |
41 // a given AudioOutputStream might or might not talk directly to hardware. | 41 // a given AudioOutputStream might or might not talk directly to hardware. |
42 class AudioOutputStream { | 42 class AudioOutputStream { |
43 public: | 43 public: |
| 44 enum State { |
| 45 STATE_STARTED = 0, // The output stream is started. |
| 46 STATE_PAUSED, // The output stream is paused. |
| 47 STATE_ERROR, // The output stream is in error state. |
| 48 }; |
| 49 |
44 // Audio sources must implement AudioSourceCallback. This interface will be | 50 // Audio sources must implement AudioSourceCallback. This interface will be |
45 // called in a random thread which very likely is a high priority thread. Do | 51 // called in a random thread which very likely is a high priority thread. Do |
46 // not rely on using this thread TLS or make calls that alter the thread | 52 // not rely on using this thread TLS or make calls that alter the thread |
47 // itself such as creating Windows or initializing COM. | 53 // itself such as creating Windows or initializing COM. |
48 class AudioSourceCallback { | 54 class AudioSourceCallback { |
49 public: | 55 public: |
50 virtual ~AudioSourceCallback() {} | 56 virtual ~AudioSourceCallback() {} |
51 | 57 |
52 // Provide more data by filling |dest| up to |max_size| bytes. The provided | 58 // Provide more data by filling |dest| up to |max_size| bytes. The provided |
53 // buffer size is usually what is specified in Open(). The source | 59 // buffer size is usually what is specified in Open(). The source |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // TODO(cpu): Define threading requirements for interacting with AudioManager. | 154 // TODO(cpu): Define threading requirements for interacting with AudioManager. |
149 static AudioManager* GetAudioManager(); | 155 static AudioManager* GetAudioManager(); |
150 | 156 |
151 protected: | 157 protected: |
152 virtual ~AudioManager() {} | 158 virtual ~AudioManager() {} |
153 }; | 159 }; |
154 | 160 |
155 | 161 |
156 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_H_ | 162 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_H_ |
157 | 163 |
OLD | NEW |