Chromium Code Reviews| 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 base::TimeDelta timestamp_offset; | |
| 328 chunk_demuxer_->Abort( | |
| 329 kSourceId, | |
| 330 base::TimeDelta(), kInfiniteDuration(), ×tamp_offset); | |
|
wolenetz
2014/05/06 00:58:11
nit: Let's use &last_timestamp_offset_ here and dr
damienv1
2014/05/06 01:21:44
Done.
| |
| 331 last_timestamp_offset_ = timestamp_offset; | |
| 326 | 332 |
| 327 DCHECK_GE(new_position, 0); | 333 DCHECK_GE(new_position, 0); |
| 328 DCHECK_LT(new_position, file_data_->data_size()); | 334 DCHECK_LT(new_position, file_data_->data_size()); |
| 329 current_position_ = new_position; | 335 current_position_ = new_position; |
| 330 | 336 |
| 331 AppendData(seek_append_size); | 337 AppendData(seek_append_size); |
| 332 } | 338 } |
| 333 | 339 |
| 334 void AppendData(int size) { | 340 void AppendData(int size) { |
| 335 DCHECK(chunk_demuxer_); | 341 DCHECK(chunk_demuxer_); |
| 336 DCHECK_LT(current_position_, file_data_->data_size()); | 342 DCHECK_LT(current_position_, file_data_->data_size()); |
| 337 DCHECK_LE(current_position_ + size, file_data_->data_size()); | 343 DCHECK_LE(current_position_ + size, file_data_->data_size()); |
| 338 | 344 |
| 339 // TODO(wolenetz): Test timestamp offset updating once "sequence" append | 345 // TODO(wolenetz): Test timestamp offset updating once "sequence" append |
| 340 // mode processing is implemented. See http://crbug.com/249422. | 346 // mode processing is implemented. See http://crbug.com/249422. |
| 341 base::TimeDelta timestamp_offset; | 347 base::TimeDelta timestamp_offset; |
| 342 chunk_demuxer_->AppendData( | 348 chunk_demuxer_->AppendData( |
| 343 kSourceId, file_data_->data() + current_position_, size, | 349 kSourceId, file_data_->data() + current_position_, size, |
| 344 base::TimeDelta(), kInfiniteDuration(), ×tamp_offset); | 350 base::TimeDelta(), kInfiniteDuration(), ×tamp_offset); |
|
wolenetz
2014/05/06 00:58:11
nit: ditto. Similarly, there are not two AppendDat
damienv1
2014/05/06 01:21:44
Done.
| |
| 345 current_position_ += size; | 351 current_position_ += size; |
| 346 last_timestamp_offset_ = timestamp_offset; | 352 last_timestamp_offset_ = timestamp_offset; |
| 347 } | 353 } |
| 348 | 354 |
| 349 void AppendAtTime(base::TimeDelta timestamp_offset, | 355 void AppendAtTime(base::TimeDelta timestamp_offset, |
| 350 const uint8* pData, | 356 const uint8* pData, |
| 351 int size) { | 357 int size) { |
| 352 CHECK(!chunk_demuxer_->IsParsingMediaSegment(kSourceId)); | 358 CHECK(!chunk_demuxer_->IsParsingMediaSegment(kSourceId)); |
| 353 chunk_demuxer_->AppendData(kSourceId, pData, size, | 359 chunk_demuxer_->AppendData(kSourceId, pData, size, |
| 354 base::TimeDelta(), kInfiniteDuration(), | 360 base::TimeDelta(), kInfiniteDuration(), |
| (...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1274 Play(); | 1280 Play(); |
| 1275 ASSERT_TRUE(WaitUntilOnEnded()); | 1281 ASSERT_TRUE(WaitUntilOnEnded()); |
| 1276 } | 1282 } |
| 1277 | 1283 |
| 1278 // TODO(wolenetz): Enable MSE testing of new frame processor based on this flag, | 1284 // 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. | 1285 // once the new processor has landed. See http://crbug.com/249422. |
| 1280 INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, PipelineIntegrationTest, | 1286 INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, PipelineIntegrationTest, |
| 1281 Values(true)); | 1287 Values(true)); |
| 1282 | 1288 |
| 1283 } // namespace media | 1289 } // namespace media |
| OLD | NEW |