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

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

Issue 14199002: Send hardware video frames with mailboxes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: video-mailbox: virtualandroid Created 7 years, 6 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.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;
}
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | content/renderer/media/renderer_gpu_video_decoder_factories.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698