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 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 // NOTE: pipeline may be deleted at this point in time as a result of | 500 // NOTE: pipeline may be deleted at this point in time as a result of |
501 // executing |stop_cb_|. | 501 // executing |stop_cb_|. |
502 return; | 502 return; |
503 } | 503 } |
504 if (!error_cb_.is_null()) { | 504 if (!error_cb_.is_null()) { |
505 DCHECK_NE(status_, PIPELINE_OK); | 505 DCHECK_NE(status_, PIPELINE_OK); |
506 base::ResetAndReturn(&error_cb_).Run(status_); | 506 base::ResetAndReturn(&error_cb_).Run(status_); |
507 } | 507 } |
508 } | 508 } |
509 | 509 |
510 void Pipeline::AddBufferedTimeRange(TimeDelta start, TimeDelta end) { | 510 void Pipeline::OnBufferedTimeRangesChanged( |
| 511 const Ranges<base::TimeDelta>& ranges) { |
511 DCHECK(IsRunning()); | 512 DCHECK(IsRunning()); |
512 base::AutoLock auto_lock(lock_); | 513 base::AutoLock auto_lock(lock_); |
513 buffered_time_ranges_.Add(start, end); | 514 buffered_time_ranges_ = ranges; |
514 did_loading_progress_ = true; | 515 did_loading_progress_ = true; |
515 } | 516 } |
516 | 517 |
517 // Called from any thread. | 518 // Called from any thread. |
518 void Pipeline::OnUpdateStatistics(const PipelineStatistics& stats_delta) { | 519 void Pipeline::OnUpdateStatistics(const PipelineStatistics& stats_delta) { |
519 base::AutoLock auto_lock(lock_); | 520 base::AutoLock auto_lock(lock_); |
520 statistics_.audio_bytes_decoded += stats_delta.audio_bytes_decoded; | 521 statistics_.audio_bytes_decoded += stats_delta.audio_bytes_decoded; |
521 statistics_.video_bytes_decoded += stats_delta.video_bytes_decoded; | 522 statistics_.video_bytes_decoded += stats_delta.video_bytes_decoded; |
522 statistics_.video_frames_decoded += stats_delta.video_frames_decoded; | 523 statistics_.video_frames_decoded += stats_delta.video_frames_decoded; |
523 statistics_.video_frames_dropped += stats_delta.video_frames_dropped; | 524 statistics_.video_frames_dropped += stats_delta.video_frames_dropped; |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 metadata_cb_.Run(metadata); | 864 metadata_cb_.Run(metadata); |
864 } | 865 } |
865 | 866 |
866 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { | 867 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { |
867 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; | 868 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; |
868 DCHECK(task_runner_->BelongsToCurrentThread()); | 869 DCHECK(task_runner_->BelongsToCurrentThread()); |
869 buffering_state_cb_.Run(new_buffering_state); | 870 buffering_state_cb_.Run(new_buffering_state); |
870 } | 871 } |
871 | 872 |
872 } // namespace media | 873 } // namespace media |
OLD | NEW |