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

Unified Diff: content/public/browser/android/external_video_surface_container.h

Issue 132233042: Enable the embedded L1/EME support in WebView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 10 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
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/android/external_video_surface_container.h
diff --git a/content/public/browser/android/external_video_surface_container.h b/content/public/browser/android/external_video_surface_container.h
new file mode 100644
index 0000000000000000000000000000000000000000..1b630e1dbe620326b3ea539d574e012ff1885b86
--- /dev/null
+++ b/content/public/browser/android/external_video_surface_container.h
@@ -0,0 +1,61 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_BROWSER_ANDROID_EXTERNAL_VIDEO_SURFACE_CONTAINER_H_
+#define CONTENT_PUBLIC_BROWSER_ANDROID_EXTERNAL_VIDEO_SURFACE_CONTAINER_H_
+
+#include <jni.h>
+
+#include "base/callback.h"
+#include "content/common/content_export.h"
+
+namespace gfx {
+class RectF;
+}
+
+namespace content {
+class WebContents;
+
+// An interface used for managing the video surface for the hole punching.
+class CONTENT_EXPORT ExternalVideoSurfaceContainer {
+ public:
+ typedef base::Callback<void(int, jobject)> SurfaceCreatedCB;
+ typedef base::Callback<void(int)> SurfaceDestroyedCB;
+
+ // Creates an ExternalVideoSurfaceContainer, and attaches it to the given
+ // WebContents. If an instance is already attached, does nothing.
+ static void CreateForWebContents(WebContents* contents);
+
+ // Returns the existing ExternalVideoSurfaceContainer attached to the given
+ // WebContents or NULL.
+ static ExternalVideoSurfaceContainer* FromWebContents(WebContents* contents);
+
+ // Called when a media player wants to request an external video surface.
+ // Whenever the surface is created and visible, |surface_created_cb| will be
+ // called. And whenever it is destroyed or invisible, |surface_destroyed_cb|
+ // will be called.
+ virtual void RequestExternalVideoSurface(
+ int player_id,
+ const SurfaceCreatedCB& surface_created_cb,
+ const SurfaceDestroyedCB& surface_destroyed_cb) = 0;
+
+ // Called when a media player wants to release an external video surface.
+ virtual void ReleaseExternalVideoSurface(int player_id) = 0;
+
+ // Called when the position and size of the video element which uses
+ // the external video surface is changed.
+ // |rect| contains the new position and size in css pixels.
+ virtual void OnExternalVideoSurfacePositionChanged(
+ int player_id, const gfx::RectF& rect) = 0;
+
+ // Called when the page that contains the video element is scrolled or zoomed.
+ virtual void OnFrameInfoUpdated() = 0;
+
+ protected:
+ virtual ~ExternalVideoSurfaceContainer() {}
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_ANDROID_EXTERNAL_VIDEO_SURFACE_CONTAINER_H_
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698