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/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 DCHECK(ready_video_frames_.empty()); | 470 DCHECK(ready_video_frames_.empty()); |
471 EnsureDemuxOrDecode(); | 471 EnsureDemuxOrDecode(); |
472 } | 472 } |
473 } | 473 } |
474 | 474 |
475 void GpuVideoDecoder::EnsureDemuxOrDecode() { | 475 void GpuVideoDecoder::EnsureDemuxOrDecode() { |
476 DCHECK(gvd_loop_proxy_->BelongsToCurrentThread()); | 476 DCHECK(gvd_loop_proxy_->BelongsToCurrentThread()); |
477 if (demuxer_read_in_progress_) | 477 if (demuxer_read_in_progress_) |
478 return; | 478 return; |
479 demuxer_read_in_progress_ = true; | 479 demuxer_read_in_progress_ = true; |
480 demuxer_stream_->Read(base::Bind( | 480 gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( |
481 &GpuVideoDecoder::RequestBufferDecode, this)); | 481 &DemuxerStream::Read, demuxer_stream_.get(), |
| 482 base::Bind(&GpuVideoDecoder::RequestBufferDecode, this))); |
482 } | 483 } |
483 | 484 |
484 void GpuVideoDecoder::NotifyFlushDone() { | 485 void GpuVideoDecoder::NotifyFlushDone() { |
485 if (!gvd_loop_proxy_->BelongsToCurrentThread()) { | 486 if (!gvd_loop_proxy_->BelongsToCurrentThread()) { |
486 gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( | 487 gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( |
487 &GpuVideoDecoder::NotifyFlushDone, this)); | 488 &GpuVideoDecoder::NotifyFlushDone, this)); |
488 return; | 489 return; |
489 } | 490 } |
490 DCHECK_EQ(state_, kDrainingDecoder); | 491 DCHECK_EQ(state_, kDrainingDecoder); |
491 state_ = kDecoderDrained; | 492 state_ = kDecoderDrained; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 | 529 |
529 error_occured_ = true; | 530 error_occured_ = true; |
530 | 531 |
531 if (!pending_read_cb_.is_null()) { | 532 if (!pending_read_cb_.is_null()) { |
532 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); | 533 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); |
533 return; | 534 return; |
534 } | 535 } |
535 } | 536 } |
536 | 537 |
537 } // namespace media | 538 } // namespace media |
OLD | NEW |