overwrite offsets for shared images

Change-Id: Id21eb40bc9a2e067f42094a989291d6339e753ac
Signed-off-by: Jacek Danecki <jacek.danecki@intel.com>
This commit is contained in:
Jacek Danecki
2018-06-20 18:48:20 +02:00
parent e47344ec0e
commit 861d001cba
2 changed files with 4 additions and 0 deletions

View File

@@ -87,6 +87,8 @@ Image *VASurface::createSharedVaSurface(Context *context, VASharingFunctions *sh
imgDesc.image_width /= 2;
imgDesc.image_height /= 2;
imgInfo.offset = vaImage.offsets[1];
imgInfo.yOffset = 0;
imgInfo.xOffset = 0;
imgInfo.yOffsetForUVPlane = static_cast<uint32_t>(imgInfo.offset / vaImage.pitches[0]);
}
sharingFunctions->destroyImage(vaImage.image_id);

View File

@@ -168,6 +168,8 @@ TEST_F(VaSharingTests, givenMockVaWhenVaSurfaceIsCreatedWithNotAlignedWidthAndHe
vaSurface->getSurfaceOffsets(surfaceOffsets);
EXPECT_EQ(alignedHeight, surfaceOffsets.yOffsetForUVplane);
EXPECT_EQ(alignedOffset, surfaceOffsets.offset);
EXPECT_EQ(0u, surfaceOffsets.yOffset);
EXPECT_EQ(0u, surfaceOffsets.xOffset);
delete vaSurface;
}