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/video_renderer_base.h" | 5 #include "media/filters/video_renderer_base.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/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 playback_rate_(0), | 41 playback_rate_(0), |
42 paint_cb_(paint_cb), | 42 paint_cb_(paint_cb), |
43 set_opaque_cb_(set_opaque_cb), | 43 set_opaque_cb_(set_opaque_cb), |
44 last_timestamp_(kNoTimestamp()) { | 44 last_timestamp_(kNoTimestamp()) { |
45 DCHECK(!paint_cb_.is_null()); | 45 DCHECK(!paint_cb_.is_null()); |
46 } | 46 } |
47 | 47 |
48 VideoRendererBase::~VideoRendererBase() { | 48 VideoRendererBase::~VideoRendererBase() { |
49 base::AutoLock auto_lock(lock_); | 49 base::AutoLock auto_lock(lock_); |
50 CHECK(state_ == kStopped || state_ == kUninitialized) << state_; | 50 CHECK(state_ == kStopped || state_ == kUninitialized) << state_; |
51 CHECK_EQ(thread_, base::kNullThreadHandle); | 51 CHECK(thread_ == base::kNullThreadHandle); |
52 } | 52 } |
53 | 53 |
54 void VideoRendererBase::Play(const base::Closure& callback) { | 54 void VideoRendererBase::Play(const base::Closure& callback) { |
55 DCHECK(message_loop_->BelongsToCurrentThread()); | 55 DCHECK(message_loop_->BelongsToCurrentThread()); |
56 base::AutoLock auto_lock(lock_); | 56 base::AutoLock auto_lock(lock_); |
57 DCHECK_EQ(kPrerolled, state_); | 57 DCHECK_EQ(kPrerolled, state_); |
58 state_ = kPlaying; | 58 state_ = kPlaying; |
59 callback.Run(); | 59 callback.Run(); |
60 } | 60 } |
61 | 61 |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 // Because we might remain in the prerolled state for an undetermined amount | 530 // Because we might remain in the prerolled state for an undetermined amount |
531 // of time (e.g., we seeked while paused), we'll paint the first prerolled | 531 // of time (e.g., we seeked while paused), we'll paint the first prerolled |
532 // frame. | 532 // frame. |
533 if (!ready_frames_.empty()) | 533 if (!ready_frames_.empty()) |
534 PaintNextReadyFrame_Locked(); | 534 PaintNextReadyFrame_Locked(); |
535 | 535 |
536 base::ResetAndReturn(&preroll_cb_).Run(PIPELINE_OK); | 536 base::ResetAndReturn(&preroll_cb_).Run(PIPELINE_OK); |
537 } | 537 } |
538 | 538 |
539 } // namespace media | 539 } // namespace media |
OLD | NEW |