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

Unified Diff: media/base/video_frame.h

Issue 22645005: media::VideoFrame::WrapExternalSharedMemory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@git-svn
Patch Set: Created 7 years, 4 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 8207d9be1d2456744ceef8a6265ef9269b9164b7..421265d84077378f71f68949bff7aa564f65abf4 100644
--- a/media/base/video_frame.h
+++ b/media/base/video_frame.h
@@ -137,6 +137,21 @@ 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(
+ Format format,
+ const gfx::Size& coded_size,
+ const gfx::Rect& visible_rect,
+ const gfx::Size& natural_size,
+ uint8* data,
+ base::SharedMemoryHandle handle,
+ base::TimeDelta timestamp,
+ const base::Closure& no_longer_needed_cb);
+
// Wraps external YUV data of the given parameters with a VideoFrame.
// The returned VideoFrame does not own the data passed in. When the frame
// is destroyed |no_longer_needed_cb.Run()| will be called.
@@ -152,7 +167,6 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
uint8* u_data,
uint8* v_data,
base::TimeDelta timestamp,
- base::SharedMemoryHandle shm_handle, // may be NULLHandle()
const base::Closure& no_longer_needed_cb);
// Creates a frame with format equals to VideoFrame::EMPTY, width, height,

Powered by Google App Engine
This is Rietveld 408576698