From 68c4e95642e4ef8a2c07321e195f7bc560a54409 Mon Sep 17 00:00:00 2001 From: lambdadroid Date: Thu, 24 Jan 2019 20:10:27 +0100 Subject: [PATCH] Fix assignment of "num_planes" in vaapi allocator Usually there are 2 planes for NV12 buffers during decoding, but during encoding the RGBA source buffer has only a single plane. Assign info.numOfPlanes instead to set the correct plane count. Change-Id: I491268b39c0376645f643a27803a983e6511a043 --- omx_utils/src/mfx_omx_vaapi_allocator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omx_utils/src/mfx_omx_vaapi_allocator.cpp b/omx_utils/src/mfx_omx_vaapi_allocator.cpp index 160474a..cdf0ee3 100644 --- a/omx_utils/src/mfx_omx_vaapi_allocator.cpp +++ b/omx_utils/src/mfx_omx_vaapi_allocator.cpp @@ -517,7 +517,7 @@ mfxStatus MfxOmxVaapiFrameAllocator::CreateSurfaceFromGralloc(const mfxU8* handl surfExtBuf.width = width; surfExtBuf.height = height; surfExtBuf.pitches[0] = info.pitch; - surfExtBuf.num_planes = 2; + surfExtBuf.num_planes = info.numOfPlanes; surfExtBuf.num_buffers = 1; #ifdef MFX_OMX_USE_PRIME surfExtBuf.buffers = (uintptr_t *)&(info.prime);