Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Side by Side Diff: content/browser/media/android/browser_surface_view_manager.h

Issue 2481583003: Send the video surface destruction message on all Android versions (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/media/android/browser_surface_view_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 23 matching lines...) Expand all
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 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 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 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 44 // crash on some devices (http://crbug.com/598408, http://crbug.com/600454).
45 // make sure the surface outlives the decoder because Android initiates the 45 void SendDestroyingVideoSurface(int surface_id);
46 // destruction in some cases.
47 void SendDestroyingVideoSurfaceIfRequired(int surface_id);
48 46
49 RenderFrameHost* const render_frame_host_; 47 RenderFrameHost* const render_frame_host_;
50 48
51 // The surface id of the ContentVideoView surface. 49 // The surface id of the ContentVideoView surface.
52 int surface_id_; 50 int surface_id_;
53 51
54 // The fullscreen view that contains a SurfaceView. 52 // The fullscreen view that contains a SurfaceView.
55 std::unique_ptr<ContentVideoView> content_video_view_; 53 std::unique_ptr<ContentVideoView> content_video_view_;
56 54
57 DISALLOW_COPY_AND_ASSIGN(BrowserSurfaceViewManager); 55 DISALLOW_COPY_AND_ASSIGN(BrowserSurfaceViewManager);
58 }; 56 };
59 57
60 } // namespace content 58 } // namespace content
61 59
62 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_SURFACE_VIEW_MANAGER_H_ 60 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_SURFACE_VIEW_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/android/browser_surface_view_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698