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