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

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: revised Created 5 years, 1 month 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 0f80d07ea2d77a9619601ffad9ed5699807cf3c3..0b4e5991b9faa9431b2c120ac596960665ec1c85 100644
--- a/content/common/gpu/media/video_encode_accelerator_unittest.cc
+++ b/content/common/gpu/media/video_encode_accelerator_unittest.cc
@@ -239,7 +239,7 @@ static void CreateAlignedInputStreamFile(const gfx::Size& coded_size,
test_stream->coded_size = coded_size;
size_t num_planes = media::VideoFrame::NumPlanes(kInputFormat);
- std::vector<size_t> padding_sizes(num_planes);
+ std::vector<std::vector<uint8>> padding(num_planes);
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);
@@ -265,7 +265,7 @@ static void CreateAlignedInputStreamFile(const gfx::Size& coded_size,
const size_t padding_rows =
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_rows * coded_bpl[i] + Align64Bytes(size) - size);
}
base::MemoryMappedFile src_file;
@@ -299,7 +299,11 @@ static void CreateAlignedInputStreamFile(const gfx::Size& coded_size,
src += visible_bpl[i];
dest_offset += coded_bpl[i];
}
- dest_offset += padding_sizes[i];
+ if (!padding[i].empty()) {
+ LOG_ASSERT(WriteFile(&dest_file, dest_offset, &padding[i][0],
+ padding[i].size()));
+ }
+ dest_offset += padding[i].size();
wuchengli 2015/11/23 09:14:26 nit: this can be moved inside if (!padding[i].empt
kcwu 2015/11/23 11:29:57 Done.
}
}
LOG_ASSERT(test_stream->mapped_aligned_in_file.Initialize(dest_file.Pass()));
« 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