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 |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7aa3a4187e2fc49ca44f9a958ef44a78aac7d006 |
--- /dev/null |
+++ b/webkit/media/android/webmediaplayer_manager_android.h |
@@ -0,0 +1,58 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_MANAGER_ANDROID_H_ |
+#define WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_MANAGER_ANDROID_H_ |
+ |
+#include <jni.h> |
+#include <map> |
+ |
+#include "base/basictypes.h" |
+ |
+namespace webkit_media { |
+ |
+class WebMediaPlayerAndroid; |
+ |
+// Class for managing all the WebMediaPlayerAndroid objects in a renderer |
+// process. |
+class WebMediaPlayerManagerAndroid { |
scherkus (not reviewing)
2012/05/23 22:45:46
ISTM this class is mostly here for two purposes:
qinmin
2012/05/24 20:30:28
I think we need this class for as it has more func
scherkus (not reviewing)
2012/05/24 21:36:32
Hrmm... I think we're going to have to sort out so
qinmin
2012/05/25 01:04:20
we still have only 1 render process and 1 browser
|
+ public: |
+ WebMediaPlayerManagerAndroid(int32 routing_id); |
+ virtual ~WebMediaPlayerManagerAndroid(); |
+ |
+ // Register and unregister a WebMediaPlayerAndroid object. |
+ virtual int RegisterMediaPlayer(WebMediaPlayerAndroid* player); |
scherkus (not reviewing)
2012/05/23 22:45:46
do we need to return an int ID or can we use the p
qinmin
2012/05/24 20:30:28
So the whole process of getting a video surface wo
|
+ virtual void UnRegisterMediaPlayer(int player_id); |
+ |
+ // Release all the media resources on the renderer process. |
+ virtual void ReleaseMediaResources(); |
+ |
+ // Pass the video surface to a particular WebMediaPlayerAndroid object given |
+ // by the player_id. |
+ // TODO(qinmin): Upstream the code for passing Java surface object to the |
+ // renderer thread |
+ virtual void SetVideoSurface(jobject j_surface, 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; |
+ }; |
+ |
+ // 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_; |
+ |
+ // ID used to create the next media player for passing the Surface. |
+ int32 next_media_player_id_; |
+ |
+ int32 routing_id_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerManagerAndroid); |
+}; |
+ |
+} // namespace webkit_media |
+ |
+#endif // WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_MANAGER_ANDROID_H_ |