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

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

Issue 11198018: Move ChannelLayout into media namespace. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixes. Created 8 years, 2 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/audio/mac/audio_output_mac.cc ('k') | media/base/channel_layout.h » ('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 #include <limits> 5 #include <limits>
6 6
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "media/audio/audio_parameters.h" 9 #include "media/audio/audio_parameters.h"
10 #include "media/base/audio_bus.h" 10 #include "media/base/audio_bus.h"
11 #include "media/base/channel_layout.h" 11 #include "media/base/channel_layout.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace media {
15
14 static const int kChannels = 6; 16 static const int kChannels = 6;
15 static const ChannelLayout kChannelLayout = CHANNEL_LAYOUT_5_1; 17 static const ChannelLayout kChannelLayout = CHANNEL_LAYOUT_5_1;
16 // Use a buffer size which is intentionally not a multiple of kChannelAlignment. 18 // Use a buffer size which is intentionally not a multiple of kChannelAlignment.
17 static const int kFrameCount = media::AudioBus::kChannelAlignment * 32 - 1; 19 static const int kFrameCount = media::AudioBus::kChannelAlignment * 32 - 1;
18 static const int kSampleRate = 48000; 20 static const int kSampleRate = 48000;
19 21
20 namespace media {
21
22 class AudioBusTest : public testing::Test { 22 class AudioBusTest : public testing::Test {
23 public: 23 public:
24 AudioBusTest() {} 24 AudioBusTest() {}
25 ~AudioBusTest() { 25 ~AudioBusTest() {
26 for (size_t i = 0; i < data_.size(); ++i) 26 for (size_t i = 0; i < data_.size(); ++i)
27 base::AlignedFree(data_[i]); 27 base::AlignedFree(data_[i]);
28 } 28 }
29 29
30 // Validate parameters returned by AudioBus v.s. the constructed parameters. 30 // Validate parameters returned by AudioBus v.s. the constructed parameters.
31 void VerifyParams(AudioBus* bus) { 31 void VerifyParams(AudioBus* bus) {
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 { 328 {
329 SCOPED_TRACE("int32"); 329 SCOPED_TRACE("int32");
330 int32 test_array[arraysize(kTestVectorInt32)]; 330 int32 test_array[arraysize(kTestVectorInt32)];
331 bus->ToInterleaved(bus->frames(), sizeof(*kTestVectorInt32), test_array); 331 bus->ToInterleaved(bus->frames(), sizeof(*kTestVectorInt32), test_array);
332 ASSERT_EQ(memcmp( 332 ASSERT_EQ(memcmp(
333 test_array, kTestVectorInt32, arraysize(kTestVectorInt32)), 0); 333 test_array, kTestVectorInt32, arraysize(kTestVectorInt32)), 0);
334 } 334 }
335 } 335 }
336 336
337 } // namespace media 337 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/mac/audio_output_mac.cc ('k') | media/base/channel_layout.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698