cudamemory: Fix outstanding memory count tracing
authorSeungha Yang <seungha@centricular.com>
Wed, 28 Feb 2024 17:06:43 +0000 (02:06 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 29 Feb 2024 11:57:50 +0000 (11:57 +0000)
Gets being released memory back to queue even if allocator is flushing
in order to count the number of outstanding memory objects.
And fixing double count increment

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6240>

subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudamemory.cpp

index 7bce1bdc49016b94e66d3bd323c57de32514f060..7096b7935f69549cfc95cd80e2132e06bcfd206e 100644 (file)
@@ -1675,11 +1675,6 @@ gst_cuda_memory_release (GstMiniObject * object)
   }
 
   alloc = GST_CUDA_POOL_ALLOCATOR (mem->allocator);
-  /* if flushing, free this memory */
-  if (GST_CUDA_POOL_ALLOCATOR_IS_FLUSHING (alloc)) {
-    GST_LOG_OBJECT (alloc, "allocator is flushing, free %p", mem);
-    return TRUE;
-  }
 
   /* return the memory to the allocator */
   gst_memory_ref (mem);
@@ -1908,7 +1903,6 @@ gst_cuda_pool_allocator_acquire_memory (GstCudaPoolAllocator * allocator,
     gst_object_unref (mem->allocator);
     mem->allocator = (GstAllocator *) gst_object_ref (allocator);
     GST_MINI_OBJECT_CAST (mem)->dispose = gst_cuda_memory_release;
-    allocator->priv->outstanding++;
   } else {
     dec_outstanding (allocator);
   }