| 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 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1141 | 1141 |
| 1142 // No factory to create proxy. | 1142 // No factory to create proxy. |
| 1143 if (!stream_texture_factory_.get()) | 1143 if (!stream_texture_factory_.get()) |
| 1144 return; | 1144 return; |
| 1145 | 1145 |
| 1146 // Not needed for hole punching. | 1146 // Not needed for hole punching. |
| 1147 if (!needs_establish_peer_) | 1147 if (!needs_establish_peer_) |
| 1148 return; | 1148 return; |
| 1149 | 1149 |
| 1150 DCHECK(!texture_id_); | 1150 DCHECK(!texture_id_); |
| 1151 stream_texture_proxy_.reset(stream_texture_factory_->CreateProxy( | 1151 stream_texture_proxy_ = stream_texture_factory_->CreateProxy( |
| 1152 kGLTextureExternalOES, &texture_id_, &texture_mailbox_)); | 1152 kGLTextureExternalOES, &texture_id_, &texture_mailbox_); |
| 1153 if (!stream_texture_proxy_) | 1153 if (!stream_texture_proxy_) |
| 1154 return; | 1154 return; |
| 1155 ReallocateVideoFrame(); | 1155 ReallocateVideoFrame(); |
| 1156 if (video_frame_provider_client_) | 1156 if (video_frame_provider_client_) |
| 1157 UpdateStreamTextureProxyCallback(video_frame_provider_client_); | 1157 UpdateStreamTextureProxyCallback(video_frame_provider_client_); |
| 1158 } | 1158 } |
| 1159 | 1159 |
| 1160 void WebMediaPlayerAndroid::EstablishSurfaceTexturePeer() { | 1160 void WebMediaPlayerAndroid::EstablishSurfaceTexturePeer() { |
| 1161 DCHECK(main_thread_checker_.CalledOnValidThread()); | 1161 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 1162 if (!stream_texture_proxy_) | 1162 if (!stream_texture_proxy_) |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1319 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1319 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1320 switches::kDisableMediaSuspend)) { | 1320 switches::kDisableMediaSuspend)) { |
| 1321 return false; | 1321 return false; |
| 1322 } | 1322 } |
| 1323 | 1323 |
| 1324 return base::FeatureList::IsEnabled(media::kResumeBackgroundVideo) && | 1324 return base::FeatureList::IsEnabled(media::kResumeBackgroundVideo) && |
| 1325 hasAudio() && !isRemote() && delegate_ && delegate_->IsHidden(); | 1325 hasAudio() && !isRemote() && delegate_ && delegate_->IsHidden(); |
| 1326 } | 1326 } |
| 1327 | 1327 |
| 1328 } // namespace content | 1328 } // namespace content |
| OLD | NEW |