Chromium Code Reviews| Index: media/base/video_frame.h |
| diff --git a/media/base/video_frame.h b/media/base/video_frame.h |
| index e6069305f2e0108248c740bcb0f6e21ee3e5fed2..ed554a1b390e8f7f892012bea686b778d2a96bfa 100644 |
| --- a/media/base/video_frame.h |
| +++ b/media/base/video_frame.h |
| @@ -135,12 +135,13 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> { |
| // least as large as 4*visible_rect().width()*visible_rect().height(). |
| void ReadPixelsFromNativeTexture(const SkBitmap& pixels); |
| - // Wraps image data in a buffer backed by a base::SharedMemoryHandle with a |
| - // VideoFrame. The image data resides in |data| and is assumed to be packed |
| - // tightly in a buffer of logical dimensions |coded_size| with the appropriate |
| - // bit depth and plane count as given by |format|. When the frame is |
| - // destroyed |no_longer_needed_cb.Run()| will be called. |
| - static scoped_refptr<VideoFrame> WrapExternalSharedMemory( |
| + // Wraps packed image data residing in a memory buffer with a VideoFrame. |
| + // The image data resides in |data| and is assumed to be packed tightly in a |
| + // buffer of logical dimensions |coded_size| with the appropriate bit depth |
| + // and plane count as given by |format|. The shared memory handle of the |
| + // backing allocation, if present, can be passed in with |handle|. When the |
| + // frame is destroyed, |no_longer_needed_cb.Run()| will be called. |
| + static scoped_refptr<VideoFrame> WrapExternalPackedMemory( |
| Format format, |
| const gfx::Size& coded_size, |
| const gfx::Rect& visible_rect, |
| @@ -194,6 +195,12 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> { |
| // given coded size and format. |
| static size_t AllocationSize(Format format, const gfx::Size& coded_size); |
| + // Returns the required allocation size for a (tightly packed) plane of the |
| + // given coded size and format. |
| + static size_t PlaneAllocationSize(Format format, |
| + size_t plane, |
|
Ami GONE FROM CHROMIUM
2013/11/19 21:01:52
size_t is a weird type to use for this. Please na
sheu
2013/11/19 21:30:27
Everything else uses size_t for plane index. Shou
ncarter (slow)
2013/11/19 21:36:42
I concur with sheu@; we should leave this as size_
|
| + const gfx::Size& coded_size); |
| + |
| Format format() const { return format_; } |
| const gfx::Size& coded_size() const { return coded_size_; } |