| 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_
|
|
|