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

Unified Diff: content/renderer/media/android/webmediaplayer_android.h

Issue 532993002: work-in-progress patch to fix context lost black video (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: post to impl 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/android/webmediaplayer_android.h
diff --git a/content/renderer/media/android/webmediaplayer_android.h b/content/renderer/media/android/webmediaplayer_android.h
index bf290b71229ca958d8c356398b03be1238f6589e..59994e4ef23dcd7182d652238e4b05c8cb4707cc 100644
--- a/content/renderer/media/android/webmediaplayer_android.h
+++ b/content/renderer/media/android/webmediaplayer_android.h
@@ -70,7 +70,8 @@ class WebContentDecryptionModuleImpl;
// player.
class WebMediaPlayerAndroid : public blink::WebMediaPlayer,
public cc::VideoFrameProvider,
- public RenderFrameObserver {
+ public RenderFrameObserver,
+ public StreamTextureFactoryContextObserver {
public:
// Construct a WebMediaPlayerAndroid object. This class communicates with the
// MediaPlayerAndroid object in the browser process through |proxy|.
@@ -196,6 +197,9 @@ class WebMediaPlayerAndroid : public blink::WebMediaPlayer,
void OnMediaPlayerPause();
void OnRequestFullscreen();
+ // StreamTextureFactoryContextObserver implementation.
+ virtual void ResetStreamTextureProxy() OVERRIDE;
+
// Called when the player is released.
virtual void OnPlayerReleased();
@@ -282,6 +286,7 @@ class WebMediaPlayerAndroid : public blink::WebMediaPlayer,
void DrawRemotePlaybackText(const std::string& remote_playback_message);
void ReallocateVideoFrame();
void SetCurrentFrameInternal(scoped_refptr<media::VideoFrame>& frame);
+ void UpdateFrameOnClientThread();
void DidLoadMediaInfo(MediaInfoLoader::Status status,
const GURL& redirected_url,
const GURL& first_party_for_cookies,
@@ -344,7 +349,10 @@ class WebMediaPlayerAndroid : public blink::WebMediaPlayer,
// The video frame object used for rendering by the compositor.
scoped_refptr<media::VideoFrame> current_frame_;
- base::Lock current_frame_lock_;
+ // Whether |stream_texture_proxy_| is initialized.
+ bool stream_texture_proxy_initialized_;
+ scoped_refptr<base::MessageLoopProxy> client_bound_loop_;
+ base::Lock current_frame_lock_; // TODO(boliu): Rename this var.
base::ThreadChecker main_thread_checker_;
@@ -410,9 +418,6 @@ class WebMediaPlayerAndroid : public blink::WebMediaPlayer,
// Whether media player needs to re-establish the surface texture peer.
bool needs_establish_peer_;
- // Whether |stream_texture_proxy_| is initialized.
- bool stream_texture_proxy_initialized_;
-
// Whether the video size info is available.
bool has_size_info_;

Powered by Google App Engine
This is Rietveld 408576698