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

Unified Diff: media/base/video_frame.h

Issue 406893002: Fix DCHECKs in V4l2VideoDevice. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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
« no previous file with comments | « content/common/gpu/media/v4l2_video_encode_accelerator.cc ('k') | 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 5939c45211e16b939c69c96be2242968144c8385..9ad9a3d937229756340ac5d0371a9dac832cd81c 100644
--- a/media/base/video_frame.h
+++ b/media/base/video_frame.h
@@ -219,6 +219,10 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
// Returns horizontal bits per pixel for given |plane| and |format|.
static int PlaneHorizontalBitsPerPixel(Format format, size_t plane);
+ // Returns the number of bytes per row for the given plane, format, and width.
+ // The width may be aligned to format requirements.
+ static int RowBytes(size_t plane, Format format, int width);
+
Format format() const { return format_; }
const gfx::Size& coded_size() const { return coded_size_; }
@@ -284,6 +288,11 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
private:
friend class base::RefCountedThreadSafe<VideoFrame>;
+
+ // Returns true if |plane| is a valid plane number for the given format. This
+ // can be used to DCHECK() plane parameters.
+ static bool IsValidPlane(size_t plane, VideoFrame::Format format);
+
// Clients must use the static CreateFrame() method to create a new frame.
VideoFrame(Format format,
const gfx::Size& coded_size,
@@ -296,9 +305,6 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
void AllocateYUV();
- // Used to DCHECK() plane parameters.
- bool IsValidPlane(size_t plane) const;
-
// Frame format.
const Format format_;
« no previous file with comments | « content/common/gpu/media/v4l2_video_encode_accelerator.cc ('k') | media/base/video_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698