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

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/filters/ffmpeg_video_decoder.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,45 @@
};
// 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 bytes_per_row and
+ // bytes_per_row_uv are zero, they are initialized to a default value
+ // suitable for the given format.
static scoped_refptr<VideoFrame> CreateFrame(
Format format,
size_t width,
size_t height,
+ size_t bytes_per_row,
+ size_t bytes_per_uv_row,
Ami GONE FROM CHROMIUM 2012/06/08 19:11:04 These two args don't make sense to me, because the
+ size_t aligned_height,
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, 0, 0, 0,
+ timestamp, duration);
+ }
// Call prior to CreateFrame to ensure validity of frame configuration. Called
- // automatically by VideoDecoderConfig::IsValidConfig().
+ // automatically by VideoDecoderConfig::IsValidConfig(). If bytes_per_row and
+ // bytes_per_uv_row are non-zero, they are also checked to be valid strides
+ // for the given buffer size and format.
static bool IsValidConfig(
Format format,
size_t width,
- size_t height);
+ size_t height,
+ size_t bytes_per_row,
+ size_t bytes_per_uv_row,
+ size_t aligned_height);
+ static bool IsValidConfig(
+ Format format,
+ size_t width,
+ size_t height) {
+ return IsValidConfig(format, width, height, 0, 0, 0);
+ }
// 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 +155,9 @@
virtual ~VideoFrame();
// Used internally by CreateFrame().
- void AllocateRGB(size_t bytes_per_pixel);
- void AllocateYUV();
+ void AllocateRGB(size_t bytes_per_row, size_t aligned_height);
+ void AllocateYUV(size_t bytes_per_y_row, size_t bytes_per_uv_row,
+ size_t aligned_height);
// 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/filters/ffmpeg_video_decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698