OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |