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

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

Issue 15993018: Reland: Use a shared thread for media operations (round 3). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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/pipeline.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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 video_renderer_.reset(); 627 video_renderer_.reset();
628 demuxer_ = NULL; 628 demuxer_ = NULL;
629 629
630 // If we stop during initialization/seeking we want to run |seek_cb_| 630 // If we stop during initialization/seeking we want to run |seek_cb_|
631 // followed by |stop_cb_| so we don't leave outstanding callbacks around. 631 // followed by |stop_cb_| so we don't leave outstanding callbacks around.
632 if (!seek_cb_.is_null()) { 632 if (!seek_cb_.is_null()) {
633 base::ResetAndReturn(&seek_cb_).Run(status_); 633 base::ResetAndReturn(&seek_cb_).Run(status_);
634 error_cb_.Reset(); 634 error_cb_.Reset();
635 } 635 }
636 if (!stop_cb_.is_null()) { 636 if (!stop_cb_.is_null()) {
637 error_cb_.Reset();
637 base::ResetAndReturn(&stop_cb_).Run(); 638 base::ResetAndReturn(&stop_cb_).Run();
638 error_cb_.Reset(); 639
640 // NOTE: pipeline may be deleted at this point in time as a result of
641 // executing |stop_cb_|.
642 return;
639 } 643 }
640 if (!error_cb_.is_null()) { 644 if (!error_cb_.is_null()) {
641 DCHECK_NE(status_, PIPELINE_OK); 645 DCHECK_NE(status_, PIPELINE_OK);
642 base::ResetAndReturn(&error_cb_).Run(status_); 646 base::ResetAndReturn(&error_cb_).Run(status_);
643 } 647 }
644 } 648 }
645 649
646 void Pipeline::AddBufferedByteRange(int64 start, int64 end) { 650 void Pipeline::AddBufferedByteRange(int64 start, int64 end) {
647 DCHECK(IsRunning()); 651 DCHECK(IsRunning());
648 base::AutoLock auto_lock(lock_); 652 base::AutoLock auto_lock(lock_);
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { 938 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() {
935 lock_.AssertAcquired(); 939 lock_.AssertAcquired();
936 if (!waiting_for_clock_update_) 940 if (!waiting_for_clock_update_)
937 return; 941 return;
938 942
939 waiting_for_clock_update_ = false; 943 waiting_for_clock_update_ = false;
940 clock_->Play(); 944 clock_->Play();
941 } 945 }
942 946
943 } // namespace media 947 } // namespace media
OLDNEW
« no previous file with comments | « media/base/pipeline.h ('k') | media/base/pipeline_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698