| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/media/android/webmediaplayer_android.h" | 5 #include "content/renderer/media/android/webmediaplayer_android.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 stream_id_, gfx::Size(natural_size_.width, natural_size_.height)); | 951 stream_id_, gfx::Size(natural_size_.width, natural_size_.height)); |
| 952 cached_stream_texture_size_ = natural_size_; | 952 cached_stream_texture_size_ = natural_size_; |
| 953 } | 953 } |
| 954 | 954 |
| 955 // Lazily allocate compositing layer. | 955 // Lazily allocate compositing layer. |
| 956 if (!video_weblayer_) { | 956 if (!video_weblayer_) { |
| 957 video_weblayer_.reset(new cc_blink::WebLayerImpl( | 957 video_weblayer_.reset(new cc_blink::WebLayerImpl( |
| 958 cc::VideoLayer::Create(cc_blink::WebLayerImpl::LayerSettings(), this, | 958 cc::VideoLayer::Create(cc_blink::WebLayerImpl::LayerSettings(), this, |
| 959 media::VIDEO_ROTATION_0))); | 959 media::VIDEO_ROTATION_0))); |
| 960 client_->setWebLayer(video_weblayer_.get()); | 960 client_->setWebLayer(video_weblayer_.get()); |
| 961 |
| 962 // If we're paused after we receive metadata for the first time, tell the |
| 963 // delegate we can now be safely suspended due to inactivity if a subsequent |
| 964 // play event does not occur. |
| 965 if (paused() && delegate_) |
| 966 delegate_->DidPause(delegate_id_, false); |
| 961 } | 967 } |
| 962 } | 968 } |
| 963 | 969 |
| 964 void WebMediaPlayerAndroid::OnTimeUpdate(base::TimeDelta current_timestamp, | 970 void WebMediaPlayerAndroid::OnTimeUpdate(base::TimeDelta current_timestamp, |
| 965 base::TimeTicks current_time_ticks) { | 971 base::TimeTicks current_time_ticks) { |
| 966 DCHECK(main_thread_checker_.CalledOnValidThread()); | 972 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 967 | 973 |
| 968 if (seeking()) | 974 if (seeking()) |
| 969 return; | 975 return; |
| 970 | 976 |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1655 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; | 1661 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; |
| 1656 } else if (is_hls_url == is_hls) { | 1662 } else if (is_hls_url == is_hls) { |
| 1657 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; | 1663 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; |
| 1658 } | 1664 } |
| 1659 UMA_HISTOGRAM_ENUMERATION( | 1665 UMA_HISTOGRAM_ENUMERATION( |
| 1660 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", | 1666 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", |
| 1661 result, PREDICTION_RESULT_MAX); | 1667 result, PREDICTION_RESULT_MAX); |
| 1662 } | 1668 } |
| 1663 | 1669 |
| 1664 } // namespace content | 1670 } // namespace content |
| OLD | NEW |