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

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

Issue 414583002: VideoRenderer: Fires all pending callbacks in dtor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « media/base/video_renderer.h ('k') | media/filters/video_renderer_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/video_renderer_impl.h" 5 #include "media/filters/video_renderer_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 DCHECK(task_runner_->BelongsToCurrentThread()); 50 DCHECK(task_runner_->BelongsToCurrentThread());
51 51
52 { 52 {
53 base::AutoLock auto_lock(lock_); 53 base::AutoLock auto_lock(lock_);
54 is_shutting_down_ = true; 54 is_shutting_down_ = true;
55 frame_available_.Signal(); 55 frame_available_.Signal();
56 } 56 }
57 57
58 if (!thread_.is_null()) 58 if (!thread_.is_null())
59 base::PlatformThread::Join(thread_); 59 base::PlatformThread::Join(thread_);
60
61 if (!init_cb_.is_null())
62 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_ABORT);
63
64 if (!flush_cb_.is_null())
65 base::ResetAndReturn(&flush_cb_).Run();
60 } 66 }
61 67
62 void VideoRendererImpl::Flush(const base::Closure& callback) { 68 void VideoRendererImpl::Flush(const base::Closure& callback) {
63 DCHECK(task_runner_->BelongsToCurrentThread()); 69 DCHECK(task_runner_->BelongsToCurrentThread());
64 base::AutoLock auto_lock(lock_); 70 base::AutoLock auto_lock(lock_);
65 DCHECK_EQ(state_, kPlaying); 71 DCHECK_EQ(state_, kPlaying);
66 flush_cb_ = callback; 72 flush_cb_ = callback;
67 state_ = kFlushing; 73 state_ = kFlushing;
68 74
69 // This is necessary if the |video_frame_stream_| has already seen an end of 75 // This is necessary if the |video_frame_stream_| has already seen an end of
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 statistics_cb_.Run(statistics); 457 statistics_cb_.Run(statistics);
452 458
453 frames_decoded_ = 0; 459 frames_decoded_ = 0;
454 frames_dropped_ = 0; 460 frames_dropped_ = 0;
455 } 461 }
456 462
457 frame_available_.TimedWait(wait_duration); 463 frame_available_.TimedWait(wait_duration);
458 } 464 }
459 465
460 } // namespace media 466 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_renderer.h ('k') | media/filters/video_renderer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698