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

Unified Diff: content/browser/android/content_video_view.h

Issue 2567233002: Use GVR async reprojection video surface for fullscreen in VR shell
Patch Set: Refactor using new interface and manager, also rebased Created 3 years, 11 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/browser/BUILD.gn ('k') | content/browser/android/content_video_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/content_video_view.h
diff --git a/content/browser/android/content_video_view.h b/content/browser/android/content_video_view.h
index cb9c0d3f60003d8408d5a36511c86cefad349a8e..cc552f3dce7d1f060756cec8d9562f6ccace71bc 100644
--- a/content/browser/android/content_video_view.h
+++ b/content/browser/android/content_video_view.h
@@ -12,6 +12,8 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/android/content_view_core.h"
+#include "content/public/browser/android/video_surface_provider.h"
+#include "ui/gfx/geometry/size.h"
#include "ui/gl/android/scoped_java_surface.h"
namespace content {
@@ -19,35 +21,15 @@ namespace content {
// Native mirror of ContentVideoView.java. This class is responsible for
// creating the Java video view and passing changes in player status to it.
// This class must be used on the UI thread.
-class ContentVideoView {
+class ContentVideoView : public content::VideoSurfaceProvider {
public:
static bool RegisterContentVideoView(JNIEnv* env);
// Returns the singleton object or NULL.
static ContentVideoView* GetInstance();
- class Client {
- public:
- Client() {}
- // For receiving notififcations when the SurfaceView surface is created and
- // destroyed. When |surface.IsEmpty()| the surface was destroyed and
- // the client should not hold any references to it once this returns.
- virtual void SetVideoSurface(gl::ScopedJavaSurface surface) = 0;
-
- // Called after the ContentVideoView has been hidden because we're exiting
- // fullscreen.
- virtual void DidExitFullscreen(bool release_media_player) = 0;
-
- protected:
- ~Client() {}
-
- DISALLOW_COPY_AND_ASSIGN(Client);
- };
-
- explicit ContentVideoView(Client* client,
- ContentViewCore* content_view_core,
- const base::android::JavaRef<jobject>& embedder,
- const gfx::Size& video_natural_size);
+ explicit ContentVideoView(ContentViewCore* content_view_core,
+ const base::android::JavaRef<jobject>& embedder);
~ContentVideoView();
// To open another video on existing ContentVideoView.
@@ -57,7 +39,12 @@ class ContentVideoView {
void OnMediaPlayerError(int error_type);
// Update the video size.
- void OnVideoSizeChanged(int width, int height);
+ void OnVideoSizeChanged(int width, int height) override;
+
+ // Instantiates the Java object and creates the video surface.
+ void CreateVideoSurface(VideoSurfaceProvider::Client* client,
+ const gfx::Size& video_natural_size) override;
+
// Exit fullscreen and notify |client_| with |DidExitFullscreen|.
void ExitFullscreen();
@@ -91,12 +78,11 @@ class ContentVideoView {
private:
// Creates the corresponding ContentVideoView Java object.
- JavaObjectWeakGlobalRef CreateJavaObject(
- ContentViewCore* content_view_core,
- const base::android::JavaRef<jobject>& j_content_video_view_embedder,
- const gfx::Size& video_natural_size);
+ JavaObjectWeakGlobalRef CreateJavaObject(const gfx::Size& video_natural_size);
- Client* client_;
+ VideoSurfaceProvider::Client* client_;
+ ContentViewCore* cvc_;
+ const base::android::JavaRef<jobject>& j_content_video_view_embedder_;
// Weak reference to corresponding Java object.
JavaObjectWeakGlobalRef j_content_video_view_;
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/android/content_video_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698