Index: content/renderer/media/android/webmediaplayer_android.cc |
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc |
index 4a8e6a433b85e7943c82871d35cb43254fc5f0c4..eff7d97bc12263015477b110a68bdbbe4ce6bee7 100644 |
--- a/content/renderer/media/android/webmediaplayer_android.cc |
+++ b/content/renderer/media/android/webmediaplayer_android.cc |
@@ -83,6 +83,9 @@ WebMediaPlayerAndroid::WebMediaPlayerAndroid( |
manager_(manager), |
network_state_(WebMediaPlayer::NetworkStateEmpty), |
ready_state_(WebMediaPlayer::ReadyStateHaveNothing), |
+ texture_id_(0), |
+ texture_mailbox_sync_point_(0), |
+ stream_id_(0), |
is_playing_(false), |
needs_establish_peer_(true), |
stream_texture_proxy_initialized_(false), |
@@ -128,7 +131,11 @@ WebMediaPlayerAndroid::WebMediaPlayerAndroid( |
if (stream_texture_factory_) { |
stream_texture_proxy_.reset(stream_texture_factory_->CreateProxy()); |
if (needs_establish_peer_) { |
- stream_id_ = stream_texture_factory_->CreateStreamTexture(&texture_id_); |
+ stream_id_ = stream_texture_factory_->CreateStreamTexture( |
+ kGLTextureExternalOES, |
+ &texture_id_, |
+ &texture_mailbox_, |
+ &texture_mailbox_sync_point_); |
ReallocateVideoFrame(); |
} |
} |
@@ -776,7 +783,11 @@ void WebMediaPlayerAndroid::ReallocateVideoFrame() { |
#endif |
} else if (texture_id_) { |
current_frame_ = VideoFrame::WrapNativeTexture( |
- texture_id_, kGLTextureExternalOES, natural_size_, |
+ new VideoFrame::MailboxHolder( |
+ texture_mailbox_, |
+ texture_mailbox_sync_point_, |
+ VideoFrame::MailboxHolder::TextureNoLongerNeededCallback()), |
+ kGLTextureExternalOES, natural_size_, |
gfx::Rect(natural_size_), natural_size_, base::TimeDelta(), |
VideoFrame::ReadPixelsCB(), |
base::Closure()); |
@@ -818,7 +829,13 @@ void WebMediaPlayerAndroid::EstablishSurfaceTexturePeer() { |
stream_texture_factory_->DestroyStreamTexture(texture_id_); |
stream_id_ = 0; |
texture_id_ = 0; |
- stream_id_ = stream_texture_factory_->CreateStreamTexture(&texture_id_); |
+ texture_mailbox_ = gpu::Mailbox(); |
+ texture_mailbox_sync_point_ = 0; |
+ stream_id_ = stream_texture_factory_->CreateStreamTexture( |
+ kGLTextureExternalOES, |
+ &texture_id_, |
+ &texture_mailbox_, |
+ &texture_mailbox_sync_point_); |
ReallocateVideoFrame(); |
stream_texture_proxy_initialized_ = false; |
} |