| 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 <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 cached_stream_texture_size_ = natural_size_; | 906 cached_stream_texture_size_ = natural_size_; |
| 907 } | 907 } |
| 908 | 908 |
| 909 // Lazily allocate compositing layer. | 909 // Lazily allocate compositing layer. |
| 910 if (!video_weblayer_) { | 910 if (!video_weblayer_) { |
| 911 video_weblayer_.reset(new cc_blink::WebLayerImpl( | 911 video_weblayer_.reset(new cc_blink::WebLayerImpl( |
| 912 cc::VideoLayer::Create(cc_blink::WebLayerImpl::LayerSettings(), this, | 912 cc::VideoLayer::Create(cc_blink::WebLayerImpl::LayerSettings(), this, |
| 913 media::VIDEO_ROTATION_0))); | 913 media::VIDEO_ROTATION_0))); |
| 914 client_->setWebLayer(video_weblayer_.get()); | 914 client_->setWebLayer(video_weblayer_.get()); |
| 915 } | 915 } |
| 916 | |
| 917 // TODO(qinmin): This is a hack. We need the media element to stop showing the | |
| 918 // poster image by forcing it to call setDisplayMode(video). Should move the | |
| 919 // logic into HTMLMediaElement.cpp. | |
| 920 client_->timeChanged(); | |
| 921 } | 916 } |
| 922 | 917 |
| 923 void WebMediaPlayerAndroid::OnTimeUpdate(base::TimeDelta current_timestamp, | 918 void WebMediaPlayerAndroid::OnTimeUpdate(base::TimeDelta current_timestamp, |
| 924 base::TimeTicks current_time_ticks) { | 919 base::TimeTicks current_time_ticks) { |
| 925 DCHECK(main_thread_checker_.CalledOnValidThread()); | 920 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 926 // Compensate the current_timestamp with the IPC latency. | 921 // Compensate the current_timestamp with the IPC latency. |
| 927 base::TimeDelta lower_bound = | 922 base::TimeDelta lower_bound = |
| 928 base::TimeTicks::Now() - current_time_ticks + current_timestamp; | 923 base::TimeTicks::Now() - current_time_ticks + current_timestamp; |
| 929 base::TimeDelta upper_bound = lower_bound; | 924 base::TimeDelta upper_bound = lower_bound; |
| 930 // We should get another time update in about |kTimeUpdateInterval| | 925 // We should get another time update in about |kTimeUpdateInterval| |
| (...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1890 | 1885 |
| 1891 bool is_hls = IsHLSStream(); | 1886 bool is_hls = IsHLSStream(); |
| 1892 UMA_HISTOGRAM_BOOLEAN("Media.Android.IsHttpLiveStreamingMedia", is_hls); | 1887 UMA_HISTOGRAM_BOOLEAN("Media.Android.IsHttpLiveStreamingMedia", is_hls); |
| 1893 if (is_hls) { | 1888 if (is_hls) { |
| 1894 media::RecordOriginOfHLSPlayback( | 1889 media::RecordOriginOfHLSPlayback( |
| 1895 GURL(frame_->document().securityOrigin().toString())); | 1890 GURL(frame_->document().securityOrigin().toString())); |
| 1896 } | 1891 } |
| 1897 } | 1892 } |
| 1898 | 1893 |
| 1899 } // namespace content | 1894 } // namespace content |
| OLD | NEW |