Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/media/cma/pipeline/media_pipeline_impl.h" | 5 #include "chromecast/media/cma/pipeline/media_pipeline_impl.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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 345 metrics::CastMetricsHelper::GetInstance()->RecordApplicationEvent( | 345 metrics::CastMetricsHelper::GetInstance()->RecordApplicationEvent( |
| 346 "Cast.Platform.Ended"); | 346 "Cast.Platform.Ended"); |
| 347 | 347 |
| 348 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, | 348 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
| 349 pending_flush_task_->done_cb); | 349 pending_flush_task_->done_cb); |
| 350 pending_flush_task_.reset(); | 350 pending_flush_task_.reset(); |
| 351 } | 351 } |
| 352 } | 352 } |
| 353 | 353 |
| 354 void MediaPipelineImpl::OnBufferingNotification(bool is_buffering) { | 354 void MediaPipelineImpl::OnBufferingNotification(bool is_buffering) { |
| 355 CMALOG(kLogControl) << __FUNCTION__ << " is_buffering=" << is_buffering; | 355 LOG(INFO) << __FUNCTION__ << " is_buffering=" << is_buffering; |
|
alokp
2017/01/05 23:57:38
We should continue to use VLOG here.
| |
| 356 DCHECK(thread_checker_.CalledOnValidThread()); | 356 DCHECK(thread_checker_.CalledOnValidThread()); |
| 357 DCHECK((backend_state_ == BACKEND_STATE_PLAYING) || | 357 DCHECK((backend_state_ == BACKEND_STATE_PLAYING) || |
| 358 (backend_state_ == BACKEND_STATE_PAUSED)); | 358 (backend_state_ == BACKEND_STATE_PAUSED)); |
| 359 DCHECK(buffering_controller_); | 359 DCHECK(buffering_controller_); |
| 360 DCHECK_EQ(is_buffering, buffering_controller_->IsBuffering()); | 360 DCHECK_EQ(is_buffering, buffering_controller_->IsBuffering()); |
| 361 | 361 |
| 362 if (!client_.buffering_state_cb.is_null()) { | 362 if (!client_.buffering_state_cb.is_null()) { |
| 363 if (is_buffering) { | 363 if (is_buffering) { |
| 364 // TODO(alokp): WebMediaPlayerImpl currently only handles HAVE_ENOUGH. | 364 // TODO(alokp): WebMediaPlayerImpl currently only handles HAVE_ENOUGH. |
| 365 // See WebMediaPlayerImpl::OnPipelineBufferingStateChanged, | 365 // See WebMediaPlayerImpl::OnPipelineBufferingStateChanged, |
| 366 // http://crbug.com/144683. | 366 // http://crbug.com/144683. |
| 367 LOG(WARNING) << "Ignoring buffering notification."; | 367 NOTIMPLEMENTED(); |
| 368 } else { | 368 } else { |
| 369 client_.buffering_state_cb.Run(::media::BUFFERING_HAVE_ENOUGH); | 369 client_.buffering_state_cb.Run(::media::BUFFERING_HAVE_ENOUGH); |
| 370 } | 370 } |
| 371 } | 371 } |
| 372 | 372 |
| 373 if (is_buffering && (backend_state_ == BACKEND_STATE_PLAYING)) { | 373 if (is_buffering && (backend_state_ == BACKEND_STATE_PLAYING)) { |
| 374 media_pipeline_backend_->Pause(); | 374 media_pipeline_backend_->Pause(); |
| 375 backend_state_ = BACKEND_STATE_PAUSED; | 375 backend_state_ = BACKEND_STATE_PAUSED; |
| 376 metrics::CastMetricsHelper::GetInstance()->RecordApplicationEvent( | 376 metrics::CastMetricsHelper::GetInstance()->RecordApplicationEvent( |
| 377 "Cast.Platform.Pause"); | 377 "Cast.Platform.Pause"); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 524 | 524 |
| 525 void MediaPipelineImpl::ResetBitrateState() { | 525 void MediaPipelineImpl::ResetBitrateState() { |
| 526 elapsed_time_delta_ = base::TimeDelta::FromSeconds(0); | 526 elapsed_time_delta_ = base::TimeDelta::FromSeconds(0); |
| 527 audio_bytes_for_bitrate_estimation_ = 0; | 527 audio_bytes_for_bitrate_estimation_ = 0; |
| 528 video_bytes_for_bitrate_estimation_ = 0; | 528 video_bytes_for_bitrate_estimation_ = 0; |
| 529 last_sample_time_ = base::TimeTicks::Now(); | 529 last_sample_time_ = base::TimeTicks::Now(); |
| 530 } | 530 } |
| 531 | 531 |
| 532 } // namespace media | 532 } // namespace media |
| 533 } // namespace chromecast | 533 } // namespace chromecast |
| OLD | NEW |