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

Side by Side Diff: media/filters/gpu_video_decoder.cc

Issue 10536122: Ensure GpuVideoDecoder satisfies outstanding reads before firing callback indicating it is reset. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 "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/callback_helpers.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 DCHECK(!closure.is_null()); 80 DCHECK(!closure.is_null());
81 81
82 // VideoRendererBase::Flush() can't complete while it has a pending read to 82 // VideoRendererBase::Flush() can't complete while it has a pending read to
83 // us, so we fulfill such a read here. 83 // us, so we fulfill such a read here.
84 if (!pending_read_cb_.is_null()) 84 if (!pending_read_cb_.is_null())
85 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEmptyFrame()); 85 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEmptyFrame());
86 86
87 if (shutting_down_) { 87 if (shutting_down_) {
88 // Immediately fire the callback instead of waiting for the reset to 88 // Immediately fire the callback instead of waiting for the reset to
89 // complete (which will happen after PipelineImpl::Stop() completes). 89 // complete (which will happen after PipelineImpl::Stop() completes).
90 closure.Run(); 90 gvd_loop_proxy_->PostTask(FROM_HERE, closure);
91 } else { 91 } else {
92 pending_reset_cb_ = closure; 92 pending_reset_cb_ = closure;
93 } 93 }
94 94
95 vda_loop_proxy_->PostTask(FROM_HERE, base::Bind( 95 vda_loop_proxy_->PostTask(FROM_HERE, base::Bind(
96 &VideoDecodeAccelerator::Reset, vda_)); 96 &VideoDecodeAccelerator::Reset, vda_));
97 } 97 }
98 98
99 void GpuVideoDecoder::Stop(const base::Closure& closure) { 99 void GpuVideoDecoder::Stop(const base::Closure& closure) {
100 if (!gvd_loop_proxy_->BelongsToCurrentThread()) { 100 if (!gvd_loop_proxy_->BelongsToCurrentThread()) {
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 535
536 error_occured_ = true; 536 error_occured_ = true;
537 537
538 if (!pending_read_cb_.is_null()) { 538 if (!pending_read_cb_.is_null()) {
539 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); 539 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL);
540 return; 540 return;
541 } 541 }
542 } 542 }
543 543
544 } // namespace media 544 } // 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