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 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 | 844 |
845 #if defined(VIDEO_HOLE) | 845 #if defined(VIDEO_HOLE) |
846 // Use H/W surface for encrypted video. | 846 // Use H/W surface for encrypted video. |
847 // TODO(qinmin): Change this so that only EME needs the H/W surface | 847 // TODO(qinmin): Change this so that only EME needs the H/W surface |
848 if (force_use_overlay_embedded_video_ || | 848 if (force_use_overlay_embedded_video_ || |
849 (media_source_delegate_ && media_source_delegate_->IsVideoEncrypted() && | 849 (media_source_delegate_ && media_source_delegate_->IsVideoEncrypted() && |
850 player_manager_->ShouldUseVideoOverlayForEmbeddedEncryptedVideo())) { | 850 player_manager_->ShouldUseVideoOverlayForEmbeddedEncryptedVideo())) { |
851 needs_external_surface_ = true; | 851 needs_external_surface_ = true; |
852 if (!paused() && !is_fullscreen_) | 852 if (!paused() && !is_fullscreen_) |
853 player_manager_->RequestExternalSurface(player_id_, last_computed_rect_); | 853 player_manager_->RequestExternalSurface(player_id_, last_computed_rect_); |
854 } else if (stream_texture_proxy_ && !stream_id_) { | 854 } else if (!stream_texture_proxy_) { |
855 // Do deferred stream texture creation finally. | 855 // Do deferred stream texture creation finally. |
856 DoCreateStreamTexture(); | |
857 SetNeedsEstablishPeer(true); | 856 SetNeedsEstablishPeer(true); |
| 857 TryCreateStreamTextureProxyIfNeeded(); |
858 } | 858 } |
859 #endif // defined(VIDEO_HOLE) | 859 #endif // defined(VIDEO_HOLE) |
860 natural_size_.width = width; | 860 natural_size_.width = width; |
861 natural_size_.height = height; | 861 natural_size_.height = height; |
862 | 862 |
863 // When play() gets called, |natural_size_| may still be empty and | 863 // When play() gets called, |natural_size_| may still be empty and |
864 // EstablishSurfaceTexturePeer() will not get called. As a result, the video | 864 // EstablishSurfaceTexturePeer() will not get called. As a result, the video |
865 // may play without a surface texture. When we finally get the valid video | 865 // may play without a surface texture. When we finally get the valid video |
866 // size here, we should call EstablishSurfaceTexturePeer() if it has not been | 866 // size here, we should call EstablishSurfaceTexturePeer() if it has not been |
867 // previously called. | 867 // previously called. |
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1815 | 1815 |
1816 bool WebMediaPlayerAndroid::IsHLSStream() const { | 1816 bool WebMediaPlayerAndroid::IsHLSStream() const { |
1817 std::string mime; | 1817 std::string mime; |
1818 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; | 1818 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; |
1819 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) | 1819 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) |
1820 return false; | 1820 return false; |
1821 return !mime.compare("application/x-mpegurl"); | 1821 return !mime.compare("application/x-mpegurl"); |
1822 } | 1822 } |
1823 | 1823 |
1824 } // namespace content | 1824 } // namespace content |
OLD | NEW |