From: Jeongmo Yang Date: Mon, 29 Aug 2022 08:33:39 +0000 (+0900) Subject: Replace tbm_bo_map/unmap() by tbm_bo_get_handle() X-Git-Tag: accepted/tizen/unified/20220831.133851^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F82%2F280382%2F2;p=platform%2Fcore%2Fapi%2Fcamera.git Replace tbm_bo_map/unmap() by tbm_bo_get_handle() - The data pointer could be unavailable after tbm_bo_unmap(). [Version] 0.4.88 [Issue Type] Bug fix Change-Id: I1118b46853c15b6b08b7f110213c10e9f0958194 Signed-off-by: Jeongmo Yang --- diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index fff5121..51a37de 100644 --- a/packaging/capi-media-camera.spec +++ b/packaging/capi-media-camera.spec @@ -1,6 +1,6 @@ Name: capi-media-camera Summary: A Camera API -Version: 0.4.87 +Version: 0.4.88 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/camera.c b/src/camera.c index 2d9b6a7..f53286b 100644 --- a/src/camera.c +++ b/src/camera.c @@ -664,16 +664,14 @@ static bool __camera_import_tbm_fd(tbm_bufmgr bufmgr, int fd, tbm_bo *bo, tbm_bo return false; } - tmp_bo_handle = tbm_bo_map(tmp_bo, TBM_DEVICE_CPU, TBM_OPTION_READ); + tmp_bo_handle = tbm_bo_get_handle(tmp_bo, TBM_DEVICE_CPU); if (tmp_bo_handle.ptr == NULL) { - CAM_LOG_ERROR("map failed %p", tmp_bo); + CAM_LOG_ERROR("tbm_bo_get_handle() failed %p", tmp_bo); tbm_bo_unref(tmp_bo); tmp_bo = NULL; return false; } - tbm_bo_unmap(tmp_bo); - /* set bo and bo_handle */ *bo = tmp_bo; *bo_handle = tmp_bo_handle;