waylandsink : support cache flush of tbm 85/105985/1
authorHyunil <hyunil46.park@samsung.com>
Tue, 20 Dec 2016 06:40:55 +0000 (15:40 +0900)
committerHyunil Park <hyunil46.park@samsung.com>
Tue, 20 Dec 2016 07:01:45 +0000 (23:01 -0800)
Change-Id: I835614e82870cc1a2197bb67f98d6374990f9e1b
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
ext/wayland/gstwaylandsink.c

index 2a82cc4..060400c 100755 (executable)
@@ -629,13 +629,17 @@ gst_wayland_sink_make_flush_buffer (GstWlDisplay * display,
       /* 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 */