| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // video and release the media player and surface texture when we switch tabs. | 184 // video and release the media player and surface texture when we switch tabs. |
| 185 // However, the actual GlTexture is not released to keep the video screenshot. | 185 // However, the actual GlTexture is not released to keep the video screenshot. |
| 186 virtual void ReleaseMediaResources(); | 186 virtual void ReleaseMediaResources(); |
| 187 | 187 |
| 188 // Method inherited from DestructionObserver. | 188 // Method inherited from DestructionObserver. |
| 189 virtual void WillDestroyCurrentMessageLoop() OVERRIDE; | 189 virtual void WillDestroyCurrentMessageLoop() OVERRIDE; |
| 190 | 190 |
| 191 // Detach the player from its manager. | 191 // Detach the player from its manager. |
| 192 void Detach(); | 192 void Detach(); |
| 193 | 193 |
| 194 #if defined(GOOGLE_TV) | 194 #if defined(VIDEO_HOLE) |
| 195 // Retrieve geometry of the media player (i.e. location and size of the video | 195 // Retrieve geometry of the media player (i.e. location and size of the video |
| 196 // frame) if changed. Returns true only if the geometry has been changed since | 196 // frame) if changed. Returns true only if the geometry has been changed since |
| 197 // the last call. | 197 // the last call. |
| 198 bool RetrieveGeometryChange(gfx::RectF* rect); | 198 bool RetrieveGeometryChange(gfx::RectF* rect); |
| 199 #endif | 199 #endif // defined(VIDEO_HOLE) |
| 200 | 200 |
| 201 virtual MediaKeyException generateKeyRequest( | 201 virtual MediaKeyException generateKeyRequest( |
| 202 const blink::WebString& key_system, | 202 const blink::WebString& key_system, |
| 203 const unsigned char* init_data, | 203 const unsigned char* init_data, |
| 204 unsigned init_data_length) OVERRIDE; | 204 unsigned init_data_length) OVERRIDE; |
| 205 virtual MediaKeyException addKey( | 205 virtual MediaKeyException addKey( |
| 206 const blink::WebString& key_system, | 206 const blink::WebString& key_system, |
| 207 const unsigned char* key, | 207 const unsigned char* key, |
| 208 unsigned key_length, | 208 unsigned key_length, |
| 209 const unsigned char* init_data, | 209 const unsigned char* init_data, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 void DoCreateStreamTexture(); | 249 void DoCreateStreamTexture(); |
| 250 | 250 |
| 251 | 251 |
| 252 // Helper method to reestablish the surface texture peer for android | 252 // Helper method to reestablish the surface texture peer for android |
| 253 // media player. | 253 // media player. |
| 254 void EstablishSurfaceTexturePeer(); | 254 void EstablishSurfaceTexturePeer(); |
| 255 | 255 |
| 256 // Requesting whether the surface texture peer needs to be reestablished. | 256 // Requesting whether the surface texture peer needs to be reestablished. |
| 257 void SetNeedsEstablishPeer(bool needs_establish_peer); | 257 void SetNeedsEstablishPeer(bool needs_establish_peer); |
| 258 | 258 |
| 259 #if defined(GOOGLE_TV) | |
| 260 // Request external surface for out-of-band composition. | |
| 261 void RequestExternalSurface(); | |
| 262 #endif | |
| 263 | |
| 264 private: | 259 private: |
| 265 void DrawRemotePlaybackIcon(); | 260 void DrawRemotePlaybackIcon(); |
| 266 void ReallocateVideoFrame(); | 261 void ReallocateVideoFrame(); |
| 267 void SetCurrentFrameInternal(scoped_refptr<media::VideoFrame>& frame); | 262 void SetCurrentFrameInternal(scoped_refptr<media::VideoFrame>& frame); |
| 268 void DidLoadMediaInfo(MediaInfoLoader::Status status); | 263 void DidLoadMediaInfo(MediaInfoLoader::Status status); |
| 269 void DoReleaseRemotePlaybackTexture(uint32 sync_point); | 264 void DoReleaseRemotePlaybackTexture(uint32 sync_point); |
| 270 | 265 |
| 271 bool IsKeySystemSupported(const blink::WebString& key_system); | 266 bool IsKeySystemSupported(const blink::WebString& key_system); |
| 272 | 267 |
| 273 // Actually do the work for generateKeyRequest/addKey so they can easily | 268 // Actually do the work for generateKeyRequest/addKey so they can easily |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 | 389 |
| 395 // Whether media player needs external surface. | 390 // Whether media player needs external surface. |
| 396 bool needs_external_surface_; | 391 bool needs_external_surface_; |
| 397 | 392 |
| 398 // A pointer back to the compositor to inform it about state changes. This is | 393 // A pointer back to the compositor to inform it about state changes. This is |
| 399 // not NULL while the compositor is actively using this webmediaplayer. | 394 // not NULL while the compositor is actively using this webmediaplayer. |
| 400 cc::VideoFrameProvider::Client* video_frame_provider_client_; | 395 cc::VideoFrameProvider::Client* video_frame_provider_client_; |
| 401 | 396 |
| 402 scoped_ptr<webkit::WebLayerImpl> video_weblayer_; | 397 scoped_ptr<webkit::WebLayerImpl> video_weblayer_; |
| 403 | 398 |
| 399 #if defined(VIDEO_HOLE) |
| 400 // A rectangle represents the geometry of video frame, when computed last |
| 401 // time. |
| 402 gfx::RectF last_computed_rect_; |
| 403 #endif // defined(VIDEO_HOLE) |
| 404 |
| 404 #if defined(GOOGLE_TV) | 405 #if defined(GOOGLE_TV) |
| 405 // Pixel threshold for external surface usage. Negative value means that the | 406 // Pixel threshold for external surface usage. Negative value means that the |
| 406 // threshold is not defined, so that external surface is never used. | 407 // threshold is not defined, so that external surface is never used. |
| 407 int external_surface_threshold_; | 408 int external_surface_threshold_; |
| 408 | 409 |
| 409 // A rectangle represents the geometry of video frame, when computed last | |
| 410 // time. | |
| 411 gfx::RectF last_computed_rect_; | |
| 412 | |
| 413 // Media Stream related fields. | 410 // Media Stream related fields. |
| 414 media::Demuxer* demuxer_; | 411 media::Demuxer* demuxer_; |
| 415 base::Closure destroy_demuxer_cb_; | 412 base::Closure destroy_demuxer_cb_; |
| 416 scoped_refptr<MediaStreamAudioRenderer> audio_renderer_; | 413 scoped_refptr<MediaStreamAudioRenderer> audio_renderer_; |
| 417 MediaStreamClient* media_stream_client_; | 414 MediaStreamClient* media_stream_client_; |
| 418 #endif | 415 #endif |
| 419 | 416 |
| 420 scoped_ptr<MediaSourceDelegate, | 417 scoped_ptr<MediaSourceDelegate, |
| 421 MediaSourceDelegate::Destroyer> media_source_delegate_; | 418 MediaSourceDelegate::Destroyer> media_source_delegate_; |
| 422 | 419 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 450 scoped_ptr<ProxyDecryptor> decryptor_; | 447 scoped_ptr<ProxyDecryptor> decryptor_; |
| 451 | 448 |
| 452 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; | 449 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; |
| 453 | 450 |
| 454 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 451 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
| 455 }; | 452 }; |
| 456 | 453 |
| 457 } // namespace content | 454 } // namespace content |
| 458 | 455 |
| 459 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 456 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| OLD | NEW |