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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
941 ReallocateVideoFrame(); | 941 ReallocateVideoFrame(); |
942 client_->disconnectedFromRemoteDevice(); | 942 client_->disconnectedFromRemoteDevice(); |
943 } | 943 } |
944 | 944 |
945 void WebMediaPlayerAndroid::OnDidExitFullscreen() { | 945 void WebMediaPlayerAndroid::OnDidExitFullscreen() { |
946 // |needs_external_surface_| is always false on non-TV devices. | 946 // |needs_external_surface_| is always false on non-TV devices. |
947 if (!needs_external_surface_) | 947 if (!needs_external_surface_) |
948 SetNeedsEstablishPeer(true); | 948 SetNeedsEstablishPeer(true); |
949 // We had the fullscreen surface connected to Android MediaPlayer, | 949 // We had the fullscreen surface connected to Android MediaPlayer, |
950 // so reconnect our surface texture for embedded playback. | 950 // so reconnect our surface texture for embedded playback. |
951 if (!paused() && needs_establish_peer_) | 951 if (!paused() && needs_establish_peer_) { |
952 TryCreateStreamTextureProxyIfNeeded(); | |
boliu
2015/07/06 18:34:20
how would this help if the problem is needs_establ
Hugo Holgersson
2015/07/06 20:53:53
At this point, here in OnDidExitFullscreen(), need
boliu
2015/07/06 21:05:48
Ahh, ok. Then the more correct fix is to create a
Hugo Holgersson
2015/07/06 22:30:46
Hmm. I don't quite understand. SynchronousComposit
boliu
2015/07/06 23:33:21
I meant RestoreContextOnMainThread will call a dif
Hugo Holgersson
2015/07/08 13:23:50
If that method ignores needs_establish_peer_ it mi
boliu
2015/07/08 15:26:29
It could recreate only if there is already an exis
| |
952 EstablishSurfaceTexturePeer(); | 953 EstablishSurfaceTexturePeer(); |
954 } | |
953 | 955 |
954 #if defined(VIDEO_HOLE) | 956 #if defined(VIDEO_HOLE) |
955 if (!paused() && needs_external_surface_) | 957 if (!paused() && needs_external_surface_) |
956 player_manager_->RequestExternalSurface(player_id_, last_computed_rect_); | 958 player_manager_->RequestExternalSurface(player_id_, last_computed_rect_); |
957 #endif // defined(VIDEO_HOLE) | 959 #endif // defined(VIDEO_HOLE) |
958 is_fullscreen_ = false; | 960 is_fullscreen_ = false; |
959 client_->repaint(); | 961 client_->repaint(); |
960 } | 962 } |
961 | 963 |
962 void WebMediaPlayerAndroid::OnMediaPlayerPlay() { | 964 void WebMediaPlayerAndroid::OnMediaPlayerPlay() { |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1851 | 1853 |
1852 bool WebMediaPlayerAndroid::IsHLSStream() const { | 1854 bool WebMediaPlayerAndroid::IsHLSStream() const { |
1853 std::string mime; | 1855 std::string mime; |
1854 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; | 1856 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; |
1855 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) | 1857 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) |
1856 return false; | 1858 return false; |
1857 return !mime.compare("application/x-mpegurl"); | 1859 return !mime.compare("application/x-mpegurl"); |
1858 } | 1860 } |
1859 | 1861 |
1860 } // namespace content | 1862 } // namespace content |
OLD | NEW |