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

Side by Side Diff: media/base/pipeline.cc

Issue 416393003: Make Demuxer::Stop() synchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android Created 6 years, 3 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/mock_filters.h ('k') | media/base/pipeline_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 (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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 403
404 void Pipeline::DoStop(const PipelineStatusCB& done_cb) { 404 void Pipeline::DoStop(const PipelineStatusCB& done_cb) {
405 DVLOG(2) << __FUNCTION__; 405 DVLOG(2) << __FUNCTION__;
406 DCHECK(task_runner_->BelongsToCurrentThread()); 406 DCHECK(task_runner_->BelongsToCurrentThread());
407 DCHECK(!pending_callbacks_.get()); 407 DCHECK(!pending_callbacks_.get());
408 408
409 renderer_.reset(); 409 renderer_.reset();
410 text_renderer_.reset(); 410 text_renderer_.reset();
411 411
412 if (demuxer_) { 412 if (demuxer_) {
413 demuxer_->Stop(base::Bind(done_cb, PIPELINE_OK)); 413 demuxer_->Stop();
414 return; 414 demuxer_ = NULL;
415 } 415 }
416 416
417 task_runner_->PostTask(FROM_HERE, base::Bind(done_cb, PIPELINE_OK)); 417 task_runner_->PostTask(FROM_HERE, base::Bind(done_cb, PIPELINE_OK));
418 } 418 }
419 419
420 void Pipeline::OnStopCompleted(PipelineStatus status) { 420 void Pipeline::OnStopCompleted(PipelineStatus status) {
421 DVLOG(2) << __FUNCTION__; 421 DVLOG(2) << __FUNCTION__;
422 DCHECK(task_runner_->BelongsToCurrentThread()); 422 DCHECK(task_runner_->BelongsToCurrentThread());
423 DCHECK_EQ(state_, kStopping); 423 DCHECK_EQ(state_, kStopping);
424 DCHECK(!renderer_); 424 DCHECK(!renderer_);
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 metadata_cb_.Run(metadata); 700 metadata_cb_.Run(metadata);
701 } 701 }
702 702
703 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { 703 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) {
704 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; 704 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") ";
705 DCHECK(task_runner_->BelongsToCurrentThread()); 705 DCHECK(task_runner_->BelongsToCurrentThread());
706 buffering_state_cb_.Run(new_buffering_state); 706 buffering_state_cb_.Run(new_buffering_state);
707 } 707 }
708 708
709 } // namespace media 709 } // namespace media
OLDNEW
« no previous file with comments | « media/base/mock_filters.h ('k') | media/base/pipeline_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698