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

Unified Diff: media/base/test_helpers.h

Issue 261533002: Remove AudioBuffer::set_duration(), instead base on frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix divide by zero case. Created 6 years, 8 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
« no previous file with comments | « media/base/audio_splicer_unittest.cc ('k') | media/base/test_helpers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/test_helpers.h
diff --git a/media/base/test_helpers.h b/media/base/test_helpers.h
index f342af440cec63ed817540f17674d2d34516fc4d..8dc38958f5d2a0605b435d9f599e20bb17fd8ab5 100644
--- a/media/base/test_helpers.h
+++ b/media/base/test_helpers.h
@@ -86,41 +86,32 @@ class TestVideoConfig {
};
// Create an AudioBuffer containing |frames| frames of data, where each sample
-// is of type T.
+// is of type T. |start| and |increment| are used to specify the values for the
+// samples, which are created in channel order. The value for frame and channel
+// is determined by:
//
-// For interleaved formats, each frame will have the data from |channels|
-// channels interleaved. |start| and |increment| are used to specify the values
-// for the samples. Since this is interleaved data, channel 0 data will be:
-// |start|
-// |start| + |channels| * |increment|
-// |start| + 2 * |channels| * |increment|, and so on.
-// Data for subsequent channels is similar. No check is done that |format|
-// requires data to be of type T, but it is verified that |format| is an
-// interleaved format.
+// |start| + |channel| * |frames| * |increment| + index * |increment|
//
-// For planar formats, there will be a block for each of |channel| channels.
-// |start| and |increment| are used to specify the values for the samples, which
-// are created in channel order. Since this is planar data, channel 0 data will
-// be:
-// |start|
-// |start| + |increment|
-// |start| + 2 * |increment|, and so on.
-// Data for channel 1 will follow where channel 0 ends. Subsequent channels are
-// similar. No check is done that |format| requires data to be of type T, but it
-// is verified that |format| is a planar format.
+// E.g., for a stereo buffer the values in channel 0 will be:
+// start
+// start + increment
+// start + 2 * increment, ...
//
-// |start_time| will be used as the start time for the samples. |duration| is
-// the duration.
+// While, values in channel 1 will be:
+// start + frames * increment
+// start + (frames + 1) * increment
+// start + (frames + 2) * increment, ...
+//
+// |start_time| will be used as the start time for the samples.
template <class T>
scoped_refptr<AudioBuffer> MakeAudioBuffer(SampleFormat format,
ChannelLayout channel_layout,
- int channel_count,
+ size_t channel_count,
int sample_rate,
T start,
T increment,
- int frames,
- base::TimeDelta timestamp,
- base::TimeDelta duration);
+ size_t frames,
+ base::TimeDelta timestamp);
// Create a fake video DecoderBuffer for testing purpose. The buffer contains
// part of video decoder config info embedded so that the testing code can do
« no previous file with comments | « media/base/audio_splicer_unittest.cc ('k') | media/base/test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698