Commit a2027b5e authored by Wim Taymans's avatar Wim Taymans

allocator: remove user_data from alloc vmethod

Remove the user_data from the alloc vmethod. Subclasses that implement a new
alloc function can also implement their own vmethod to pass extra arguments. We
can then also require that custom allocators implement an alloc function so that
gst_allocator_alloc() always works.
parent 60382cd9
......@@ -303,7 +303,7 @@ gst_allocator_alloc (GstAllocator * allocator, gsize size,
aclass = GST_ALLOCATOR_GET_CLASS (allocator);
if (aclass->alloc)
mem = aclass->alloc (allocator, size, params, NULL);
mem = aclass->alloc (allocator, size, params);
else
mem = NULL;
......@@ -505,7 +505,7 @@ _default_mem_is_span (GstMemoryDefault * mem1, GstMemoryDefault * mem2,
static GstMemory *
default_alloc (GstAllocator * allocator, gsize size,
GstAllocationParams * params, gpointer user_data)
GstAllocationParams * params)
{
gsize maxsize = size + params->prefix + params->padding;
......
......@@ -125,7 +125,7 @@ struct _GstAllocatorClass {
GstObjectClass object_class;
GstMemory * (*alloc) (GstAllocator *allocator, gsize size,
GstAllocationParams *params, gpointer user_data);
GstAllocationParams *params);
void (*free) (GstAllocator *allocator, GstMemory *memory);
/*< private >*/
......
......@@ -29,8 +29,7 @@ typedef struct
static GstMemory *
_my_alloc (GstAllocator * allocator, gsize size,
GstAllocationParams * params, gpointer user_data)
_my_alloc (GstAllocator * allocator, gsize size, GstAllocationParams * params)
{
MyMemory *mem;
gsize maxsize = size + params->prefix + params->padding;
......
......@@ -34,8 +34,7 @@ typedef struct
static GstMemory *
_my_alloc (GstAllocator * allocator, gsize size,
GstAllocationParams * params, gpointer user_data)
_my_alloc (GstAllocator * allocator, gsize size, GstAllocationParams * params)
{
g_warning ("Use my_vidmem_alloc() to allocate from this allocator");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment