Index: media/base/video_frame.h |
=================================================================== |
--- media/base/video_frame.h (revision 140753) |
+++ media/base/video_frame.h (working copy) |
@@ -38,20 +38,39 @@ |
}; |
// 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 given, alignment is a |
+ // power of 2 number (in bytes) by which the horizontal and vertical buffer |
+ // dimensions should be aligned during allocation. |
static scoped_refptr<VideoFrame> CreateFrame( |
Format format, |
size_t width, |
size_t height, |
+ size_t alignment, |
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, 1, |
scherkus (not reviewing)
2012/06/14 19:21:20
nit: this can fit on one line
rbultje1
2012/06/14 19:26:25
Done.
|
+ timestamp, duration); |
+ } |
// Call prior to CreateFrame to ensure validity of frame configuration. Called |
// automatically by VideoDecoderConfig::IsValidConfig(). |
static bool IsValidConfig( |
scherkus (not reviewing)
2012/06/14 19:21:20
hrm this was added in r122886 and seems to be used
rbultje1
2012/06/14 19:26:25
Done.
|
Format format, |
size_t width, |
- size_t height); |
+ size_t height, |
+ size_t alignment); |
+ static bool IsValidConfig( |
+ Format format, |
+ size_t width, |
+ size_t height) { |
+ return IsValidConfig(format, width, height, 1); |
+ } |
// 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 +149,8 @@ |
virtual ~VideoFrame(); |
// Used internally by CreateFrame(). |
- void AllocateRGB(size_t bytes_per_pixel); |
- void AllocateYUV(); |
+ void AllocateRGB(size_t bytes_per_pixel, size_t alignment); |
+ void AllocateYUV(size_t alignment); |
// Used to DCHECK() plane parameters. |
bool IsValidPlane(size_t plane) const; |