OLD | NEW |
---|---|
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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
519 | 519 |
520 return; | 520 return; |
521 } | 521 } |
522 | 522 |
523 stop_cb_ = stop_cb; | 523 stop_cb_ = stop_cb; |
524 | 524 |
525 // We may already be stopping due to a runtime error. | 525 // We may already be stopping due to a runtime error. |
526 if (state_ == kStopping) | 526 if (state_ == kStopping) |
527 return; | 527 return; |
528 | 528 |
529 PipelineStatistics stats = GetStatistics(); | |
530 if (renderer_ && renderer_->HasVideo() && stats.video_frames_decoded > 0) { | |
DaleCurtis
2014/08/28 18:25:24
No {} required since it's a single line if.
prabhur1
2014/08/28 18:46:30
Done.
| |
531 UMA_HISTOGRAM_COUNTS("Media.DroppedFrameCount", stats.video_frames_dropped); | |
532 } | |
533 | |
529 SetState(kStopping); | 534 SetState(kStopping); |
530 pending_callbacks_.reset(); | 535 pending_callbacks_.reset(); |
531 DoStop(base::Bind(&Pipeline::OnStopCompleted, weak_factory_.GetWeakPtr())); | 536 DoStop(base::Bind(&Pipeline::OnStopCompleted, weak_factory_.GetWeakPtr())); |
532 } | 537 } |
533 | 538 |
534 void Pipeline::ErrorChangedTask(PipelineStatus error) { | 539 void Pipeline::ErrorChangedTask(PipelineStatus error) { |
535 DCHECK(task_runner_->BelongsToCurrentThread()); | 540 DCHECK(task_runner_->BelongsToCurrentThread()); |
536 DCHECK_NE(PIPELINE_OK, error) << "PIPELINE_OK isn't an error!"; | 541 DCHECK_NE(PIPELINE_OK, error) << "PIPELINE_OK isn't an error!"; |
537 | 542 |
538 media_log_->AddEvent(media_log_->CreatePipelineErrorEvent(error)); | 543 media_log_->AddEvent(media_log_->CreatePipelineErrorEvent(error)); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
669 base::Bind(&Pipeline::GetMediaDuration, base::Unretained(this))); | 674 base::Bind(&Pipeline::GetMediaDuration, base::Unretained(this))); |
670 } | 675 } |
671 | 676 |
672 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { | 677 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { |
673 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; | 678 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; |
674 DCHECK(task_runner_->BelongsToCurrentThread()); | 679 DCHECK(task_runner_->BelongsToCurrentThread()); |
675 buffering_state_cb_.Run(new_buffering_state); | 680 buffering_state_cb_.Run(new_buffering_state); |
676 } | 681 } |
677 | 682 |
678 } // namespace media | 683 } // namespace media |
OLD | NEW |