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/base/pipeline.cc

Issue 10857018: Upgrade Pipeline::Start() NOTREACHED() back into a CHECK(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: Created 8 years, 4 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/base/pipeline.h" 5 #include "media/base/pipeline.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 media_log_->AddEvent( 104 media_log_->AddEvent(
105 media_log_->CreateEvent(MediaLogEvent::PIPELINE_DESTROYED)); 105 media_log_->CreateEvent(MediaLogEvent::PIPELINE_DESTROYED));
106 } 106 }
107 107
108 void Pipeline::Start(scoped_ptr<FilterCollection> collection, 108 void Pipeline::Start(scoped_ptr<FilterCollection> collection,
109 const PipelineStatusCB& ended_cb, 109 const PipelineStatusCB& ended_cb,
110 const PipelineStatusCB& error_cb, 110 const PipelineStatusCB& error_cb,
111 const PipelineStatusCB& start_cb) { 111 const PipelineStatusCB& start_cb) {
112 base::AutoLock auto_lock(lock_); 112 base::AutoLock auto_lock(lock_);
113 if (running_) { 113 CHECK(!running_) << "Media pipeline is already running";
114 NOTREACHED() << "Media pipeline is already running";
115 return;
116 }
117 114
118 running_ = true; 115 running_ = true;
119 message_loop_->PostTask(FROM_HERE, base::Bind( 116 message_loop_->PostTask(FROM_HERE, base::Bind(
120 &Pipeline::StartTask, this, base::Passed(&collection), 117 &Pipeline::StartTask, this, base::Passed(&collection),
121 ended_cb, error_cb, start_cb)); 118 ended_cb, error_cb, start_cb));
122 } 119 }
123 120
124 void Pipeline::Stop(const base::Closure& stop_cb) { 121 void Pipeline::Stop(const base::Closure& stop_cb) {
125 base::AutoLock auto_lock(lock_); 122 base::AutoLock auto_lock(lock_);
126 message_loop_->PostTask(FROM_HERE, base::Bind( 123 message_loop_->PostTask(FROM_HERE, base::Bind(
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 statistics_.video_frames_decoded += stats.video_frames_decoded; 547 statistics_.video_frames_decoded += stats.video_frames_decoded;
551 statistics_.video_frames_dropped += stats.video_frames_dropped; 548 statistics_.video_frames_dropped += stats.video_frames_dropped;
552 } 549 }
553 550
554 void Pipeline::StartTask(scoped_ptr<FilterCollection> filter_collection, 551 void Pipeline::StartTask(scoped_ptr<FilterCollection> filter_collection,
555 const PipelineStatusCB& ended_cb, 552 const PipelineStatusCB& ended_cb,
556 const PipelineStatusCB& error_cb, 553 const PipelineStatusCB& error_cb,
557 const PipelineStatusCB& start_cb) { 554 const PipelineStatusCB& start_cb) {
558 DCHECK(message_loop_->BelongsToCurrentThread()); 555 DCHECK(message_loop_->BelongsToCurrentThread());
559 DCHECK_EQ(kCreated, state_); 556 DCHECK_EQ(kCreated, state_);
557 if (state_ != kCreated)
Ami GONE FROM CHROMIUM 2012/08/15 18:04:38 wat?
Ami GONE FROM CHROMIUM 2012/08/15 18:10:27 Per offline convo, promote DCHECK above to CHECK,
558 return;
559
560 filter_collection_ = filter_collection.Pass(); 560 filter_collection_ = filter_collection.Pass();
561 ended_cb_ = ended_cb; 561 ended_cb_ = ended_cb;
562 error_cb_ = error_cb; 562 error_cb_ = error_cb;
563 seek_cb_ = start_cb; 563 seek_cb_ = start_cb;
564 564
565 // Kick off initialization. 565 // Kick off initialization.
566 pipeline_init_state_.reset(new PipelineInitState()); 566 pipeline_init_state_.reset(new PipelineInitState());
567 567
568 SetState(kInitDemuxer); 568 SetState(kInitDemuxer);
569 InitializeDemuxer(); 569 InitializeDemuxer();
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { 1217 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() {
1218 lock_.AssertAcquired(); 1218 lock_.AssertAcquired();
1219 if (!waiting_for_clock_update_) 1219 if (!waiting_for_clock_update_)
1220 return; 1220 return;
1221 1221
1222 waiting_for_clock_update_ = false; 1222 waiting_for_clock_update_ = false;
1223 clock_->Play(); 1223 clock_->Play();
1224 } 1224 }
1225 1225
1226 } // namespace media 1226 } // 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