| 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 base::Bind(&WebMediaPlayerAndroid::DidLoadMediaInfo, | 212 base::Bind(&WebMediaPlayerAndroid::DidLoadMediaInfo, |
| 213 weak_factory_.GetWeakPtr()))); | 213 weak_factory_.GetWeakPtr()))); |
| 214 info_loader_->Start(frame_); | 214 info_loader_->Start(frame_); |
| 215 } | 215 } |
| 216 | 216 |
| 217 url_ = url; | 217 url_ = url; |
| 218 GURL first_party_url = frame_->document().firstPartyForCookies(); | 218 GURL first_party_url = frame_->document().firstPartyForCookies(); |
| 219 manager_->Initialize( | 219 manager_->Initialize( |
| 220 player_type_, player_id_, url, first_party_url, demuxer_client_id); | 220 player_type_, player_id_, url, first_party_url, demuxer_client_id); |
| 221 | 221 |
| 222 if (manager_->IsInFullscreen(frame_)) | 222 if (manager_->ShouldEnterFullscreen(frame_)) |
| 223 manager_->EnterFullscreen(player_id_); | 223 manager_->EnterFullscreen(player_id_, frame_); |
| 224 | 224 |
| 225 UpdateNetworkState(WebMediaPlayer::NetworkStateLoading); | 225 UpdateNetworkState(WebMediaPlayer::NetworkStateLoading); |
| 226 UpdateReadyState(WebMediaPlayer::ReadyStateHaveNothing); | 226 UpdateReadyState(WebMediaPlayer::ReadyStateHaveNothing); |
| 227 } | 227 } |
| 228 | 228 |
| 229 void WebMediaPlayerAndroid::DidLoadMediaInfo(MediaInfoLoader::Status status) { | 229 void WebMediaPlayerAndroid::DidLoadMediaInfo(MediaInfoLoader::Status status) { |
| 230 DCHECK(!media_source_delegate_); | 230 DCHECK(!media_source_delegate_); |
| 231 if (status == MediaInfoLoader::kFailed) { | 231 if (status == MediaInfoLoader::kFailed) { |
| 232 info_loader_.reset(); | 232 info_loader_.reset(); |
| 233 UpdateNetworkState(WebMediaPlayer::NetworkStateNetworkError); | 233 UpdateNetworkState(WebMediaPlayer::NetworkStateNetworkError); |
| (...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1397 GLES2Interface* gl = stream_texture_factory_->ContextGL(); | 1397 GLES2Interface* gl = stream_texture_factory_->ContextGL(); |
| 1398 | 1398 |
| 1399 if (sync_point) | 1399 if (sync_point) |
| 1400 gl->WaitSyncPointCHROMIUM(sync_point); | 1400 gl->WaitSyncPointCHROMIUM(sync_point); |
| 1401 gl->DeleteTextures(1, &remote_playback_texture_id_); | 1401 gl->DeleteTextures(1, &remote_playback_texture_id_); |
| 1402 remote_playback_texture_id_ = 0; | 1402 remote_playback_texture_id_ = 0; |
| 1403 } | 1403 } |
| 1404 | 1404 |
| 1405 void WebMediaPlayerAndroid::enterFullscreen() { | 1405 void WebMediaPlayerAndroid::enterFullscreen() { |
| 1406 if (manager_->CanEnterFullscreen(frame_)) { | 1406 if (manager_->CanEnterFullscreen(frame_)) { |
| 1407 manager_->EnterFullscreen(player_id_); | 1407 manager_->EnterFullscreen(player_id_, frame_); |
| 1408 SetNeedsEstablishPeer(false); | 1408 SetNeedsEstablishPeer(false); |
| 1409 } | 1409 } |
| 1410 } | 1410 } |
| 1411 | 1411 |
| 1412 void WebMediaPlayerAndroid::exitFullscreen() { | 1412 void WebMediaPlayerAndroid::exitFullscreen() { |
| 1413 manager_->ExitFullscreen(player_id_); | 1413 manager_->ExitFullscreen(player_id_); |
| 1414 } | 1414 } |
| 1415 | 1415 |
| 1416 bool WebMediaPlayerAndroid::canEnterFullscreen() const { | 1416 bool WebMediaPlayerAndroid::canEnterFullscreen() const { |
| 1417 return manager_->CanEnterFullscreen(frame_); | 1417 return manager_->CanEnterFullscreen(frame_); |
| 1418 } | 1418 } |
| 1419 | 1419 |
| 1420 } // namespace content | 1420 } // namespace content |
| OLD | NEW |