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

Unified Diff: webkit/media/android/webmediaplayer_manager_android.h

Issue 10533049: Adding the logic for releasing decoder resources in WebMediaPlayerManagerAndroid (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing feedbacks Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: webkit/media/android/webmediaplayer_manager_android.h
diff --git a/webkit/media/android/webmediaplayer_manager_android.h b/webkit/media/android/webmediaplayer_manager_android.h
index e8a046a664d561412fc9ae3955adbf277e14e859..49ca4c380ee049c771df3fc2197dccb312b15715 100644
--- a/webkit/media/android/webmediaplayer_manager_android.h
+++ b/webkit/media/android/webmediaplayer_manager_android.h
@@ -26,6 +26,13 @@ class WebMediaPlayerManagerAndroid {
int RegisterMediaPlayer(WebMediaPlayerAndroid* player);
void UnregisterMediaPlayer(int player_id);
+ // Called when a mediaplayer starts to decode media. If the number
+ // of active decoders hits the limit, release some resources.
+ // TODO(qinmin): we need to classify between video and audio decoders.
+ // Audio decoders are inexpensive. And css animations often come with
+ // lots of small audio files.
+ void RequestMediaResources(int player_id);
+
// Release all the media resources on the renderer process.
void ReleaseMediaResources();
@@ -33,15 +40,12 @@ class WebMediaPlayerManagerAndroid {
WebMediaPlayerAndroid* GetMediaPlayer(int player_id);
private:
- // Information needed to manage WebMediaPlayerAndroid.
- // TODO(qinmin): more informations will be added here for resource management.
- struct MediaPlayerInfo {
- webkit_media::WebMediaPlayerAndroid* player;
- };
+ // Get the number of active players.
+ int32 GetActivePlayerCount();
// Info for all available WebMediaPlayerAndroid on a page; kept so that
// we can enumerate them to send updates about tab focus and visibily.
- std::map<int32, MediaPlayerInfo> media_players_;
+ std::map<int32, WebMediaPlayerAndroid*> media_players_;
int32 next_media_player_id_;
« no previous file with comments | « webkit/media/android/webmediaplayer_android.cc ('k') | webkit/media/android/webmediaplayer_manager_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698