| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008-2009 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: |
| 11 // - AudioSource : produces audio samples on a pull model. Implements | 11 // - AudioSource : produces audio samples on a pull model. Implements |
| (...skipping 24 matching lines...) Expand all Loading... |
| 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 { | 44 enum State { |
| 45 STATE_CREATED = 0, // The output stream is created. | 45 STATE_CREATED = 0, // The output stream is created. |
| 46 STATE_OPENED, // The output stream is opened. | |
| 47 STATE_STARTED, // The output stream is started. | 46 STATE_STARTED, // The output stream is started. |
| 48 STATE_PAUSED, // The output stream is paused. | 47 STATE_PAUSED, // The output stream is paused. |
| 49 STATE_STOPPED, // The output stream is stopped. | 48 STATE_STOPPED, // The output stream is stopped. |
| 50 STATE_CLOSING, // The output stream is being closed. | |
| 51 STATE_CLOSED, // The output stream is closed. | 49 STATE_CLOSED, // The output stream is closed. |
| 52 STATE_ERROR, // The output stream is in error state. | 50 STATE_ERROR, // The output stream is in error state. |
| 53 }; | 51 }; |
| 54 | 52 |
| 55 // Audio sources must implement AudioSourceCallback. This interface will be | 53 // Audio sources must implement AudioSourceCallback. This interface will be |
| 56 // called in a random thread which very likely is a high priority thread. Do | 54 // called in a random thread which very likely is a high priority thread. Do |
| 57 // not rely on using this thread TLS or make calls that alter the thread | 55 // not rely on using this thread TLS or make calls that alter the thread |
| 58 // itself such as creating Windows or initializing COM. | 56 // itself such as creating Windows or initializing COM. |
| 59 class AudioSourceCallback { | 57 class AudioSourceCallback { |
| 60 public: | 58 public: |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // Get AudioManager singleton. | 158 // Get AudioManager singleton. |
| 161 // TODO(cpu): Define threading requirements for interacting with AudioManager. | 159 // TODO(cpu): Define threading requirements for interacting with AudioManager. |
| 162 static AudioManager* GetAudioManager(); | 160 static AudioManager* GetAudioManager(); |
| 163 | 161 |
| 164 protected: | 162 protected: |
| 165 virtual ~AudioManager() {} | 163 virtual ~AudioManager() {} |
| 166 }; | 164 }; |
| 167 | 165 |
| 168 | 166 |
| 169 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_H_ | 167 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_H_ |
| OLD | NEW |