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

Side by Side Diff: media/base/video_frame.h

Issue 11043002: ReadPixels from known-usable textures, and give SkBitmap its precious BGRA. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: BGRA for all! Created 8 years, 2 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 unified diff | Download patch
« no previous file with comments | « content/renderer/media/renderer_gpu_video_decoder_factories.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BASE_VIDEO_FRAME_H_ 5 #ifndef MEDIA_BASE_VIDEO_FRAME_H_
6 #define MEDIA_BASE_VIDEO_FRAME_H_ 6 #define MEDIA_BASE_VIDEO_FRAME_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/md5.h" 9 #include "base/md5.h"
10 #include "media/base/buffers.h" 10 #include "media/base/buffers.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 static scoped_refptr<VideoFrame> WrapNativeTexture( 69 static scoped_refptr<VideoFrame> WrapNativeTexture(
70 uint32 texture_id, 70 uint32 texture_id,
71 uint32 texture_target, 71 uint32 texture_target,
72 const gfx::Size& data_size, 72 const gfx::Size& data_size,
73 const gfx::Size& natural_size, 73 const gfx::Size& natural_size,
74 base::TimeDelta timestamp, 74 base::TimeDelta timestamp,
75 const ReadPixelsCB& read_pixels_cb, 75 const ReadPixelsCB& read_pixels_cb,
76 const base::Closure& no_longer_needed); 76 const base::Closure& no_longer_needed);
77 77
78 // Read pixels from the native texture backing |*this| and write 78 // Read pixels from the native texture backing |*this| and write
79 // them to |*pixels| as RGBA. |pixels| must point to a buffer at 79 // them to |*pixels| as BGRA. |pixels| must point to a buffer at
80 // least as large as 4*data_size().width()*data_size().height(). 80 // least as large as 4*data_size().width()*data_size().height().
81 void ReadPixelsFromNativeTexture(void* pixels); 81 void ReadPixelsFromNativeTexture(void* pixels);
82 82
83 // Creates a frame with format equals to VideoFrame::EMPTY, width, height, 83 // Creates a frame with format equals to VideoFrame::EMPTY, width, height,
84 // and timestamp are all 0. 84 // and timestamp are all 0.
85 static scoped_refptr<VideoFrame> CreateEmptyFrame(); 85 static scoped_refptr<VideoFrame> CreateEmptyFrame();
86 86
87 // Allocates YV12 frame based on |width| and |height|, and sets its data to 87 // Allocates YV12 frame based on |width| and |height|, and sets its data to
88 // the YUV equivalent of RGB(0,0,0). 88 // the YUV equivalent of RGB(0,0,0).
89 static scoped_refptr<VideoFrame> CreateBlackFrame(const gfx::Size& size); 89 static scoped_refptr<VideoFrame> CreateBlackFrame(const gfx::Size& size);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 base::Closure texture_no_longer_needed_; 168 base::Closure texture_no_longer_needed_;
169 169
170 base::TimeDelta timestamp_; 170 base::TimeDelta timestamp_;
171 171
172 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); 172 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame);
173 }; 173 };
174 174
175 } // namespace media 175 } // namespace media
176 176
177 #endif // MEDIA_BASE_VIDEO_FRAME_H_ 177 #endif // MEDIA_BASE_VIDEO_FRAME_H_
OLDNEW
« no previous file with comments | « content/renderer/media/renderer_gpu_video_decoder_factories.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698