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

Unified Diff: media/mp4/aac_unittest.cc

Issue 10710002: Add HE AAC support to ISO BMFF. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add unittest for 5.1 channel. Created 8 years, 6 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/mp4/aac_unittest.cc
diff --git a/media/mp4/aac_unittest.cc b/media/mp4/aac_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c7c2e392a88fd514e229bf09b74d554f1d5b5af9
--- /dev/null
+++ b/media/mp4/aac_unittest.cc
@@ -0,0 +1,66 @@
+// 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/mp4/aac.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace media {
+
+namespace mp4 {
+
+TEST(AACTest, BasicProfileTest) {
+ AAC aac;
+ uint8 buffer[] = {
+ 0x03, 0x19, 0x00, 0x01, 0x00, 0x04, 0x11, 0x40,
+ 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x05, 0x02, 0x12, 0x10,
+ 0x06, 0x01, 0x02
+ };
+ std::vector<uint8> data;
+
+ data.assign(buffer, buffer + sizeof(buffer));
+
+ EXPECT_TRUE(aac.Initialize(data));
+ EXPECT_EQ(aac.frequency(), 44100u);
+ EXPECT_EQ(aac.channel_layout(), CHANNEL_LAYOUT_STEREO);
+}
+
+TEST(AACTest, ExtensionTest) {
+ AAC aac;
+ uint8 buffer[] = {
+ 0x03, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x16, 0x40,
+ 0x15, 0x00, 0x02, 0xeb, 0x00, 0x02, 0x0f, 0xd0,
+ 0x00, 0x01, 0xad, 0x20, 0x05, 0x07, 0x13, 0x08,
+ 0x56, 0xe5, 0x9d, 0x48, 0x80, 0x06, 0x01, 0x02
+ };
+ std::vector<uint8> data;
+
+ data.assign(buffer, buffer + sizeof(buffer));
+
+ EXPECT_TRUE(aac.Initialize(data));
+ EXPECT_EQ(aac.frequency(), 48000u);
+ EXPECT_EQ(aac.channel_layout(), CHANNEL_LAYOUT_STEREO);
+}
+
+TEST(AACTest, SixChannelTest) {
+ AAC aac;
+ uint8 buffer[] = {
+ 0x03, 0x19, 0x00, 0x00, 0x00, 0x04, 0x11, 0x40,
+ 0x15, 0x00, 0x18, 0x00, 0x00, 0x08, 0xf4, 0x70,
+ 0x00, 0x06, 0xad, 0x60, 0x05, 0x02, 0x11, 0xb0,
+ 0x06, 0x01, 0x02
+ };
+ std::vector<uint8> data;
+
+ data.assign(buffer, buffer + sizeof(buffer));
+
+ EXPECT_TRUE(aac.Initialize(data));
+ EXPECT_EQ(aac.frequency(), 48000u);
+ EXPECT_EQ(aac.channel_layout(), CHANNEL_LAYOUT_5_1);
+}
+
+} // namespace mp4
+
+} // namespace media

Powered by Google App Engine
This is Rietveld 408576698