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

Unified Diff: media/base/audio_bus.h

Issue 10871051: Convert WebAudio file handlers to use AudioBus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 8 years, 4 months 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
Index: media/base/audio_bus.h
diff --git a/media/base/audio_bus.h b/media/base/audio_bus.h
index acf64919c716221c50861c733cde3cfe42fadb0f..ea7e5f81a5fb8f1a8eba59ced6e8ae2fb0c91730 100644
--- a/media/base/audio_bus.h
+++ b/media/base/audio_bus.h
@@ -49,10 +49,18 @@ class MEDIA_EXPORT AudioBus {
// data. Expects interleaving to be [ch0, ch1, ..., chN, ch0, ch1, ...] with
// |bytes_per_sample| per value. Values are scaled and bias corrected during
// conversion. ToInterleaved() will also clip values to format range.
- // Handles uint8, int16, and int32 currently.
+ // Handles uint8, int16, and int32 currently. FromInterleaved() will zero out
+ // any unfilled frames when |frames| is less than frames().
void FromInterleaved(const void* source, int frames, int bytes_per_sample);
void ToInterleaved(int frames, int bytes_per_sample, void* dest) const;
+ // Similar to FromInterleaved() above, but meant for streaming sources. Does
+ // not zero out remaining frames, the caller is responsible for doing so using
+ // ZeroFramesPartial(). Frames are deinterleaved from the start of |source|
+ // to channel(x)[start_frame].
+ void FromInterleavedPartial(const void* source, int start_frame, int frames,
+ int bytes_per_sample);
+
// Helper method for copying channel data from one AudioBus to another. Both
// AudioBus object must have the same frames() and channels().
void CopyTo(AudioBus* dest) const;
@@ -68,6 +76,7 @@ class MEDIA_EXPORT AudioBus {
// Helper method for zeroing out all channels of audio data.
void Zero();
void ZeroFrames(int frames);
+ void ZeroFramesPartial(int start_frame, int frames);
private:
friend class scoped_ptr<AudioBus>;
« no previous file with comments | « media/audio/audio_util.cc ('k') | media/base/audio_bus.cc » ('j') | media/base/audio_bus.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698