| 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 WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 5 #ifndef WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| 6 #define WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 6 #define WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 virtual ~WebMediaPlayerAndroid(); | 130 virtual ~WebMediaPlayerAndroid(); |
| 131 | 131 |
| 132 // Helper method to update the playing state. | 132 // Helper method to update the playing state. |
| 133 virtual void UpdatePlayingState(bool is_playing_); | 133 virtual void UpdatePlayingState(bool is_playing_); |
| 134 | 134 |
| 135 // Helper methods for posting task for setting states and update WebKit. | 135 // Helper methods for posting task for setting states and update WebKit. |
| 136 virtual void UpdateNetworkState(WebKit::WebMediaPlayer::NetworkState state); | 136 virtual void UpdateNetworkState(WebKit::WebMediaPlayer::NetworkState state); |
| 137 virtual void UpdateReadyState(WebKit::WebMediaPlayer::ReadyState state); | 137 virtual void UpdateReadyState(WebKit::WebMediaPlayer::ReadyState state); |
| 138 | 138 |
| 139 // Helper method to reestablish the surface texture peer for android | 139 // Helper method to reestablish the surface texture peer for android |
| 140 // mediaplayer. | 140 // media player. |
| 141 virtual void EstablishSurfaceTexturePeer(); | 141 virtual void EstablishSurfaceTexturePeer(); |
| 142 | 142 |
| 143 // Requesting whether the surface texture peer needs to be reestablished. |
| 144 virtual void SetNeedsEstablishPeer(bool needs_establish_peer); |
| 145 |
| 143 // Method to be implemented by child classes. | 146 // Method to be implemented by child classes. |
| 144 // Initialize the media player bridge object. | 147 // Initialize the media player bridge object. |
| 145 virtual void InitializeMediaPlayer(GURL url) = 0; | 148 virtual void InitializeMediaPlayer(GURL url) = 0; |
| 146 | 149 |
| 147 // Inform the media player to start playing. | 150 // Inform the media player to start playing. |
| 148 virtual void PlayInternal() = 0; | 151 virtual void PlayInternal() = 0; |
| 149 | 152 |
| 150 // Inform the media player to pause. | 153 // Inform the media player to pause. |
| 151 virtual void PauseInternal() = 0; | 154 virtual void PauseInternal() = 0; |
| 152 | 155 |
| 153 // Inform the media player to seek to a particular position. | 156 // Inform the media player to seek to a particular position. |
| 154 virtual void SeekInternal(base::TimeDelta time) = 0; | 157 virtual void SeekInternal(base::TimeDelta time) = 0; |
| 155 | 158 |
| 156 // Get the current time from the media player. | 159 // Get the current time from the media player. |
| 157 virtual float GetCurrentTimeInternal() const = 0; | 160 virtual float GetCurrentTimeInternal() const = 0; |
| 158 | 161 |
| 159 // Release the Android Media player. | 162 // Release the Android Media player. |
| 160 virtual void ReleaseResourcesInternal() = 0; | 163 virtual void ReleaseResourcesInternal() = 0; |
| 161 | 164 |
| 162 // Cleaning up all remaining resources as this object is about to get deleted. | 165 // Cleaning up all remaining resources as this object is about to get deleted. |
| 163 virtual void Destroy() = 0; | 166 virtual void Destroy() = 0; |
| 164 | 167 |
| 165 WebKit::WebMediaPlayerClient* client() { return client_; } | 168 WebKit::WebMediaPlayerClient* client() { return client_; } |
| 166 | 169 |
| 167 int player_id() { return player_id_; } | 170 int player_id() const { return player_id_; } |
| 171 |
| 172 WebMediaPlayerManagerAndroid* manager() const { return manager_; } |
| 168 | 173 |
| 169 private: | 174 private: |
| 170 WebKit::WebMediaPlayerClient* const client_; | 175 WebKit::WebMediaPlayerClient* const client_; |
| 171 | 176 |
| 172 // Save the list of buffered time ranges. | 177 // Save the list of buffered time ranges. |
| 173 WebKit::WebTimeRanges buffered_; | 178 WebKit::WebTimeRanges buffered_; |
| 174 | 179 |
| 175 // Size of the video. | 180 // Size of the video. |
| 176 WebKit::WebSize natural_size_; | 181 WebKit::WebSize natural_size_; |
| 177 | 182 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 // Object for calling back the compositor thread to repaint the video when a | 229 // Object for calling back the compositor thread to repaint the video when a |
| 225 // frame available. It should be initialized on the compositor thread. | 230 // frame available. It should be initialized on the compositor thread. |
| 226 scoped_ptr<StreamTextureProxy> stream_texture_proxy_; | 231 scoped_ptr<StreamTextureProxy> stream_texture_proxy_; |
| 227 | 232 |
| 228 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 233 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
| 229 }; | 234 }; |
| 230 | 235 |
| 231 } // namespace webkit_media | 236 } // namespace webkit_media |
| 232 | 237 |
| 233 #endif // WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 238 #endif // WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| OLD | NEW |