Chromium Code Reviews| Index: media/base/pipeline.cc |
| diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc |
| index 387470aec070dd242e5486419f9efb15d859a2fa..90a090b4fccf140ff8753a4dbd9eb9bc8d78143d 100644 |
| --- a/media/base/pipeline.cc |
| +++ b/media/base/pipeline.cc |
| @@ -46,6 +46,11 @@ Pipeline::Pipeline( |
| pending_cdm_context_(nullptr), |
| weak_factory_(this) { |
| media_log_->AddEvent(media_log_->CreatePipelineStateChangedEvent(kCreated)); |
| + |
| + // By default these values are initialized to -1 to indicate no data, but |
| + // Pipeline clients should always see a zero value in these cases. |
|
xhwang
2015/10/25 17:01:56
In this case, why do we need the concept of "no da
DaleCurtis
2015/10/27 23:14:20
Removed in favor of returning delta stats from ren
|
| + statistics_.audio_memory_usage = 0; |
| + statistics_.video_memory_usage = 0; |
| } |
| Pipeline::~Pipeline() { |
| @@ -472,6 +477,11 @@ void Pipeline::OnUpdateStatistics(const PipelineStatistics& stats) { |
| statistics_.video_bytes_decoded += stats.video_bytes_decoded; |
| statistics_.video_frames_decoded += stats.video_frames_decoded; |
| statistics_.video_frames_dropped += stats.video_frames_dropped; |
| + |
| + if (stats.audio_memory_usage >= 0) |
| + statistics_.audio_memory_usage = stats.audio_memory_usage; |
| + if (stats.video_memory_usage >= 0) |
| + statistics_.video_memory_usage = stats.video_memory_usage; |
| } |
| void Pipeline::StartTask() { |