Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(583)

Side by Side Diff: media/renderers/renderer_impl.cc

Issue 2115143002: Transition media element to HAVE_CURRENT_DATA upon underflow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/blink/webmediaplayer_impl_unittest.cc ('k') | media/renderers/renderer_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "media/renderers/renderer_impl.h" 5 #include "media/renderers/renderer_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 // Disable underflow by ignoring updates that renderers have ran out of data. 684 // Disable underflow by ignoring updates that renderers have ran out of data.
685 if (state_ == STATE_PLAYING && underflow_disabled_for_testing_ && 685 if (state_ == STATE_PLAYING && underflow_disabled_for_testing_ &&
686 time_ticking_) { 686 time_ticking_) {
687 DVLOG(1) << "Update ignored because underflow is disabled for testing."; 687 DVLOG(1) << "Update ignored because underflow is disabled for testing.";
688 return; 688 return;
689 } 689 }
690 690
691 // Renderer underflowed. 691 // Renderer underflowed.
692 if (!was_waiting_for_enough_data && WaitingForEnoughData()) { 692 if (!was_waiting_for_enough_data && WaitingForEnoughData()) {
693 PausePlayback(); 693 PausePlayback();
694 694 client_->OnBufferingStateChange(BUFFERING_HAVE_NOTHING);
695 // TODO(scherkus): Fire BUFFERING_HAVE_NOTHING callback to alert clients of
696 // underflow state http://crbug.com/144683
697 return; 695 return;
698 } 696 }
699 697
700 // Renderer prerolled. 698 // Renderer prerolled.
701 if (was_waiting_for_enough_data && !WaitingForEnoughData()) { 699 if (was_waiting_for_enough_data && !WaitingForEnoughData()) {
702 StartPlayback(); 700 StartPlayback();
703 client_->OnBufferingStateChange(BUFFERING_HAVE_ENOUGH); 701 client_->OnBufferingStateChange(BUFFERING_HAVE_ENOUGH);
704 return; 702 return;
705 } 703 }
706 } 704 }
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 DCHECK(task_runner_->BelongsToCurrentThread()); 843 DCHECK(task_runner_->BelongsToCurrentThread());
846 client_->OnVideoNaturalSizeChange(size); 844 client_->OnVideoNaturalSizeChange(size);
847 } 845 }
848 846
849 void RendererImpl::OnVideoOpacityChange(bool opaque) { 847 void RendererImpl::OnVideoOpacityChange(bool opaque) {
850 DCHECK(task_runner_->BelongsToCurrentThread()); 848 DCHECK(task_runner_->BelongsToCurrentThread());
851 client_->OnVideoOpacityChange(opaque); 849 client_->OnVideoOpacityChange(opaque);
852 } 850 }
853 851
854 } // namespace media 852 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_impl_unittest.cc ('k') | media/renderers/renderer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698