| OLD | NEW |
| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 AppendData(seek_append_size); | 293 AppendData(seek_append_size); |
| 294 } | 294 } |
| 295 | 295 |
| 296 void AppendData(int size) { | 296 void AppendData(int size) { |
| 297 DCHECK(chunk_demuxer_); | 297 DCHECK(chunk_demuxer_); |
| 298 DCHECK_LT(current_position_, file_data_->data_size()); | 298 DCHECK_LT(current_position_, file_data_->data_size()); |
| 299 DCHECK_LE(current_position_ + size, file_data_->data_size()); | 299 DCHECK_LE(current_position_ + size, file_data_->data_size()); |
| 300 | 300 |
| 301 // TODO(wolenetz): Test timestamp offset updating once "sequence" append | 301 // TODO(wolenetz): Test timestamp offset updating once "sequence" append |
| 302 // mode processing is implemented. See http://crbug.com/249422. | 302 // mode processing is implemented. See http://crbug.com/249422. |
| 303 base::TimeDelta timestamp_offset; |
| 303 chunk_demuxer_->AppendData( | 304 chunk_demuxer_->AppendData( |
| 304 kSourceId, file_data_->data() + current_position_, size, NULL); | 305 kSourceId, file_data_->data() + current_position_, size, |
| 306 base::TimeDelta(), kInfiniteDuration(), ×tamp_offset); |
| 305 current_position_ += size; | 307 current_position_ += size; |
| 306 } | 308 } |
| 307 | 309 |
| 308 void AppendAtTime(const base::TimeDelta& timestampOffset, | 310 void AppendAtTime(const base::TimeDelta& timestampOffset, |
| 309 const uint8* pData, int size) { | 311 const uint8* pData, int size) { |
| 310 CHECK(chunk_demuxer_->SetTimestampOffset(kSourceId, timestampOffset)); | 312 base::TimeDelta timestamp_offset = timestampOffset; |
| 311 chunk_demuxer_->AppendData(kSourceId, pData, size, NULL); | 313 CHECK(!chunk_demuxer_->IsParsingMediaSegment(kSourceId)); |
| 312 CHECK(chunk_demuxer_->SetTimestampOffset(kSourceId, base::TimeDelta())); | 314 chunk_demuxer_->AppendData(kSourceId, pData, size, |
| 315 base::TimeDelta(), kInfiniteDuration(), |
| 316 ×tamp_offset); |
| 313 } | 317 } |
| 314 | 318 |
| 315 void EndOfStream() { | 319 void EndOfStream() { |
| 316 chunk_demuxer_->MarkEndOfStream(PIPELINE_OK); | 320 chunk_demuxer_->MarkEndOfStream(PIPELINE_OK); |
| 317 } | 321 } |
| 318 | 322 |
| 319 void Abort() { | 323 void Abort() { |
| 320 if (!chunk_demuxer_) | 324 if (!chunk_demuxer_) |
| 321 return; | 325 return; |
| 322 chunk_demuxer_->Shutdown(); | 326 chunk_demuxer_->Shutdown(); |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 // Verify that VP8 video with inband text track can be played back. | 1112 // Verify that VP8 video with inband text track can be played back. |
| 1109 TEST_F(PipelineIntegrationTest, | 1113 TEST_F(PipelineIntegrationTest, |
| 1110 BasicPlayback_VP8_WebVTT_WebM) { | 1114 BasicPlayback_VP8_WebVTT_WebM) { |
| 1111 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"), | 1115 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"), |
| 1112 PIPELINE_OK)); | 1116 PIPELINE_OK)); |
| 1113 Play(); | 1117 Play(); |
| 1114 ASSERT_TRUE(WaitUntilOnEnded()); | 1118 ASSERT_TRUE(WaitUntilOnEnded()); |
| 1115 } | 1119 } |
| 1116 | 1120 |
| 1117 } // namespace media | 1121 } // namespace media |
| OLD | NEW |