GstD3D11Memory *dmem;
ID3D11RenderTargetView *rtv = nullptr;
GstD3D11ClearRTVFunc clear_func = nullptr;
+ gboolean is_new_texture = TRUE;
device_handle = gst_d3d11_device_get_device_handle (device);
GST_ERROR_OBJECT (self, "Couldn't create texture");
return nullptr;
}
+ } else {
+ is_new_texture = FALSE;
}
mem =
if (!mem)
return nullptr;
+ /* Don't clear external texture */
+ if (!is_new_texture)
+ return mem;
+
/* Clear with YUV black if needed and possible
* TODO: do this using UAV if RTV is not allowed (e.g., packed YUV formats) */
if ((desc->BindFlags & D3D11_BIND_RENDER_TARGET) == 0)
gsize mem_size;
};
-static void gst_d3d11_pool_allocator_dispose (GObject * object);
static void gst_d3d11_pool_allocator_finalize (GObject * object);
static gboolean
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstD3D11AllocatorClass *d3d11alloc_class = GST_D3D11_ALLOCATOR_CLASS (klass);
- gobject_class->dispose = gst_d3d11_pool_allocator_dispose;
gobject_class->finalize = gst_d3d11_pool_allocator_finalize;
d3d11alloc_class->set_active = gst_d3d11_pool_allocator_set_active;
}
static void
-gst_d3d11_pool_allocator_dispose (GObject * object)
-{
- GstD3D11PoolAllocator *self = GST_D3D11_POOL_ALLOCATOR (object);
-
- gst_clear_object (&self->device);
-
- G_OBJECT_CLASS (pool_alloc_parent_class)->dispose (object);
-}
-
-static void
gst_d3d11_pool_allocator_finalize (GObject * object)
{
GstD3D11PoolAllocator *self = GST_D3D11_POOL_ALLOCATOR (object);
GST_D3D11_CLEAR_COM (priv->texture);
+ gst_clear_object (&self->device);
+
G_OBJECT_CLASS (pool_alloc_parent_class)->finalize (object);
}
GST_MINI_OBJECT_CAST (mem)->dispose = NULL;
mem->allocator = (GstAllocator *) gst_object_ref (_d3d11_memory_allocator);
- gst_object_unref (self);
/* keep it around in our queue */
gst_atomic_queue_push (self->priv->queue, mem);
gst_poll_write_control (self->priv->poll);
dec_outstanding (self);
+
+ gst_object_unref (self);
}
static gboolean