Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: media/gpu/dxva_video_decode_accelerator_win.cc

Issue 2366213004: Allow resetting DXVAVDA while it's currently flushing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ensure notify happens Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698