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

Unified Diff: media/base/video_frame.h

Issue 10451051: Provide a Chrome-owned buffer to FFmpeg for video decoding, instead of (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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') | media/base/video_frame.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame.h
===================================================================
--- media/base/video_frame.h (revision 140753)
+++ media/base/video_frame.h (working copy)
@@ -38,20 +38,39 @@
};
// Creates a new frame in system memory with given parameters. Buffers for
- // the frame are allocated but not initialized.
+ // the frame are allocated but not initialized. If given, alignment is a
+ // power of 2 number (in bytes) by which the horizontal and vertical buffer
+ // dimensions should be aligned during allocation.
static scoped_refptr<VideoFrame> CreateFrame(
Format format,
size_t width,
size_t height,
+ size_t alignment,
base::TimeDelta timestamp,
base::TimeDelta duration);
+ static scoped_refptr<VideoFrame> CreateFrame(
+ Format format,
+ size_t width,
+ size_t height,
+ base::TimeDelta timestamp,
+ base::TimeDelta duration) {
+ return CreateFrame(format, width, height, 1,
+ timestamp, duration);
+ }
// Call prior to CreateFrame to ensure validity of frame configuration. Called
// automatically by VideoDecoderConfig::IsValidConfig().
static bool IsValidConfig(
scherkus (not reviewing) 2012/06/14 02:21:33 I actually don't see any public users of this func
rbultje1 2012/06/14 18:32:20 See video_decoder_config.cc
Format format,
size_t width,
- size_t height);
+ size_t height,
+ size_t alignment);
+ static bool IsValidConfig(
+ Format format,
+ size_t width,
+ size_t height) {
+ return IsValidConfig(format, width, height, 1);
+ }
// Wraps a native texture of the given parameters with a VideoFrame. When the
// frame is destroyed |no_longer_needed.Run()| will be called.
@@ -130,8 +149,8 @@
virtual ~VideoFrame();
// Used internally by CreateFrame().
- void AllocateRGB(size_t bytes_per_pixel);
- void AllocateYUV();
+ void AllocateRGB(size_t bytes_per_pixel, size_t alignment);
+ void AllocateYUV(size_t alignment);
// Used to DCHECK() plane parameters.
bool IsValidPlane(size_t plane) const;
« no previous file with comments | « no previous file | media/base/video_frame.cc » ('j') | media/base/video_frame.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698