/* get virtual address */
src.ptr = dst.ptr = NULL;
/* bo map, we can use tbm_bo_map too. */
- src = tbm_bo_get_handle (mm_video_buf->handle.bo[i], TBM_DEVICE_CPU);
- dst = tbm_bo_get_handle (bo, TBM_DEVICE_CPU);
+ src =
+ tbm_bo_map (mm_video_buf->handle.bo[i], TBM_DEVICE_CPU,
+ TBM_OPTION_READ);
+ dst = tbm_bo_map (bo, TBM_DEVICE_CPU, TBM_OPTION_READ | TBM_OPTION_WRITE);
if (!src.ptr || !dst.ptr) {
GST_ERROR ("get tbm bo handle failed src(%p) dst(%p): %s", src.ptr,
dst.ptr, strerror (errno));
- tbm_bo_unref (mm_video_buf->handle.bo[i]);
- tbm_bo_unref (bo);
+ if (src.ptr)
+ tbm_bo_unmap (mm_video_buf->handle.bo[i]);
+ if (dst.ptr)
+ tbm_bo_unmap (bo);
return FALSE;
}
/* copy */