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

Unified Diff: media/filters/pipeline_integration_test.cc

Issue 278673003: Enable splice frames and partial appends for AAC; with test! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/pipeline_integration_test.cc
diff --git a/media/filters/pipeline_integration_test.cc b/media/filters/pipeline_integration_test.cc
index 2d4c4d9ebe74830fad4912d6b1c58e53b1dd3c8f..761f86d5298f746081ee81eef9adf8b50cadcb6a 100644
--- a/media/filters/pipeline_integration_test.cc
+++ b/media/filters/pipeline_integration_test.cc
@@ -852,24 +852,36 @@ TEST_P(PipelineIntegrationTest, MediaSource_ADTS) {
TEST_P(PipelineIntegrationTest, MediaSource_ADTS_TimestampOffset) {
MockMediaSource source("sfx.adts", kADTS, kAppendWholeFile, GetParam());
- StartPipelineWithMediaSource(&source);
+ StartHashedPipelineWithMediaSource(&source);
EXPECT_EQ(325, source.last_timestamp_offset().InMilliseconds());
+ // Trim off multiple frames off the beginning of the segment which will cause
+ // the first decoded frame to be incorrect if preroll isn't implemented.
wolenetz 2014/05/16 20:06:16 nit: By "preroll", do you really mean partial appe
DaleCurtis 2014/05/16 20:11:56 No I mean preroll as in this won't work if partial
wolenetz 2014/05/16 20:17:32 I understand and lgtm if you meant "this test will
+ const base::TimeDelta adts_preroll_duration =
+ base::TimeDelta::FromSecondsD(2.5 * 1024 / 44100);
+ const base::TimeDelta append_time =
+ source.last_timestamp_offset() - adts_preroll_duration;
+
scoped_refptr<DecoderBuffer> second_file = ReadTestDataFile("sfx.adts");
- source.AppendAtTime(
- source.last_timestamp_offset() - base::TimeDelta::FromMilliseconds(10),
- second_file->data(),
- second_file->data_size());
+ source.AppendAtTimeWithWindow(append_time,
+ append_time + adts_preroll_duration,
+ kInfiniteDuration(),
+ second_file->data(),
+ second_file->data_size());
source.EndOfStream();
- EXPECT_EQ(640, source.last_timestamp_offset().InMilliseconds());
+ EXPECT_EQ(592, source.last_timestamp_offset().InMilliseconds());
EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
- EXPECT_EQ(640, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
+ EXPECT_EQ(592, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
Play();
EXPECT_TRUE(WaitUntilOnEnded());
+
+ // If preroll is not implemented this would be:
+ // 5.85,3.25,5.35,1.45,4.75,1.88,
+ EXPECT_EQ("-0.81,0.97,-1.22,-0.70,-1.76,-0.34,", GetAudioHash());
}
TEST_F(PipelineIntegrationTest, BasicPlaybackHashed_MP3) {
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698