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

Unified Diff: media/base/surface_manager.h

Issue 1655083002: Enable SurfaceView fullscreen video on Android with WebMediaPlayerImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@avda-sv
Patch Set: Add an empty destructor to satisfy chromium-style Created 4 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 | « media/base/renderer_factory.h ('k') | media/blink/webmediaplayer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/surface_manager.h
diff --git a/media/base/surface_manager.h b/media/base/surface_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..84df7c136d6fb26707902f67af4bbeb44a3855de
--- /dev/null
+++ b/media/base/surface_manager.h
@@ -0,0 +1,45 @@
+// Copyright 2016 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 MEDIA_BASE_SURFACE_MANAGER_H_
+#define MEDIA_BASE_SURFACE_MANAGER_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "media/base/media_export.h"
+#include "ui/gfx/geometry/size.h"
+
+namespace media {
+
+using SurfaceCreatedCB = base::Callback<void(int)>;
+using RequestSurfaceCB = base::Callback<void(const SurfaceCreatedCB&)>;
+
+class MEDIA_EXPORT SurfaceManager {
+ public:
+ enum { kNoSurfaceID = -1 };
+
+ SurfaceManager() {}
+ virtual ~SurfaceManager() {}
+
+ // Create a fullscreen surface. The id will be returned with
+ // |surface_created_cb|. If this is called more than once before the first
+ // |surface_created_cb| is called, the surface will be delivered to the last
+ // caller. If this is called after the fullscreen surface is created, the
+ // existing surface will be returned. The client should ensure that the
+ // previous consumer is no longer using the surface.
+ virtual void CreateFullscreenSurface(
+ const gfx::Size& video_natural_size,
+ const SurfaceCreatedCB& surface_created_cb) = 0;
+
+ // Call this when the natural size of the fullscreen video changes. The
+ // surface will be resized to match the aspect ratio.
+ virtual void NaturalSizeChanged(const gfx::Size& size) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SurfaceManager);
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_SURFACE_MANAGER_H_
« no previous file with comments | « media/base/renderer_factory.h ('k') | media/blink/webmediaplayer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698