| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 MediaPlayerAndroid* player = GetFullscreenPlayer(); | 186 MediaPlayerAndroid* player = GetFullscreenPlayer(); |
| 187 fullscreen_player_id_ = -1; | 187 fullscreen_player_id_ = -1; |
| 188 if (!player) | 188 if (!player) |
| 189 return; | 189 return; |
| 190 if (release_media_player) | 190 if (release_media_player) |
| 191 ReleaseFullscreenPlayer(player); | 191 ReleaseFullscreenPlayer(player); |
| 192 else | 192 else |
| 193 player->SetVideoSurface(gfx::ScopedJavaSurface()); | 193 player->SetVideoSurface(gfx::ScopedJavaSurface()); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void BrowserMediaPlayerManager::OnTimeUpdate(int player_id, | 196 void BrowserMediaPlayerManager::OnTimeUpdate( |
| 197 base::TimeDelta current_time) { | 197 int player_id, |
| 198 Send( | 198 base::TimeDelta current_timestamp, |
| 199 new MediaPlayerMsg_MediaTimeUpdate(RoutingID(), player_id, current_time)); | 199 base::TimeTicks current_time_ticks) { |
| 200 Send(new MediaPlayerMsg_MediaTimeUpdate( |
| 201 RoutingID(), player_id, current_timestamp, current_time_ticks)); |
| 200 } | 202 } |
| 201 | 203 |
| 202 void BrowserMediaPlayerManager::SetVideoSurface( | 204 void BrowserMediaPlayerManager::SetVideoSurface( |
| 203 gfx::ScopedJavaSurface surface) { | 205 gfx::ScopedJavaSurface surface) { |
| 204 MediaPlayerAndroid* player = GetFullscreenPlayer(); | 206 MediaPlayerAndroid* player = GetFullscreenPlayer(); |
| 205 if (!player) | 207 if (!player) |
| 206 return; | 208 return; |
| 207 | 209 |
| 208 bool empty_surface = surface.IsEmpty(); | 210 bool empty_surface = surface.IsEmpty(); |
| 209 player->SetVideoSurface(surface.Pass()); | 211 player->SetVideoSurface(surface.Pass()); |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); | 599 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); |
| 598 #endif // defined(VIDEO_HOLE) | 600 #endif // defined(VIDEO_HOLE) |
| 599 } | 601 } |
| 600 | 602 |
| 601 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) { | 603 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) { |
| 602 player->Release(); | 604 player->Release(); |
| 603 ReleaseMediaResources(player->player_id()); | 605 ReleaseMediaResources(player->player_id()); |
| 604 } | 606 } |
| 605 | 607 |
| 606 } // namespace content | 608 } // namespace content |
| OLD | NEW |