| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 int RoutingID(); | 158 int RoutingID(); |
| 159 | 159 |
| 160 // Helper function to send messages to RenderFrameObserver. | 160 // Helper function to send messages to RenderFrameObserver. |
| 161 bool Send(IPC::Message* msg); | 161 bool Send(IPC::Message* msg); |
| 162 | 162 |
| 163 private: | 163 private: |
| 164 // Constructs a MediaPlayerAndroid object. | 164 // Constructs a MediaPlayerAndroid object. |
| 165 media::MediaPlayerAndroid* CreateMediaPlayer( | 165 media::MediaPlayerAndroid* CreateMediaPlayer( |
| 166 const MediaPlayerHostMsg_Initialize_Params& media_player_params, | 166 const MediaPlayerHostMsg_Initialize_Params& media_player_params, |
| 167 bool hide_url_log, | 167 bool hide_url_log, |
| 168 media::MediaPlayerManager* manager, | |
| 169 BrowserDemuxerAndroid* demuxer); | 168 BrowserDemuxerAndroid* demuxer); |
| 170 | 169 |
| 171 // MediaPlayerAndroid must call this before it is going to decode | 170 // MediaPlayerAndroid must call this before it is going to decode |
| 172 // media streams. This helps the manager object maintain an array | 171 // media streams. This helps the manager object maintain an array |
| 173 // of active MediaPlayerAndroid objects and release the resources | 172 // of active MediaPlayerAndroid objects and release the resources |
| 174 // when needed. Currently we only count video resources as they are | 173 // when needed. Currently we only count video resources as they are |
| 175 // constrained by hardware and memory limits. | 174 // constrained by hardware and memory limits. |
| 176 virtual void OnMediaResourcesRequested(int player_id); | 175 virtual void OnMediaResourcesRequested(int player_id); |
| 177 | 176 |
| 178 // Called when a player releases all decoding resources. | 177 // Called when a player releases all decoding resources. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 213 |
| 215 // NOTE: Weak pointers must be invalidated before all other member variables. | 214 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 216 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; | 215 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; |
| 217 | 216 |
| 218 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); | 217 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); |
| 219 }; | 218 }; |
| 220 | 219 |
| 221 } // namespace content | 220 } // namespace content |
| 222 | 221 |
| 223 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ | 222 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ |
| OLD | NEW |