Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: media/filters/pipeline_integration_test.cc

Issue 239423005: Wire up codec_delay() to MP3StreamParser and FFmpegAudioDecoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ResetTimestampState() on config change. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/filters/opus_audio_decoder.cc ('k') | media/formats/mp4/mp4_stream_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "media/filters/pipeline_integration_test_base.h" 5 #include "media/filters/pipeline_integration_test_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); 856 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
857 EXPECT_EQ(640, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); 857 EXPECT_EQ(640, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
858 858
859 Play(); 859 Play();
860 860
861 EXPECT_TRUE(WaitUntilOnEnded()); 861 EXPECT_TRUE(WaitUntilOnEnded());
862 } 862 }
863 863
864 TEST_P(PipelineIntegrationTest, MediaSource_MP3) { 864 TEST_P(PipelineIntegrationTest, MediaSource_MP3) {
865 MockMediaSource source("sfx.mp3", kMP3, kAppendWholeFile, GetParam()); 865 MockMediaSource source("sfx.mp3", kMP3, kAppendWholeFile, GetParam());
866 StartPipelineWithMediaSource(&source); 866 StartHashedPipelineWithMediaSource(&source);
867 source.EndOfStream(); 867 source.EndOfStream();
868 868
869 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); 869 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
870 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); 870 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
871 EXPECT_EQ(313, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); 871 EXPECT_EQ(313, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
872 872
873 Play(); 873 Play();
874 874
875 EXPECT_TRUE(WaitUntilOnEnded()); 875 EXPECT_TRUE(WaitUntilOnEnded());
876
877 // Verify that codec delay was stripped, if it wasn't the hash would be:
878 // "5.16,1.25,7.78,4.29,8.98,2.76,"
879 EXPECT_EQ("5.81,2.71,8.97,4.32,7.83,1.12,", GetAudioHash());
876 } 880 }
877 881
878 TEST_P(PipelineIntegrationTest, MediaSource_MP3_TimestampOffset) { 882 TEST_P(PipelineIntegrationTest, MediaSource_MP3_TimestampOffset) {
879 MockMediaSource source("sfx.mp3", kMP3, kAppendWholeFile, GetParam()); 883 MockMediaSource source("sfx.mp3", kMP3, kAppendWholeFile, GetParam());
880 StartPipelineWithMediaSource(&source); 884 StartPipelineWithMediaSource(&source);
881 EXPECT_EQ(313, source.last_timestamp_offset().InMilliseconds()); 885 EXPECT_EQ(313, source.last_timestamp_offset().InMilliseconds());
882 886
883 scoped_refptr<DecoderBuffer> second_file = ReadTestDataFile("sfx.mp3"); 887 scoped_refptr<DecoderBuffer> second_file = ReadTestDataFile("sfx.mp3");
884 source.AppendAtTime( 888 source.AppendAtTime(
885 source.last_timestamp_offset() - base::TimeDelta::FromMilliseconds(10), 889 source.last_timestamp_offset() - base::TimeDelta::FromMilliseconds(10),
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 Play(); 1288 Play();
1285 ASSERT_TRUE(WaitUntilOnEnded()); 1289 ASSERT_TRUE(WaitUntilOnEnded());
1286 } 1290 }
1287 1291
1288 // TODO(wolenetz): Enable MSE testing of new frame processor based on this flag, 1292 // TODO(wolenetz): Enable MSE testing of new frame processor based on this flag,
1289 // once the new processor has landed. See http://crbug.com/249422. 1293 // once the new processor has landed. See http://crbug.com/249422.
1290 INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, PipelineIntegrationTest, 1294 INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, PipelineIntegrationTest,
1291 Values(true)); 1295 Values(true));
1292 1296
1293 } // namespace media 1297 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/opus_audio_decoder.cc ('k') | media/formats/mp4/mp4_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698