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

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: add one DCHECK back 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
Index: media/base/video_frame.h
diff --git a/media/base/video_frame.h b/media/base/video_frame.h
index 5939c45211e16b939c69c96be2242968144c8385..e0df41b54d05e2253f0c99fb860d011b827fe7a3 100644
--- a/media/base/video_frame.h
+++ b/media/base/video_frame.h
@@ -219,6 +219,11 @@ 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.
+ // This refers to the bytes representing frame data scanlines without stride
+ // padding.
+ 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 +289,10 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
private:
friend class base::RefCountedThreadSafe<VideoFrame>;
+
+ // Used to DCHECK() plane parameters.
+ static bool IsValidPlane(size_t plane, VideoFrame::Format format);
kcwu 2014/08/15 10:19:17 It is not always used to DCHECK(), for instance, H
wuchengli 2014/08/18 07:08:13 Updated the comments.
+
// 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_;

Powered by Google App Engine
This is Rietveld 408576698