Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "media/audio/audio_parameters.h" | 10 #include "media/audio/audio_parameters.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 // | 47 // |
| 48 // |params.format| can be set to AUDIO_PCM_LOW_LATENCY and that has two | 48 // |params.format| can be set to AUDIO_PCM_LOW_LATENCY and that has two |
| 49 // effects: | 49 // effects: |
| 50 // 1- Instead of triple buffered the audio will be double buffered. | 50 // 1- Instead of triple buffered the audio will be double buffered. |
| 51 // 2- A low latency driver or alternative audio subsystem will be used when | 51 // 2- A low latency driver or alternative audio subsystem will be used when |
| 52 // available. | 52 // available. |
| 53 // | 53 // |
| 54 // Do not free the returned AudioOutputStream. It is owned by AudioManager. | 54 // Do not free the returned AudioOutputStream. It is owned by AudioManager. |
| 55 virtual AudioOutputStream* MakeAudioOutputStream(AudioParameters params) = 0; | 55 virtual AudioOutputStream* MakeAudioOutputStream(AudioParameters params) = 0; |
| 56 | 56 |
| 57 // Creates new audio output proxy. A proxy implements | |
| 58 // AudioOutputStream inteface, but unlike regular output stream | |
|
scherkus (not reviewing)
2010/11/24 02:01:59
nit: inteface -> interface
Sergey Ulanov
2010/11/24 03:49:54
Done.
| |
| 59 // created with MakeAudioOutputStream() it opens device only when a | |
| 60 // sound is actually playing. | |
| 61 virtual AudioOutputStream* MakeAudioOutputStreamProxy( | |
| 62 const AudioParameters& params) = 0; | |
| 63 | |
| 57 // Factory to create audio recording streams. | 64 // Factory to create audio recording streams. |
| 58 // |channels| can be 1 or 2. | 65 // |channels| can be 1 or 2. |
| 59 // |sample_rate| is in hertz and can be any value supported by the platform. | 66 // |sample_rate| is in hertz and can be any value supported by the platform. |
| 60 // |bits_per_sample| can be any value supported by the platform. | 67 // |bits_per_sample| can be any value supported by the platform. |
| 61 // |samples_per_packet| is in hertz as well and can be 0 to |sample_rate|, | 68 // |samples_per_packet| is in hertz as well and can be 0 to |sample_rate|, |
| 62 // with 0 suggesting that the implementation use a default value for that | 69 // with 0 suggesting that the implementation use a default value for that |
| 63 // platform. | 70 // platform. |
| 64 // 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 |
| 65 // we have reached some other platform specific limit. | 72 // we have reached some other platform specific limit. |
| 66 // | 73 // |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 87 virtual void Init() = 0; | 94 virtual void Init() = 0; |
| 88 | 95 |
| 89 private: | 96 private: |
| 90 static void Destroy(void*); | 97 static void Destroy(void*); |
| 91 | 98 |
| 92 // Called by GetAudioManager() to create platform-specific audio manager. | 99 // Called by GetAudioManager() to create platform-specific audio manager. |
| 93 static AudioManager* CreateAudioManager(); | 100 static AudioManager* CreateAudioManager(); |
| 94 }; | 101 }; |
| 95 | 102 |
| 96 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ | 103 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ |
| OLD | NEW |