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

Side by Side 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, 5 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "media/mp4/aac.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 namespace media {
10
11 namespace mp4 {
12
13 TEST(AACTest, BasicProfileTest) {
14 AAC aac;
15 uint8 buffer[] = {
16 0x03, 0x19, 0x00, 0x01, 0x00, 0x04, 0x11, 0x40,
17 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
18 0x00, 0x00, 0x00, 0x00, 0x05, 0x02, 0x12, 0x10,
19 0x06, 0x01, 0x02
20 };
21 std::vector<uint8> data;
22
23 data.assign(buffer, buffer + sizeof(buffer));
24
25 EXPECT_TRUE(aac.Initialize(data));
26 EXPECT_EQ(aac.frequency(), 44100u);
27 EXPECT_EQ(aac.channel_layout(), CHANNEL_LAYOUT_STEREO);
28 }
29
30 TEST(AACTest, ExtensionTest) {
31 AAC aac;
32 uint8 buffer[] = {
33 0x03, 0x1e, 0x00, 0x00, 0x00, 0x04, 0x16, 0x40,
34 0x15, 0x00, 0x02, 0xeb, 0x00, 0x02, 0x0f, 0xd0,
35 0x00, 0x01, 0xad, 0x20, 0x05, 0x07, 0x13, 0x08,
36 0x56, 0xe5, 0x9d, 0x48, 0x80, 0x06, 0x01, 0x02
37 };
38 std::vector<uint8> data;
39
40 data.assign(buffer, buffer + sizeof(buffer));
41
42 EXPECT_TRUE(aac.Initialize(data));
43 EXPECT_EQ(aac.frequency(), 48000u);
44 EXPECT_EQ(aac.channel_layout(), CHANNEL_LAYOUT_STEREO);
45 }
46
47 TEST(AACTest, SixChannelTest) {
48 AAC aac;
49 uint8 buffer[] = {
50 0x03, 0x19, 0x00, 0x00, 0x00, 0x04, 0x11, 0x40,
51 0x15, 0x00, 0x18, 0x00, 0x00, 0x08, 0xf4, 0x70,
52 0x00, 0x06, 0xad, 0x60, 0x05, 0x02, 0x11, 0xb0,
53 0x06, 0x01, 0x02
54 };
55 std::vector<uint8> data;
56
57 data.assign(buffer, buffer + sizeof(buffer));
58
59 EXPECT_TRUE(aac.Initialize(data));
60 EXPECT_EQ(aac.frequency(), 48000u);
61 EXPECT_EQ(aac.channel_layout(), CHANNEL_LAYOUT_5_1);
62 }
63
64 } // namespace mp4
65
66 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698