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

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

Issue 557603002: Fix potential deadlock between Pipeline and VideoRendererImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« 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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 &Demuxer::Seek, base::Unretained(demuxer_), seek_timestamp)); 398 &Demuxer::Seek, base::Unretained(demuxer_), seek_timestamp));
399 399
400 pending_callbacks_ = SerialRunner::Run(bound_fns, done_cb); 400 pending_callbacks_ = SerialRunner::Run(bound_fns, done_cb);
401 } 401 }
402 402
403 void Pipeline::DoStop(const PipelineStatusCB& done_cb) { 403 void Pipeline::DoStop(const PipelineStatusCB& done_cb) {
404 DVLOG(2) << __FUNCTION__; 404 DVLOG(2) << __FUNCTION__;
405 DCHECK(task_runner_->BelongsToCurrentThread()); 405 DCHECK(task_runner_->BelongsToCurrentThread());
406 DCHECK(!pending_callbacks_.get()); 406 DCHECK(!pending_callbacks_.get());
407 407
408 // TODO(scherkus): Enforce that Renderer is only called on a single thread,
409 // even for accessing media time http://crbug.com/370634
410 scoped_ptr<Renderer> renderer;
408 { 411 {
409 base::AutoLock auto_lock(lock_); 412 base::AutoLock auto_lock(lock_);
410 renderer_.reset(); 413 renderer.swap(renderer_);
411 } 414 }
415 renderer.reset();
412 text_renderer_.reset(); 416 text_renderer_.reset();
413 417
414 if (demuxer_) { 418 if (demuxer_) {
415 demuxer_->Stop(); 419 demuxer_->Stop();
416 demuxer_ = NULL; 420 demuxer_ = NULL;
417 } 421 }
418 422
419 task_runner_->PostTask(FROM_HERE, base::Bind(done_cb, PIPELINE_OK)); 423 task_runner_->PostTask(FROM_HERE, base::Bind(done_cb, PIPELINE_OK));
420 } 424 }
421 425
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 metadata_cb_.Run(metadata); 708 metadata_cb_.Run(metadata);
705 } 709 }
706 710
707 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { 711 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) {
708 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; 712 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") ";
709 DCHECK(task_runner_->BelongsToCurrentThread()); 713 DCHECK(task_runner_->BelongsToCurrentThread());
710 buffering_state_cb_.Run(new_buffering_state); 714 buffering_state_cb_.Run(new_buffering_state);
711 } 715 }
712 716
713 } // namespace media 717 } // 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