Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: content/browser/media/android/browser_media_player_manager.cc

Issue 877253002: Ensure ExternalSurface is idle in fullscreen video mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/browser/media/android/browser_media_player_manager.h" 5 #include "content/browser/media/android/browser_media_player_manager.h"
6 6
7 #include "base/android/scoped_java_ref.h" 7 #include "base/android/scoped_java_ref.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "content/browser/android/content_view_core_impl.h" 9 #include "content/browser/android/content_view_core_impl.h"
10 #include "content/browser/media/android/browser_demuxer_android.h" 10 #include "content/browser/media/android/browser_demuxer_android.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 gfx::ScopedJavaSurface::AcquireExternalSurface(surface)); 313 gfx::ScopedJavaSurface::AcquireExternalSurface(surface));
314 } 314 }
315 } 315 }
316 316
317 void BrowserMediaPlayerManager::DetachExternalVideoSurface(int player_id) { 317 void BrowserMediaPlayerManager::DetachExternalVideoSurface(int player_id) {
318 MediaPlayerAndroid* player = GetPlayer(player_id); 318 MediaPlayerAndroid* player = GetPlayer(player_id);
319 if (player) 319 if (player)
320 player->SetVideoSurface(gfx::ScopedJavaSurface()); 320 player->SetVideoSurface(gfx::ScopedJavaSurface());
321 } 321 }
322 322
323 void BrowserMediaPlayerManager::OnFrameInfoUpdated() { 323 void BrowserMediaPlayerManager::OnFrameInfoUpdated() {
Hugo Holgersson 2015/01/29 15:24:18 I added a print here. In fullscreen video playback
324 if (fullscreen_player_id_ != kInvalidMediaPlayerId)
325 return;
326
324 if (external_video_surface_container_) 327 if (external_video_surface_container_)
325 external_video_surface_container_->OnFrameInfoUpdated(); 328 external_video_surface_container_->OnFrameInfoUpdated();
326 } 329 }
327 330
328 void BrowserMediaPlayerManager::OnNotifyExternalSurface( 331 void BrowserMediaPlayerManager::OnNotifyExternalSurface(
329 int player_id, bool is_request, const gfx::RectF& rect) { 332 int player_id, bool is_request, const gfx::RectF& rect) {
330 if (!web_contents_) 333 if (!web_contents_ || fullscreen_player_id_ != kInvalidMediaPlayerId)
qinmin 2015/01/28 19:31:04 What happens if we exit fullscreen? The external s
william.xie1 2015/01/28 23:33:22 Hi Min, if we exit fullscreen, the external surfac
qinmin 2015/02/02 17:45:07 what if user wrote a script to scroll the page whi
331 return; 334 return;
332 335
333 if (is_request) { 336 if (is_request) {
334 OnRequestExternalSurface(player_id, rect); 337 OnRequestExternalSurface(player_id, rect);
335 } 338 }
336 if (external_video_surface_container_) { 339 if (external_video_surface_container_) {
337 external_video_surface_container_->OnExternalVideoSurfacePositionChanged( 340 external_video_surface_container_->OnExternalVideoSurfacePositionChanged(
338 player_id, rect); 341 player_id, rect);
339 } 342 }
340 } 343 }
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); 580 external_video_surface_container_->ReleaseExternalVideoSurface(player_id);
578 #endif // defined(VIDEO_HOLE) 581 #endif // defined(VIDEO_HOLE)
579 } 582 }
580 583
581 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) { 584 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) {
582 player->Release(); 585 player->Release();
583 ReleaseMediaResources(player->player_id()); 586 ReleaseMediaResources(player->player_id());
584 } 587 }
585 588
586 } // namespace content 589 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698