| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/video_renderer_impl.h" | 5 #include "media/filters/video_renderer_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 DCHECK(task_runner_->BelongsToCurrentThread()); | 50 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 51 | 51 |
| 52 { | 52 { |
| 53 base::AutoLock auto_lock(lock_); | 53 base::AutoLock auto_lock(lock_); |
| 54 is_shutting_down_ = true; | 54 is_shutting_down_ = true; |
| 55 frame_available_.Signal(); | 55 frame_available_.Signal(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 if (!thread_.is_null()) | 58 if (!thread_.is_null()) |
| 59 base::PlatformThread::Join(thread_); | 59 base::PlatformThread::Join(thread_); |
| 60 |
| 61 if (!init_cb_.is_null()) |
| 62 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_ABORT); |
| 63 |
| 64 if (!flush_cb_.is_null()) |
| 65 base::ResetAndReturn(&flush_cb_).Run(); |
| 60 } | 66 } |
| 61 | 67 |
| 62 void VideoRendererImpl::Flush(const base::Closure& callback) { | 68 void VideoRendererImpl::Flush(const base::Closure& callback) { |
| 63 DCHECK(task_runner_->BelongsToCurrentThread()); | 69 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 64 base::AutoLock auto_lock(lock_); | 70 base::AutoLock auto_lock(lock_); |
| 65 DCHECK_EQ(state_, kPlaying); | 71 DCHECK_EQ(state_, kPlaying); |
| 66 flush_cb_ = callback; | 72 flush_cb_ = callback; |
| 67 state_ = kFlushing; | 73 state_ = kFlushing; |
| 68 | 74 |
| 69 // This is necessary if the |video_frame_stream_| has already seen an end of | 75 // This is necessary if the |video_frame_stream_| has already seen an end of |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 statistics_cb_.Run(statistics); | 457 statistics_cb_.Run(statistics); |
| 452 | 458 |
| 453 frames_decoded_ = 0; | 459 frames_decoded_ = 0; |
| 454 frames_dropped_ = 0; | 460 frames_dropped_ = 0; |
| 455 } | 461 } |
| 456 | 462 |
| 457 frame_available_.TimedWait(wait_duration); | 463 frame_available_.TimedWait(wait_duration); |
| 458 } | 464 } |
| 459 | 465 |
| 460 } // namespace media | 466 } // namespace media |
| OLD | NEW |