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" |
11 #include "base/callback_helpers.h" | 11 #include "base/callback_helpers.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
| 16 #include "base/string_number_conversions.h" |
16 #include "base/string_util.h" | 17 #include "base/string_util.h" |
17 #include "base/synchronization/condition_variable.h" | 18 #include "base/synchronization/condition_variable.h" |
18 #include "media/base/audio_decoder.h" | 19 #include "media/base/audio_decoder.h" |
19 #include "media/base/audio_renderer.h" | 20 #include "media/base/audio_renderer.h" |
20 #include "media/base/buffers.h" | 21 #include "media/base/buffers.h" |
21 #include "media/base/clock.h" | 22 #include "media/base/clock.h" |
22 #include "media/base/filter_collection.h" | 23 #include "media/base/filter_collection.h" |
23 #include "media/base/media_log.h" | 24 #include "media/base/media_log.h" |
24 #include "media/base/video_decoder.h" | 25 #include "media/base/video_decoder.h" |
25 #include "media/base/video_renderer.h" | 26 #include "media/base/video_renderer.h" |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 MediaLogEvent::DURATION_SET, "duration", duration)); | 384 MediaLogEvent::DURATION_SET, "duration", duration)); |
384 UMA_HISTOGRAM_LONG_TIMES("Media.Duration", duration); | 385 UMA_HISTOGRAM_LONG_TIMES("Media.Duration", duration); |
385 | 386 |
386 base::AutoLock auto_lock(lock_); | 387 base::AutoLock auto_lock(lock_); |
387 clock_->SetDuration(duration); | 388 clock_->SetDuration(duration); |
388 } | 389 } |
389 | 390 |
390 void Pipeline::SetTotalBytes(int64 total_bytes) { | 391 void Pipeline::SetTotalBytes(int64 total_bytes) { |
391 DCHECK(IsRunning()); | 392 DCHECK(IsRunning()); |
392 media_log_->AddEvent( | 393 media_log_->AddEvent( |
393 media_log_->CreateIntegerEvent( | 394 media_log_->CreateStringEvent( |
394 MediaLogEvent::TOTAL_BYTES_SET, "total_bytes", total_bytes)); | 395 MediaLogEvent::TOTAL_BYTES_SET, "total_bytes", |
| 396 base::Int64ToString(total_bytes))); |
395 int64 total_mbytes = total_bytes >> 20; | 397 int64 total_mbytes = total_bytes >> 20; |
396 if (total_mbytes > kint32max) | 398 if (total_mbytes > kint32max) |
397 total_mbytes = kint32max; | 399 total_mbytes = kint32max; |
398 UMA_HISTOGRAM_CUSTOM_COUNTS( | 400 UMA_HISTOGRAM_CUSTOM_COUNTS( |
399 "Media.TotalMBytes", static_cast<int32>(total_mbytes), 1, kint32max, 50); | 401 "Media.TotalMBytes", static_cast<int32>(total_mbytes), 1, kint32max, 50); |
400 | 402 |
401 base::AutoLock auto_lock(lock_); | 403 base::AutoLock auto_lock(lock_); |
402 total_bytes_ = total_bytes; | 404 total_bytes_ = total_bytes; |
403 } | 405 } |
404 | 406 |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1216 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { | 1218 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { |
1217 lock_.AssertAcquired(); | 1219 lock_.AssertAcquired(); |
1218 if (!waiting_for_clock_update_) | 1220 if (!waiting_for_clock_update_) |
1219 return; | 1221 return; |
1220 | 1222 |
1221 waiting_for_clock_update_ = false; | 1223 waiting_for_clock_update_ = false; |
1222 clock_->Play(); | 1224 clock_->Play(); |
1223 } | 1225 } |
1224 | 1226 |
1225 } // namespace media | 1227 } // namespace media |
OLD | NEW |