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

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

Issue 9717021: Make Callback::Reset() return a copy to support use-cases where Run() ends up modifying |*this|. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 9 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
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/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "media/base/demuxer_stream.h" 10 #include "media/base/demuxer_stream.h"
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 if (!vda_) 512 if (!vda_)
513 return; 513 return;
514 514
515 DCHECK(ready_video_frames_.empty()); 515 DCHECK(ready_video_frames_.empty());
516 516
517 // This needs to happen after the Reset() on vda_ is done to ensure pictures 517 // This needs to happen after the Reset() on vda_ is done to ensure pictures
518 // delivered during the reset can find their time data. 518 // delivered during the reset can find their time data.
519 input_buffer_time_data_.clear(); 519 input_buffer_time_data_.clear();
520 520
521 if (!pending_reset_cb_.is_null()) 521 if (!pending_reset_cb_.is_null())
522 ResetAndRunCB(&pending_reset_cb_); 522 pending_reset_cb_.ResetAndRun();
523 523
524 if (!pending_read_cb_.is_null()) 524 if (!pending_read_cb_.is_null())
525 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEmptyFrame()); 525 EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEmptyFrame());
526 } 526 }
527 527
528 void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) { 528 void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) {
529 if (!gvd_loop_proxy_->BelongsToCurrentThread()) { 529 if (!gvd_loop_proxy_->BelongsToCurrentThread()) {
530 gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( 530 gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind(
531 &GpuVideoDecoder::NotifyError, this, error)); 531 &GpuVideoDecoder::NotifyError, this, error));
532 return; 532 return;
533 } 533 }
534 if (!vda_) 534 if (!vda_)
535 return; 535 return;
536 vda_ = NULL; 536 vda_ = NULL;
537 DLOG(ERROR) << "VDA Error: " << error; 537 DLOG(ERROR) << "VDA Error: " << error;
538 if (host()) 538 if (host())
539 host()->SetError(PIPELINE_ERROR_DECODE); 539 host()->SetError(PIPELINE_ERROR_DECODE);
540 } 540 }
541 541
542 } // namespace media 542 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698