| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 | 315 |
| 316 scoped_ptr<Demuxer> GetDemuxer() { return owned_chunk_demuxer_.Pass(); } | 316 scoped_ptr<Demuxer> GetDemuxer() { return owned_chunk_demuxer_.Pass(); } |
| 317 | 317 |
| 318 void set_need_key_cb(const Demuxer::NeedKeyCB& need_key_cb) { | 318 void set_need_key_cb(const Demuxer::NeedKeyCB& need_key_cb) { |
| 319 need_key_cb_ = need_key_cb; | 319 need_key_cb_ = need_key_cb; |
| 320 } | 320 } |
| 321 | 321 |
| 322 void Seek(base::TimeDelta seek_time, int new_position, int seek_append_size) { | 322 void Seek(base::TimeDelta seek_time, int new_position, int seek_append_size) { |
| 323 chunk_demuxer_->StartWaitingForSeek(seek_time); | 323 chunk_demuxer_->StartWaitingForSeek(seek_time); |
| 324 | 324 |
| 325 chunk_demuxer_->Abort(kSourceId); | 325 // TODO(wolenetz): Test timestamp offset updating once "sequence" append |
| 326 // mode processing is implemented. See http://crbug.com/249422. |
| 327 chunk_demuxer_->Abort( |
| 328 kSourceId, |
| 329 base::TimeDelta(), kInfiniteDuration(), &last_timestamp_offset_); |
| 326 | 330 |
| 327 DCHECK_GE(new_position, 0); | 331 DCHECK_GE(new_position, 0); |
| 328 DCHECK_LT(new_position, file_data_->data_size()); | 332 DCHECK_LT(new_position, file_data_->data_size()); |
| 329 current_position_ = new_position; | 333 current_position_ = new_position; |
| 330 | 334 |
| 331 AppendData(seek_append_size); | 335 AppendData(seek_append_size); |
| 332 } | 336 } |
| 333 | 337 |
| 334 void AppendData(int size) { | 338 void AppendData(int size) { |
| 335 DCHECK(chunk_demuxer_); | 339 DCHECK(chunk_demuxer_); |
| 336 DCHECK_LT(current_position_, file_data_->data_size()); | 340 DCHECK_LT(current_position_, file_data_->data_size()); |
| 337 DCHECK_LE(current_position_ + size, file_data_->data_size()); | 341 DCHECK_LE(current_position_ + size, file_data_->data_size()); |
| 338 | 342 |
| 339 // TODO(wolenetz): Test timestamp offset updating once "sequence" append | 343 // TODO(wolenetz): Test timestamp offset updating once "sequence" append |
| 340 // mode processing is implemented. See http://crbug.com/249422. | 344 // mode processing is implemented. See http://crbug.com/249422. |
| 341 base::TimeDelta timestamp_offset; | |
| 342 chunk_demuxer_->AppendData( | 345 chunk_demuxer_->AppendData( |
| 343 kSourceId, file_data_->data() + current_position_, size, | 346 kSourceId, file_data_->data() + current_position_, size, |
| 344 base::TimeDelta(), kInfiniteDuration(), ×tamp_offset); | 347 base::TimeDelta(), kInfiniteDuration(), &last_timestamp_offset_); |
| 345 current_position_ += size; | 348 current_position_ += size; |
| 346 last_timestamp_offset_ = timestamp_offset; | |
| 347 } | 349 } |
| 348 | 350 |
| 349 void AppendAtTime(base::TimeDelta timestamp_offset, | 351 void AppendAtTime(base::TimeDelta timestamp_offset, |
| 350 const uint8* pData, | 352 const uint8* pData, |
| 351 int size) { | 353 int size) { |
| 352 CHECK(!chunk_demuxer_->IsParsingMediaSegment(kSourceId)); | 354 CHECK(!chunk_demuxer_->IsParsingMediaSegment(kSourceId)); |
| 353 chunk_demuxer_->AppendData(kSourceId, pData, size, | 355 chunk_demuxer_->AppendData(kSourceId, pData, size, |
| 354 base::TimeDelta(), kInfiniteDuration(), | 356 base::TimeDelta(), kInfiniteDuration(), |
| 355 ×tamp_offset); | 357 ×tamp_offset); |
| 356 last_timestamp_offset_ = timestamp_offset; | 358 last_timestamp_offset_ = timestamp_offset; |
| (...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1274 Play(); | 1276 Play(); |
| 1275 ASSERT_TRUE(WaitUntilOnEnded()); | 1277 ASSERT_TRUE(WaitUntilOnEnded()); |
| 1276 } | 1278 } |
| 1277 | 1279 |
| 1278 // TODO(wolenetz): Enable MSE testing of new frame processor based on this flag, | 1280 // TODO(wolenetz): Enable MSE testing of new frame processor based on this flag, |
| 1279 // once the new processor has landed. See http://crbug.com/249422. | 1281 // once the new processor has landed. See http://crbug.com/249422. |
| 1280 INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, PipelineIntegrationTest, | 1282 INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, PipelineIntegrationTest, |
| 1281 Values(true)); | 1283 Values(true)); |
| 1282 | 1284 |
| 1283 } // namespace media | 1285 } // namespace media |
| OLD | NEW |