Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(811)

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 12443003: Implement out-of-band video compositing on Android: Step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/android/media_player_manager_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698