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/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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 view_android->SetOverlayVideoMode(false); | 145 view_android->SetOverlayVideoMode(false); |
146 } | 146 } |
147 | 147 |
148 Send( | 148 Send( |
149 new MediaPlayerMsg_DidExitFullscreen(RoutingID(), fullscreen_player_id_)); | 149 new MediaPlayerMsg_DidExitFullscreen(RoutingID(), fullscreen_player_id_)); |
150 video_view_.reset(); | 150 video_view_.reset(); |
151 MediaPlayerAndroid* player = GetFullscreenPlayer(); | 151 MediaPlayerAndroid* player = GetFullscreenPlayer(); |
152 fullscreen_player_id_ = kInvalidMediaPlayerId; | 152 fullscreen_player_id_ = kInvalidMediaPlayerId; |
153 if (!player) | 153 if (!player) |
154 return; | 154 return; |
| 155 |
| 156 #if defined(VIDEO_HOLE) |
| 157 if (external_video_surface_container_) |
| 158 external_video_surface_container_->OnFrameInfoUpdated(); |
| 159 #endif // defined(VIDEO_HOLE) |
| 160 |
155 if (release_media_player) | 161 if (release_media_player) |
156 ReleaseFullscreenPlayer(player); | 162 ReleaseFullscreenPlayer(player); |
157 else | 163 else |
158 player->SetVideoSurface(gfx::ScopedJavaSurface()); | 164 player->SetVideoSurface(gfx::ScopedJavaSurface()); |
159 } | 165 } |
160 | 166 |
161 void BrowserMediaPlayerManager::OnTimeUpdate( | 167 void BrowserMediaPlayerManager::OnTimeUpdate( |
162 int player_id, | 168 int player_id, |
163 base::TimeDelta current_timestamp, | 169 base::TimeDelta current_timestamp, |
164 base::TimeTicks current_time_ticks) { | 170 base::TimeTicks current_time_ticks) { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 } | 320 } |
315 } | 321 } |
316 | 322 |
317 void BrowserMediaPlayerManager::DetachExternalVideoSurface(int player_id) { | 323 void BrowserMediaPlayerManager::DetachExternalVideoSurface(int player_id) { |
318 MediaPlayerAndroid* player = GetPlayer(player_id); | 324 MediaPlayerAndroid* player = GetPlayer(player_id); |
319 if (player) | 325 if (player) |
320 player->SetVideoSurface(gfx::ScopedJavaSurface()); | 326 player->SetVideoSurface(gfx::ScopedJavaSurface()); |
321 } | 327 } |
322 | 328 |
323 void BrowserMediaPlayerManager::OnFrameInfoUpdated() { | 329 void BrowserMediaPlayerManager::OnFrameInfoUpdated() { |
| 330 if (fullscreen_player_id_ != kInvalidMediaPlayerId) |
| 331 return; |
| 332 |
324 if (external_video_surface_container_) | 333 if (external_video_surface_container_) |
325 external_video_surface_container_->OnFrameInfoUpdated(); | 334 external_video_surface_container_->OnFrameInfoUpdated(); |
326 } | 335 } |
327 | 336 |
328 void BrowserMediaPlayerManager::OnNotifyExternalSurface( | 337 void BrowserMediaPlayerManager::OnNotifyExternalSurface( |
329 int player_id, bool is_request, const gfx::RectF& rect) { | 338 int player_id, bool is_request, const gfx::RectF& rect) { |
330 if (!web_contents_) | 339 if (!web_contents_) |
331 return; | 340 return; |
332 | 341 |
333 if (is_request) { | 342 if (is_request) { |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); | 586 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); |
578 #endif // defined(VIDEO_HOLE) | 587 #endif // defined(VIDEO_HOLE) |
579 } | 588 } |
580 | 589 |
581 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) { | 590 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) { |
582 player->Release(); | 591 player->Release(); |
583 ReleaseMediaResources(player->player_id()); | 592 ReleaseMediaResources(player->player_id()); |
584 } | 593 } |
585 | 594 |
586 } // namespace content | 595 } // namespace content |
OLD | NEW |