| 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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 } | 459 } |
| 460 | 460 |
| 461 void Pipeline::AddBufferedTimeRange(TimeDelta start, TimeDelta end) { | 461 void Pipeline::AddBufferedTimeRange(TimeDelta start, TimeDelta end) { |
| 462 DCHECK(IsRunning()); | 462 DCHECK(IsRunning()); |
| 463 base::AutoLock auto_lock(lock_); | 463 base::AutoLock auto_lock(lock_); |
| 464 buffered_time_ranges_.Add(start, end); | 464 buffered_time_ranges_.Add(start, end); |
| 465 did_loading_progress_ = true; | 465 did_loading_progress_ = true; |
| 466 } | 466 } |
| 467 | 467 |
| 468 // Called from any thread. | 468 // Called from any thread. |
| 469 void Pipeline::OnUpdateStatistics(const PipelineStatistics& stats) { | 469 void Pipeline::OnUpdateStatistics(const PipelineStatistics& stats_delta) { |
| 470 base::AutoLock auto_lock(lock_); | 470 base::AutoLock auto_lock(lock_); |
| 471 statistics_.audio_bytes_decoded += stats.audio_bytes_decoded; | 471 statistics_.audio_bytes_decoded += stats_delta.audio_bytes_decoded; |
| 472 statistics_.video_bytes_decoded += stats.video_bytes_decoded; | 472 statistics_.video_bytes_decoded += stats_delta.video_bytes_decoded; |
| 473 statistics_.video_frames_decoded += stats.video_frames_decoded; | 473 statistics_.video_frames_decoded += stats_delta.video_frames_decoded; |
| 474 statistics_.video_frames_dropped += stats.video_frames_dropped; | 474 statistics_.video_frames_dropped += stats_delta.video_frames_dropped; |
| 475 statistics_.audio_memory_usage += stats_delta.audio_memory_usage; |
| 476 statistics_.video_memory_usage += stats_delta.video_memory_usage; |
| 475 } | 477 } |
| 476 | 478 |
| 477 void Pipeline::StartTask() { | 479 void Pipeline::StartTask() { |
| 478 DCHECK(task_runner_->BelongsToCurrentThread()); | 480 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 479 | 481 |
| 480 CHECK_EQ(kCreated, state_) | 482 CHECK_EQ(kCreated, state_) |
| 481 << "Media pipeline cannot be started more than once"; | 483 << "Media pipeline cannot be started more than once"; |
| 482 | 484 |
| 483 text_renderer_ = CreateTextRenderer(); | 485 text_renderer_ = CreateTextRenderer(); |
| 484 if (text_renderer_) { | 486 if (text_renderer_) { |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 metadata_cb_.Run(metadata); | 729 metadata_cb_.Run(metadata); |
| 728 } | 730 } |
| 729 | 731 |
| 730 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { | 732 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { |
| 731 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; | 733 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; |
| 732 DCHECK(task_runner_->BelongsToCurrentThread()); | 734 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 733 buffering_state_cb_.Run(new_buffering_state); | 735 buffering_state_cb_.Run(new_buffering_state); |
| 734 } | 736 } |
| 735 | 737 |
| 736 } // namespace media | 738 } // namespace media |
| OLD | NEW |