| 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 <deque> | 5 #include <deque> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/md5.h" | 10 #include "base/md5.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 InitializeDecoder(config); | 163 InitializeDecoder(config); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void InitializeDecoder(const AudioDecoderConfig& config) { | 166 void InitializeDecoder(const AudioDecoderConfig& config) { |
| 167 InitializeDecoderWithResult(config, true); | 167 InitializeDecoderWithResult(config, true); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void InitializeDecoderWithResult(const AudioDecoderConfig& config, | 170 void InitializeDecoderWithResult(const AudioDecoderConfig& config, |
| 171 bool success) { | 171 bool success) { |
| 172 decoder_->Initialize( | 172 decoder_->Initialize( |
| 173 config, SetCdmReadyCB(), NewExpectedBoolCB(success), | 173 config, NewExpectedBoolCB(success), |
| 174 base::Bind(&AudioDecoderTest::OnDecoderOutput, base::Unretained(this))); | 174 base::Bind(&AudioDecoderTest::OnDecoderOutput, base::Unretained(this))); |
| 175 base::RunLoop().RunUntilIdle(); | 175 base::RunLoop().RunUntilIdle(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void Decode() { | 178 void Decode() { |
| 179 AVPacket packet; | 179 AVPacket packet; |
| 180 ASSERT_TRUE(reader_->ReadPacketForTesting(&packet)); | 180 ASSERT_TRUE(reader_->ReadPacketForTesting(&packet)); |
| 181 | 181 |
| 182 // Split out packet metadata before making a copy. | 182 // Split out packet metadata before making a copy. |
| 183 av_packet_split_side_data(&packet); | 183 av_packet_split_side_data(&packet); |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 }; | 524 }; |
| 525 | 525 |
| 526 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderTest, | 526 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderTest, |
| 527 AudioDecoderTest, | 527 AudioDecoderTest, |
| 528 testing::ValuesIn(kFFmpegTests)); | 528 testing::ValuesIn(kFFmpegTests)); |
| 529 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderBehavioralTest, | 529 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderBehavioralTest, |
| 530 FFmpegAudioDecoderBehavioralTest, | 530 FFmpegAudioDecoderBehavioralTest, |
| 531 testing::ValuesIn(kFFmpegBehavioralTest)); | 531 testing::ValuesIn(kFFmpegBehavioralTest)); |
| 532 | 532 |
| 533 } // namespace media | 533 } // namespace media |
| OLD | NEW |