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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 {27188, 26122, "4.24,3.95,4.22,4.78,5.13,4.93,"}, | 567 {27188, 26122, "4.24,3.95,4.22,4.78,5.13,4.93,"}, |
568 }; | 568 }; |
569 | 569 |
570 const DecodedBufferExpectations kSfxAdtsExpectations[] = { | 570 const DecodedBufferExpectations kSfxAdtsExpectations[] = { |
571 {0, 23219, "-1.90,-1.53,-0.15,1.28,1.23,-0.33,"}, | 571 {0, 23219, "-1.90,-1.53,-0.15,1.28,1.23,-0.33,"}, |
572 {23219, 23219, "0.54,0.88,2.19,3.54,3.24,1.63,"}, | 572 {23219, 23219, "0.54,0.88,2.19,3.54,3.24,1.63,"}, |
573 {46439, 23219, "1.42,1.69,2.95,4.23,4.02,2.36,"}, | 573 {46439, 23219, "1.42,1.69,2.95,4.23,4.02,2.36,"}, |
574 }; | 574 }; |
575 #endif | 575 #endif |
576 | 576 |
577 #if defined(OS_CHROMEOS) | |
578 const DecodedBufferExpectations kSfxFlacExpectations[] = { | 577 const DecodedBufferExpectations kSfxFlacExpectations[] = { |
579 {0, 104489, "-2.42,-1.12,0.71,1.70,1.09,-0.68,"}, | 578 {0, 104489, "-2.42,-1.12,0.71,1.70,1.09,-0.68,"}, |
580 {104489, 104489, "-1.99,-0.67,1.18,2.19,1.60,-0.16,"}, | 579 {104489, 104489, "-1.99,-0.67,1.18,2.19,1.60,-0.16,"}, |
581 {208979, 79433, "2.84,2.70,3.23,4.06,4.59,4.44,"}, | 580 {208979, 79433, "2.84,2.70,3.23,4.06,4.59,4.44,"}, |
582 }; | 581 }; |
583 #endif | |
584 | 582 |
585 const DecodedBufferExpectations kSfxWaveExpectations[] = { | 583 const DecodedBufferExpectations kSfxWaveExpectations[] = { |
586 {0, 23219, "-1.23,-0.87,0.47,1.85,1.88,0.29,"}, | 584 {0, 23219, "-1.23,-0.87,0.47,1.85,1.88,0.29,"}, |
587 {23219, 23219, "0.75,1.10,2.43,3.78,3.53,1.93,"}, | 585 {23219, 23219, "0.75,1.10,2.43,3.78,3.53,1.93,"}, |
588 {46439, 23219, "1.27,1.56,2.83,4.13,3.87,2.23,"}, | 586 {46439, 23219, "1.27,1.56,2.83,4.13,3.87,2.23,"}, |
589 }; | 587 }; |
590 | 588 |
591 const DecodedBufferExpectations kFourChannelWaveExpectations[] = { | 589 const DecodedBufferExpectations kFourChannelWaveExpectations[] = { |
592 {0, 11609, "-1.68,1.68,0.89,-3.45,1.52,1.15,"}, | 590 {0, 11609, "-1.68,1.68,0.89,-3.45,1.52,1.15,"}, |
593 {11609, 11609, "43.26,9.06,18.27,35.98,19.45,7.46,"}, | 591 {11609, 11609, "43.26,9.06,18.27,35.98,19.45,7.46,"}, |
(...skipping 12 matching lines...) Expand all Loading... |
606 {36281, 23219, "-1.43,-1.25,0.11,1.29,1.86,0.14,"}, | 604 {36281, 23219, "-1.43,-1.25,0.11,1.29,1.86,0.14,"}, |
607 }; | 605 }; |
608 | 606 |
609 const DecoderTestData kFFmpegTests[] = { | 607 const DecoderTestData kFFmpegTests[] = { |
610 #if defined(USE_PROPRIETARY_CODECS) | 608 #if defined(USE_PROPRIETARY_CODECS) |
611 {FFMPEG, kCodecMP3, "sfx.mp3", kSfxMp3Expectations, 0, 44100, | 609 {FFMPEG, kCodecMP3, "sfx.mp3", kSfxMp3Expectations, 0, 44100, |
612 CHANNEL_LAYOUT_MONO}, | 610 CHANNEL_LAYOUT_MONO}, |
613 {FFMPEG, kCodecAAC, "sfx.adts", kSfxAdtsExpectations, 0, 44100, | 611 {FFMPEG, kCodecAAC, "sfx.adts", kSfxAdtsExpectations, 0, 44100, |
614 CHANNEL_LAYOUT_MONO}, | 612 CHANNEL_LAYOUT_MONO}, |
615 #endif | 613 #endif |
616 #if defined(OS_CHROMEOS) | |
617 {FFMPEG, kCodecFLAC, "sfx.flac", kSfxFlacExpectations, 0, 44100, | 614 {FFMPEG, kCodecFLAC, "sfx.flac", kSfxFlacExpectations, 0, 44100, |
618 CHANNEL_LAYOUT_MONO}, | 615 CHANNEL_LAYOUT_MONO}, |
619 #endif | |
620 {FFMPEG, kCodecPCM, "sfx_f32le.wav", kSfxWaveExpectations, 0, 44100, | 616 {FFMPEG, kCodecPCM, "sfx_f32le.wav", kSfxWaveExpectations, 0, 44100, |
621 CHANNEL_LAYOUT_MONO}, | 617 CHANNEL_LAYOUT_MONO}, |
622 {FFMPEG, kCodecPCM, "4ch.wav", kFourChannelWaveExpectations, 0, 44100, | 618 {FFMPEG, kCodecPCM, "4ch.wav", kFourChannelWaveExpectations, 0, 44100, |
623 CHANNEL_LAYOUT_QUAD}, | 619 CHANNEL_LAYOUT_QUAD}, |
624 {FFMPEG, kCodecVorbis, "sfx.ogg", kSfxOggExpectations, 0, 44100, | 620 {FFMPEG, kCodecVorbis, "sfx.ogg", kSfxOggExpectations, 0, 44100, |
625 CHANNEL_LAYOUT_MONO}, | 621 CHANNEL_LAYOUT_MONO}, |
626 // Note: bear.ogv is incorrectly muxed such that valid samples are given | 622 // Note: bear.ogv is incorrectly muxed such that valid samples are given |
627 // negative timestamps, this marks them for discard per the ogg vorbis spec. | 623 // negative timestamps, this marks them for discard per the ogg vorbis spec. |
628 {FFMPEG, kCodecVorbis, "bear.ogv", kBearOgvExpectations, -704, 44100, | 624 {FFMPEG, kCodecVorbis, "bear.ogv", kBearOgvExpectations, -704, 44100, |
629 CHANNEL_LAYOUT_STEREO}, | 625 CHANNEL_LAYOUT_STEREO}, |
630 }; | 626 }; |
631 | 627 |
632 // Dummy data for behavioral tests. | 628 // Dummy data for behavioral tests. |
633 const DecoderTestData kFFmpegBehavioralTest[] = { | 629 const DecoderTestData kFFmpegBehavioralTest[] = { |
634 {FFMPEG, kUnknownAudioCodec, "", NULL, 0, 0, CHANNEL_LAYOUT_NONE}, | 630 {FFMPEG, kUnknownAudioCodec, "", NULL, 0, 0, CHANNEL_LAYOUT_NONE}, |
635 }; | 631 }; |
636 | 632 |
637 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderTest, | 633 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderTest, |
638 AudioDecoderTest, | 634 AudioDecoderTest, |
639 testing::ValuesIn(kFFmpegTests)); | 635 testing::ValuesIn(kFFmpegTests)); |
640 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderBehavioralTest, | 636 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderBehavioralTest, |
641 FFmpegAudioDecoderBehavioralTest, | 637 FFmpegAudioDecoderBehavioralTest, |
642 testing::ValuesIn(kFFmpegBehavioralTest)); | 638 testing::ValuesIn(kFFmpegBehavioralTest)); |
643 | 639 |
644 } // namespace media | 640 } // namespace media |
OLD | NEW |