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/gpu_video_decoder.h" | 5 #include "media/filters/gpu_video_decoder.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 } | 80 } |
| 81 | 81 |
| 82 // Throw away any already-decoded, not-yet-delivered frames. | 82 // Throw away any already-decoded, not-yet-delivered frames. |
| 83 ready_video_frames_.clear(); | 83 ready_video_frames_.clear(); |
| 84 | 84 |
| 85 if (!vda_.get()) { | 85 if (!vda_.get()) { |
| 86 gvd_loop_proxy_->PostTask(FROM_HERE, closure); | 86 gvd_loop_proxy_->PostTask(FROM_HERE, closure); |
| 87 return; | 87 return; |
| 88 } | 88 } |
| 89 | 89 |
| 90 // VideoRendererBase::Flush() can't complete while it has a pending read to | |
| 91 // us, so we fulfill such a read here. | |
|
xhwang
2013/04/18 03:18:36
This is VideoDecoder API implementation and we don
| |
| 92 if (!pending_read_cb_.is_null()) | 90 if (!pending_read_cb_.is_null()) |
| 93 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEmptyFrame()); | 91 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEmptyFrame()); |
| 94 | 92 |
| 95 DCHECK(pending_reset_cb_.is_null()); | 93 DCHECK(pending_reset_cb_.is_null()); |
| 96 pending_reset_cb_ = BindToCurrentLoop(closure); | 94 pending_reset_cb_ = BindToCurrentLoop(closure); |
| 97 | 95 |
| 98 vda_loop_proxy_->PostTask(FROM_HERE, base::Bind( | 96 vda_loop_proxy_->PostTask(FROM_HERE, base::Bind( |
| 99 &VideoDecodeAccelerator::Reset, weak_vda_)); | 97 &VideoDecodeAccelerator::Reset, weak_vda_)); |
| 100 } | 98 } |
| 101 | 99 |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 613 | 611 |
| 614 error_occured_ = true; | 612 error_occured_ = true; |
| 615 | 613 |
| 616 if (!pending_read_cb_.is_null()) { | 614 if (!pending_read_cb_.is_null()) { |
| 617 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); | 615 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); |
| 618 return; | 616 return; |
| 619 } | 617 } |
| 620 } | 618 } |
| 621 | 619 |
| 622 } // namespace media | 620 } // namespace media |
| OLD | NEW |