| 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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 {27188, 26122, "4.24,3.95,4.22,4.78,5.13,4.93,"}, | 495 {27188, 26122, "4.24,3.95,4.22,4.78,5.13,4.93,"}, |
| 496 }; | 496 }; |
| 497 | 497 |
| 498 const DecodedBufferExpectations kSfxAdtsExpectations[] = { | 498 const DecodedBufferExpectations kSfxAdtsExpectations[] = { |
| 499 {0, 23219, "-1.90,-1.53,-0.15,1.28,1.23,-0.33,"}, | 499 {0, 23219, "-1.90,-1.53,-0.15,1.28,1.23,-0.33,"}, |
| 500 {23219, 23219, "0.54,0.88,2.19,3.54,3.24,1.63,"}, | 500 {23219, 23219, "0.54,0.88,2.19,3.54,3.24,1.63,"}, |
| 501 {46439, 23219, "1.42,1.69,2.95,4.23,4.02,2.36,"}, | 501 {46439, 23219, "1.42,1.69,2.95,4.23,4.02,2.36,"}, |
| 502 }; | 502 }; |
| 503 #endif | 503 #endif |
| 504 | 504 |
| 505 #if defined(OS_CHROMEOS) | |
| 506 const DecodedBufferExpectations kSfxFlacExpectations[] = { | 505 const DecodedBufferExpectations kSfxFlacExpectations[] = { |
| 507 {0, 104489, "-2.42,-1.12,0.71,1.70,1.09,-0.68,"}, | 506 {0, 104489, "-2.42,-1.12,0.71,1.70,1.09,-0.68,"}, |
| 508 {104489, 104489, "-1.99,-0.67,1.18,2.19,1.60,-0.16,"}, | 507 {104489, 104489, "-1.99,-0.67,1.18,2.19,1.60,-0.16,"}, |
| 509 {208979, 79433, "2.84,2.70,3.23,4.06,4.59,4.44,"}, | 508 {208979, 79433, "2.84,2.70,3.23,4.06,4.59,4.44,"}, |
| 510 }; | 509 }; |
| 511 #endif | |
| 512 | 510 |
| 513 const DecodedBufferExpectations kSfxWaveExpectations[] = { | 511 const DecodedBufferExpectations kSfxWaveExpectations[] = { |
| 514 {0, 23219, "-1.23,-0.87,0.47,1.85,1.88,0.29,"}, | 512 {0, 23219, "-1.23,-0.87,0.47,1.85,1.88,0.29,"}, |
| 515 {23219, 23219, "0.75,1.10,2.43,3.78,3.53,1.93,"}, | 513 {23219, 23219, "0.75,1.10,2.43,3.78,3.53,1.93,"}, |
| 516 {46439, 23219, "1.27,1.56,2.83,4.13,3.87,2.23,"}, | 514 {46439, 23219, "1.27,1.56,2.83,4.13,3.87,2.23,"}, |
| 517 }; | 515 }; |
| 518 | 516 |
| 519 const DecodedBufferExpectations kFourChannelWaveExpectations[] = { | 517 const DecodedBufferExpectations kFourChannelWaveExpectations[] = { |
| 520 {0, 11609, "-1.68,1.68,0.89,-3.45,1.52,1.15,"}, | 518 {0, 11609, "-1.68,1.68,0.89,-3.45,1.52,1.15,"}, |
| 521 {11609, 11609, "43.26,9.06,18.27,35.98,19.45,7.46,"}, | 519 {11609, 11609, "43.26,9.06,18.27,35.98,19.45,7.46,"}, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 548 }; | 546 }; |
| 549 #endif | 547 #endif |
| 550 | 548 |
| 551 const DecoderTestData kFFmpegTests[] = { | 549 const DecoderTestData kFFmpegTests[] = { |
| 552 #if defined(USE_PROPRIETARY_CODECS) | 550 #if defined(USE_PROPRIETARY_CODECS) |
| 553 {FFMPEG, kCodecMP3, "sfx.mp3", kSfxMp3Expectations, 0, 44100, | 551 {FFMPEG, kCodecMP3, "sfx.mp3", kSfxMp3Expectations, 0, 44100, |
| 554 CHANNEL_LAYOUT_MONO}, | 552 CHANNEL_LAYOUT_MONO}, |
| 555 {FFMPEG, kCodecAAC, "sfx.adts", kSfxAdtsExpectations, 0, 44100, | 553 {FFMPEG, kCodecAAC, "sfx.adts", kSfxAdtsExpectations, 0, 44100, |
| 556 CHANNEL_LAYOUT_MONO}, | 554 CHANNEL_LAYOUT_MONO}, |
| 557 #endif | 555 #endif |
| 558 #if defined(OS_CHROMEOS) | |
| 559 {FFMPEG, kCodecFLAC, "sfx.flac", kSfxFlacExpectations, 0, 44100, | 556 {FFMPEG, kCodecFLAC, "sfx.flac", kSfxFlacExpectations, 0, 44100, |
| 560 CHANNEL_LAYOUT_MONO}, | 557 CHANNEL_LAYOUT_MONO}, |
| 561 #endif | |
| 562 {FFMPEG, kCodecPCM, "sfx_f32le.wav", kSfxWaveExpectations, 0, 44100, | 558 {FFMPEG, kCodecPCM, "sfx_f32le.wav", kSfxWaveExpectations, 0, 44100, |
| 563 CHANNEL_LAYOUT_MONO}, | 559 CHANNEL_LAYOUT_MONO}, |
| 564 {FFMPEG, kCodecPCM, "4ch.wav", kFourChannelWaveExpectations, 0, 44100, | 560 {FFMPEG, kCodecPCM, "4ch.wav", kFourChannelWaveExpectations, 0, 44100, |
| 565 CHANNEL_LAYOUT_QUAD}, | 561 CHANNEL_LAYOUT_QUAD}, |
| 566 {FFMPEG, kCodecVorbis, "sfx.ogg", kSfxOggExpectations, 0, 44100, | 562 {FFMPEG, kCodecVorbis, "sfx.ogg", kSfxOggExpectations, 0, 44100, |
| 567 CHANNEL_LAYOUT_MONO}, | 563 CHANNEL_LAYOUT_MONO}, |
| 568 // Note: bear.ogv is incorrectly muxed such that valid samples are given | 564 // Note: bear.ogv is incorrectly muxed such that valid samples are given |
| 569 // negative timestamps, this marks them for discard per the ogg vorbis spec. | 565 // negative timestamps, this marks them for discard per the ogg vorbis spec. |
| 570 {FFMPEG, kCodecVorbis, "bear.ogv", kBearOgvExpectations, -704, 44100, | 566 {FFMPEG, kCodecVorbis, "bear.ogv", kBearOgvExpectations, -704, 44100, |
| 571 CHANNEL_LAYOUT_STEREO}, | 567 CHANNEL_LAYOUT_STEREO}, |
| 572 {FFMPEG, kCodecOpus, "sfx-opus.ogg", kSfxOpusExpectations, -312, 48000, | 568 {FFMPEG, kCodecOpus, "sfx-opus.ogg", kSfxOpusExpectations, -312, 48000, |
| 573 CHANNEL_LAYOUT_MONO}, | 569 CHANNEL_LAYOUT_MONO}, |
| 574 {FFMPEG, kCodecOpus, "bear-opus.ogg", kBearOpusExpectations, 24, 48000, | 570 {FFMPEG, kCodecOpus, "bear-opus.ogg", kBearOpusExpectations, 24, 48000, |
| 575 CHANNEL_LAYOUT_STEREO}, | 571 CHANNEL_LAYOUT_STEREO}, |
| 576 }; | 572 }; |
| 577 | 573 |
| 578 // Dummy data for behavioral tests. | 574 // Dummy data for behavioral tests. |
| 579 const DecoderTestData kFFmpegBehavioralTest[] = { | 575 const DecoderTestData kFFmpegBehavioralTest[] = { |
| 580 {FFMPEG, kUnknownAudioCodec, "", NULL, 0, 0, CHANNEL_LAYOUT_NONE}, | 576 {FFMPEG, kUnknownAudioCodec, "", NULL, 0, 0, CHANNEL_LAYOUT_NONE}, |
| 581 }; | 577 }; |
| 582 | 578 |
| 583 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderTest, | 579 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderTest, |
| 584 AudioDecoderTest, | 580 AudioDecoderTest, |
| 585 testing::ValuesIn(kFFmpegTests)); | 581 testing::ValuesIn(kFFmpegTests)); |
| 586 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderBehavioralTest, | 582 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderBehavioralTest, |
| 587 FFmpegAudioDecoderBehavioralTest, | 583 FFmpegAudioDecoderBehavioralTest, |
| 588 testing::ValuesIn(kFFmpegBehavioralTest)); | 584 testing::ValuesIn(kFFmpegBehavioralTest)); |
| 589 | 585 |
| 590 } // namespace media | 586 } // namespace media |
| OLD | NEW |