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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 int RoutingID(); | 146 int RoutingID(); |
147 | 147 |
148 // Helper function to send messages to RenderFrameObserver. | 148 // Helper function to send messages to RenderFrameObserver. |
149 bool Send(IPC::Message* msg); | 149 bool Send(IPC::Message* msg); |
150 | 150 |
151 private: | 151 private: |
152 // Constructs a MediaPlayerAndroid object. | 152 // Constructs a MediaPlayerAndroid object. |
153 media::MediaPlayerAndroid* CreateMediaPlayer( | 153 media::MediaPlayerAndroid* CreateMediaPlayer( |
154 const MediaPlayerHostMsg_Initialize_Params& media_player_params, | 154 const MediaPlayerHostMsg_Initialize_Params& media_player_params, |
155 bool hide_url_log, | 155 bool hide_url_log, |
156 media::MediaPlayerManager* manager, | |
157 BrowserDemuxerAndroid* demuxer); | 156 BrowserDemuxerAndroid* demuxer); |
158 | 157 |
159 // MediaPlayerAndroid must call this before it is going to decode | 158 // MediaPlayerAndroid must call this before it is going to decode |
160 // media streams. This helps the manager object maintain an array | 159 // media streams. This helps the manager object maintain an array |
161 // of active MediaPlayerAndroid objects and release the resources | 160 // of active MediaPlayerAndroid objects and release the resources |
162 // when needed. Currently we only count video resources as they are | 161 // when needed. Currently we only count video resources as they are |
163 // constrained by hardware and memory limits. | 162 // constrained by hardware and memory limits. |
164 virtual void OnMediaResourcesRequested(int player_id); | 163 virtual void OnMediaResourcesRequested(int player_id); |
165 | 164 |
166 // Called when a player releases all decoding resources. | 165 // Called when a player releases all decoding resources. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 201 |
203 // NOTE: Weak pointers must be invalidated before all other member variables. | 202 // NOTE: Weak pointers must be invalidated before all other member variables. |
204 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; | 203 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; |
205 | 204 |
206 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); | 205 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); |
207 }; | 206 }; |
208 | 207 |
209 } // namespace content | 208 } // namespace content |
210 | 209 |
211 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ | 210 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ |
OLD | NEW |