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