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

Unified Diff: webkit/media/webmediaplayer_impl.cc

Issue 12412007: Add a new API in WebMediaPlayer to do a GPU-GPU textures copy if possible (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add new API in WebMediaPlayer to do GPU-GPU textures copy Created 7 years, 9 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
« webkit/media/webmediaplayer_impl.h ('K') | « webkit/media/webmediaplayer_impl.h ('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 804135b658bcfefad732d60d2c56c35e0580e914..25844ffab61ec76030770e8762f6638ae99d2972 100644
--- a/webkit/media/webmediaplayer_impl.cc
+++ b/webkit/media/webmediaplayer_impl.cc
@@ -25,6 +25,7 @@
#include "media/filters/audio_renderer_impl.h"
#include "media/filters/chunk_demuxer.h"
#include "media/filters/video_renderer_base.h"
+#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebString.h"
@@ -670,6 +671,27 @@ void WebMediaPlayerImpl::putCurrentFrame(
delete web_video_frame;
}
+bool WebMediaPlayerImpl::copyVideoTextureToPlatformTexture(
+ WebKit::WebGraphicsContext3D* webGraphicsContext,
scherkus (not reviewing) 2013/03/08 20:17:37 web_graphics_context
+ unsigned int texture,
+ unsigned int level,
+ unsigned int internalFormat) {
scherkus (not reviewing) 2013/03/08 20:17:37 internal_format
+ scoped_refptr<media::VideoFrame> video_frame;
+ {
+ base::AutoLock auto_lock(lock_);
+ video_frame = current_frame_;
+ }
+ if (video_frame
scherkus (not reviewing) 2013/03/08 20:17:37 chromium puts && at the end of lines
+ && video_frame->format() == media::VideoFrame::NATIVE_TEXTURE
+ && video_frame->texture_target() == GL_TEXTURE_2D) {
+ uint32 sourceTexture = video_frame->texture_id();
scherkus (not reviewing) 2013/03/08 20:17:37 source_texture
+ webGraphicsContext->copyTextureCHROMIUM(GL_TEXTURE_2D,
+ sourceTexture, texture, level, internalFormat);
+ return true;
+ }
+ return false;
+}
+
// Helper enum for reporting generateKeyRequest/addKey histograms.
enum MediaKeyException {
kUnknownResultId,
« webkit/media/webmediaplayer_impl.h ('K') | « webkit/media/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698