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

Side by Side Diff: media/base/test_helpers.h

Issue 212103013: Add channel_count parameter back to AudioBuffer creation methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mstr
Patch Set: fix unit test 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_BASE_TEST_HELPERS_H_ 5 #ifndef MEDIA_BASE_TEST_HELPERS_H_
6 #define MEDIA_BASE_TEST_HELPERS_H_ 6 #define MEDIA_BASE_TEST_HELPERS_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "media/base/channel_layout.h" 10 #include "media/base/channel_layout.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // |start| + 2 * |increment|, and so on. 107 // |start| + 2 * |increment|, and so on.
108 // Data for channel 1 will follow where channel 0 ends. Subsequent channels are 108 // Data for channel 1 will follow where channel 0 ends. Subsequent channels are
109 // similar. No check is done that |format| requires data to be of type T, but it 109 // similar. No check is done that |format| requires data to be of type T, but it
110 // is verified that |format| is a planar format. 110 // is verified that |format| is a planar format.
111 // 111 //
112 // |start_time| will be used as the start time for the samples. |duration| is 112 // |start_time| will be used as the start time for the samples. |duration| is
113 // the duration. 113 // the duration.
114 template <class T> 114 template <class T>
115 scoped_refptr<AudioBuffer> MakeAudioBuffer(SampleFormat format, 115 scoped_refptr<AudioBuffer> MakeAudioBuffer(SampleFormat format,
116 ChannelLayout channel_layout, 116 ChannelLayout channel_layout,
117 int channel_count,
117 int sample_rate, 118 int sample_rate,
118 T start, 119 T start,
119 T increment, 120 T increment,
120 int frames, 121 int frames,
121 base::TimeDelta timestamp, 122 base::TimeDelta timestamp,
122 base::TimeDelta duration); 123 base::TimeDelta duration);
123 124
124 // Create a fake video DecoderBuffer for testing purpose. The buffer contains 125 // Create a fake video DecoderBuffer for testing purpose. The buffer contains
125 // part of video decoder config info embedded so that the testing code can do 126 // part of video decoder config info embedded so that the testing code can do
126 // some sanity check. 127 // some sanity check.
127 scoped_refptr<DecoderBuffer> CreateFakeVideoBufferForTest( 128 scoped_refptr<DecoderBuffer> CreateFakeVideoBufferForTest(
128 const VideoDecoderConfig& config, 129 const VideoDecoderConfig& config,
129 base::TimeDelta timestamp, 130 base::TimeDelta timestamp,
130 base::TimeDelta duration); 131 base::TimeDelta duration);
131 132
132 // Verify if a fake video DecoderBuffer is valid. 133 // Verify if a fake video DecoderBuffer is valid.
133 bool VerifyFakeVideoBufferForTest(const scoped_refptr<DecoderBuffer>& buffer, 134 bool VerifyFakeVideoBufferForTest(const scoped_refptr<DecoderBuffer>& buffer,
134 const VideoDecoderConfig& config); 135 const VideoDecoderConfig& config);
135 136
136 } // namespace media 137 } // namespace media
137 138
138 #endif // MEDIA_BASE_TEST_HELPERS_H_ 139 #endif // MEDIA_BASE_TEST_HELPERS_H_
OLDNEW
« 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