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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 } | 242 } |
243 | 243 |
244 void Pipeline::SetClockForTesting(Clock* clock) { | 244 void Pipeline::SetClockForTesting(Clock* clock) { |
245 clock_.reset(clock); | 245 clock_.reset(clock); |
246 } | 246 } |
247 | 247 |
248 void Pipeline::SetErrorForTesting(PipelineStatus status) { | 248 void Pipeline::SetErrorForTesting(PipelineStatus status) { |
249 SetError(status); | 249 SetError(status); |
250 } | 250 } |
251 | 251 |
| 252 void Pipeline::KeyAdded() { |
| 253 DCHECK(demuxer_); |
| 254 if (demuxer_) |
| 255 demuxer_->KeyAdded(); |
| 256 } |
| 257 |
252 void Pipeline::SetState(State next_state) { | 258 void Pipeline::SetState(State next_state) { |
253 if (state_ != kStarted && next_state == kStarted && | 259 if (state_ != kStarted && next_state == kStarted && |
254 !creation_time_.is_null()) { | 260 !creation_time_.is_null()) { |
255 UMA_HISTOGRAM_TIMES( | 261 UMA_HISTOGRAM_TIMES( |
256 "Media.TimeToPipelineStarted", base::Time::Now() - creation_time_); | 262 "Media.TimeToPipelineStarted", base::Time::Now() - creation_time_); |
257 creation_time_ = base::Time(); | 263 creation_time_ = base::Time(); |
258 } | 264 } |
259 state_ = next_state; | 265 state_ = next_state; |
260 media_log_->AddEvent(media_log_->CreatePipelineStateChangedEvent(next_state)); | 266 media_log_->AddEvent(media_log_->CreatePipelineStateChangedEvent(next_state)); |
261 } | 267 } |
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { | 1241 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { |
1236 lock_.AssertAcquired(); | 1242 lock_.AssertAcquired(); |
1237 if (!waiting_for_clock_update_) | 1243 if (!waiting_for_clock_update_) |
1238 return; | 1244 return; |
1239 | 1245 |
1240 waiting_for_clock_update_ = false; | 1246 waiting_for_clock_update_ = false; |
1241 clock_->Play(); | 1247 clock_->Play(); |
1242 } | 1248 } |
1243 | 1249 |
1244 } // namespace media | 1250 } // namespace media |
OLD | NEW |