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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 media_log_->AddEvent(media_log_->CreateEvent(MediaLogEvent::VIDEO_ENDED)); | 713 media_log_->AddEvent(media_log_->CreateEvent(MediaLogEvent::VIDEO_ENDED)); |
714 } | 714 } |
715 | 715 |
716 // Called from any thread. | 716 // Called from any thread. |
717 void Pipeline::OnUpdateStatistics(const PipelineStatistics& stats) { | 717 void Pipeline::OnUpdateStatistics(const PipelineStatistics& stats) { |
718 base::AutoLock auto_lock(lock_); | 718 base::AutoLock auto_lock(lock_); |
719 statistics_.audio_bytes_decoded += stats.audio_bytes_decoded; | 719 statistics_.audio_bytes_decoded += stats.audio_bytes_decoded; |
720 statistics_.video_bytes_decoded += stats.video_bytes_decoded; | 720 statistics_.video_bytes_decoded += stats.video_bytes_decoded; |
721 statistics_.video_frames_decoded += stats.video_frames_decoded; | 721 statistics_.video_frames_decoded += stats.video_frames_decoded; |
722 statistics_.video_frames_dropped += stats.video_frames_dropped; | 722 statistics_.video_frames_dropped += stats.video_frames_dropped; |
| 723 media_log_->AddEvent( |
| 724 media_log_->CreatePipelineStatisticsChangedEvent(statistics_)); |
723 } | 725 } |
724 | 726 |
725 void Pipeline::StartTask(scoped_ptr<FilterCollection> filter_collection, | 727 void Pipeline::StartTask(scoped_ptr<FilterCollection> filter_collection, |
726 const base::Closure& ended_cb, | 728 const base::Closure& ended_cb, |
727 const PipelineStatusCB& error_cb, | 729 const PipelineStatusCB& error_cb, |
728 const PipelineStatusCB& seek_cb, | 730 const PipelineStatusCB& seek_cb, |
729 const BufferingStateCB& buffering_state_cb, | 731 const BufferingStateCB& buffering_state_cb, |
730 const base::Closure& duration_change_cb) { | 732 const base::Closure& duration_change_cb) { |
731 DCHECK(message_loop_->BelongsToCurrentThread()); | 733 DCHECK(message_loop_->BelongsToCurrentThread()); |
732 CHECK_EQ(kCreated, state_) | 734 CHECK_EQ(kCreated, state_) |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { | 975 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { |
974 lock_.AssertAcquired(); | 976 lock_.AssertAcquired(); |
975 if (!waiting_for_clock_update_) | 977 if (!waiting_for_clock_update_) |
976 return; | 978 return; |
977 | 979 |
978 waiting_for_clock_update_ = false; | 980 waiting_for_clock_update_ = false; |
979 clock_->Play(); | 981 clock_->Play(); |
980 } | 982 } |
981 | 983 |
982 } // namespace media | 984 } // namespace media |
OLD | NEW |