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

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: 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..d6b133c147e246d08af0b29fdf7271984078ab34 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();
@@ -34,8 +41,8 @@ class WebMediaPlayerManagerAndroid {
private:
// Information needed to manage WebMediaPlayerAndroid.
- // TODO(qinmin): more informations will be added here for resource management.
struct MediaPlayerInfo {
+ bool is_active_;
webkit_media::WebMediaPlayerAndroid* player;
};
@@ -45,6 +52,9 @@ class WebMediaPlayerManagerAndroid {
int32 next_media_player_id_;
+ // Number of active players.
+ int32 num_active_players_;
+
DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerManagerAndroid);
};

Powered by Google App Engine
This is Rietveld 408576698