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

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: Rework test. 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
« no previous file with comments | « no previous file | media/base/video_frame_unittest.cc » ('j') | media/base/video_frame_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index fc977364417280706f5dadd95ad58d47b299408e..b1cedc208b72aac548184a899bee9b360eaac938 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -206,13 +206,21 @@ int VideoFrame::stride(size_t plane) const {
int VideoFrame::row_bytes(size_t plane) const {
DCHECK(IsValidPlane(plane));
switch (format_) {
+ // 16bpp.
case RGB555:
case RGB565:
+ return width_ * 2;
+
+ // 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)
« no previous file with comments | « no previous file | media/base/video_frame_unittest.cc » ('j') | media/base/video_frame_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698