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

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

Issue 12741012: base: Support setting thread priorities generically. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add id to handle. Created 7 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
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/video_renderer_base.h" 5 #include "media/filters/video_renderer_base.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/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 30 matching lines...) Expand all
41 playback_rate_(0), 41 playback_rate_(0),
42 paint_cb_(paint_cb), 42 paint_cb_(paint_cb),
43 set_opaque_cb_(set_opaque_cb), 43 set_opaque_cb_(set_opaque_cb),
44 last_timestamp_(kNoTimestamp()) { 44 last_timestamp_(kNoTimestamp()) {
45 DCHECK(!paint_cb_.is_null()); 45 DCHECK(!paint_cb_.is_null());
46 } 46 }
47 47
48 VideoRendererBase::~VideoRendererBase() { 48 VideoRendererBase::~VideoRendererBase() {
49 base::AutoLock auto_lock(lock_); 49 base::AutoLock auto_lock(lock_);
50 CHECK(state_ == kStopped || state_ == kUninitialized) << state_; 50 CHECK(state_ == kStopped || state_ == kUninitialized) << state_;
51 CHECK_EQ(thread_, base::kNullThreadHandle); 51 CHECK(thread_ == base::kNullThreadHandle);
52 } 52 }
53 53
54 void VideoRendererBase::Play(const base::Closure& callback) { 54 void VideoRendererBase::Play(const base::Closure& callback) {
55 DCHECK(message_loop_->BelongsToCurrentThread()); 55 DCHECK(message_loop_->BelongsToCurrentThread());
56 base::AutoLock auto_lock(lock_); 56 base::AutoLock auto_lock(lock_);
57 DCHECK_EQ(kPrerolled, state_); 57 DCHECK_EQ(kPrerolled, state_);
58 state_ = kPlaying; 58 state_ = kPlaying;
59 callback.Run(); 59 callback.Run();
60 } 60 }
61 61
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 // Because we might remain in the prerolled state for an undetermined amount 530 // Because we might remain in the prerolled state for an undetermined amount
531 // of time (e.g., we seeked while paused), we'll paint the first prerolled 531 // of time (e.g., we seeked while paused), we'll paint the first prerolled
532 // frame. 532 // frame.
533 if (!ready_frames_.empty()) 533 if (!ready_frames_.empty())
534 PaintNextReadyFrame_Locked(); 534 PaintNextReadyFrame_Locked();
535 535
536 base::ResetAndReturn(&preroll_cb_).Run(PIPELINE_OK); 536 base::ResetAndReturn(&preroll_cb_).Run(PIPELINE_OK);
537 } 537 }
538 538
539 } // namespace media 539 } // namespace media
OLDNEW
« base/threading/platform_thread_posix.cc ('K') | « media/audio/audio_device_thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698