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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 Pipeline::Pipeline(const scoped_refptr<base::MessageLoopProxy>& message_loop, | 65 Pipeline::Pipeline(const scoped_refptr<base::MessageLoopProxy>& message_loop, |
66 MediaLog* media_log) | 66 MediaLog* media_log) |
67 : message_loop_(message_loop), | 67 : message_loop_(message_loop), |
68 media_log_(media_log), | 68 media_log_(media_log), |
69 running_(false), | 69 running_(false), |
70 did_loading_progress_(false), | 70 did_loading_progress_(false), |
71 total_bytes_(0), | 71 total_bytes_(0), |
72 natural_size_(0, 0), | 72 natural_size_(0, 0), |
73 volume_(1.0f), | 73 volume_(1.0f), |
74 playback_rate_(0.0f), | 74 playback_rate_(0.0f), |
75 clock_(new Clock(&base::Time::Now)), | 75 clock_(new Clock(&default_clock_)), |
76 waiting_for_clock_update_(false), | 76 waiting_for_clock_update_(false), |
77 status_(PIPELINE_OK), | 77 status_(PIPELINE_OK), |
78 has_audio_(false), | 78 has_audio_(false), |
79 has_video_(false), | 79 has_video_(false), |
80 state_(kCreated), | 80 state_(kCreated), |
81 audio_ended_(false), | 81 audio_ended_(false), |
82 video_ended_(false), | 82 video_ended_(false), |
83 audio_disabled_(false), | 83 audio_disabled_(false), |
84 creation_time_(base::Time::Now()) { | 84 creation_time_(base::Time::Now()) { |
85 media_log_->AddEvent(media_log_->CreatePipelineStateChangedEvent(kCreated)); | 85 media_log_->AddEvent(media_log_->CreatePipelineStateChangedEvent(kCreated)); |
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { | 975 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { |
976 lock_.AssertAcquired(); | 976 lock_.AssertAcquired(); |
977 if (!waiting_for_clock_update_) | 977 if (!waiting_for_clock_update_) |
978 return; | 978 return; |
979 | 979 |
980 waiting_for_clock_update_ = false; | 980 waiting_for_clock_update_ = false; |
981 clock_->Play(); | 981 clock_->Play(); |
982 } | 982 } |
983 | 983 |
984 } // namespace media | 984 } // namespace media |
OLD | NEW |