| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |