Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 1101823002: CC Animations: Make LayerAnimationController creation optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Plumb LayerSettings parameter for cc::Layer construction. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 // For hidden video element (with style "display:none"), ensure the texture 892 // For hidden video element (with style "display:none"), ensure the texture
893 // size is set. 893 // size is set.
894 if (!is_remote_ && cached_stream_texture_size_ != natural_size_) { 894 if (!is_remote_ && cached_stream_texture_size_ != natural_size_) {
895 stream_texture_factory_->SetStreamTextureSize( 895 stream_texture_factory_->SetStreamTextureSize(
896 stream_id_, gfx::Size(natural_size_.width, natural_size_.height)); 896 stream_id_, gfx::Size(natural_size_.width, natural_size_.height));
897 cached_stream_texture_size_ = natural_size_; 897 cached_stream_texture_size_ = natural_size_;
898 } 898 }
899 899
900 // Lazily allocate compositing layer. 900 // Lazily allocate compositing layer.
901 if (!video_weblayer_) { 901 if (!video_weblayer_) {
902 video_weblayer_.reset(new cc_blink::WebLayerImpl( 902 video_weblayer_.reset(new cc_blink::WebLayerImpl(cc::VideoLayer::Create(
903 cc::VideoLayer::Create(this, media::VIDEO_ROTATION_0))); 903 WebLayerImpl::LayerSettings(), this, media::VIDEO_ROTATION_0)));
904 client_->setWebLayer(video_weblayer_.get()); 904 client_->setWebLayer(video_weblayer_.get());
905 } 905 }
906 906
907 // TODO(qinmin): This is a hack. We need the media element to stop showing the 907 // TODO(qinmin): This is a hack. We need the media element to stop showing the
908 // poster image by forcing it to call setDisplayMode(video). Should move the 908 // poster image by forcing it to call setDisplayMode(video). Should move the
909 // logic into HTMLMediaElement.cpp. 909 // logic into HTMLMediaElement.cpp.
910 client_->timeChanged(); 910 client_->timeChanged();
911 } 911 }
912 912
913 void WebMediaPlayerAndroid::OnTimeUpdate(base::TimeDelta current_timestamp, 913 void WebMediaPlayerAndroid::OnTimeUpdate(base::TimeDelta current_timestamp,
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
1854 1854
1855 bool WebMediaPlayerAndroid::IsHLSStream() const { 1855 bool WebMediaPlayerAndroid::IsHLSStream() const {
1856 std::string mime; 1856 std::string mime;
1857 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; 1857 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_;
1858 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) 1858 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime))
1859 return false; 1859 return false;
1860 return !mime.compare("application/x-mpegurl"); 1860 return !mime.compare("application/x-mpegurl");
1861 } 1861 }
1862 1862
1863 } // namespace content 1863 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698