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

Unified Diff: content/browser/renderer_host/surface_texture_transport_client_android.cc

Issue 14199002: Send hardware video frames with mailboxes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use the texture target in the hardware video frame Created 7 years, 8 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/browser/renderer_host/surface_texture_transport_client_android.cc
diff --git a/content/browser/renderer_host/surface_texture_transport_client_android.cc b/content/browser/renderer_host/surface_texture_transport_client_android.cc
index d6d57353281f7979c49c51e1fe7b51b1986b3ef0..4f75d9420e8a70cf1f8c4c2312b9d4eeeca47cae 100644
--- a/content/browser/renderer_host/surface_texture_transport_client_android.cc
+++ b/content/browser/renderer_host/surface_texture_transport_client_android.cc
@@ -46,6 +46,7 @@ class SurfaceRefAndroid : public GpuSurfaceTracker::SurfaceRef {
SurfaceTextureTransportClient::SurfaceTextureTransportClient()
: window_(NULL),
texture_id_(0),
+ texture_mailbox_sync_point_(0),
surface_id_(0) {
}
@@ -96,16 +97,25 @@ scoped_refptr<media::VideoFrame> SurfaceTextureTransportClient::
context->makeContextCurrent();
texture_id_ = context->createTexture();
surface_texture_->AttachToGLContext(texture_id_);
+
+ context->genMailboxCHROMIUM(texture_mailbox_.name);
+ context->bindTexture(kGLTextureExternalOES, texture_id_);
+ context->produceTextureCHROMIUM(kGLTextureExternalOES,
+ texture_mailbox_.name);
+ texture_mailbox_sync_point_ = context->insertSyncPoint();
}
if (!video_frame_) {
const gfx::Size size = video_layer_->bounds();
video_frame_ = media::VideoFrame::WrapNativeTexture(
- texture_id_, kGLTextureExternalOES,
+ texture_mailbox_,
+ texture_mailbox_sync_point_,
+ kGLTextureExternalOES,
size,
gfx::Rect(gfx::Point(), size),
size,
base::TimeDelta(),
media::VideoFrame::ReadPixelsCB(),
+ media::VideoFrame::TextureNoLongerNeededCallback(),
base::Closure());
}
surface_texture_->UpdateTexImage();

Powered by Google App Engine
This is Rietveld 408576698