[tizenmemory] Set missed flags when map video memory 55/226455/2 accepted/tizen_5.5_unified accepted/tizen_5.5_unified_wearable_hotfix tizen_5.5 tizen_5.5_wearable_hotfix accepted/tizen/5.5/unified/20200304.123824 accepted/tizen/5.5/unified/wearable/hotfix/20201027.102920 submit/tizen_5.5/20200303.051333 submit/tizen_5.5_wearable_hotfix/20201026.184306
authorJeongmo Yang <jm80.yang@samsung.com>
Tue, 3 Mar 2020 03:12:49 +0000 (12:12 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Tue, 3 Mar 2020 03:56:45 +0000 (12:56 +0900)
- gst_buffer_unref() is missed after gst_buffer_ref() while mapping and unmapping video memory,
  so, the buffer is not released and it caused underrun of bufferpool.

[Version] 1.12.2-9
[Profile] Common
[Issue Type] Bug fix

Change-Id: I7990bb88c5852999522a8b2b7d1b10b9e9b83fc2
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
gst-libs/gst/allocators/gsttizenmemory.c
packaging/gst-plugins-base.spec

index d85fdba..0e18a07 100644 (file)
@@ -431,7 +431,7 @@ gst_tizen_video_memory_map (GstVideoMeta * meta, guint plane, GstMapInfo * info,
   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;
   }
 
@@ -440,17 +440,17 @@ gst_tizen_video_memory_map (GstVideoMeta * meta, guint plane, GstMapInfo * info,
       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);
     }
 
@@ -460,12 +460,15 @@ gst_tizen_video_memory_map (GstVideoMeta * meta, guint plane, GstMapInfo * info,
   *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:
@@ -488,25 +491,25 @@ gst_tizen_video_memory_unmap (GstVideoMeta * meta, guint plane, GstMapInfo * inf
   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) {
index c29bc0e..4320e11 100644 (file)
@@ -5,7 +5,7 @@
 
 Name:           gst-plugins-base
 Version:        1.12.2
-Release:        8
+Release:        9
 License:        LGPL-2.0+
 Summary:        GStreamer Streaming-Media Framework Plug-Ins
 Url:            http://gstreamer.freedesktop.org/