Commit 043b5dfe authored by Marijn Suijten's avatar Marijn Suijten 🦀

gstallocator: Make alloc function take GstAllocationParams by const

The param argument passed to this function does not need to be modified.
Add const to enforce this at compile-time and emit a proper signature in
G-IR.
parent 8076ef11
Pipeline #255869 waiting for manual action with stages
in 56 seconds
......@@ -290,7 +290,7 @@ gst_allocator_set_default (GstAllocator * allocator)
*/
GstMemory *
gst_allocator_alloc (GstAllocator * allocator, gsize size,
GstAllocationParams * params)
const GstAllocationParams * params)
{
GstMemory *mem;
static GstAllocationParams defparams = { 0, 0, 0, 0, };
......@@ -505,7 +505,7 @@ _sysmem_is_span (GstMemorySystem * mem1, GstMemorySystem * mem2, gsize * offset)
static GstMemory *
default_alloc (GstAllocator * allocator, gsize size,
GstAllocationParams * params)
const GstAllocationParams * params)
{
gsize maxsize = size + params->prefix + params->padding;
......
......@@ -144,7 +144,7 @@ struct _GstAllocatorClass {
/*< public >*/
GstMemory * (*alloc) (GstAllocator *allocator, gsize size,
GstAllocationParams *params);
const GstAllocationParams *params);
void (*free) (GstAllocator *allocator, GstMemory *memory);
/*< private >*/
......@@ -181,7 +181,7 @@ void gst_allocation_params_free (GstAllocationParams *params);
GST_API
GstMemory * gst_allocator_alloc (GstAllocator * allocator, gsize size,
GstAllocationParams *params);
const GstAllocationParams *params);
GST_API
void gst_allocator_free (GstAllocator * allocator, GstMemory *memory);
......
......@@ -878,7 +878,7 @@ gst_buffer_new (void)
*/
GstBuffer *
gst_buffer_new_allocate (GstAllocator * allocator, gsize size,
GstAllocationParams * params)
const GstAllocationParams * params)
{
GstBuffer *newbuf;
GstMemory *mem;
......
......@@ -291,7 +291,7 @@ GstBuffer * gst_buffer_new (void);
GST_API
GstBuffer * gst_buffer_new_allocate (GstAllocator * allocator, gsize size,
GstAllocationParams * params);
const GstAllocationParams * params);
GST_API
GstBuffer * gst_buffer_new_wrapped_full (GstMemoryFlags flags, gpointer data, gsize maxsize,
gsize offset, gsize size, gpointer user_data,
......
......@@ -586,7 +586,7 @@ typedef struct
static GstMemory *
_my_opaque_alloc (GstAllocator * allocator, gsize size,
GstAllocationParams * params)
const GstAllocationParams * params)
{
MyOpaqueMemory *mem = g_slice_new (MyOpaqueMemory);
gsize maxsize = size + params->prefix + params->padding;
......
......@@ -29,7 +29,8 @@ typedef struct
static GstMemory *
_my_alloc (GstAllocator * allocator, gsize size, GstAllocationParams * params)
_my_alloc (GstAllocator * allocator, gsize size,
const GstAllocationParams * params)
{
MyMemory *mem;
gsize maxsize = size + params->prefix + params->padding;
......
......@@ -34,7 +34,8 @@ typedef struct
static GstMemory *
_my_alloc (GstAllocator * allocator, gsize size, GstAllocationParams * params)
_my_alloc (GstAllocator * allocator, gsize size,
const 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