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

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

Issue 231933006: Move ExternalVideoSurfaceHolder from WebContents UserData to BrowserMediaPlayerManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 months 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_MEDIA_PLAYER_MANAGER_H_ 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_
6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ 6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 13 matching lines...) Expand all
24 #include "url/gurl.h" 24 #include "url/gurl.h"
25 25
26 namespace media { 26 namespace media {
27 class DemuxerAndroid; 27 class DemuxerAndroid;
28 class MediaDrmBridge; 28 class MediaDrmBridge;
29 } 29 }
30 30
31 namespace content { 31 namespace content {
32 class BrowserDemuxerAndroid; 32 class BrowserDemuxerAndroid;
33 class ContentViewCoreImpl; 33 class ContentViewCoreImpl;
34 class ExternalVideoSurfaceContainer;
34 class WebContents; 35 class WebContents;
35 36
36 // This class manages all the MediaPlayerAndroid objects. It receives 37 // This class manages all the MediaPlayerAndroid objects. It receives
37 // control operations from the the render process, and forwards 38 // control operations from the the render process, and forwards
38 // them to corresponding MediaPlayerAndroid object. Callbacks from 39 // them to corresponding MediaPlayerAndroid object. Callbacks from
39 // MediaPlayerAndroid objects are converted to IPCs and then sent to the 40 // MediaPlayerAndroid objects are converted to IPCs and then sent to the
40 // render process. 41 // render process.
41 class CONTENT_EXPORT BrowserMediaPlayerManager 42 class CONTENT_EXPORT BrowserMediaPlayerManager
42 : public WebContentsObserver, 43 : public WebContentsObserver,
43 public media::MediaPlayerManager { 44 public media::MediaPlayerManager {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 virtual void OnSessionReady(int cdm_id, uint32 session_id) OVERRIDE; 102 virtual void OnSessionReady(int cdm_id, uint32 session_id) OVERRIDE;
102 virtual void OnSessionClosed(int cdm_id, uint32 session_id) OVERRIDE; 103 virtual void OnSessionClosed(int cdm_id, uint32 session_id) OVERRIDE;
103 virtual void OnSessionError(int cdm_id, 104 virtual void OnSessionError(int cdm_id,
104 uint32 session_id, 105 uint32 session_id,
105 media::MediaKeys::KeyError error_code, 106 media::MediaKeys::KeyError error_code,
106 uint32 system_code) OVERRIDE; 107 uint32 system_code) OVERRIDE;
107 108
108 #if defined(VIDEO_HOLE) 109 #if defined(VIDEO_HOLE)
109 void AttachExternalVideoSurface(int player_id, jobject surface); 110 void AttachExternalVideoSurface(int player_id, jobject surface);
110 void DetachExternalVideoSurface(int player_id); 111 void DetachExternalVideoSurface(int player_id);
112 void OnFrameInfoUpdated();
111 #endif // defined(VIDEO_HOLE) 113 #endif // defined(VIDEO_HOLE)
112 114
113 // Called to disble the current fullscreen playback if the video is encrypted. 115 // Called to disble the current fullscreen playback if the video is encrypted.
114 // TODO(qinmin): remove this once we have the new fullscreen mode. 116 // TODO(qinmin): remove this once we have the new fullscreen mode.
115 void DisableFullscreenEncryptedMediaPlayback(); 117 void DisableFullscreenEncryptedMediaPlayback();
116 118
117 protected: 119 protected:
118 // Clients must use Create() or subclass constructor. 120 // Clients must use Create() or subclass constructor.
119 explicit BrowserMediaPlayerManager(RenderViewHost* render_view_host); 121 explicit BrowserMediaPlayerManager(RenderViewHost* render_view_host);
120 122
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 // device DRM credentials. 225 // device DRM credentials.
224 // These 2 sets does not cover all the EME videos. If a video only streams 226 // These 2 sets does not cover all the EME videos. If a video only streams
225 // clear data, it will not be included in either set. 227 // clear data, it will not be included in either set.
226 std::set<int> cdm_ids_pending_approval_; 228 std::set<int> cdm_ids_pending_approval_;
227 std::set<int> cdm_ids_approved_; 229 std::set<int> cdm_ids_approved_;
228 230
229 // The fullscreen video view object or NULL if video is not played in 231 // The fullscreen video view object or NULL if video is not played in
230 // fullscreen. 232 // fullscreen.
231 scoped_ptr<ContentVideoView> video_view_; 233 scoped_ptr<ContentVideoView> video_view_;
232 234
235 #if defined(VIDEO_HOLE)
236 scoped_ptr<ExternalVideoSurfaceContainer> external_video_surface_container_;
237 #endif
238
233 // Player ID of the fullscreen media player. 239 // Player ID of the fullscreen media player.
234 int fullscreen_player_id_; 240 int fullscreen_player_id_;
235 241
236 // The player ID pending to enter fullscreen. 242 // The player ID pending to enter fullscreen.
237 int pending_fullscreen_player_id_; 243 int pending_fullscreen_player_id_;
238 244
239 // Whether the fullscreen player has been Release()-d. 245 // Whether the fullscreen player has been Release()-d.
240 bool fullscreen_player_is_released_; 246 bool fullscreen_player_is_released_;
241 247
242 WebContents* web_contents_; 248 WebContents* web_contents_;
243 249
244 // Object for retrieving resources media players. 250 // Object for retrieving resources media players.
245 scoped_ptr<media::MediaResourceGetter> media_resource_getter_; 251 scoped_ptr<media::MediaResourceGetter> media_resource_getter_;
246 252
247 // NOTE: Weak pointers must be invalidated before all other member variables. 253 // NOTE: Weak pointers must be invalidated before all other member variables.
248 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; 254 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_;
249 255
250 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); 256 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager);
251 }; 257 };
252 258
253 } // namespace content 259 } // namespace content
254 260
255 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ 261 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698