| 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/gpu/dxva_video_decode_accelerator_win.h" | 5 #include "media/gpu/dxva_video_decode_accelerator_win.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #if !defined(OS_WIN) | 9 #if !defined(OS_WIN) |
| 10 #error This file should only be built on Windows. | 10 #error This file should only be built on Windows. |
| (...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, | 994 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, |
| 995 base::Unretained(this))); | 995 base::Unretained(this))); |
| 996 } | 996 } |
| 997 | 997 |
| 998 void DXVAVideoDecodeAccelerator::Reset() { | 998 void DXVAVideoDecodeAccelerator::Reset() { |
| 999 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 999 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
| 1000 | 1000 |
| 1001 DVLOG(1) << "DXVAVideoDecodeAccelerator::Reset"; | 1001 DVLOG(1) << "DXVAVideoDecodeAccelerator::Reset"; |
| 1002 | 1002 |
| 1003 State state = GetState(); | 1003 State state = GetState(); |
| 1004 RETURN_AND_NOTIFY_ON_FAILURE((state == kNormal || state == kStopped), | 1004 RETURN_AND_NOTIFY_ON_FAILURE( |
| 1005 "Reset: invalid state: " << state, | 1005 (state == kNormal || state == kStopped || state == kFlushing), |
| 1006 ILLEGAL_STATE, ); | 1006 "Reset: invalid state: " << state, ILLEGAL_STATE, ); |
| 1007 | 1007 |
| 1008 decoder_thread_.Stop(); | 1008 decoder_thread_.Stop(); |
| 1009 | 1009 |
| 1010 if (state == kFlushing) |
| 1011 NotifyFlushDone(); |
| 1012 |
| 1010 SetState(kResetting); | 1013 SetState(kResetting); |
| 1011 | 1014 |
| 1012 // If we have pending output frames waiting for display then we drop those | 1015 // If we have pending output frames waiting for display then we drop those |
| 1013 // frames and set the corresponding picture buffer as available. | 1016 // frames and set the corresponding picture buffer as available. |
| 1014 PendingOutputSamples::iterator index; | 1017 PendingOutputSamples::iterator index; |
| 1015 for (index = pending_output_samples_.begin(); | 1018 for (index = pending_output_samples_.begin(); |
| 1016 index != pending_output_samples_.end(); ++index) { | 1019 index != pending_output_samples_.end(); ++index) { |
| 1017 if (index->picture_buffer_id != -1) { | 1020 if (index->picture_buffer_id != -1) { |
| 1018 OutputBuffers::iterator it = | 1021 OutputBuffers::iterator it = |
| 1019 output_picture_buffers_.find(index->picture_buffer_id); | 1022 output_picture_buffers_.find(index->picture_buffer_id); |
| (...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2685 SetState(kConfigChange); | 2688 SetState(kConfigChange); |
| 2686 Invalidate(); | 2689 Invalidate(); |
| 2687 Initialize(config_, client_); | 2690 Initialize(config_, client_); |
| 2688 decoder_thread_task_runner_->PostTask( | 2691 decoder_thread_task_runner_->PostTask( |
| 2689 FROM_HERE, | 2692 FROM_HERE, |
| 2690 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, | 2693 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, |
| 2691 base::Unretained(this))); | 2694 base::Unretained(this))); |
| 2692 } | 2695 } |
| 2693 | 2696 |
| 2694 } // namespace media | 2697 } // namespace media |
| OLD | NEW |