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_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_MEDIA_PLAYER_MANAGER_IMPL_H_ |
6 #define CONTENT_BROWSER_ANDROID_MEDIA_PLAYER_MANAGER_IMPL_H_ | 6 #define CONTENT_BROWSER_ANDROID_MEDIA_PLAYER_MANAGER_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 20 matching lines...) Expand all Loading... | |
31 class MediaPlayerManagerImpl | 31 class MediaPlayerManagerImpl |
32 : public RenderViewHostObserver, | 32 : public RenderViewHostObserver, |
33 public media::MediaPlayerManager { | 33 public media::MediaPlayerManager { |
34 public: | 34 public: |
35 virtual ~MediaPlayerManagerImpl(); | 35 virtual ~MediaPlayerManagerImpl(); |
36 | 36 |
37 // RenderViewHostObserver overrides. | 37 // RenderViewHostObserver overrides. |
38 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 38 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
39 | 39 |
40 // Fullscreen video playback controls. | 40 // Fullscreen video playback controls. |
41 void FullscreenPlayerPlay(); | 41 virtual void FullscreenPlayerPlay(); |
42 void FullscreenPlayerPause(); | 42 virtual void FullscreenPlayerPause(); |
43 void FullscreenPlayerSeek(int msec); | 43 virtual void FullscreenPlayerSeek(int msec); |
44 void ExitFullscreen(bool release_media_player); | 44 virtual void ExitFullscreen(bool release_media_player); |
45 void SetVideoSurface(jobject surface); | 45 virtual void SetVideoSurface(jobject surface); |
46 | 46 |
47 // media::MediaPlayerManager overrides. | 47 // media::MediaPlayerManager overrides. |
48 virtual void OnTimeUpdate( | 48 virtual void OnTimeUpdate( |
49 int player_id, base::TimeDelta current_time) OVERRIDE; | 49 int player_id, base::TimeDelta current_time) OVERRIDE; |
50 virtual void OnMediaMetadataChanged( | 50 virtual void OnMediaMetadataChanged( |
51 int player_id, | 51 int player_id, |
52 base::TimeDelta duration, | 52 base::TimeDelta duration, |
53 int width, | 53 int width, |
54 int height, | 54 int height, |
55 bool success) OVERRIDE; | 55 bool success) OVERRIDE; |
(...skipping 26 matching lines...) Expand all Loading... | |
82 #endif | 82 #endif |
83 | 83 |
84 protected: | 84 protected: |
85 friend MediaPlayerManager* MediaPlayerManager::Create( | 85 friend MediaPlayerManager* MediaPlayerManager::Create( |
86 content::RenderViewHost*); | 86 content::RenderViewHost*); |
87 | 87 |
88 // The instance of this class is supposed to be created by either Create() | 88 // The instance of this class is supposed to be created by either Create() |
89 // method of MediaPlayerManager or the derived classes constructors. | 89 // method of MediaPlayerManager or the derived classes constructors. |
90 explicit MediaPlayerManagerImpl(RenderViewHost* render_view_host); | 90 explicit MediaPlayerManagerImpl(RenderViewHost* render_view_host); |
91 | 91 |
92 private: | |
93 // Message handlers. | 92 // Message handlers. |
94 void OnEnterFullscreen(int player_id); | 93 virtual void OnEnterFullscreen(int player_id); |
bulach
2013/05/29 18:31:23
make clang happy, append OVERRIDE :)
whywhat
2013/05/29 18:50:12
These are not overrides but virtual methods to ove
| |
95 void OnExitFullscreen(int player_id); | 94 virtual void OnExitFullscreen(int player_id); |
96 void OnInitialize(int player_id, const GURL& url, | 95 virtual void OnInitialize( |
97 bool is_media_source, | 96 int player_id, |
98 const GURL& first_party_for_cookies); | 97 const GURL& url, |
99 void OnStart(int player_id); | 98 bool is_media_source, |
100 void OnSeek(int player_id, base::TimeDelta time); | 99 const GURL& first_party_for_cookies); |
101 void OnPause(int player_id); | 100 virtual void OnStart(int player_id); |
102 void OnReleaseResources(int player_id); | 101 virtual void OnSeek(int player_id, base::TimeDelta time); |
103 void OnDestroyPlayer(int player_id); | 102 virtual void OnPause(int player_id); |
104 void OnDemuxerReady( | 103 virtual void OnReleaseResources(int player_id); |
104 virtual void OnDestroyPlayer(int player_id); | |
105 virtual void OnDemuxerReady( | |
105 int player_id, | 106 int player_id, |
106 const media::MediaPlayerHostMsg_DemuxerReady_Params& params); | 107 const media::MediaPlayerHostMsg_DemuxerReady_Params& params); |
107 void OnReadFromDemuxerAck( | 108 virtual void OnReadFromDemuxerAck( |
108 int player_id, | 109 int player_id, |
109 const media::MediaPlayerHostMsg_ReadFromDemuxerAck_Params& params); | 110 const media::MediaPlayerHostMsg_ReadFromDemuxerAck_Params& params); |
110 void OnMediaSeekRequestAck(int player_id); | 111 void OnMediaSeekRequestAck(int player_id); |
111 | 112 |
112 #if defined(GOOGLE_TV) | 113 #if defined(GOOGLE_TV) |
113 void OnNotifyExternalSurface( | 114 virtual void OnNotifyExternalSurface( |
114 int player_id, bool is_request, const gfx::RectF& rect); | 115 int player_id, bool is_request, const gfx::RectF& rect); |
115 #endif | 116 #endif |
116 | 117 |
118 // Adds a given player to the list. | |
119 void AddPlayer(media::MediaPlayerAndroid* player); | |
120 | |
121 // Removes the player with the specified id. | |
122 void RemovePlayer(int player_id); | |
123 | |
124 private: | |
117 // An array of managed players. | 125 // An array of managed players. |
118 ScopedVector<media::MediaPlayerAndroid> players_; | 126 ScopedVector<media::MediaPlayerAndroid> players_; |
119 | 127 |
120 // The fullscreen video view object. | 128 // The fullscreen video view object. |
121 ContentVideoView video_view_; | 129 ContentVideoView video_view_; |
122 | 130 |
123 // Player ID of the fullscreen media player. | 131 // Player ID of the fullscreen media player. |
124 int fullscreen_player_id_; | 132 int fullscreen_player_id_; |
125 | 133 |
126 WebContents* web_contents_; | 134 WebContents* web_contents_; |
127 | 135 |
128 // Object for retrieving resources media players. | 136 // Object for retrieving resources media players. |
129 scoped_ptr<media::MediaResourceGetter> media_resource_getter_; | 137 scoped_ptr<media::MediaResourceGetter> media_resource_getter_; |
130 | 138 |
131 DISALLOW_COPY_AND_ASSIGN(MediaPlayerManagerImpl); | 139 DISALLOW_COPY_AND_ASSIGN(MediaPlayerManagerImpl); |
132 }; | 140 }; |
133 | 141 |
134 } // namespace content | 142 } // namespace content |
135 | 143 |
136 #endif // CONTENT_BROWSER_ANDROID_MEDIA_PLAYER_MANAGER_IMPL_H_ | 144 #endif // CONTENT_BROWSER_ANDROID_MEDIA_PLAYER_MANAGER_IMPL_H_ |
OLD | NEW |