| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_VIDEO_SURFACE_PROVIDER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_VIDEO_SURFACE_PROVIDER_H_ |
| 7 |
| 8 #include "content/common/content_export.h" |
| 9 #include "ui/gfx/geometry/size.h" |
| 10 #include "ui/gl/android/scoped_java_surface.h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 class CONTENT_EXPORT VideoSurfaceProvider { |
| 15 public: |
| 16 class Client { |
| 17 public: |
| 18 // For receiving notififcations when the surface is created and |
| 19 // destroyed. When |surface.IsEmpty()| the surface was destroyed and |
| 20 // the client should not hold any references to it once this returns. |
| 21 virtual void SetVideoSurface(gl::ScopedJavaSurface surface) = 0; |
| 22 |
| 23 // Called after the video surface has been hidden because we're exiting |
| 24 // fullscreen. |
| 25 virtual void DidExitFullscreen(bool release_media_player) = 0; |
| 26 |
| 27 protected: |
| 28 Client() {} |
| 29 ~Client() {} |
| 30 |
| 31 DISALLOW_COPY_AND_ASSIGN(Client); |
| 32 }; |
| 33 |
| 34 // Update the video size. |
| 35 virtual void OnVideoSizeChanged(int width, int height) = 0; |
| 36 |
| 37 // Create the video surface and call back to the client when done. |
| 38 virtual void CreateVideoSurface(Client* client, |
| 39 const gfx::Size& video_natural_size) = 0; |
| 40 VideoSurfaceProvider() {} |
| 41 ~VideoSurfaceProvider() {} |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(VideoSurfaceProvider); |
| 44 |
| 45 }; |
| 46 |
| 47 } // namespace content |
| 48 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_VIDEO_SURFACE_PROVIDER_H_ |
| OLD | NEW |