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/android/media_players_observer.h" | 10 #include "content/browser/android/media_players_observer.h" |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 if (fullscreen_player_id_ != kInvalidMediaPlayerId) { | 312 if (fullscreen_player_id_ != kInvalidMediaPlayerId) { |
313 // TODO(qinmin): Determine the correct error code we should report to WMPA. | 313 // TODO(qinmin): Determine the correct error code we should report to WMPA. |
314 OnError(player_id, MediaPlayerAndroid::MEDIA_ERROR_DECODE); | 314 OnError(player_id, MediaPlayerAndroid::MEDIA_ERROR_DECODE); |
315 return; | 315 return; |
316 } | 316 } |
317 | 317 |
318 Send(new MediaPlayerMsg_RequestFullscreen(RoutingID(), player_id)); | 318 Send(new MediaPlayerMsg_RequestFullscreen(RoutingID(), player_id)); |
319 } | 319 } |
320 | 320 |
321 #if defined(VIDEO_HOLE) | 321 #if defined(VIDEO_HOLE) |
322 bool | |
323 BrowserMediaPlayerManager::ShouldUseVideoOverlayForEmbeddedEncryptedVideo() { | |
324 RendererPreferences* prefs = web_contents_->GetMutableRendererPrefs(); | |
325 return prefs->use_video_overlay_for_embedded_encrypted_video; | |
326 } | |
327 | |
328 void BrowserMediaPlayerManager::AttachExternalVideoSurface(int player_id, | 322 void BrowserMediaPlayerManager::AttachExternalVideoSurface(int player_id, |
329 jobject surface) { | 323 jobject surface) { |
330 MediaPlayerAndroid* player = GetPlayer(player_id); | 324 MediaPlayerAndroid* player = GetPlayer(player_id); |
331 if (player) { | 325 if (player) { |
332 player->SetVideoSurface( | 326 player->SetVideoSurface( |
333 gfx::ScopedJavaSurface::AcquireExternalSurface(surface)); | 327 gfx::ScopedJavaSurface::AcquireExternalSurface(surface)); |
334 } | 328 } |
335 } | 329 } |
336 | 330 |
337 void BrowserMediaPlayerManager::DetachExternalVideoSurface(int player_id) { | 331 void BrowserMediaPlayerManager::DetachExternalVideoSurface(int player_id) { |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); | 595 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); |
602 #endif // defined(VIDEO_HOLE) | 596 #endif // defined(VIDEO_HOLE) |
603 } | 597 } |
604 | 598 |
605 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) { | 599 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) { |
606 player->Release(); | 600 player->Release(); |
607 ReleaseMediaResources(player->player_id()); | 601 ReleaseMediaResources(player->player_id()); |
608 } | 602 } |
609 | 603 |
610 } // namespace content | 604 } // namespace content |
OLD | NEW |