| Index: media/base/video_frame.h
|
| diff --git a/media/base/video_frame.h b/media/base/video_frame.h
|
| index 26a9dea9330d0e12f6ce17969a34b2922042c243..c40cb239ed4d331d3d1d2f2702c20cdd1b17502d 100644
|
| --- a/media/base/video_frame.h
|
| +++ b/media/base/video_frame.h
|
| @@ -8,6 +8,7 @@
|
| #include "base/callback.h"
|
| #include "base/md5.h"
|
| #include "media/base/buffers.h"
|
| +#include "ui/gfx/size.h"
|
|
|
| namespace media {
|
|
|
| @@ -39,27 +40,31 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
|
|
|
| // Creates a new frame in system memory with given parameters. Buffers for
|
| // the frame are allocated but not initialized.
|
| + // |data_size| is the width and height of the frame data in pixels.
|
| + // |natural_size| is the width and height of the frame when the frame's aspect
|
| + // ratio is applied to |data_size|.
|
| static scoped_refptr<VideoFrame> CreateFrame(
|
| Format format,
|
| - size_t width,
|
| - size_t height,
|
| + const gfx::Size& data_size,
|
| + const gfx::Size& natural_size,
|
| base::TimeDelta timestamp);
|
|
|
| // Call prior to CreateFrame to ensure validity of frame configuration. Called
|
| // automatically by VideoDecoderConfig::IsValidConfig().
|
| // TODO(scherkus): VideoDecoderConfig shouldn't call this method
|
| - static bool IsValidConfig(
|
| - Format format,
|
| - size_t width,
|
| - size_t height);
|
| + static bool IsValidConfig(Format format, const gfx::Size& data_size,
|
| + const gfx::Size& natural_size);
|
|
|
| // Wraps a native texture of the given parameters with a VideoFrame. When the
|
| // frame is destroyed |no_longer_needed.Run()| will be called.
|
| + // |data_size| is the width and height of the frame data in pixels.
|
| + // |natural_size| is the width and height of the frame when the frame's aspect
|
| + // ratio is applied to |size|.
|
| static scoped_refptr<VideoFrame> WrapNativeTexture(
|
| uint32 texture_id,
|
| uint32 texture_target,
|
| - size_t width,
|
| - size_t height,
|
| + const gfx::Size& data_size,
|
| + const gfx::Size& natural_size,
|
| base::TimeDelta timestamp,
|
| const base::Closure& no_longer_needed);
|
|
|
| @@ -69,13 +74,12 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
|
|
|
| // Allocates YV12 frame based on |width| and |height|, and sets its data to
|
| // the YUV equivalent of RGB(0,0,0).
|
| - static scoped_refptr<VideoFrame> CreateBlackFrame(int width, int height);
|
| + static scoped_refptr<VideoFrame> CreateBlackFrame(const gfx::Size& size);
|
|
|
| Format format() const { return format_; }
|
|
|
| - size_t width() const { return width_; }
|
| -
|
| - size_t height() const { return height_; }
|
| + const gfx::Size& data_size() const { return data_size_; }
|
| + const gfx::Size& natural_size() const { return natural_size_; }
|
|
|
| int stride(size_t plane) const;
|
|
|
| @@ -115,8 +119,8 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
|
| friend class base::RefCountedThreadSafe<VideoFrame>;
|
| // Clients must use the static CreateFrame() method to create a new frame.
|
| VideoFrame(Format format,
|
| - size_t video_width,
|
| - size_t video_height,
|
| + const gfx::Size& size,
|
| + const gfx::Size& natural_size,
|
| base::TimeDelta timestamp);
|
| virtual ~VideoFrame();
|
|
|
| @@ -130,9 +134,12 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
|
| // Frame format.
|
| Format format_;
|
|
|
| - // Width and height of surface.
|
| - size_t width_;
|
| - size_t height_;
|
| + // Width and height of the video frame.
|
| + gfx::Size data_size_;
|
| +
|
| + // Width and height of the video frame with aspect ratio taken
|
| + // into account.
|
| + gfx::Size natural_size_;
|
|
|
| // Array of strides for each plane, typically greater or equal to the width
|
| // of the surface divided by the horizontal sampling period. Note that
|
|
|