mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-06-26 09:50:39 +00:00
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.
This commit is contained in:
parent
60382cd994
commit
a2027b5e9b
|
@ -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");
|
||||
|
||||
|
|
Loading…
Reference in a new issue