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

Unified Diff: media/base/video_util.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
« media/base/video_frame_unittest.cc ('K') | « media/base/video_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_util.cc
diff --git a/media/base/video_util.cc b/media/base/video_util.cc
index 4476e6d0693e3934ec99f75392fcf610eba15ea1..15416b9b0924701c2a2dd209ed99d7c37283f8e0 100644
--- a/media/base/video_util.cc
+++ b/media/base/video_util.cc
@@ -9,34 +9,37 @@
namespace media {
-static void CopyPlane(size_t plane, const uint8* source, int stride, int rows,
- VideoFrame* frame) {
+static void CopyPlane(size_t plane, const uint8* source, size_t stride,
+ size_t rows, VideoFrame* frame) {
Ami GONE FROM CHROMIUM 2012/03/21 04:33:44 Are you worried about an image w/ over 2 billion i
DaleCurtis 2012/03/22 01:24:43 I just flipped these to make them consistent with
uint8* dest = frame->data(plane);
- int dest_stride = frame->stride(plane);
+ size_t dest_stride = frame->stride(plane);
// Clamp in case source frame has smaller stride.
- int bytes_to_copy_per_row = std::min(frame->row_bytes(plane), stride);
+ size_t bytes_to_copy_per_row = std::min(frame->row_bytes(plane), stride);
// Clamp in case source frame has smaller height.
- int rows_to_copy = std::min(frame->rows(plane), rows);
+ size_t rows_to_copy = std::min(frame->rows(plane), rows);
// Copy!
- for (int row = 0; row < rows_to_copy; ++row) {
+ for (size_t row = 0; row < rows_to_copy; ++row) {
memcpy(dest, source, bytes_to_copy_per_row);
source += stride;
dest += dest_stride;
}
}
-void CopyYPlane(const uint8* source, int stride, int rows, VideoFrame* frame) {
+void CopyYPlane(const uint8* source, size_t stride, size_t rows,
+ VideoFrame* frame) {
CopyPlane(VideoFrame::kYPlane, source, stride, rows, frame);
}
-void CopyUPlane(const uint8* source, int stride, int rows, VideoFrame* frame) {
+void CopyUPlane(const uint8* source, size_t stride, size_t rows,
+ VideoFrame* frame) {
CopyPlane(VideoFrame::kUPlane, source, stride, rows, frame);
}
-void CopyVPlane(const uint8* source, int stride, int rows, VideoFrame* frame) {
+void CopyVPlane(const uint8* source, size_t stride, size_t rows,
+ VideoFrame* frame) {
CopyPlane(VideoFrame::kVPlane, source, stride, rows, frame);
}
« media/base/video_frame_unittest.cc ('K') | « media/base/video_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698