Commit ae74a75a authored by Emircan Uysaler's avatar Emircan Uysaler Committed by Commit Bot

Fix stride in single planar frames created by CreateFrame()

This CL is a followup to https://chromium-review.googlesource.com/743022.
It adds the missing stride information for single planar frames.

Bug: 555909
Change-Id: Ied15fa15b898dbd17f3dae45788b68a0a286ef24
Reviewed-on: https://chromium-review.googlesource.com/766867Reviewed-by: default avatarEmircan Uysaler <emircan@chromium.org>
Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Commit-Queue: Emircan Uysaler <emircan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516074}
parent a5d05be3
......@@ -1208,6 +1208,7 @@ void VideoFrame::AllocateMemory(bool zero_initialize_memory) {
if (NumPlanes(format_) == 1) {
data_size = AllocationSize(format_, coded_size_);
offset[0] = 0;
strides_[0] = row_bytes(0);
} else {
for (size_t plane = 0; plane < NumPlanes(format_); ++plane) {
// The *2 in alignment for height is because some formats (e.g. h264)
......
......@@ -158,6 +158,7 @@ TEST(VideoFrame, CreateFrame) {
frame = VideoFrame::CreateFrame(media::PIXEL_FORMAT_ARGB, size,
gfx::Rect(size), size, kTimestamp);
EXPECT_EQ(media::PIXEL_FORMAT_ARGB, frame->format());
EXPECT_GE(frame->stride(VideoFrame::kARGBPlane), frame->coded_size().width());
// Test double planar frame.
frame = VideoFrame::CreateFrame(media::PIXEL_FORMAT_NV12, size,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment