pool_alloc = GST_D3D11_POOL_ALLOCATOR (alloc);
flow_ret = gst_d3d11_pool_allocator_acquire_memory (pool_alloc, &mem);
+ gst_d3d11_allocator_set_active (alloc, FALSE);
if (flow_ret != GST_FLOW_OK) {
GST_ERROR_OBJECT (self, "Failed to allocate initial memory");
- gst_d3d11_allocator_set_active (alloc, FALSE);
gst_object_unref (alloc);
return FALSE;
}
&stride) || stride < desc[i].Width) {
GST_ERROR_OBJECT (self, "Failed to calculate stride");
- gst_d3d11_allocator_set_active (alloc, FALSE);
gst_object_unref (alloc);
gst_memory_unref (mem);
/* keep it around in our queue */
priv->queue.push (mem);
priv->outstanding--;
+ if (priv->outstanding == 0 && priv->flushing)
+ gst_d3d11_pool_allocator_stop (self);
WakeAllConditionVariable (&priv->cond);
ReleaseSRWLockExclusive (&priv->lock);
priv = alloc->priv;
AcquireSRWLockExclusive (&priv->lock);
- /* if flushing, free this memory */
- if (alloc->priv->flushing) {
- ReleaseSRWLockExclusive (&priv->lock);
- GST_LOG_OBJECT (alloc, "allocator is flushing, free %p", mem);
- return TRUE;
- }
-
/* return the memory to the allocator */
gst_memory_ref (mem);
gst_d3d11_pool_allocator_release_memory (alloc, mem);
/* keep it around in our queue */
priv->queue.push (mem);
priv->outstanding--;
+ if (priv->outstanding == 0 && priv->flushing)
+ gst_d3d12_pool_allocator_stop (self);
priv->cond.notify_all ();
priv->lock.unlock ();
priv = alloc->priv;
priv->lock.lock ();
- /* if flushing, free this memory */
- if (alloc->priv->flushing) {
- priv->lock.unlock ();
- GST_LOG_OBJECT (alloc, "allocator is flushing, free %p", mem);
- return TRUE;
- }
-
/* return the memory to the allocator */
gst_memory_ref (mem);
gst_d3d12_pool_allocator_release_memory (alloc, mem);