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

Side by Side Diff: content/common/gpu/media/dxva_video_decode_accelerator.cc

Issue 10827095: Drop pending output pictures on DXVA::Reset(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« 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 "content/common/gpu/media/dxva_video_decode_accelerator.h" 5 #include "content/common/gpu/media/dxva_video_decode_accelerator.h"
6 6
7 #if !defined(OS_WIN) 7 #if !defined(OS_WIN)
8 #error This file should only be built on Windows. 8 #error This file should only be built on Windows.
9 #endif // !defined(OS_WIN) 9 #endif // !defined(OS_WIN)
10 10
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 void DXVAVideoDecodeAccelerator::Reset() { 667 void DXVAVideoDecodeAccelerator::Reset() {
668 DCHECK(CalledOnValidThread()); 668 DCHECK(CalledOnValidThread());
669 669
670 DVLOG(1) << "DXVAVideoDecodeAccelerator::Reset"; 670 DVLOG(1) << "DXVAVideoDecodeAccelerator::Reset";
671 671
672 RETURN_AND_NOTIFY_ON_FAILURE((state_ == kNormal || state_ == kStopped), 672 RETURN_AND_NOTIFY_ON_FAILURE((state_ == kNormal || state_ == kStopped),
673 "Reset: invalid state: " << state_, ILLEGAL_STATE,); 673 "Reset: invalid state: " << state_, ILLEGAL_STATE,);
674 674
675 state_ = kResetting; 675 state_ = kResetting;
676 676
677 pending_output_samples_.clear();
678
677 RETURN_AND_NOTIFY_ON_FAILURE(SendMFTMessage(MFT_MESSAGE_COMMAND_FLUSH, 0), 679 RETURN_AND_NOTIFY_ON_FAILURE(SendMFTMessage(MFT_MESSAGE_COMMAND_FLUSH, 0),
678 "Reset: Failed to send message.", PLATFORM_FAILURE,); 680 "Reset: Failed to send message.", PLATFORM_FAILURE,);
679 681
680 MessageLoop::current()->PostTask(FROM_HERE, base::Bind( 682 MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
681 &DXVAVideoDecodeAccelerator::NotifyResetDone, base::AsWeakPtr(this))); 683 &DXVAVideoDecodeAccelerator::NotifyResetDone, base::AsWeakPtr(this)));
682 684
683 state_ = DXVAVideoDecodeAccelerator::kNormal; 685 state_ = DXVAVideoDecodeAccelerator::kNormal;
684 } 686 }
685 687
686 void DXVAVideoDecodeAccelerator::Destroy() { 688 void DXVAVideoDecodeAccelerator::Destroy() {
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 GL_TEXTURE_2D); 1044 GL_TEXTURE_2D);
1043 } 1045 }
1044 } 1046 }
1045 1047
1046 void DXVAVideoDecodeAccelerator::NotifyPictureReady( 1048 void DXVAVideoDecodeAccelerator::NotifyPictureReady(
1047 const media::Picture& picture) { 1049 const media::Picture& picture) {
1048 // This task could execute after the decoder has been torn down. 1050 // This task could execute after the decoder has been torn down.
1049 if (state_ != kUninitialized && client_) 1051 if (state_ != kUninitialized && client_)
1050 client_->PictureReady(picture); 1052 client_->PictureReady(picture);
1051 } 1053 }
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