| 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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 | 617 |
| 618 return; | 618 return; |
| 619 } | 619 } |
| 620 | 620 |
| 621 stop_cb_ = stop_cb; | 621 stop_cb_ = stop_cb; |
| 622 | 622 |
| 623 // We may already be stopping due to a runtime error. | 623 // We may already be stopping due to a runtime error. |
| 624 if (state_ == kStopping) | 624 if (state_ == kStopping) |
| 625 return; | 625 return; |
| 626 | 626 |
| 627 PipelineStatistics stats = GetStatistics(); |
| 628 UMA_HISTOGRAM_COUNTS("Media.DroppedFrameCount", stats.video_frames_dropped); |
| 629 |
| 627 SetState(kStopping); | 630 SetState(kStopping); |
| 628 pending_callbacks_.reset(); | 631 pending_callbacks_.reset(); |
| 629 DoStop(base::Bind(&Pipeline::OnStopCompleted, weak_factory_.GetWeakPtr())); | 632 DoStop(base::Bind(&Pipeline::OnStopCompleted, weak_factory_.GetWeakPtr())); |
| 630 } | 633 } |
| 631 | 634 |
| 632 void Pipeline::ErrorChangedTask(PipelineStatus error) { | 635 void Pipeline::ErrorChangedTask(PipelineStatus error) { |
| 633 DCHECK(task_runner_->BelongsToCurrentThread()); | 636 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 634 DCHECK_NE(PIPELINE_OK, error) << "PIPELINE_OK isn't an error!"; | 637 DCHECK_NE(PIPELINE_OK, error) << "PIPELINE_OK isn't an error!"; |
| 635 | 638 |
| 636 media_log_->AddEvent(media_log_->CreatePipelineErrorEvent(error)); | 639 media_log_->AddEvent(media_log_->CreatePipelineErrorEvent(error)); |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { | 926 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { |
| 924 lock_.AssertAcquired(); | 927 lock_.AssertAcquired(); |
| 925 if (interpolation_state_ != INTERPOLATION_WAITING_FOR_AUDIO_TIME_UPDATE) | 928 if (interpolation_state_ != INTERPOLATION_WAITING_FOR_AUDIO_TIME_UPDATE) |
| 926 return; | 929 return; |
| 927 | 930 |
| 928 interpolation_state_ = INTERPOLATION_STARTED; | 931 interpolation_state_ = INTERPOLATION_STARTED; |
| 929 interpolator_->StartInterpolating(); | 932 interpolator_->StartInterpolating(); |
| 930 } | 933 } |
| 931 | 934 |
| 932 } // namespace media | 935 } // namespace media |
| OLD | NEW |