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

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

Issue 1819023002: Merge M50: "Supress pipeline errors during destruction and suspend." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 9 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 | « media/base/demuxer.h ('k') | media/base/pipeline_impl_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_impl.h" 5 #include "media/base/pipeline_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 SetState(kStopping); 578 SetState(kStopping);
579 pending_callbacks_.reset(); 579 pending_callbacks_.reset();
580 DoStop( 580 DoStop(
581 base::Bind(&PipelineImpl::OnStopCompleted, weak_factory_.GetWeakPtr())); 581 base::Bind(&PipelineImpl::OnStopCompleted, weak_factory_.GetWeakPtr()));
582 } 582 }
583 583
584 void PipelineImpl::ErrorChangedTask(PipelineStatus error) { 584 void PipelineImpl::ErrorChangedTask(PipelineStatus error) {
585 DCHECK(task_runner_->BelongsToCurrentThread()); 585 DCHECK(task_runner_->BelongsToCurrentThread());
586 DCHECK_NE(PIPELINE_OK, error) << "PIPELINE_OK isn't an error!"; 586 DCHECK_NE(PIPELINE_OK, error) << "PIPELINE_OK isn't an error!";
587 587
588 media_log_->AddEvent(media_log_->CreatePipelineErrorEvent(error)); 588 // Don't report pipeline error events to the media log here. The embedder will
589 // log this when |error_cb_| is called. If the pipeline is already stopped or
590 // stopping we also don't want to log any event. In case we are suspending or
591 // suspended, the error may be recoverable, so don't propagate it now, instead
592 // let the subsequent seek during resume propagate it if it's unrecoverable.
589 593
590 if (state_ == kStopping || state_ == kStopped) 594 if (state_ == kStopping || state_ == kStopped || state_ == kSuspending ||
595 state_ == kSuspended) {
591 return; 596 return;
597 }
592 598
593 SetState(kStopping); 599 SetState(kStopping);
594 pending_callbacks_.reset(); 600 pending_callbacks_.reset();
595 status_ = error; 601 status_ = error;
596 602
597 DoStop( 603 DoStop(
598 base::Bind(&PipelineImpl::OnStopCompleted, weak_factory_.GetWeakPtr())); 604 base::Bind(&PipelineImpl::OnStopCompleted, weak_factory_.GetWeakPtr()));
599 } 605 }
600 606
601 void PipelineImpl::PlaybackRateChangedTask(double playback_rate) { 607 void PipelineImpl::PlaybackRateChangedTask(double playback_rate) {
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 metadata_cb_.Run(metadata); 867 metadata_cb_.Run(metadata);
862 } 868 }
863 869
864 void PipelineImpl::BufferingStateChanged(BufferingState new_buffering_state) { 870 void PipelineImpl::BufferingStateChanged(BufferingState new_buffering_state) {
865 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; 871 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") ";
866 DCHECK(task_runner_->BelongsToCurrentThread()); 872 DCHECK(task_runner_->BelongsToCurrentThread());
867 buffering_state_cb_.Run(new_buffering_state); 873 buffering_state_cb_.Run(new_buffering_state);
868 } 874 }
869 875
870 } // namespace media 876 } // namespace media
OLDNEW
« no previous file with comments | « media/base/demuxer.h ('k') | media/base/pipeline_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698