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

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

Issue 10408043: Fix a deadlock in the GPU Video decoding code in the renderer which would occur when the renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 DCHECK(ready_video_frames_.empty()); 470 DCHECK(ready_video_frames_.empty());
471 EnsureDemuxOrDecode(); 471 EnsureDemuxOrDecode();
472 } 472 }
473 } 473 }
474 474
475 void GpuVideoDecoder::EnsureDemuxOrDecode() { 475 void GpuVideoDecoder::EnsureDemuxOrDecode() {
476 DCHECK(gvd_loop_proxy_->BelongsToCurrentThread()); 476 DCHECK(gvd_loop_proxy_->BelongsToCurrentThread());
477 if (demuxer_read_in_progress_) 477 if (demuxer_read_in_progress_)
478 return; 478 return;
479 demuxer_read_in_progress_ = true; 479 demuxer_read_in_progress_ = true;
480 demuxer_stream_->Read(base::Bind( 480 gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind(
481 &GpuVideoDecoder::RequestBufferDecode, this)); 481 &DemuxerStream::Read, demuxer_stream_.get(),
482 base::Bind(&GpuVideoDecoder::RequestBufferDecode, this)));
482 } 483 }
483 484
484 void GpuVideoDecoder::NotifyFlushDone() { 485 void GpuVideoDecoder::NotifyFlushDone() {
485 if (!gvd_loop_proxy_->BelongsToCurrentThread()) { 486 if (!gvd_loop_proxy_->BelongsToCurrentThread()) {
486 gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( 487 gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind(
487 &GpuVideoDecoder::NotifyFlushDone, this)); 488 &GpuVideoDecoder::NotifyFlushDone, this));
488 return; 489 return;
489 } 490 }
490 DCHECK_EQ(state_, kDrainingDecoder); 491 DCHECK_EQ(state_, kDrainingDecoder);
491 state_ = kDecoderDrained; 492 state_ = kDecoderDrained;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 529
529 error_occured_ = true; 530 error_occured_ = true;
530 531
531 if (!pending_read_cb_.is_null()) { 532 if (!pending_read_cb_.is_null()) {
532 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); 533 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL);
533 return; 534 return;
534 } 535 }
535 } 536 }
536 537
537 } // namespace media 538 } // 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