OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_ANDROID_MEDIA_PLAYER_MANAGER_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_MEDIA_PLAYER_MANAGER_ANDROID_H_ |
6 #define CONTENT_BROWSER_ANDROID_MEDIA_PLAYER_MANAGER_ANDROID_H_ | 6 #define CONTENT_BROWSER_ANDROID_MEDIA_PLAYER_MANAGER_ANDROID_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 void OnError(int player_id, int error); | 54 void OnError(int player_id, int error); |
55 void OnVideoSizeChanged(int player_id, int width, int height); | 55 void OnVideoSizeChanged(int player_id, int width, int height); |
56 | 56 |
57 // media::MediaPlayerBridgeManager overrides. | 57 // media::MediaPlayerBridgeManager overrides. |
58 virtual void RequestMediaResources(media::MediaPlayerBridge* player) OVERRIDE; | 58 virtual void RequestMediaResources(media::MediaPlayerBridge* player) OVERRIDE; |
59 virtual void ReleaseMediaResources(media::MediaPlayerBridge* player) OVERRIDE; | 59 virtual void ReleaseMediaResources(media::MediaPlayerBridge* player) OVERRIDE; |
60 | 60 |
61 // Release all the players managed by this object. | 61 // Release all the players managed by this object. |
62 void DestroyAllMediaPlayers(); | 62 void DestroyAllMediaPlayers(); |
63 | 63 |
| 64 // External surface video rendering. |
| 65 void SetExternalVideoSurface(jobject surface); |
| 66 |
64 media::MediaPlayerBridge* GetFullscreenPlayer(); | 67 media::MediaPlayerBridge* GetFullscreenPlayer(); |
65 media::MediaPlayerBridge* GetPlayer(int player_id); | 68 media::MediaPlayerBridge* GetPlayer(int player_id); |
66 | 69 |
67 private: | 70 private: |
68 // Message handlers. | 71 // Message handlers. |
69 void OnEnterFullscreen(int player_id); | 72 void OnEnterFullscreen(int player_id); |
70 void OnExitFullscreen(int player_id); | 73 void OnExitFullscreen(int player_id); |
71 void OnInitialize(int player_id, const std::string& url, | 74 void OnInitialize(int player_id, const std::string& url, |
72 const std::string& first_party_for_cookies); | 75 const std::string& first_party_for_cookies); |
73 void OnStart(int player_id); | 76 void OnStart(int player_id); |
74 void OnSeek(int player_id, base::TimeDelta time); | 77 void OnSeek(int player_id, base::TimeDelta time); |
75 void OnPause(int player_id); | 78 void OnPause(int player_id); |
76 void OnReleaseResources(int player_id); | 79 void OnReleaseResources(int player_id); |
77 void OnDestroyPlayer(int player_id); | 80 void OnDestroyPlayer(int player_id); |
| 81 void OnRequestExternalSurface(int player_id); |
78 | 82 |
79 // An array of managed players. | 83 // An array of managed players. |
80 ScopedVector<media::MediaPlayerBridge> players_; | 84 ScopedVector<media::MediaPlayerBridge> players_; |
81 | 85 |
82 // The fullscreen video view object. | 86 // The fullscreen video view object. |
83 ContentVideoView video_view_; | 87 ContentVideoView video_view_; |
84 | 88 |
85 // Player ID of the fullscreen media player. | 89 // Player ID of the fullscreen media player. |
86 int fullscreen_player_id_; | 90 int fullscreen_player_id_; |
87 | 91 |
| 92 // Player ID of the user of the external video surface. |
| 93 int external_video_surface_user_id_; |
| 94 |
88 DISALLOW_COPY_AND_ASSIGN(MediaPlayerManagerAndroid); | 95 DISALLOW_COPY_AND_ASSIGN(MediaPlayerManagerAndroid); |
89 }; | 96 }; |
90 | 97 |
91 } // namespace content | 98 } // namespace content |
92 | 99 |
93 #endif // CONTENT_BROWSER_ANDROID_MEDIA_PLAYER_MANAGER_ANDROID_H_ | 100 #endif // CONTENT_BROWSER_ANDROID_MEDIA_PLAYER_MANAGER_ANDROID_H_ |
OLD | NEW |