Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Unified Diff: media/base/video_frame.h

Issue 48113011: Remove media::VideoFrame from media::VideoCaptureDevice::Client interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@git-svn
Patch Set: 4969ee91 Initial. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/video_frame.h
diff --git a/media/base/video_frame.h b/media/base/video_frame.h
index df383d0d79849a9b746645cdf07febedeceaf461..b0b18ad29d7b2b64ffc3cd2722baf634ee0be6e5 100644
--- a/media/base/video_frame.h
+++ b/media/base/video_frame.h
@@ -137,12 +137,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,
@@ -197,6 +198,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,
+ const gfx::Size& coded_size);
+
Format format() const { return format_; }
const gfx::Size& coded_size() const { return coded_size_; }

Powered by Google App Engine
This is Rietveld 408576698