| 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 size_t ignore_orig_sample_rate; |
| 208 ASSERT_TRUE(ParseAdtsHeader(packet.data, false, &config, |
| 209 &ignore_orig_sample_rate)); |
| 208 ASSERT_FALSE(config.extra_data().empty()); | 210 ASSERT_FALSE(config.extra_data().empty()); |
| 209 } | 211 } |
| 210 #endif | 212 #endif |
| 211 | 213 |
| 212 av_packet_unref(&packet); | 214 av_packet_unref(&packet); |
| 213 | 215 |
| 214 EXPECT_EQ(GetParam().codec, config.codec()); | 216 EXPECT_EQ(GetParam().codec, config.codec()); |
| 215 EXPECT_EQ(GetParam().samples_per_second, config.samples_per_second()); | 217 EXPECT_EQ(GetParam().samples_per_second, config.samples_per_second()); |
| 216 EXPECT_EQ(GetParam().channel_layout, config.channel_layout()); | 218 EXPECT_EQ(GetParam().channel_layout, config.channel_layout()); |
| 217 | 219 |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 }; | 620 }; |
| 619 | 621 |
| 620 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderTest, | 622 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderTest, |
| 621 AudioDecoderTest, | 623 AudioDecoderTest, |
| 622 testing::ValuesIn(kFFmpegTests)); | 624 testing::ValuesIn(kFFmpegTests)); |
| 623 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderBehavioralTest, | 625 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderBehavioralTest, |
| 624 FFmpegAudioDecoderBehavioralTest, | 626 FFmpegAudioDecoderBehavioralTest, |
| 625 testing::ValuesIn(kFFmpegBehavioralTest)); | 627 testing::ValuesIn(kFFmpegBehavioralTest)); |
| 626 | 628 |
| 627 } // namespace media | 629 } // namespace media |
| OLD | NEW |