revert: 回退 surfaceId 的修改

Signed-off-by: 花祭 <jiazihao1@h-partners.com>
Change-Id: I1b63d8aaf83e526357437741b9178ae945be0347
This commit is contained in:
花祭 2024-10-17 07:21:29 +00:00
parent c1ad444611
commit da742dc7d0

View File

@ -130,13 +130,12 @@ int32_t OH_NativeImage_GetSurfaceId(OH_NativeImage* image, uint64_t* surfaceId)
BLOGE("parameter error");
return SURFACE_ERROR_INVALID_PARAM;
}
*surfaceId = image->consumer->GetUniqueId();
if (image->pSurface == nullptr) {
image->pSurface = Surface::CreateSurfaceAsProducer(image->producer);
}
BLOGE_CHECK_AND_RETURN_RET(image->pSurface != nullptr, SURFACE_ERROR_UNKOWN, "pSurface is null");
*surfaceId = image->consumer->GetUniqueId();
return SURFACE_ERROR_OK;
}