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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // Allocates YV12 frame based on |size|, and sets its data to the YUV(y,u,v). | 182 // Allocates YV12 frame based on |size|, and sets its data to the YUV(y,u,v). |
183 static scoped_refptr<VideoFrame> CreateColorFrame( | 183 static scoped_refptr<VideoFrame> CreateColorFrame( |
184 const gfx::Size& size, | 184 const gfx::Size& size, |
185 uint8 y, uint8 u, uint8 v, | 185 uint8 y, uint8 u, uint8 v, |
186 base::TimeDelta timestamp); | 186 base::TimeDelta timestamp); |
187 | 187 |
188 // Allocates YV12 frame based on |size|, and sets its data to the YUV | 188 // Allocates YV12 frame based on |size|, and sets its data to the YUV |
189 // equivalent of RGB(0,0,0). | 189 // equivalent of RGB(0,0,0). |
190 static scoped_refptr<VideoFrame> CreateBlackFrame(const gfx::Size& size); | 190 static scoped_refptr<VideoFrame> CreateBlackFrame(const gfx::Size& size); |
191 | 191 |
| 192 // Allocates YV12A frame based on |size|, and sets its data to the YUVA |
| 193 // equivalent of RGBA(0,0,0,0). |
| 194 static scoped_refptr<VideoFrame> CreateTransparentFrame( |
| 195 const gfx::Size& size); |
| 196 |
192 #if defined(VIDEO_HOLE) | 197 #if defined(VIDEO_HOLE) |
193 // Allocates a hole frame. | 198 // Allocates a hole frame. |
194 static scoped_refptr<VideoFrame> CreateHoleFrame(const gfx::Size& size); | 199 static scoped_refptr<VideoFrame> CreateHoleFrame(const gfx::Size& size); |
195 #endif // defined(VIDEO_HOLE) | 200 #endif // defined(VIDEO_HOLE) |
196 | 201 |
197 static size_t NumPlanes(Format format); | 202 static size_t NumPlanes(Format format); |
198 | 203 |
199 // Returns the required allocation size for a (tightly packed) frame of the | 204 // Returns the required allocation size for a (tightly packed) frame of the |
200 // given coded size and format. | 205 // given coded size and format. |
201 static size_t AllocationSize(Format format, const gfx::Size& coded_size); | 206 static size_t AllocationSize(Format format, const gfx::Size& coded_size); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 std::vector<uint32> release_sync_points_; | 338 std::vector<uint32> release_sync_points_; |
334 | 339 |
335 const bool end_of_stream_; | 340 const bool end_of_stream_; |
336 | 341 |
337 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 342 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
338 }; | 343 }; |
339 | 344 |
340 } // namespace media | 345 } // namespace media |
341 | 346 |
342 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 347 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
OLD | NEW |