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

Unified Diff: media/base/video_frame.cc

Issue 9766007: Fix incorrect VideoFrame::row_bytes() for RGB. Add tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Typos. Created 8 years, 9 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.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index fc977364417280706f5dadd95ad58d47b299408e..9d154d04c990a4eced29c065ac7e57a0d56f2adf 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -198,21 +198,29 @@ bool VideoFrame::IsValidPlane(size_t plane) const {
return false;
}
-int VideoFrame::stride(size_t plane) const {
+size_t VideoFrame::stride(size_t plane) const {
DCHECK(IsValidPlane(plane));
return strides_[plane];
}
-int VideoFrame::row_bytes(size_t plane) const {
+size_t VideoFrame::row_bytes(size_t plane) const {
DCHECK(IsValidPlane(plane));
switch (format_) {
+ // 16bpp.
case RGB555:
case RGB565:
+ return width_ * 2;
Ami GONE FROM CHROMIUM 2012/03/21 04:33:44 FTR, nothing uses these, right? (i.e. this a rake-
DaleCurtis 2012/03/22 01:24:43 None that I could find. I like the rake in the gra
Ami GONE FROM CHROMIUM 2012/03/22 10:53:25 Oh, sad panda.
scherkus (not reviewing) 2012/03/22 10:57:54 I believe all usage of these additional formats ar
DaleCurtis 2012/03/22 17:30:36 To be precise, I took my notes from the previous s
+
+ // 24bpp.
case RGB24:
+ return width_ * 3;
+
+ // 32bpp.
case RGB32:
case RGBA:
- return width_;
+ return width_ * 4;
+ // Planar, 8bpp.
case YV12:
case YV16:
if (plane == kYPlane)
@@ -228,7 +236,7 @@ int VideoFrame::row_bytes(size_t plane) const {
return 0;
}
-int VideoFrame::rows(size_t plane) const {
+size_t VideoFrame::rows(size_t plane) const {
DCHECK(IsValidPlane(plane));
switch (format_) {
case RGB555:

Powered by Google App Engine
This is Rietveld 408576698