| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_SURFACE_VIEW_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_SURFACE_VIEW_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_SURFACE_VIEW_MANAGER_H_ | 6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_SURFACE_VIEW_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 void SetVideoSurface(gfx::ScopedJavaSurface surface) override; | 30 void SetVideoSurface(gfx::ScopedJavaSurface surface) override; |
| 31 void DidExitFullscreen(bool release_media_player) override; | 31 void DidExitFullscreen(bool release_media_player) override; |
| 32 | 32 |
| 33 void OnCreateFullscreenSurface(const gfx::Size& video_natural_size); | 33 void OnCreateFullscreenSurface(const gfx::Size& video_natural_size); |
| 34 void OnNaturalSizeChanged(const gfx::Size& size); | 34 void OnNaturalSizeChanged(const gfx::Size& size); |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 // Send a message to return the surface id to the caller. | 37 // Send a message to return the surface id to the caller. |
| 38 bool SendSurfaceID(int surface_id); | 38 bool SendSurfaceID(int surface_id); |
| 39 | 39 |
| 40 // Synchronously notify the decoder that the surface is being destroyed so |
| 41 // it can stop rendering to it. Without this, the MediaCodec decoder will |
| 42 // start throwing IllegalStateException, and crash on some devices |
| 43 // (http://crbug.com/598408). There is no way for us to make sure the surface |
| 44 // outlives the decoder because Android initiates the destruction in some |
| 45 // cases. |
| 46 void SendDestroyingVideoSurface(int surface_id); |
| 47 |
| 40 RenderFrameHost* const render_frame_host_; | 48 RenderFrameHost* const render_frame_host_; |
| 41 | 49 |
| 42 // The surface id of the ContentVideoView surface. | 50 // The surface id of the ContentVideoView surface. |
| 43 int surface_id_; | 51 int surface_id_; |
| 44 | 52 |
| 45 // The fullscreen view that contains a SurfaceView. | 53 // The fullscreen view that contains a SurfaceView. |
| 46 scoped_ptr<ContentVideoView> content_video_view_; | 54 scoped_ptr<ContentVideoView> content_video_view_; |
| 47 | 55 |
| 48 DISALLOW_COPY_AND_ASSIGN(BrowserSurfaceViewManager); | 56 DISALLOW_COPY_AND_ASSIGN(BrowserSurfaceViewManager); |
| 49 }; | 57 }; |
| 50 | 58 |
| 51 } // namespace content | 59 } // namespace content |
| 52 | 60 |
| 53 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_SURFACE_VIEW_MANAGER_H_ | 61 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_SURFACE_VIEW_MANAGER_H_ |
| OLD | NEW |