diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-11 03:07:19 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-11 03:07:19 +0000 |
commit | 9ade381f46175dead00a1cc9ffc3328230e8c982 (patch) | |
tree | 64c6caf04643408b2e25bce192f03c9b7b93eaa2 /media/audio/audio_manager.h | |
parent | adc19c0eeac9f3caaae4e35bd64e79e6b6e72a0f (diff) | |
download | chromium_src-9ade381f46175dead00a1cc9ffc3328230e8c982.zip chromium_src-9ade381f46175dead00a1cc9ffc3328230e8c982.tar.gz chromium_src-9ade381f46175dead00a1cc9ffc3328230e8c982.tar.bz2 |
Simplified AudioOutputStream interface.
1. Removed packet_size parameter from Open().
2. Removed OnClose() from the callback. Now the callback is guaranteed to be called only between Start() and Stop().
3. Added samples_per_packet in the AudioParameters struct.
BUG=39825
TEST=Unittests
Review URL: http://codereview.chromium.org/4661001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65766 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/audio_manager.h')
-rw-r--r-- | media/audio/audio_manager.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/media/audio/audio_manager.h b/media/audio/audio_manager.h index 805db89..26f0acf 100644 --- a/media/audio/audio_manager.h +++ b/media/audio/audio_manager.h @@ -12,6 +12,9 @@ class AudioInputStream; class AudioOutputStream; class MessageLoop; +// TODO(sergeyu): In this interface and some other places AudioParameters struct +// is passed by value. It is better to change it to const reference. + // Manages all audio resources. In particular it owns the AudioOutputStream // objects. Provides some convenience functions that avoid the need to provide // iterators over the existing streams. @@ -26,14 +29,19 @@ class AudioManager { // sample rates. virtual bool HasAudioInputDevices() = 0; - // Factory for all the supported stream formats. The |channels| can be 1 to 5. - // The |sample_rate| is in hertz and can be any value supported by the - // platform. For some future formats the |sample_rate| and |bits_per_sample| - // can take special values. + // Factory for all the supported stream formats. |params| defines parameters + // of the audio stream to be created. + // + // |params.sample_per_packet| is the requested buffer allocation which the + // audio source thinks it can usually fill without blocking. Internally two + // or three buffers are created, one will be locked for playback and one will + // be ready to be filled in the call to AudioSourceCallback::OnMoreData(). + // // Returns NULL if the combination of the parameters is not supported, or if // we have reached some other platform specific limit. // - // AUDIO_PCM_LOW_LATENCY can be passed to this method and it has two effects: + // |params.format| can be set to AUDIO_PCM_LOW_LATENCY and that has two + // effects: // 1- Instead of triple buffered the audio will be double buffered. // 2- A low latency driver or alternative audio subsystem will be used when // available. @@ -53,8 +61,7 @@ class AudioManager { // // Do not free the returned AudioInputStream. It is owned by AudioManager. // When you are done with it, call |Stop()| and |Close()| to release it. - virtual AudioInputStream* MakeAudioInputStream(AudioParameters params, - int samples_per_packet) = 0; + virtual AudioInputStream* MakeAudioInputStream(AudioParameters params) = 0; // Muting continues playback but effectively the volume is set to zero. // Un-muting returns the volume to the previous level. |