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

Unified Diff: media/base/video_frame.h

Issue 1313413010: Add VideoFrame::CreateZeroInitializedFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | media/base/video_frame.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame.h
diff --git a/media/base/video_frame.h b/media/base/video_frame.h
index 80169cbe822990ca487fa5993d12bc2c5a7aa0d0..bc5c832c1f2234f94815dd217f7275fc20686057 100644
--- a/media/base/video_frame.h
+++ b/media/base/video_frame.h
@@ -113,6 +113,15 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
const gfx::Size& natural_size,
base::TimeDelta timestamp);
+ // Offers the same functionality as CreateFrame, and additionally zeroes out
+ // the initial allocated buffers.
+ static scoped_refptr<VideoFrame> CreateZeroInitializedFrame(
+ VideoPixelFormat format,
+ const gfx::Size& coded_size,
+ const gfx::Rect& visible_rect,
+ const gfx::Size& natural_size,
+ base::TimeDelta timestamp);
+
// Wraps a native texture of the given parameters with a VideoFrame.
// The backing of the VideoFrame is held in the mailbox held by
// |mailbox_holder|, and |mailbox_holder_release_cb| will be called with
@@ -415,7 +424,15 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
base::TimeDelta timestamp);
virtual ~VideoFrame();
- void AllocateYUV();
+ static scoped_refptr<VideoFrame> CreateFrameInternal(
+ VideoPixelFormat format,
+ const gfx::Size& coded_size,
+ const gfx::Rect& visible_rect,
+ const gfx::Size& natural_size,
+ base::TimeDelta timestamp,
+ bool zero_initialize_memory);
+
+ void AllocateYUV(bool zero_initialize_memory);
// Frame format.
const VideoPixelFormat format_;
« no previous file with comments | « no previous file | media/base/video_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698