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

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

Issue 178153004: Enable round-tripping and updating of WebSourceBufferImpl timestamp offset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Allow NULL for WSBI::append()'s |new_timestamp_offset| parameter Created 6 years, 9 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
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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 286
287 chunk_demuxer_->Abort(kSourceId); 287 chunk_demuxer_->Abort(kSourceId);
288 288
289 DCHECK_GE(new_position, 0); 289 DCHECK_GE(new_position, 0);
290 DCHECK_LT(new_position, file_data_->data_size()); 290 DCHECK_LT(new_position, file_data_->data_size());
291 current_position_ = new_position; 291 current_position_ = new_position;
292 292
293 AppendData(seek_append_size); 293 AppendData(seek_append_size);
294 } 294 }
295 295
296 void AppendDataExpectingNoTimestampOffsetUpdate(const uint8* data, int size) {
297 // TODO(wolenetz): Test timestamp offset updating once "sequence" append
298 // mode processing is implemented. See http://crbug.com/249422.
299 base::TimeDelta dummy_new_timestamp_offset;
300 chunk_demuxer_->AppendData(kSourceId, data, size,
301 &dummy_new_timestamp_offset);
302 EXPECT_EQ(kNoTimestamp(), dummy_new_timestamp_offset);
303 }
304
296 void AppendData(int size) { 305 void AppendData(int size) {
297 DCHECK(chunk_demuxer_); 306 DCHECK(chunk_demuxer_);
298 DCHECK_LT(current_position_, file_data_->data_size()); 307 DCHECK_LT(current_position_, file_data_->data_size());
299 DCHECK_LE(current_position_ + size, file_data_->data_size()); 308 DCHECK_LE(current_position_ + size, file_data_->data_size());
300 chunk_demuxer_->AppendData( 309
301 kSourceId, file_data_->data() + current_position_, size); 310 AppendDataExpectingNoTimestampOffsetUpdate(
311 file_data_->data() + current_position_, size);
302 current_position_ += size; 312 current_position_ += size;
303 } 313 }
304 314
305 void AppendAtTime(const base::TimeDelta& timestampOffset, 315 void AppendAtTime(const base::TimeDelta& timestampOffset,
306 const uint8* pData, int size) { 316 const uint8* pData, int size) {
307 CHECK(chunk_demuxer_->SetTimestampOffset(kSourceId, timestampOffset)); 317 CHECK(chunk_demuxer_->SetTimestampOffset(kSourceId, timestampOffset));
308 chunk_demuxer_->AppendData(kSourceId, pData, size); 318 AppendDataExpectingNoTimestampOffsetUpdate(pData, size);
309 CHECK(chunk_demuxer_->SetTimestampOffset(kSourceId, base::TimeDelta())); 319 CHECK(chunk_demuxer_->SetTimestampOffset(kSourceId, base::TimeDelta()));
310 } 320 }
311 321
312 void EndOfStream() { 322 void EndOfStream() {
313 chunk_demuxer_->MarkEndOfStream(PIPELINE_OK); 323 chunk_demuxer_->MarkEndOfStream(PIPELINE_OK);
314 } 324 }
315 325
316 void Abort() { 326 void Abort() {
317 if (!chunk_demuxer_) 327 if (!chunk_demuxer_)
318 return; 328 return;
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 // Verify that VP8 video with inband text track can be played back. 1122 // Verify that VP8 video with inband text track can be played back.
1113 TEST_F(PipelineIntegrationTest, 1123 TEST_F(PipelineIntegrationTest,
1114 BasicPlayback_VP8_WebVTT_WebM) { 1124 BasicPlayback_VP8_WebVTT_WebM) {
1115 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"), 1125 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"),
1116 PIPELINE_OK)); 1126 PIPELINE_OK));
1117 Play(); 1127 Play();
1118 ASSERT_TRUE(WaitUntilOnEnded()); 1128 ASSERT_TRUE(WaitUntilOnEnded());
1119 } 1129 }
1120 1130
1121 } // namespace media 1131 } // namespace media
OLDNEW
« media/filters/chunk_demuxer.cc ('K') | « media/filters/chunk_demuxer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698