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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |