Chromium Code Reviews| Index: media/base/video_frame.h |
| =================================================================== |
| --- media/base/video_frame.h (revision 140753) |
| +++ media/base/video_frame.h (working copy) |
| @@ -38,20 +38,45 @@ |
| }; |
| // Creates a new frame in system memory with given parameters. Buffers for |
| - // the frame are allocated but not initialized. |
| + // the frame are allocated but not initialized. If bytes_per_row and |
| + // bytes_per_row_uv are zero, they are initialized to a default value |
| + // suitable for the given format. |
| static scoped_refptr<VideoFrame> CreateFrame( |
| Format format, |
| size_t width, |
| size_t height, |
| + size_t bytes_per_row, |
| + size_t bytes_per_uv_row, |
|
Ami GONE FROM CHROMIUM
2012/06/08 19:11:04
These two args don't make sense to me, because the
|
| + size_t aligned_height, |
| base::TimeDelta timestamp, |
| base::TimeDelta duration); |
| + static scoped_refptr<VideoFrame> CreateFrame( |
| + Format format, |
| + size_t width, |
| + size_t height, |
| + base::TimeDelta timestamp, |
| + base::TimeDelta duration) { |
| + return CreateFrame(format, width, height, 0, 0, 0, |
| + timestamp, duration); |
| + } |
| // Call prior to CreateFrame to ensure validity of frame configuration. Called |
| - // automatically by VideoDecoderConfig::IsValidConfig(). |
| + // automatically by VideoDecoderConfig::IsValidConfig(). If bytes_per_row and |
| + // bytes_per_uv_row are non-zero, they are also checked to be valid strides |
| + // for the given buffer size and format. |
| static bool IsValidConfig( |
| Format format, |
| size_t width, |
| - size_t height); |
| + size_t height, |
| + size_t bytes_per_row, |
| + size_t bytes_per_uv_row, |
| + size_t aligned_height); |
| + static bool IsValidConfig( |
| + Format format, |
| + size_t width, |
| + size_t height) { |
| + return IsValidConfig(format, width, height, 0, 0, 0); |
| + } |
| // Wraps a native texture of the given parameters with a VideoFrame. When the |
| // frame is destroyed |no_longer_needed.Run()| will be called. |
| @@ -130,8 +155,9 @@ |
| virtual ~VideoFrame(); |
| // Used internally by CreateFrame(). |
| - void AllocateRGB(size_t bytes_per_pixel); |
| - void AllocateYUV(); |
| + void AllocateRGB(size_t bytes_per_row, size_t aligned_height); |
| + void AllocateYUV(size_t bytes_per_y_row, size_t bytes_per_uv_row, |
| + size_t aligned_height); |
| // Used to DCHECK() plane parameters. |
| bool IsValidPlane(size_t plane) const; |