OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 return; | 369 return; |
370 | 370 |
371 base::ThreadTaskRunnerHandle::Get()->PostTask( | 371 base::ThreadTaskRunnerHandle::Get()->PostTask( |
372 FROM_HERE, | 372 FROM_HERE, |
373 base::Bind(&AudioVideoPipelineDeviceTest::FeedVideoBuffer, | 373 base::Bind(&AudioVideoPipelineDeviceTest::FeedVideoBuffer, |
374 base::Unretained(this))); | 374 base::Unretained(this))); |
375 } | 375 } |
376 } | 376 } |
377 | 377 |
378 void AudioVideoPipelineDeviceTest::MonitorLoop() { | 378 void AudioVideoPipelineDeviceTest::MonitorLoop() { |
| 379 // Backend is stopped, no need to monitor the loop any more. |
| 380 if (audio_decoder_ == nullptr && video_decoder_ == nullptr) |
| 381 return; |
| 382 |
379 base::TimeDelta media_time = | 383 base::TimeDelta media_time = |
380 base::TimeDelta::FromMicroseconds(backend_->GetCurrentPts()); | 384 base::TimeDelta::FromMicroseconds(backend_->GetCurrentPts()); |
381 | 385 |
382 if (!pause_pattern_.empty() && | 386 if (!pause_pattern_.empty() && |
383 pause_pattern_[pause_pattern_idx_].delay >= base::TimeDelta() && | 387 pause_pattern_[pause_pattern_idx_].delay >= base::TimeDelta() && |
384 media_time >= pause_time_ + pause_pattern_[pause_pattern_idx_].delay) { | 388 media_time >= pause_time_ + pause_pattern_[pause_pattern_idx_].delay) { |
385 // Do Pause | 389 // Do Pause |
386 backend_->Pause(); | 390 backend_->Pause(); |
387 pause_time_ = base::TimeDelta::FromMicroseconds(backend_->GetCurrentPts()); | 391 pause_time_ = base::TimeDelta::FromMicroseconds(backend_->GetCurrentPts()); |
388 | 392 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 TEST_F(AudioVideoPipelineDeviceTest, WebmPlayback) { | 488 TEST_F(AudioVideoPipelineDeviceTest, WebmPlayback) { |
485 scoped_ptr<base::MessageLoop> message_loop(new base::MessageLoop()); | 489 scoped_ptr<base::MessageLoop> message_loop(new base::MessageLoop()); |
486 | 490 |
487 ConfigureForFile("bear-640x360.webm"); | 491 ConfigureForFile("bear-640x360.webm"); |
488 Start(); | 492 Start(); |
489 message_loop->Run(); | 493 message_loop->Run(); |
490 } | 494 } |
491 | 495 |
492 } // namespace media | 496 } // namespace media |
493 } // namespace chromecast | 497 } // namespace chromecast |
OLD | NEW |