| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 media_player_params.player_id, | 78 media_player_params.player_id, |
| 79 media_player_params.url, | 79 media_player_params.url, |
| 80 media_player_params.first_party_for_cookies, | 80 media_player_params.first_party_for_cookies, |
| 81 user_agent, | 81 user_agent, |
| 82 hide_url_log, | 82 hide_url_log, |
| 83 manager, | 83 manager, |
| 84 base::Bind(&BrowserMediaPlayerManager::OnMediaResourcesRequested, | 84 base::Bind(&BrowserMediaPlayerManager::OnMediaResourcesRequested, |
| 85 weak_ptr_factory_.GetWeakPtr()), | 85 weak_ptr_factory_.GetWeakPtr()), |
| 86 base::Bind(&BrowserMediaPlayerManager::OnMediaResourcesReleased, | 86 base::Bind(&BrowserMediaPlayerManager::OnMediaResourcesReleased, |
| 87 weak_ptr_factory_.GetWeakPtr()), | 87 weak_ptr_factory_.GetWeakPtr()), |
| 88 media_player_params.frame_url); | 88 media_player_params.frame_url, |
| 89 media_player_params.allow_credentials); |
| 89 BrowserMediaPlayerManager* browser_media_player_manager = | 90 BrowserMediaPlayerManager* browser_media_player_manager = |
| 90 static_cast<BrowserMediaPlayerManager*>(manager); | 91 static_cast<BrowserMediaPlayerManager*>(manager); |
| 91 ContentViewCoreImpl* content_view_core_impl = | 92 ContentViewCoreImpl* content_view_core_impl = |
| 92 static_cast<ContentViewCoreImpl*>(ContentViewCore::FromWebContents( | 93 static_cast<ContentViewCoreImpl*>(ContentViewCore::FromWebContents( |
| 93 browser_media_player_manager->web_contents_)); | 94 browser_media_player_manager->web_contents_)); |
| 94 if (!content_view_core_impl) { | 95 if (!content_view_core_impl) { |
| 95 // May reach here due to prerendering. Don't extract the metadata | 96 // May reach here due to prerendering. Don't extract the metadata |
| 96 // since it is expensive. | 97 // since it is expensive. |
| 97 // TODO(qinmin): extract the metadata once the user decided to load | 98 // TODO(qinmin): extract the metadata once the user decided to load |
| 98 // the page. | 99 // the page. |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 #if defined(VIDEO_HOLE) | 586 #if defined(VIDEO_HOLE) |
| 586 MediaPlayerAndroid* player = GetPlayer(player_id); | 587 MediaPlayerAndroid* player = GetPlayer(player_id); |
| 587 if (player && player->IsSurfaceInUse()) | 588 if (player && player->IsSurfaceInUse()) |
| 588 return; | 589 return; |
| 589 if (external_video_surface_container_) | 590 if (external_video_surface_container_) |
| 590 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); | 591 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); |
| 591 #endif // defined(VIDEO_HOLE) | 592 #endif // defined(VIDEO_HOLE) |
| 592 } | 593 } |
| 593 | 594 |
| 594 } // namespace content | 595 } // namespace content |
| OLD | NEW |