OLD | NEW |
---|---|
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 <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 void OnCreateSession(int media_keys_id, | 143 void OnCreateSession(int media_keys_id, |
144 uint32 session_id, | 144 uint32 session_id, |
145 const std::string& type, | 145 const std::string& type, |
146 const std::vector<uint8>& init_data); | 146 const std::vector<uint8>& init_data); |
147 void OnUpdateSession(int media_keys_id, | 147 void OnUpdateSession(int media_keys_id, |
148 uint32 session_id, | 148 uint32 session_id, |
149 const std::vector<uint8>& response); | 149 const std::vector<uint8>& response); |
150 void OnReleaseSession(int media_keys_id, uint32 session_id); | 150 void OnReleaseSession(int media_keys_id, uint32 session_id); |
151 void OnSetMediaKeys(int player_id, int media_keys_id); | 151 void OnSetMediaKeys(int player_id, int media_keys_id); |
152 | 152 |
153 void OnCancelAllPendingSessionCreations(int media_keys_id); | |
154 | |
153 #if defined(VIDEO_HOLE) | 155 #if defined(VIDEO_HOLE) |
154 virtual void OnNotifyExternalSurface( | 156 virtual void OnNotifyExternalSurface( |
155 int player_id, bool is_request, const gfx::RectF& rect); | 157 int player_id, bool is_request, const gfx::RectF& rect); |
156 #endif // defined(VIDEO_HOLE) | 158 #endif // defined(VIDEO_HOLE) |
157 | 159 |
158 // Adds a given player to the list. | 160 // Adds a given player to the list. |
159 void AddPlayer(media::MediaPlayerAndroid* player); | 161 void AddPlayer(media::MediaPlayerAndroid* player); |
160 | 162 |
161 // Removes the player with the specified id. | 163 // Removes the player with the specified id. |
162 void RemovePlayer(int player_id); | 164 void RemovePlayer(int player_id); |
163 | 165 |
164 // Replaces a player with the specified id with a given MediaPlayerAndroid | 166 // Replaces a player with the specified id with a given MediaPlayerAndroid |
165 // object. This will also return the original MediaPlayerAndroid object that | 167 // object. This will also return the original MediaPlayerAndroid object that |
166 // was replaced. | 168 // was replaced. |
167 scoped_ptr<media::MediaPlayerAndroid> SwapPlayer( | 169 scoped_ptr<media::MediaPlayerAndroid> SwapPlayer( |
168 int player_id, | 170 int player_id, |
169 media::MediaPlayerAndroid* player); | 171 media::MediaPlayerAndroid* player); |
170 | 172 |
171 // Adds a new MediaDrmBridge for the given |uuid|, |media_keys_id|, and | 173 // Adds a new MediaDrmBridge for the given |uuid|, |media_keys_id|, and |
172 // |frame_url|. | 174 // |frame_url|. |
173 void AddDrmBridge(int media_keys_id, | 175 void AddDrmBridge(int media_keys_id, |
174 const std::vector<uint8>& uuid, | 176 const std::vector<uint8>& uuid, |
175 const GURL& frame_url); | 177 const GURL& frame_url); |
176 | 178 |
177 // Removes the DRM bridge with the specified id. | 179 // Removes the DRM bridge with the specified id. |
178 void RemoveDrmBridge(int media_keys_id); | 180 void RemoveDrmBridge(int media_keys_id); |
179 | 181 |
180 private: | 182 private: |
181 void GenerateKeyIfAllowed(int media_keys_id, | 183 void CreateSessionIfPermitted(int media_keys_id, |
xhwang
2013/12/30 19:00:59
doc about what's happening if not |permitted|, and
Kibeom Kim (inactive)
2013/12/30 21:52:24
Done.
| |
182 uint32 session_id, | 184 uint32 session_id, |
183 const std::string& type, | 185 const std::string& type, |
184 const std::vector<uint8>& init_data, | 186 const std::vector<uint8>& init_data, |
185 bool allowed); | 187 bool permitted); |
186 | 188 |
187 // Constructs a MediaPlayerAndroid object. Declared static to permit embedders | 189 // Constructs a MediaPlayerAndroid object. Declared static to permit embedders |
188 // to override functionality. | 190 // to override functionality. |
189 // | 191 // |
190 // Objects must call |manager->RequestMediaResources()| before decoding | 192 // Objects must call |manager->RequestMediaResources()| before decoding |
191 // and |manager->ReleaseMediaSources()| after finishing. This allows the | 193 // and |manager->ReleaseMediaSources()| after finishing. This allows the |
192 // manager to track decoding resources across the process and free them as | 194 // manager to track decoding resources across the process and free them as |
193 // needed. | 195 // needed. |
194 static media::MediaPlayerAndroid* CreateMediaPlayer( | 196 static media::MediaPlayerAndroid* CreateMediaPlayer( |
195 MediaPlayerHostMsg_Initialize_Type type, | 197 MediaPlayerHostMsg_Initialize_Type type, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
230 scoped_ptr<media::MediaResourceGetter> media_resource_getter_; | 232 scoped_ptr<media::MediaResourceGetter> media_resource_getter_; |
231 | 233 |
232 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; | 234 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; |
233 | 235 |
234 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); | 236 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); |
235 }; | 237 }; |
236 | 238 |
237 } // namespace content | 239 } // namespace content |
238 | 240 |
239 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ | 241 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ |
OLD | NEW |