| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1014 void WebMediaPlayerAndroid::OnDisconnectedFromRemoteDevice() { | 1014 void WebMediaPlayerAndroid::OnDisconnectedFromRemoteDevice() { |
| 1015 DCHECK(main_thread_checker_.CalledOnValidThread()); | 1015 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 1016 SetNeedsEstablishPeer(true); | 1016 SetNeedsEstablishPeer(true); |
| 1017 if (!paused()) | 1017 if (!paused()) |
| 1018 EstablishSurfaceTexturePeer(); | 1018 EstablishSurfaceTexturePeer(); |
| 1019 is_remote_ = false; | 1019 is_remote_ = false; |
| 1020 ReallocateVideoFrame(); | 1020 ReallocateVideoFrame(); |
| 1021 client_->disconnectedFromRemoteDevice(); | 1021 client_->disconnectedFromRemoteDevice(); |
| 1022 } | 1022 } |
| 1023 | 1023 |
| 1024 void WebMediaPlayerAndroid::OnCancelledRemotePlaybackRequest() { |
| 1025 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 1026 client_->cancelledRemotePlaybackRequest(); |
| 1027 } |
| 1028 |
| 1024 void WebMediaPlayerAndroid::OnDidExitFullscreen() { | 1029 void WebMediaPlayerAndroid::OnDidExitFullscreen() { |
| 1025 // |needs_external_surface_| is always false on non-TV devices. | 1030 // |needs_external_surface_| is always false on non-TV devices. |
| 1026 if (!needs_external_surface_) | 1031 if (!needs_external_surface_) |
| 1027 SetNeedsEstablishPeer(true); | 1032 SetNeedsEstablishPeer(true); |
| 1028 // We had the fullscreen surface connected to Android MediaPlayer, | 1033 // We had the fullscreen surface connected to Android MediaPlayer, |
| 1029 // so reconnect our surface texture for embedded playback. | 1034 // so reconnect our surface texture for embedded playback. |
| 1030 if (!paused() && needs_establish_peer_) { | 1035 if (!paused() && needs_establish_peer_) { |
| 1031 TryCreateStreamTextureProxyIfNeeded(); | 1036 TryCreateStreamTextureProxyIfNeeded(); |
| 1032 EstablishSurfaceTexturePeer(); | 1037 EstablishSurfaceTexturePeer(); |
| 1033 suppress_deleting_texture_ = true; | 1038 suppress_deleting_texture_ = true; |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1671 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; | 1676 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; |
| 1672 } else if (is_hls_url == is_hls) { | 1677 } else if (is_hls_url == is_hls) { |
| 1673 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; | 1678 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; |
| 1674 } | 1679 } |
| 1675 UMA_HISTOGRAM_ENUMERATION( | 1680 UMA_HISTOGRAM_ENUMERATION( |
| 1676 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", | 1681 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", |
| 1677 result, PREDICTION_RESULT_MAX); | 1682 result, PREDICTION_RESULT_MAX); |
| 1678 } | 1683 } |
| 1679 | 1684 |
| 1680 } // namespace content | 1685 } // namespace content |
| OLD | NEW |