OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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_BROWSER_MEDIA_ANDROID_BROWSER_SURFACE_VIEW_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_SURFACE_VIEW_MANAGER_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "content/browser/android/content_video_view.h" |
| 13 #include "content/common/content_export.h" |
| 14 #include "ui/gfx/geometry/size.h" |
| 15 |
| 16 namespace content { |
| 17 |
| 18 class RenderFrameHost; |
| 19 |
| 20 // BrowserSurfaceViewManager creates and owns a ContentVideoView on behalf of |
| 21 // a fullscreen media player. Its SurfaceView is registered so that a decoder |
| 22 // in the GPU process can look it up and render to it. |
| 23 class CONTENT_EXPORT BrowserSurfaceViewManager |
| 24 : public ContentVideoView::Client { |
| 25 public: |
| 26 explicit BrowserSurfaceViewManager(RenderFrameHost* render_frame_host); |
| 27 ~BrowserSurfaceViewManager(); |
| 28 |
| 29 // ContentVideoView::Client overrides. |
| 30 void SetVideoSurface(gfx::ScopedJavaSurface surface) override; |
| 31 void DidExitFullscreen(bool release_media_player) override; |
| 32 |
| 33 void OnCreateFullscreenSurface(const gfx::Size& video_natural_size); |
| 34 void OnNaturalSizeChanged(const gfx::Size& size); |
| 35 |
| 36 private: |
| 37 // Send a message to return the surface id to the caller. |
| 38 bool SendSurfaceID(int surface_id); |
| 39 |
| 40 RenderFrameHost* const render_frame_host_; |
| 41 |
| 42 // The surface id of the ContentVideoView surface. |
| 43 int surface_id_; |
| 44 |
| 45 // The fullscreen view that contains a SurfaceView. |
| 46 scoped_ptr<ContentVideoView> content_video_view_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(BrowserSurfaceViewManager); |
| 49 }; |
| 50 |
| 51 } // namespace content |
| 52 |
| 53 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_SURFACE_VIEW_MANAGER_H_ |
OLD | NEW |