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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 // size is set. | 895 // size is set. |
896 if (!is_remote_ && cached_stream_texture_size_ != natural_size_) { | 896 if (!is_remote_ && cached_stream_texture_size_ != natural_size_) { |
897 stream_texture_factory_->SetStreamTextureSize( | 897 stream_texture_factory_->SetStreamTextureSize( |
898 stream_id_, gfx::Size(natural_size_.width, natural_size_.height)); | 898 stream_id_, gfx::Size(natural_size_.width, natural_size_.height)); |
899 cached_stream_texture_size_ = natural_size_; | 899 cached_stream_texture_size_ = natural_size_; |
900 } | 900 } |
901 | 901 |
902 // Lazily allocate compositing layer. | 902 // Lazily allocate compositing layer. |
903 if (!video_weblayer_) { | 903 if (!video_weblayer_) { |
904 video_weblayer_.reset(new cc_blink::WebLayerImpl( | 904 video_weblayer_.reset(new cc_blink::WebLayerImpl( |
905 cc::VideoLayer::Create(this, media::VIDEO_ROTATION_0))); | 905 cc::VideoLayer::Create(cc_blink::WebLayerImpl::LayerSettings(), this, |
| 906 media::VIDEO_ROTATION_0))); |
906 client_->setWebLayer(video_weblayer_.get()); | 907 client_->setWebLayer(video_weblayer_.get()); |
907 } | 908 } |
908 | 909 |
909 // TODO(qinmin): This is a hack. We need the media element to stop showing the | 910 // TODO(qinmin): This is a hack. We need the media element to stop showing the |
910 // poster image by forcing it to call setDisplayMode(video). Should move the | 911 // poster image by forcing it to call setDisplayMode(video). Should move the |
911 // logic into HTMLMediaElement.cpp. | 912 // logic into HTMLMediaElement.cpp. |
912 client_->timeChanged(); | 913 client_->timeChanged(); |
913 } | 914 } |
914 | 915 |
915 void WebMediaPlayerAndroid::OnTimeUpdate(base::TimeDelta current_timestamp, | 916 void WebMediaPlayerAndroid::OnTimeUpdate(base::TimeDelta current_timestamp, |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1864 | 1865 |
1865 bool WebMediaPlayerAndroid::IsHLSStream() const { | 1866 bool WebMediaPlayerAndroid::IsHLSStream() const { |
1866 std::string mime; | 1867 std::string mime; |
1867 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; | 1868 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; |
1868 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) | 1869 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) |
1869 return false; | 1870 return false; |
1870 return !mime.compare("application/x-mpegurl"); | 1871 return !mime.compare("application/x-mpegurl"); |
1871 } | 1872 } |
1872 | 1873 |
1873 } // namespace content | 1874 } // namespace content |
OLD | NEW |