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

Unified Diff: media/base/channel_mixer_unittest.cc

Issue 11150034: Add support for channel transforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. 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 side-by-side diff with in-line comments
Download patch
Index: media/base/channel_mixer_unittest.cc
diff --git a/media/base/channel_mixer_unittest.cc b/media/base/channel_mixer_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ce7db0a4870781c39a4c590946ab1356c0497292
--- /dev/null
+++ b/media/base/channel_mixer_unittest.cc
@@ -0,0 +1,32 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "media/base/audio_bus.h"
+#include "media/base/channel_mixer.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace media {
+
+// Test flush resets the internal state properly.
+TEST(ChannelMixerTest, Construction) {
+ static const int kFrames = 16;
+
+ for (ChannelLayout input_layout = CHANNEL_LAYOUT_MONO;
+ input_layout < CHANNEL_LAYOUT_MAX; input_layout++) {
+ for (ChannelLayout output_layout = CHANNEL_LAYOUT_MONO;
+ output_layout < CHANNEL_LAYOUT_STEREO_DOWNMIX; output_layout++) {
+ ChannelMixer mixer(input_layout, output_layout);
scherkus (not reviewing) 2012/10/18 01:30:39 should consider using SCOPED_TRACE() to document t
DaleCurtis 2012/10/18 05:22:04 Done.
+ scoped_ptr<AudioBus> input_bus = AudioBus::Create(
+ ChannelLayoutToChannelCount(input_layout), kFrames);
+ scoped_ptr<AudioBus> output_bus = AudioBus::Create(
+ ChannelLayoutToChannelCount(output_layout), kFrames);
+ for(int ch = 0; ch < input_bus->channels(); ++ch)
+ std::fill(input_bus->channel(ch), input_bus->channel(ch) + kFrames, 1);
+
+ mixer.Rematrix(input_bus.get(), output_bus.get());
scherkus (not reviewing) 2012/10/18 01:30:39 what exactly are we testing?
DaleCurtis 2012/10/18 01:56:44 Just that construction of all layouts is possible
scherkus (not reviewing) 2012/10/18 02:24:03 How about naming this "AllLayoutCombinations" inst
DaleCurtis 2012/10/18 05:22:04 Done.
+ }
+ }
+}
+
+} // namespace media
« media/base/channel_mixer.cc ('K') | « media/base/channel_mixer.cc ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698