Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(674)

Unified Diff: media/audio/audio_manager.h

Issue 4661001: Simplified AudioOutputStream interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/audio_io.h ('k') | media/audio/audio_output_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_manager.h
diff --git a/media/audio/audio_manager.h b/media/audio/audio_manager.h
index 805db89e43d3a31d14ffc0014cd556abc67646d6..26f0acfd067418bfa4bd0d6631e09068c8071ac5 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.
« no previous file with comments | « media/audio/audio_io.h ('k') | media/audio/audio_output_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698