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

Unified Diff: content/common/gpu/media/video_encode_accelerator_unittest.cc

Issue 1324213007: vea_unittest: Fix driver doesn't suppport hole in memory mapped file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/video_encode_accelerator_unittest.cc
diff --git a/content/common/gpu/media/video_encode_accelerator_unittest.cc b/content/common/gpu/media/video_encode_accelerator_unittest.cc
index 6c5550187a0b26a228487cb7ea979dc94c6f2e32..2a79d15c333bb1f831b0d478ee0684b99de760c6 100644
--- a/content/common/gpu/media/video_encode_accelerator_unittest.cc
+++ b/content/common/gpu/media/video_encode_accelerator_unittest.cc
@@ -225,6 +225,7 @@ static void CreateAlignedInputStreamFile(const gfx::Size& coded_size,
std::vector<size_t> coded_bpl(num_planes);
std::vector<size_t> visible_bpl(num_planes);
std::vector<size_t> visible_plane_rows(num_planes);
+ std::vector<std::vector<uint8>> padding(num_planes);
// Calculate padding in bytes to be added after each plane required to keep
// starting addresses of all planes at a 64 byte boudnary. This padding will
@@ -248,6 +249,7 @@ static void CreateAlignedInputStreamFile(const gfx::Size& coded_size,
media::VideoFrame::Rows(i, kInputFormat, coded_size.height()) -
visible_plane_rows[i];
padding_sizes[i] = padding_rows * coded_bpl[i] + Align64Bytes(size) - size;
+ padding[i].resize(padding_sizes[i]);
}
base::MemoryMappedFile src_file;
@@ -281,6 +283,10 @@ static void CreateAlignedInputStreamFile(const gfx::Size& coded_size,
src += visible_bpl[i];
dest_offset += coded_bpl[i];
}
+ if (padding_sizes[i]) {
wuchengli 2015/11/19 03:33:40 We can use padding[i].size() and remove |padding_s
kcwu 2015/11/20 10:04:06 Done.
+ CHECK(WriteFile(&dest_file, dest_offset, &padding[i][0],
wuchengli 2015/11/19 03:33:40 s/CHECK/LOG_ASSERT/
kcwu 2015/11/20 10:04:06 Done.
+ padding_sizes[i]));
+ }
dest_offset += padding_sizes[i];
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698