| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 it->second.shm_buffer->shm->Close(); | 574 it->second.shm_buffer->shm->Close(); |
| 575 } | 575 } |
| 576 bitstream_buffers_in_decoder_.clear(); | 576 bitstream_buffers_in_decoder_.clear(); |
| 577 } | 577 } |
| 578 | 578 |
| 579 void GpuVideoDecoder::NotifyFlushDone() { | 579 void GpuVideoDecoder::NotifyFlushDone() { |
| 580 DVLOG(3) << "NotifyFlushDone()"; | 580 DVLOG(3) << "NotifyFlushDone()"; |
| 581 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); | 581 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); |
| 582 DCHECK_EQ(state_, kDrainingDecoder); | 582 DCHECK_EQ(state_, kDrainingDecoder); |
| 583 state_ = kDecoderDrained; | 583 state_ = kDecoderDrained; |
| 584 DeliverFrame(VideoFrame::CreateEOSFrame()); | |
| 585 base::ResetAndReturn(&eos_decode_cb_).Run(kOk); | 584 base::ResetAndReturn(&eos_decode_cb_).Run(kOk); |
| 586 } | 585 } |
| 587 | 586 |
| 588 void GpuVideoDecoder::NotifyResetDone() { | 587 void GpuVideoDecoder::NotifyResetDone() { |
| 589 DVLOG(3) << "NotifyResetDone()"; | 588 DVLOG(3) << "NotifyResetDone()"; |
| 590 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); | 589 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); |
| 591 DCHECK(bitstream_buffers_in_decoder_.empty()); | 590 DCHECK(bitstream_buffers_in_decoder_.empty()); |
| 592 | 591 |
| 593 // This needs to happen after the Reset() on vda_ is done to ensure pictures | 592 // This needs to happen after the Reset() on vda_ is done to ensure pictures |
| 594 // delivered during the reset can find their time data. | 593 // delivered during the reset can find their time data. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 608 DLOG(ERROR) << "VDA Error: " << error; | 607 DLOG(ERROR) << "VDA Error: " << error; |
| 609 DestroyVDA(); | 608 DestroyVDA(); |
| 610 } | 609 } |
| 611 | 610 |
| 612 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 611 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
| 613 const { | 612 const { |
| 614 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 613 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
| 615 } | 614 } |
| 616 | 615 |
| 617 } // namespace media | 616 } // namespace media |
| OLD | NEW |