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

Unified Diff: media/base/video_frame.cc

Issue 11016006: Support reading pixels from HW-decoded video textures into canvas/webgl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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
« no previous file with comments | « media/base/video_frame.h ('k') | media/filters/gpu_video_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index 5409e8458f247ddd038698b9cb9689178a9e01dd..7c1ea809cc1823c5ef10df0968ee68489ee3043f 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -61,15 +61,23 @@ scoped_refptr<VideoFrame> VideoFrame::WrapNativeTexture(
const gfx::Size& data_size,
const gfx::Size& natural_size,
base::TimeDelta timestamp,
+ const ReadPixelsCB& read_pixels_cb,
const base::Closure& no_longer_needed) {
scoped_refptr<VideoFrame> frame(
new VideoFrame(NATIVE_TEXTURE, data_size, natural_size, timestamp));
frame->texture_id_ = texture_id;
frame->texture_target_ = texture_target;
+ frame->read_pixels_cb_ = read_pixels_cb;
frame->texture_no_longer_needed_ = no_longer_needed;
return frame;
}
+void VideoFrame::ReadPixelsFromNativeTexture(void* pixels) {
+ DCHECK_EQ(format_, NATIVE_TEXTURE);
+ if (!read_pixels_cb_.is_null())
+ read_pixels_cb_.Run(pixels);
+}
+
// static
scoped_refptr<VideoFrame> VideoFrame::CreateEmptyFrame() {
return new VideoFrame(
« no previous file with comments | « media/base/video_frame.h ('k') | media/filters/gpu_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698