| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 protected: | 259 protected: |
| 260 // Helper method to update the playing state. | 260 // Helper method to update the playing state. |
| 261 void UpdatePlayingState(bool is_playing_); | 261 void UpdatePlayingState(bool is_playing_); |
| 262 | 262 |
| 263 // Helper methods for posting task for setting states and update WebKit. | 263 // Helper methods for posting task for setting states and update WebKit. |
| 264 void UpdateNetworkState(blink::WebMediaPlayer::NetworkState state); | 264 void UpdateNetworkState(blink::WebMediaPlayer::NetworkState state); |
| 265 void UpdateReadyState(blink::WebMediaPlayer::ReadyState state); | 265 void UpdateReadyState(blink::WebMediaPlayer::ReadyState state); |
| 266 void TryCreateStreamTextureProxyIfNeeded(); | 266 void TryCreateStreamTextureProxyIfNeeded(); |
| 267 void DoCreateStreamTexture(); | 267 void DoCreateStreamTexture(); |
| 268 | 268 |
| 269 // Helper method to reestablish the surface texture peer for android | 269 // This method is meant to be idempotent. Should be called whenever any of |
| 270 // media player. | 270 // conditions chances and it is ok to establish peer. |
| 271 void EstablishSurfaceTexturePeer(); | 271 void EstablishSurfaceTexturePeerIfNeeded(); |
| 272 | |
| 273 // Requesting whether the surface texture peer needs to be reestablished. | |
| 274 void SetNeedsEstablishPeer(bool needs_establish_peer); | |
| 275 | 272 |
| 276 private: | 273 private: |
| 277 void InitializePlayer(const GURL& url, | 274 void InitializePlayer(const GURL& url, |
| 278 const GURL& first_party_for_cookies, | 275 const GURL& first_party_for_cookies, |
| 279 bool allowed_stored_credentials, | 276 bool allowed_stored_credentials, |
| 280 int demuxer_client_id); | 277 int demuxer_client_id); |
| 281 void Pause(bool is_media_related_action); | 278 void Pause(bool is_media_related_action); |
| 282 void DrawRemotePlaybackText(const std::string& remote_playback_message); | 279 void DrawRemotePlaybackText(const std::string& remote_playback_message); |
| 283 void ReallocateVideoFrame(); | 280 void ReallocateVideoFrame(); |
| 284 void SetCurrentFrameInternal(scoped_refptr<media::VideoFrame>& frame); | 281 void SetCurrentFrameInternal(scoped_refptr<media::VideoFrame>& frame); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 // point for when the mailbox was produced. | 398 // point for when the mailbox was produced. |
| 402 gpu::Mailbox texture_mailbox_; | 399 gpu::Mailbox texture_mailbox_; |
| 403 | 400 |
| 404 // Stream texture ID allocated to the video. | 401 // Stream texture ID allocated to the video. |
| 405 unsigned int stream_id_; | 402 unsigned int stream_id_; |
| 406 | 403 |
| 407 // Whether the mediaplayer is playing. | 404 // Whether the mediaplayer is playing. |
| 408 bool is_playing_; | 405 bool is_playing_; |
| 409 | 406 |
| 410 // Whether media player needs to re-establish the surface texture peer. | 407 // Whether media player needs to re-establish the surface texture peer. |
| 411 bool needs_establish_peer_; | 408 bool peer_established_; |
| 409 bool in_fullscreen_; |
| 412 | 410 |
| 413 // Whether |stream_texture_proxy_| is initialized. | 411 // Whether |stream_texture_proxy_| is initialized. |
| 414 bool stream_texture_proxy_initialized_; | 412 bool stream_texture_proxy_initialized_; |
| 415 | 413 |
| 416 // Whether the video size info is available. | 414 // Whether the video size info is available. |
| 417 bool has_size_info_; | 415 bool has_size_info_; |
| 418 | 416 |
| 419 // Object for allocating stream textures. | 417 // Object for allocating stream textures. |
| 420 scoped_refptr<StreamTextureFactory> stream_texture_factory_; | 418 scoped_refptr<StreamTextureFactory> stream_texture_factory_; |
| 421 | 419 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 | 493 |
| 496 // NOTE: Weak pointers must be invalidated before all other member variables. | 494 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 497 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; | 495 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; |
| 498 | 496 |
| 499 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 497 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
| 500 }; | 498 }; |
| 501 | 499 |
| 502 } // namespace content | 500 } // namespace content |
| 503 | 501 |
| 504 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 502 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| OLD | NEW |