| 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 <memory> | 10 #include <memory> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 void SetVideoSurface(gfx::ScopedJavaSurface surface) override; | 31 void SetVideoSurface(gfx::ScopedJavaSurface surface) override; |
| 32 void DidExitFullscreen(bool release_media_player) override; | 32 void DidExitFullscreen(bool release_media_player) override; |
| 33 | 33 |
| 34 void OnCreateFullscreenSurface(const gfx::Size& video_natural_size); | 34 void OnCreateFullscreenSurface(const gfx::Size& video_natural_size); |
| 35 void OnNaturalSizeChanged(const gfx::Size& size); | 35 void OnNaturalSizeChanged(const gfx::Size& size); |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 // Send a message to return the surface id to the caller. | 38 // Send a message to return the surface id to the caller. |
| 39 bool SendSurfaceID(int surface_id); | 39 bool SendSurfaceID(int surface_id); |
| 40 | 40 |
| 41 // Synchronously notify the decoder that the surface is being destroyed so it |
| 42 // can stop rendering to it. This sends a message to the GPU process. Without |
| 43 // this, the MediaCodec decoder will start throwing IllegalStateException, and |
| 44 // crash on some devices (http://crbug.com/598408). There is no way for us to |
| 45 // make sure the surface outlives the decoder because Android initiates the |
| 46 // destruction in some cases. |
| 47 void SendDestroyingVideoSurfaceIfRequired(int surface_id); |
| 48 |
| 41 RenderFrameHost* const render_frame_host_; | 49 RenderFrameHost* const render_frame_host_; |
| 42 | 50 |
| 43 // The surface id of the ContentVideoView surface. | 51 // The surface id of the ContentVideoView surface. |
| 44 int surface_id_; | 52 int surface_id_; |
| 45 | 53 |
| 46 // The fullscreen view that contains a SurfaceView. | 54 // The fullscreen view that contains a SurfaceView. |
| 47 std::unique_ptr<ContentVideoView> content_video_view_; | 55 std::unique_ptr<ContentVideoView> content_video_view_; |
| 48 | 56 |
| 49 DISALLOW_COPY_AND_ASSIGN(BrowserSurfaceViewManager); | 57 DISALLOW_COPY_AND_ASSIGN(BrowserSurfaceViewManager); |
| 50 }; | 58 }; |
| 51 | 59 |
| 52 } // namespace content | 60 } // namespace content |
| 53 | 61 |
| 54 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_SURFACE_VIEW_MANAGER_H_ | 62 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_SURFACE_VIEW_MANAGER_H_ |
| OLD | NEW |