| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 6 #define CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 virtual void seek(double seconds); | 108 virtual void seek(double seconds); |
| 109 virtual bool supportsSave() const; | 109 virtual bool supportsSave() const; |
| 110 virtual void setRate(double rate); | 110 virtual void setRate(double rate); |
| 111 virtual void setVolume(double volume); | 111 virtual void setVolume(double volume); |
| 112 virtual void requestRemotePlayback(); | 112 virtual void requestRemotePlayback(); |
| 113 virtual void requestRemotePlaybackControl(); | 113 virtual void requestRemotePlaybackControl(); |
| 114 virtual blink::WebTimeRanges buffered() const; | 114 virtual blink::WebTimeRanges buffered() const; |
| 115 virtual blink::WebTimeRanges seekable() const; | 115 virtual blink::WebTimeRanges seekable() const; |
| 116 | 116 |
| 117 // Poster image, as defined in the <video> element. | 117 // Poster image, as defined in the <video> element. |
| 118 virtual void setPoster(const blink::WebURL& poster) OVERRIDE; | 118 virtual void setPoster(const blink::WebURL& poster) override; |
| 119 | 119 |
| 120 // Methods for painting. | 120 // Methods for painting. |
| 121 // FIXME: This path "only works" on Android. It is a workaround for the | 121 // FIXME: This path "only works" on Android. It is a workaround for the |
| 122 // issue that Skia could not handle Android's GL_TEXTURE_EXTERNAL_OES texture | 122 // issue that Skia could not handle Android's GL_TEXTURE_EXTERNAL_OES texture |
| 123 // internally. It should be removed and replaced by the normal paint path. | 123 // internally. It should be removed and replaced by the normal paint path. |
| 124 // https://code.google.com/p/skia/issues/detail?id=1189 | 124 // https://code.google.com/p/skia/issues/detail?id=1189 |
| 125 virtual void paint(blink::WebCanvas* canvas, | 125 virtual void paint(blink::WebCanvas* canvas, |
| 126 const blink::WebRect& rect, | 126 const blink::WebRect& rect, |
| 127 unsigned char alpha, | 127 unsigned char alpha, |
| 128 SkXfermode::Mode mode); | 128 SkXfermode::Mode mode); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 // Provide statistics. | 168 // Provide statistics. |
| 169 virtual unsigned decodedFrameCount() const; | 169 virtual unsigned decodedFrameCount() const; |
| 170 virtual unsigned droppedFrameCount() const; | 170 virtual unsigned droppedFrameCount() const; |
| 171 virtual unsigned audioDecodedByteCount() const; | 171 virtual unsigned audioDecodedByteCount() const; |
| 172 virtual unsigned videoDecodedByteCount() const; | 172 virtual unsigned videoDecodedByteCount() const; |
| 173 | 173 |
| 174 // cc::VideoFrameProvider implementation. These methods are running on the | 174 // cc::VideoFrameProvider implementation. These methods are running on the |
| 175 // compositor thread. | 175 // compositor thread. |
| 176 virtual void SetVideoFrameProviderClient( | 176 virtual void SetVideoFrameProviderClient( |
| 177 cc::VideoFrameProvider::Client* client) OVERRIDE; | 177 cc::VideoFrameProvider::Client* client) override; |
| 178 virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() OVERRIDE; | 178 virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() override; |
| 179 virtual void PutCurrentFrame(const scoped_refptr<media::VideoFrame>& frame) | 179 virtual void PutCurrentFrame(const scoped_refptr<media::VideoFrame>& frame) |
| 180 OVERRIDE; | 180 override; |
| 181 | 181 |
| 182 // Media player callback handlers. | 182 // Media player callback handlers. |
| 183 void OnMediaMetadataChanged(const base::TimeDelta& duration, int width, | 183 void OnMediaMetadataChanged(const base::TimeDelta& duration, int width, |
| 184 int height, bool success); | 184 int height, bool success); |
| 185 void OnPlaybackComplete(); | 185 void OnPlaybackComplete(); |
| 186 void OnBufferingUpdate(int percentage); | 186 void OnBufferingUpdate(int percentage); |
| 187 void OnSeekRequest(const base::TimeDelta& time_to_seek); | 187 void OnSeekRequest(const base::TimeDelta& time_to_seek); |
| 188 void OnSeekComplete(const base::TimeDelta& current_time); | 188 void OnSeekComplete(const base::TimeDelta& current_time); |
| 189 void OnMediaError(int error_type); | 189 void OnMediaError(int error_type); |
| 190 void OnVideoSizeChanged(int width, int height); | 190 void OnVideoSizeChanged(int width, int height); |
| 191 void OnDurationChanged(const base::TimeDelta& duration); | 191 void OnDurationChanged(const base::TimeDelta& duration); |
| 192 | 192 |
| 193 // Called to update the current time. | 193 // Called to update the current time. |
| 194 void OnTimeUpdate(base::TimeDelta current_timestamp, | 194 void OnTimeUpdate(base::TimeDelta current_timestamp, |
| 195 base::TimeTicks current_time_ticks); | 195 base::TimeTicks current_time_ticks); |
| 196 | 196 |
| 197 // Functions called when media player status changes. | 197 // Functions called when media player status changes. |
| 198 void OnConnectedToRemoteDevice(const std::string& remote_playback_message); | 198 void OnConnectedToRemoteDevice(const std::string& remote_playback_message); |
| 199 void OnDisconnectedFromRemoteDevice(); | 199 void OnDisconnectedFromRemoteDevice(); |
| 200 void OnDidEnterFullscreen(); | 200 void OnDidEnterFullscreen(); |
| 201 void OnDidExitFullscreen(); | 201 void OnDidExitFullscreen(); |
| 202 void OnMediaPlayerPlay(); | 202 void OnMediaPlayerPlay(); |
| 203 void OnMediaPlayerPause(); | 203 void OnMediaPlayerPause(); |
| 204 void OnRequestFullscreen(); | 204 void OnRequestFullscreen(); |
| 205 void OnRemoteRouteAvailabilityChanged(bool routes_available); | 205 void OnRemoteRouteAvailabilityChanged(bool routes_available); |
| 206 | 206 |
| 207 // StreamTextureFactoryContextObserver implementation. | 207 // StreamTextureFactoryContextObserver implementation. |
| 208 virtual void ResetStreamTextureProxy() OVERRIDE; | 208 virtual void ResetStreamTextureProxy() override; |
| 209 | 209 |
| 210 // Called when the player is released. | 210 // Called when the player is released. |
| 211 virtual void OnPlayerReleased(); | 211 virtual void OnPlayerReleased(); |
| 212 | 212 |
| 213 // This function is called by the RendererMediaPlayerManager to pause the | 213 // This function is called by the RendererMediaPlayerManager to pause the |
| 214 // video and release the media player and surface texture when we switch tabs. | 214 // video and release the media player and surface texture when we switch tabs. |
| 215 // However, the actual GlTexture is not released to keep the video screenshot. | 215 // However, the actual GlTexture is not released to keep the video screenshot. |
| 216 virtual void ReleaseMediaResources(); | 216 virtual void ReleaseMediaResources(); |
| 217 | 217 |
| 218 // RenderFrameObserver implementation. | 218 // RenderFrameObserver implementation. |
| 219 virtual void OnDestruct() OVERRIDE; | 219 virtual void OnDestruct() override; |
| 220 | 220 |
| 221 #if defined(VIDEO_HOLE) | 221 #if defined(VIDEO_HOLE) |
| 222 // Calculate the boundary rectangle of the media player (i.e. location and | 222 // Calculate the boundary rectangle of the media player (i.e. location and |
| 223 // size of the video frame). | 223 // size of the video frame). |
| 224 // Returns true if the geometry has been changed since the last call. | 224 // Returns true if the geometry has been changed since the last call. |
| 225 bool UpdateBoundaryRectangle(); | 225 bool UpdateBoundaryRectangle(); |
| 226 | 226 |
| 227 const gfx::RectF GetBoundaryRectangle(); | 227 const gfx::RectF GetBoundaryRectangle(); |
| 228 #endif // defined(VIDEO_HOLE) | 228 #endif // defined(VIDEO_HOLE) |
| 229 | 229 |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 | 504 |
| 505 // NOTE: Weak pointers must be invalidated before all other member variables. | 505 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 506 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; | 506 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; |
| 507 | 507 |
| 508 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 508 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
| 509 }; | 509 }; |
| 510 | 510 |
| 511 } // namespace content | 511 } // namespace content |
| 512 | 512 |
| 513 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 513 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| OLD | NEW |