| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 197 |
| 198 AudioDecoderConfig config; | 198 AudioDecoderConfig config; |
| 199 ASSERT_TRUE(AVCodecContextToAudioDecoderConfig( | 199 ASSERT_TRUE(AVCodecContextToAudioDecoderConfig( |
| 200 reader_->codec_context_for_testing(), Unencrypted(), &config)); | 200 reader_->codec_context_for_testing(), Unencrypted(), &config)); |
| 201 | 201 |
| 202 #if defined(OS_ANDROID) && defined(USE_PROPRIETARY_CODECS) | 202 #if defined(OS_ANDROID) && defined(USE_PROPRIETARY_CODECS) |
| 203 // MEDIA_CODEC type requires config->extra_data() for AAC codec. For ADTS | 203 // MEDIA_CODEC type requires config->extra_data() for AAC codec. For ADTS |
| 204 // streams we need to extract it with a separate procedure. | 204 // streams we need to extract it with a separate procedure. |
| 205 if (GetParam().decoder_type == MEDIA_CODEC && | 205 if (GetParam().decoder_type == MEDIA_CODEC && |
| 206 GetParam().codec == kCodecAAC && config.extra_data().empty()) { | 206 GetParam().codec == kCodecAAC && config.extra_data().empty()) { |
| 207 ASSERT_TRUE(ParseAdtsHeader(packet.data, false, &config)); | 207 ASSERT_TRUE(ParseAdtsHeader(packet.data, false, Unencrypted(), &config)); |
| 208 ASSERT_FALSE(config.extra_data().empty()); | 208 ASSERT_FALSE(config.extra_data().empty()); |
| 209 } | 209 } |
| 210 #endif | 210 #endif |
| 211 | 211 |
| 212 av_packet_unref(&packet); | 212 av_packet_unref(&packet); |
| 213 | 213 |
| 214 EXPECT_EQ(GetParam().codec, config.codec()); | 214 EXPECT_EQ(GetParam().codec, config.codec()); |
| 215 EXPECT_EQ(GetParam().samples_per_second, config.samples_per_second()); | 215 EXPECT_EQ(GetParam().samples_per_second, config.samples_per_second()); |
| 216 EXPECT_EQ(GetParam().channel_layout, config.channel_layout()); | 216 EXPECT_EQ(GetParam().channel_layout, config.channel_layout()); |
| 217 | 217 |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 }; | 621 }; |
| 622 | 622 |
| 623 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderTest, | 623 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderTest, |
| 624 AudioDecoderTest, | 624 AudioDecoderTest, |
| 625 testing::ValuesIn(kFFmpegTests)); | 625 testing::ValuesIn(kFFmpegTests)); |
| 626 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderBehavioralTest, | 626 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderBehavioralTest, |
| 627 FFmpegAudioDecoderBehavioralTest, | 627 FFmpegAudioDecoderBehavioralTest, |
| 628 testing::ValuesIn(kFFmpegBehavioralTest)); | 628 testing::ValuesIn(kFFmpegBehavioralTest)); |
| 629 | 629 |
| 630 } // namespace media | 630 } // namespace media |
| OLD | NEW |