OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/media/webmediaplayer_impl.h" | 5 #include "webkit/media/webmediaplayer_impl.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 // Only keep one time range starting from 0. | 751 // Only keep one time range starting from 0. |
752 WebKit::WebTimeRanges new_buffered(static_cast<size_t>(1)); | 752 WebKit::WebTimeRanges new_buffered(static_cast<size_t>(1)); |
753 new_buffered[0].start = 0.0f; | 753 new_buffered[0].start = 0.0f; |
754 new_buffered[0].end = | 754 new_buffered[0].end = |
755 static_cast<float>(pipeline_->GetMediaDuration().InSecondsF()); | 755 static_cast<float>(pipeline_->GetMediaDuration().InSecondsF()); |
756 buffered_.swap(new_buffered); | 756 buffered_.swap(new_buffered); |
757 | 757 |
758 if (hasVideo()) { | 758 if (hasVideo()) { |
759 UMA_HISTOGRAM_BOOLEAN("Media.AcceleratedCompositingActive", | 759 UMA_HISTOGRAM_BOOLEAN("Media.AcceleratedCompositingActive", |
760 is_accelerated_compositing_active_); | 760 is_accelerated_compositing_active_); |
| 761 } else { |
| 762 GetClient()->disableAcceleratedCompositing(); |
761 } | 763 } |
762 | 764 |
763 if (pipeline_->IsLocalSource()) | 765 if (pipeline_->IsLocalSource()) |
764 SetNetworkState(WebKit::WebMediaPlayer::Loaded); | 766 SetNetworkState(WebKit::WebMediaPlayer::Loaded); |
765 | 767 |
766 SetReadyState(WebKit::WebMediaPlayer::HaveMetadata); | 768 SetReadyState(WebKit::WebMediaPlayer::HaveMetadata); |
767 // Fire canplaythrough immediately after playback begins because of | 769 // Fire canplaythrough immediately after playback begins because of |
768 // crbug.com/106480. | 770 // crbug.com/106480. |
769 // TODO(vrk): set ready state to HaveFutureData when bug above is fixed. | 771 // TODO(vrk): set ready state to HaveFutureData when bug above is fixed. |
770 SetReadyState(WebKit::WebMediaPlayer::HaveEnoughData); | 772 SetReadyState(WebKit::WebMediaPlayer::HaveEnoughData); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 return client_; | 936 return client_; |
935 } | 937 } |
936 | 938 |
937 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 939 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
938 DCHECK_EQ(main_loop_, MessageLoop::current()); | 940 DCHECK_EQ(main_loop_, MessageLoop::current()); |
939 incremented_externally_allocated_memory_ = true; | 941 incremented_externally_allocated_memory_ = true; |
940 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 942 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
941 } | 943 } |
942 | 944 |
943 } // namespace webkit_media | 945 } // namespace webkit_media |
OLD | NEW |