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/message_loop.h" | 9 #include "base/message_loop.h" |
9 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
10 #include "media/base/demuxer_stream.h" | 11 #include "media/base/demuxer_stream.h" |
11 #include "media/base/filter_host.h" | 12 #include "media/base/filter_host.h" |
12 #include "media/base/pipeline.h" | 13 #include "media/base/pipeline.h" |
13 #include "media/base/video_decoder_config.h" | 14 #include "media/base/video_decoder_config.h" |
14 #include "media/ffmpeg/ffmpeg_common.h" | 15 #include "media/ffmpeg/ffmpeg_common.h" |
15 | 16 |
16 namespace media { | 17 namespace media { |
17 | 18 |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 if (!vda_) | 513 if (!vda_) |
513 return; | 514 return; |
514 | 515 |
515 DCHECK(ready_video_frames_.empty()); | 516 DCHECK(ready_video_frames_.empty()); |
516 | 517 |
517 // This needs to happen after the Reset() on vda_ is done to ensure pictures | 518 // This needs to happen after the Reset() on vda_ is done to ensure pictures |
518 // delivered during the reset can find their time data. | 519 // delivered during the reset can find their time data. |
519 input_buffer_time_data_.clear(); | 520 input_buffer_time_data_.clear(); |
520 | 521 |
521 if (!pending_reset_cb_.is_null()) | 522 if (!pending_reset_cb_.is_null()) |
522 ResetAndRunCB(&pending_reset_cb_); | 523 base::ResetAndReturn(&pending_reset_cb_).Run(); |
523 | 524 |
524 if (!pending_read_cb_.is_null()) | 525 if (!pending_read_cb_.is_null()) |
525 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEmptyFrame()); | 526 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEmptyFrame()); |
526 } | 527 } |
527 | 528 |
528 void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) { | 529 void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) { |
529 if (!gvd_loop_proxy_->BelongsToCurrentThread()) { | 530 if (!gvd_loop_proxy_->BelongsToCurrentThread()) { |
530 gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( | 531 gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( |
531 &GpuVideoDecoder::NotifyError, this, error)); | 532 &GpuVideoDecoder::NotifyError, this, error)); |
532 return; | 533 return; |
533 } | 534 } |
534 if (!vda_) | 535 if (!vda_) |
535 return; | 536 return; |
536 vda_ = NULL; | 537 vda_ = NULL; |
537 DLOG(ERROR) << "VDA Error: " << error; | 538 DLOG(ERROR) << "VDA Error: " << error; |
538 if (host()) | 539 if (host()) |
539 host()->SetError(PIPELINE_ERROR_DECODE); | 540 host()->SetError(PIPELINE_ERROR_DECODE); |
540 } | 541 } |
541 | 542 |
542 } // namespace media | 543 } // namespace media |
OLD | NEW |