Index: content/browser/android/content_view_core_impl.cc |
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc |
index acf06bcb96cc18b59d304858599debb345b79878..96916f497ef71bd99dab85db03744f9153892a0d 100644 |
--- a/content/browser/android/content_view_core_impl.cc |
+++ b/content/browser/android/content_view_core_impl.cc |
@@ -16,6 +16,7 @@ |
#include "cc/layers/layer.h" |
#include "content/browser/android/interstitial_page_delegate_android.h" |
#include "content/browser/android/load_url_params.h" |
+#include "content/browser/android/media_player_manager_android.h" |
#include "content/browser/android/sync_input_event_filter.h" |
#include "content/browser/android/touch_point.h" |
#include "content/browser/renderer_host/compositor_impl_android.h" |
@@ -588,6 +589,17 @@ void ContentViewCoreImpl::ShowDisambiguationPopup( |
java_bitmap.obj()); |
} |
+void ContentViewCoreImpl::RequestExternalVideoSurface(int player_id) { |
+ JNIEnv* env = AttachCurrentThread(); |
+ |
+ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
+ if (obj.is_null()) |
+ return; |
+ |
+ Java_ContentViewCore_requestExternalVideoSurface( |
+ env, obj.obj(), static_cast<jint>(player_id)); |
+} |
+ |
gfx::Size ContentViewCoreImpl::GetPhysicalBackingSize() const { |
JNIEnv* env = AttachCurrentThread(); |
ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
@@ -1177,6 +1189,29 @@ jboolean ContentViewCoreImpl::ConsumePendingRendererFrame(JNIEnv* env, |
return had_pending_frame; |
} |
+void ContentViewCoreImpl::AttachExternalVideoSurface(JNIEnv* env, |
+ jobject obj, |
+ jint player_id, |
+ jobject jsurface) { |
+ RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>( |
+ web_contents_->GetRenderViewHost()); |
+ if (rvhi && rvhi->media_player_manager()) { |
+ rvhi->media_player_manager()->AttachExternalVideoSurface( |
+ static_cast<int>(player_id), jsurface); |
+ } |
+} |
+ |
+void ContentViewCoreImpl::DetachExternalVideoSurface(JNIEnv* env, |
+ jobject obj, |
+ jint player_id) { |
+ RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>( |
+ web_contents_->GetRenderViewHost()); |
+ if (rvhi && rvhi->media_player_manager()) { |
+ rvhi->media_player_manager()->DetachExternalVideoSurface( |
+ static_cast<int>(player_id)); |
+ } |
+} |
+ |
jboolean ContentViewCoreImpl::IsRenderWidgetHostViewReady(JNIEnv* env, |
jobject obj) { |
RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |