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

Side by Side Diff: media/base/audio_fifo_unittest.cc

Issue 10918098: Introduce AudioOutputResampler for browser side resampling. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: First draft! Created 8 years, 3 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
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 #include <limits> 5 #include <limits>
6 6
7 #include "media/base/audio_bus.h" 7 #include "media/base/audio_bus.h"
8 #include "media/base/audio_fifo.h" 8 #include "media/base/audio_fifo.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace media { 11 namespace media {
12 12 #if 0
scherkus (not reviewing) 2012/09/07 13:30:17 !
DaleCurtis 2012/09/07 14:17:35 Just my hacked version for now. Didn't you read my
13 class AudioFifoTest : public testing::Test { 13 class AudioFifoTest : public testing::Test {
14 public: 14 public:
15 AudioFifoTest() {} 15 AudioFifoTest() {}
16 ~AudioFifoTest() {} 16 ~AudioFifoTest() {}
17 17
18 void VerifyValue(const float data[], int size, float value) { 18 void VerifyValue(const float data[], int size, float value) {
19 for (int i = 0; i < size; ++i) 19 for (int i = 0; i < size; ++i)
20 ASSERT_FLOAT_EQ(value, data[i]) << "i=" << i; 20 ASSERT_FLOAT_EQ(value, data[i]) << "i=" << i;
21 } 21 }
22 22
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 for (int j = 0; j < bus->channels(); ++j) { 204 for (int j = 0; j < bus->channels(); ++j) {
205 VerifyValue(bus->channel(j), bus->channels(), value); 205 VerifyValue(bus->channel(j), bus->channels(), value);
206 std::fill(bus->channel(j), bus->channel(j) + bus->frames(), value + 1); 206 std::fill(bus->channel(j), bus->channel(j) + bus->frames(), value + 1);
207 } 207 }
208 EXPECT_TRUE(fifo.Push(bus.get())); 208 EXPECT_TRUE(fifo.Push(bus.get()));
209 EXPECT_EQ(fifo.frames_in_fifo(), bus->frames()); 209 EXPECT_EQ(fifo.frames_in_fifo(), bus->frames());
210 ++value; 210 ++value;
211 } 211 }
212 212
213 } 213 }
214 #endif
214 215
215 } // namespace media 216 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698