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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 if (fullscreen_player_id_ != -1) { | 317 if (fullscreen_player_id_ != -1) { |
318 // TODO(qinmin): Determine the correct error code we should report to WMPA. | 318 // TODO(qinmin): Determine the correct error code we should report to WMPA. |
319 OnError(player_id, MediaPlayerAndroid::MEDIA_ERROR_DECODE); | 319 OnError(player_id, MediaPlayerAndroid::MEDIA_ERROR_DECODE); |
320 return; | 320 return; |
321 } | 321 } |
322 | 322 |
323 Send(new MediaPlayerMsg_RequestFullscreen(RoutingID(), player_id)); | 323 Send(new MediaPlayerMsg_RequestFullscreen(RoutingID(), player_id)); |
324 } | 324 } |
325 | 325 |
326 #if defined(VIDEO_HOLE) | 326 #if defined(VIDEO_HOLE) |
| 327 bool |
| 328 BrowserMediaPlayerManager::ShouldUseVideoOverlayForEmbeddedEncryptedVideo() { |
| 329 RendererPreferences* prefs = web_contents_->GetMutableRendererPrefs(); |
| 330 return prefs->use_video_overlay_for_embedded_encrypted_video; |
| 331 } |
| 332 |
327 void BrowserMediaPlayerManager::AttachExternalVideoSurface(int player_id, | 333 void BrowserMediaPlayerManager::AttachExternalVideoSurface(int player_id, |
328 jobject surface) { | 334 jobject surface) { |
329 MediaPlayerAndroid* player = GetPlayer(player_id); | 335 MediaPlayerAndroid* player = GetPlayer(player_id); |
330 if (player) { | 336 if (player) { |
331 player->SetVideoSurface( | 337 player->SetVideoSurface( |
332 gfx::ScopedJavaSurface::AcquireExternalSurface(surface)); | 338 gfx::ScopedJavaSurface::AcquireExternalSurface(surface)); |
333 } | 339 } |
334 } | 340 } |
335 | 341 |
336 void BrowserMediaPlayerManager::DetachExternalVideoSurface(int player_id) { | 342 void BrowserMediaPlayerManager::DetachExternalVideoSurface(int player_id) { |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 #if defined(VIDEO_HOLE) | 574 #if defined(VIDEO_HOLE) |
569 MediaPlayerAndroid* player = GetPlayer(player_id); | 575 MediaPlayerAndroid* player = GetPlayer(player_id); |
570 if (player && player->IsSurfaceInUse()) | 576 if (player && player->IsSurfaceInUse()) |
571 return; | 577 return; |
572 if (external_video_surface_container_) | 578 if (external_video_surface_container_) |
573 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); | 579 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); |
574 #endif // defined(VIDEO_HOLE) | 580 #endif // defined(VIDEO_HOLE) |
575 } | 581 } |
576 | 582 |
577 } // namespace content | 583 } // namespace content |
OLD | NEW |