Chromium Code Reviews| Index: webkit/media/android/webmediaplayer_android.cc |
| diff --git a/webkit/media/android/webmediaplayer_android.cc b/webkit/media/android/webmediaplayer_android.cc |
| index 5a0382204ce6439723150262f17cff3727ace428..5a4945e581541e753bfb1744a5e23467b6a00fd5 100644 |
| --- a/webkit/media/android/webmediaplayer_android.cc |
| +++ b/webkit/media/android/webmediaplayer_android.cc |
| @@ -43,6 +43,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), |
| has_size_info_(false), |
| @@ -55,7 +58,11 @@ WebMediaPlayerAndroid::WebMediaPlayerAndroid( |
| if (stream_texture_factory_.get()) { |
| stream_texture_proxy_.reset(stream_texture_factory_->CreateProxy()); |
| - stream_id_ = stream_texture_factory_->CreateStreamTexture(&texture_id_); |
| + stream_id_ = stream_texture_factory_->CreateStreamTexture( |
| + kGLTextureExternalOES, |
| + &texture_id_, |
| + &texture_mailbox_, |
| + &texture_mailbox_sync_point_); |
| ReallocateVideoFrame(); |
| } |
| } |
| @@ -64,8 +71,13 @@ WebMediaPlayerAndroid::~WebMediaPlayerAndroid() { |
| SetVideoFrameProviderClient(NULL); |
| client_->setWebLayer(NULL); |
| - if (stream_id_) |
| - stream_texture_factory_->DestroyStreamTexture(texture_id_); |
| + if (stream_id_) { |
| + stream_texture_factory_->DestroyStreamTexture( |
| + kGLTextureExternalOES, |
| + texture_id_, |
| + texture_mailbox_, |
| + 0); // TODO(danakj): How do I get this sync point? |
|
danakj
2013/04/18 02:38:34
Daniel/Antoine, besides "things I did horribly wro
piman
2013/04/18 04:11:19
Reading the code, my interpretation of how StreamT
no sievers
2013/04/18 17:37:08
Yep, and notice that deleting the client texture (
danakj
2013/04/19 18:03:52
Oh, I have it just deleting the client texture and
|
| + } |
| if (manager_) |
| manager_->UnregisterMediaPlayer(player_id_); |
| @@ -457,7 +469,11 @@ void WebMediaPlayerAndroid::Detach() { |
| Destroy(); |
| if (stream_id_) { |
| - stream_texture_factory_->DestroyStreamTexture(texture_id_); |
| + stream_texture_factory_->DestroyStreamTexture( |
| + kGLTextureExternalOES, |
| + texture_id_, |
| + texture_mailbox_, |
| + 0); // TODO(danakj): How do I get this sync point? |
| stream_id_ = 0; |
| } |
| @@ -477,9 +493,11 @@ void WebMediaPlayerAndroid::ReallocateVideoFrame() { |
| #endif |
| } else if (texture_id_) { |
| current_frame_ = VideoFrame::WrapNativeTexture( |
| - texture_id_, kGLTextureExternalOES, natural_size_, |
| + texture_mailbox_, texture_mailbox_sync_point_, |
| + kGLTextureExternalOES, natural_size_, |
| gfx::Rect(natural_size_), natural_size_, base::TimeDelta(), |
| VideoFrame::ReadPixelsCB(), |
| + VideoFrame::TextureNoLongerNeededCallback(), |
| base::Closure()); |
| } |
| } |