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

Unified Diff: webkit/media/webmediaplayer_impl.cc

Issue 14199002: Send hardware video frames with mailboxes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ifdefed 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
« media/base/video_frame.h ('K') | « media/video/picture.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/webmediaplayer_impl.cc
diff --git a/webkit/media/webmediaplayer_impl.cc b/webkit/media/webmediaplayer_impl.cc
index 6c3612bbe8f12d14b7be9d61c21dffa4cbfed11e..7348d51b7c8482331c4b30df0faafdaa52dd04dc 100644
--- a/webkit/media/webmediaplayer_impl.cc
+++ b/webkit/media/webmediaplayer_impl.cc
@@ -741,7 +741,18 @@ bool WebMediaPlayerImpl::copyVideoTextureToPlatformTexture(
if (video_frame &&
video_frame->format() == media::VideoFrame::NATIVE_TEXTURE &&
video_frame->texture_target() == GL_TEXTURE_2D) {
+#ifndef VIDEO_FRAME_MAILBOX
uint32 source_texture = video_frame->texture_id();
+#else
+ uint32 source_texture = web_graphics_context->createTexture();
+
+ web_graphics_context->waitSyncPoint(
+ video_frame->texture_mailbox_sync_point());
+ web_graphics_context->bindTexture(GL_TEXTURE_2D, source_texture);
+ web_graphics_context->consumeTextureCHROMIUM(
+ GL_TEXTURE_2D, video_frame->texture_mailbox().name);
+#endif
+
// The video is stored in a unmultiplied format, so premultiply
// if necessary.
web_graphics_context->pixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM,
@@ -756,6 +767,14 @@ bool WebMediaPlayerImpl::copyVideoTextureToPlatformTexture(
web_graphics_context->pixelStorei(GL_UNPACK_FLIP_Y_CHROMIUM, false);
web_graphics_context->pixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM,
false);
+
+#ifdef VIDEO_FRAME_MAILBOX
scherkus (not reviewing) 2013/04/17 20:09:34 nit: doesn't chromium prefer #if defined(FOO) / #i
danakj 2013/04/17 20:12:37 Does it? The google style guide and chromium style
scherkus (not reviewing) 2013/04/17 20:16:58 yeah I don't really care enough to have it changed
+ web_graphics_context->bindTexture(GL_TEXTURE_2D, source_texture);
+ web_graphics_context->produceTextureCHROMIUM(
+ GL_TEXTURE_2D, video_frame->texture_mailbox().name);
+ web_graphics_context->deleteTexture(source_texture);
+#endif
+
// The flush() operation is not necessary here. It is kept since the
// performance will be better when it is added than not.
web_graphics_context->flush();
« media/base/video_frame.h ('K') | « media/video/picture.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698