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

Unified Diff: content/public/browser/android/video_surface_provider.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/public/browser/android/video_surface_manager.h ('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/video_surface_provider.h
diff --git a/content/public/browser/android/video_surface_provider.h b/content/public/browser/android/video_surface_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..97280949ebb3a906229e000cbee6846f3c0c3454
--- /dev/null
+++ b/content/public/browser/android/video_surface_provider.h
@@ -0,0 +1,48 @@
+// Copyright 2017 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_VIDEO_SURFACE_PROVIDER_H_
+#define CONTENT_PUBLIC_BROWSER_ANDROID_VIDEO_SURFACE_PROVIDER_H_
+
+#include "content/common/content_export.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/gl/android/scoped_java_surface.h"
+
+namespace content {
+
+class CONTENT_EXPORT VideoSurfaceProvider {
+ public:
+ class Client {
+ public:
+ // For receiving notififcations when the 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 video surface has been hidden because we're exiting
+ // fullscreen.
+ virtual void DidExitFullscreen(bool release_media_player) = 0;
+
+ protected:
+ Client() {}
+ ~Client() {}
+
+ DISALLOW_COPY_AND_ASSIGN(Client);
+ };
+
+ // Update the video size.
+ virtual void OnVideoSizeChanged(int width, int height) = 0;
+
+ // Create the video surface and call back to the client when done.
+ virtual void CreateVideoSurface(Client* client,
+ const gfx::Size& video_natural_size) = 0;
+ VideoSurfaceProvider() {}
+ ~VideoSurfaceProvider() {}
+
+ DISALLOW_COPY_AND_ASSIGN(VideoSurfaceProvider);
+
+};
+
+} // namespace content
+#endif // CONTENT_PUBLIC_BROWSER_ANDROID_VIDEO_SURFACE_PROVIDER_H_
« no previous file with comments | « content/public/browser/android/video_surface_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698