OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "media/base/mock_media_log.h" | 7 #include "media/base/mock_media_log.h" |
8 #include "media/formats/mp4/aac.h" | 8 #include "media/formats/mp4/aac.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 AudioChannelLayoutLog("3"))); | 103 AudioChannelLayoutLog("3"))); |
104 EXPECT_TRUE(Parse(data)); | 104 EXPECT_TRUE(Parse(data)); |
105 EXPECT_EQ(aac_.GetOutputSamplesPerSecond(false), 48000); | 105 EXPECT_EQ(aac_.GetOutputSamplesPerSecond(false), 48000); |
106 EXPECT_EQ(aac_.GetOutputSamplesPerSecond(true), 48000); | 106 EXPECT_EQ(aac_.GetOutputSamplesPerSecond(true), 48000); |
107 EXPECT_EQ(aac_.GetChannelLayout(false), CHANNEL_LAYOUT_STEREO); | 107 EXPECT_EQ(aac_.GetChannelLayout(false), CHANNEL_LAYOUT_STEREO); |
108 } | 108 } |
109 | 109 |
110 // Test implicit SBR with mono channel config. | 110 // Test implicit SBR with mono channel config. |
111 // Mono channel layout should only be reported if SBR is not | 111 // Mono channel layout should only be reported if SBR is not |
112 // specified. Otherwise stereo should be reported. | 112 // specified. Otherwise stereo should be reported. |
113 // See ISO-14496-3 Section 1.6.6.1.2 for details about this special casing. | 113 // See ISO 14496-3:2005 Section 1.6.5.3 for details about this special casing. |
114 TEST_F(AACTest, ImplicitSBR_ChannelConfig0) { | 114 TEST_F(AACTest, ImplicitSBR_ChannelConfig0) { |
115 uint8 buffer[] = {0x13, 0x08}; | 115 uint8 buffer[] = {0x13, 0x08}; |
116 std::vector<uint8> data; | 116 std::vector<uint8> data; |
117 | 117 |
118 data.assign(buffer, buffer + sizeof(buffer)); | 118 data.assign(buffer, buffer + sizeof(buffer)); |
119 | 119 |
120 EXPECT_MEDIA_LOG(AllOf(AudioProfileLog("mp4a.40.2"), | 120 EXPECT_MEDIA_LOG(AllOf(AudioProfileLog("mp4a.40.2"), |
121 AudioSamplingFrequencyLog("24000"), | 121 AudioSamplingFrequencyLog("24000"), |
122 AudioExtensionSamplingFrequencyLog("0"), | 122 AudioExtensionSamplingFrequencyLog("0"), |
123 AudioChannelLayoutLog("2"))); | 123 AudioChannelLayoutLog("2"))); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 EXPECT_MEDIA_LOG(AllOf(AudioProfileLog("mp4a.40.2"), | 295 EXPECT_MEDIA_LOG(AllOf(AudioProfileLog("mp4a.40.2"), |
296 AudioSamplingFrequencyLog("64000"), | 296 AudioSamplingFrequencyLog("64000"), |
297 AudioExtensionSamplingFrequencyLog("64000"), | 297 AudioExtensionSamplingFrequencyLog("64000"), |
298 AudioChannelLayoutLog("3"))); | 298 AudioChannelLayoutLog("3"))); |
299 EXPECT_TRUE(Parse(data)); | 299 EXPECT_TRUE(Parse(data)); |
300 } | 300 } |
301 | 301 |
302 } // namespace mp4 | 302 } // namespace mp4 |
303 | 303 |
304 } // namespace media | 304 } // namespace media |
OLD | NEW |