g_mutex_lock (&vmem->lock);
if (vmem->video_memory_map[plane]) {
- GST_ERROR ("plane [%d] is already mapped", plane);
+ GST_ERROR ("[%p] plane [%d] is already mapped", buffer, plane);
goto _VIDEO_MEMORY_MAP_DONE;
}
TBM_SURF_OPTION_WRITE | TBM_SURF_OPTION_READ,
&vmem->surface_info);
if (tbm_ret != TBM_SURFACE_ERROR_NONE) {
- GST_ERROR ("tbm_surface_map for %p failed, 0x%x", vmem->surface, tbm_ret);
+ GST_ERROR ("[%p] tbm_surface_map for %p failed, 0x%x", buffer, vmem->surface, tbm_ret);
goto _VIDEO_MEMORY_MAP_DONE;
}
}
if (plane >= vmem->surface_info.num_planes) {
- GST_ERROR ("invalid plane index %d (num plane %d)",
- plane, vmem->surface_info.num_planes);
+ GST_ERROR ("[%p] invalid plane index %d (num plane %d)",
+ buffer, plane, vmem->surface_info.num_planes);
if (vmem->video_memory_map_count == 0) {
- GST_ERROR ("unmap surface %p", vmem->surface);
+ GST_ERROR ("[%p] unmap surface %p", buffer, vmem->surface);
tbm_surface_unmap (vmem->surface);
}
*data = vmem->surface_info.planes[plane].ptr;
*stride = vmem->surface_info.planes[plane].stride;
- GST_DEBUG ("mapped plane : %d, data : %p, stride : %d",
- plane, *data, *stride);
-
vmem->video_memory_map[plane] = TRUE;
vmem->video_memory_map_count++;
+ /* set map flags */
+ info->flags = flags;
+
+ GST_DEBUG ("[%p] mapped plane %d, data %p, stride %d, flags 0x%x",
+ buffer, plane, *data, *stride, info->flags);
+
mapped = TRUE;
_VIDEO_MEMORY_MAP_DONE:
g_mutex_lock (&vmem->lock);
if (vmem->video_memory_map[plane] == FALSE) {
- GST_ERROR ("plane [%d] is already unmapped", plane);
+ GST_ERROR ("[%p] plane %d is already unmapped", buffer, plane);
goto _VIDEO_MEMORY_UNMAP_DONE;
}
if (vmem->video_memory_map_count - 1 > 0) {
- GST_DEBUG ("[plane %d] skip unmap surface %p", plane, vmem->surface);
+ GST_DEBUG ("[%p] plane %d skip unmap surface %p", buffer, plane, vmem->surface);
unmapped = TRUE;
goto _VIDEO_MEMORY_UNMAP_DONE;
}
tbm_ret = tbm_surface_unmap (vmem->surface);
if (tbm_ret != TBM_SURFACE_ERROR_NONE) {
- GST_ERROR ("tbm_surface_unmap %p failed, 0x%x", vmem->surface, tbm_ret);
+ GST_ERROR ("[%p] tbm_surface_unmap %p failed, 0x%x", buffer, vmem->surface, tbm_ret);
goto _VIDEO_MEMORY_UNMAP_DONE;
}
unmapped = TRUE;
- GST_DEBUG ("[plane %d] unmap surface %p done", plane, vmem->surface);
+ GST_DEBUG ("[%p] plane %d unmap surface %p done", buffer, plane, vmem->surface);
_VIDEO_MEMORY_UNMAP_DONE:
if (unmapped == TRUE) {