Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(654)

Side by Side Diff: content/renderer/media/android/webmediaplayer_android.h

Issue 557593002: Clean up WebMediaPlayerAndroid needs_establish_peer_ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/media/android/webmediaplayer_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 changes 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
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.
408 // This should be unset in EstablishSurfaceTexturePeerIfNeeded() only, and set
409 // we believe peer is disconnected that we need to establish it again.
410 // Setting this should not be conditioned on additional state, eg playing
411 // or full screen.
411 bool needs_establish_peer_; 412 bool needs_establish_peer_;
412 413
414 // This is a helper state used in EstablishSurfaceTexturePeerIfNeeded().
415 bool in_fullscreen_;
416
413 // Whether |stream_texture_proxy_| is initialized. 417 // Whether |stream_texture_proxy_| is initialized.
414 bool stream_texture_proxy_initialized_; 418 bool stream_texture_proxy_initialized_;
415 419
416 // Whether the video size info is available. 420 // Whether the video size info is available.
417 bool has_size_info_; 421 bool has_size_info_;
418 422
419 // Object for allocating stream textures. 423 // Object for allocating stream textures.
420 scoped_refptr<StreamTextureFactory> stream_texture_factory_; 424 scoped_refptr<StreamTextureFactory> stream_texture_factory_;
421 425
422 // Object for calling back the compositor thread to repaint the video when a 426 // Object for calling back the compositor thread to repaint the video when a
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 499
496 // NOTE: Weak pointers must be invalidated before all other member variables. 500 // NOTE: Weak pointers must be invalidated before all other member variables.
497 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; 501 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_;
498 502
499 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); 503 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid);
500 }; 504 };
501 505
502 } // namespace content 506 } // namespace content
503 507
504 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ 508 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/android/webmediaplayer_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698