* @context: the #GstGLContext to initialize with
* @params: (allow-none): the @GstAllocationParams to initialize with
* @size: the number of bytes to be allocated
- * @notify: (allow-none): a #GDestroyNotify
* @user_data: (allow-none): user data to call @notify with
+ * @notify: (allow-none): a #GDestroyNotify
*
* Initializes @mem with the required parameters
*/
void
gst_gl_base_memory_init (GstGLBaseMemory * mem, GstAllocator * allocator,
GstMemory * parent, GstGLContext * context, GstAllocationParams * params,
- gsize size, GDestroyNotify notify, gpointer user_data)
+ gsize size, gpointer user_data, GDestroyNotify notify)
{
gsize align = gst_memory_alignment, offset = 0, maxsize = size;
GstMemoryFlags flags = 0;
* @context: (transfer none): a #GstGLContext
* @alloc_size: the number of bytes to allocate.
* @alloc_params: (transfer none) (allow-none): a #GstAllocationParams to apply
- * @notify: (allow-none): a #GDestroyNotify
- * @user_data: (transfer none) (allow-none): user data to call @notify with
* @wrapped_data: (transfer none) (allow-none): a sysmem data pointer to initialize the allocation with
* @gl_handle: (transfer none): a GL handle to initialize the allocation with
+ * @user_data: (transfer none) (allow-none): user data to call @notify with
+ * @notify: (allow-none): a #GDestroyNotify
*
* @notify will be called once for each allocated memory using these @params
* when freeing the memory.
gsize struct_size, guint alloc_flags, GstGLAllocationParamsCopyFunc copy,
GstGLAllocationParamsFreeFunc free, GstGLContext * context,
gsize alloc_size, GstAllocationParams * alloc_params,
- GDestroyNotify notify, gpointer user_data, gpointer wrapped_data,
- guint gl_handle)
+ gpointer wrapped_data, guint gl_handle, gpointer user_data,
+ GDestroyNotify notify)
{
memset (params, 0, sizeof (*params));
GstGLAllocationParams * dest)
{
gst_gl_allocation_params_init (dest, src->struct_size, src->alloc_flags,
- src->copy, src->free, NULL, src->alloc_size, NULL, src->notify,
- src->user_data, src->wrapped_data, src->gl_handle);
+ src->copy, src->free, NULL, src->alloc_size, NULL, src->wrapped_data,
+ src->gl_handle, src->user_data, src->notify);
if (src->context)
dest->context = gst_object_ref (src->context);
GstGLContext * context,
gsize alloc_size,
GstAllocationParams * alloc_params,
- GDestroyNotify notify,
- gpointer user_data,
gpointer wrapped_data,
- guint gl_handle);
+ guint gl_handle,
+ gpointer user_data,
+ GDestroyNotify notify);
/* free with gst_gl_allocation_params_free */
GstGLAllocationParams * gst_gl_allocation_params_copy (GstGLAllocationParams * src);
GstGLContext * context,
GstAllocationParams * params,
gsize maxsize,
- GDestroyNotify notify,
- gpointer user_data);
+ gpointer user_data,
+ GDestroyNotify notify);
gboolean gst_gl_base_memory_alloc_data (GstGLBaseMemory * gl_mem);
gboolean gst_gl_base_memory_memcpy (GstGLBaseMemory * src,
_gst_gl_buffer_allocation_params_copy_data,
(GstGLAllocationParamsFreeFunc)
_gst_gl_buffer_allocation_params_free_data, context, alloc_size,
- alloc_params, NULL, NULL, NULL, 0)) {
+ alloc_params, NULL, 0, NULL, NULL)) {
g_free (params);
return NULL;
}
gst_gl_memory_init (GstGLMemory * mem, GstAllocator * allocator,
GstMemory * parent, GstGLContext * context, GstGLTextureTarget target,
GstAllocationParams * params, GstVideoInfo * info, guint plane,
- GstVideoAlignment * valign, GDestroyNotify notify, gpointer user_data)
+ GstVideoAlignment * valign, gpointer user_data, GDestroyNotify notify)
{
const gchar *target_str;
gsize size;
_calculate_unpack_length (mem, context);
gst_gl_base_memory_init ((GstGLBaseMemory *) mem, allocator, parent, context,
- params, size, notify, user_data);
+ params, size, user_data, notify);
target_str = gst_gl_texture_target_to_string (target);
GST_CAT_DEBUG (GST_CAT_GL_MEMORY, "new GL texture context:%"
gst_gl_memory_init (mem, GST_ALLOCATOR_CAST (allocator), NULL,
params->parent.context, params->target, params->parent.alloc_params,
- params->v_info, params->plane, params->valign, params->parent.notify,
- params->parent.user_data);
+ params->v_info, params->plane, params->valign, params->parent.user_data,
+ params->parent.notify);
if (params->parent.
alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE) {
GstGLAllocationParamsFreeFunc free, GstGLContext * context,
GstAllocationParams * alloc_params, GstVideoInfo * v_info,
guint plane, GstVideoAlignment * valign, GstGLTextureTarget target,
- gpointer wrapped_data, guint gl_handle, GDestroyNotify notify,
- gpointer user_data)
+ gpointer wrapped_data, guint gl_handle, gpointer user_data,
+ GDestroyNotify notify)
{
guint i;
if (!gst_gl_allocation_params_init ((GstGLAllocationParams *) params,
struct_size, alloc_flags, copy, free, context, 0, alloc_params,
- notify, user_data, wrapped_data, gl_handle))
+ wrapped_data, gl_handle, user_data, notify))
return FALSE;
params->v_info = g_new0 (GstVideoInfo, 1);
* @valign: (allow-none): any #GstVideoAlignment applied to symem mappings of @wrapped_data
* @target: the #GstGLTextureTarget for @wrapped_data
* @wrapped_data: the data pointer to wrap
- * @notify: (allow-none): a #GDestroyNotify
* @user_data: (allow-none): user data to call @notify with
+ * @notify: (allow-none): a #GDestroyNotify
*
* Returns: a new #GstGLVideoAllocationParams for wrapping @wrapped_data
*/
gst_gl_video_allocation_params_new_wrapped_data (GstGLContext * context,
GstAllocationParams * alloc_params, GstVideoInfo * v_info, guint plane,
GstVideoAlignment * valign, GstGLTextureTarget target,
- gpointer wrapped_data, GDestroyNotify notify, gpointer user_data)
+ gpointer wrapped_data, gpointer user_data, GDestroyNotify notify)
{
GstGLVideoAllocationParams *params = g_new0 (GstGLVideoAllocationParams, 1);
gst_gl_video_allocation_params_copy_data,
(GstGLAllocationParamsFreeFunc)
gst_gl_video_allocation_params_free_data, context, alloc_params,
- v_info, plane, valign, target, wrapped_data, 0, notify, user_data)) {
+ v_info, plane, valign, target, wrapped_data, 0, user_data, notify)) {
g_free (params);
return NULL;
}
* @valign: (allow-none): any #GstVideoAlignment applied to symem mappings of @tex_id
* @target: the #GstGLTextureTarget for @tex_id
* @tex_id: the GL texture to wrap
- * @notify: (allow-none): a #GDestroyNotify
* @user_data: (allow-none): user data to call @notify with
+ * @notify: (allow-none): a #GDestroyNotify
*
* Returns: a new #GstGLVideoAllocationParams for wrapping @tex_id
*/
gst_gl_video_allocation_params_new_wrapped_texture (GstGLContext * context,
GstAllocationParams * alloc_params, GstVideoInfo * v_info, guint plane,
GstVideoAlignment * valign, GstGLTextureTarget target,
- guint tex_id, GDestroyNotify notify, gpointer user_data)
+ guint tex_id, gpointer user_data, GDestroyNotify notify)
{
GstGLVideoAllocationParams *params = g_new0 (GstGLVideoAllocationParams, 1);
gst_gl_video_allocation_params_copy_data,
(GstGLAllocationParamsFreeFunc)
gst_gl_video_allocation_params_free_data, context, alloc_params,
- v_info, plane, valign, target, NULL, tex_id, notify, user_data)) {
+ v_info, plane, valign, target, NULL, tex_id, user_data, notify)) {
g_free (params);
return NULL;
}
GstGLTextureTarget target,
gpointer wrapped_data,
guint gl_handle,
- GDestroyNotify notify,
- gpointer user_data);
+ gpointer user_data,
+ GDestroyNotify notify);
GstGLVideoAllocationParams * gst_gl_video_allocation_params_new (GstGLContext * context,
GstAllocationParams * alloc_params,
GstVideoInfo * v_info,
GstVideoAlignment * valign,
GstGLTextureTarget target,
gpointer wrapped_data,
- GDestroyNotify notify,
- gpointer user_data);
+ gpointer user_data,
+ GDestroyNotify notify);
GstGLVideoAllocationParams * gst_gl_video_allocation_params_new_wrapped_texture (GstGLContext * context,
GstAllocationParams * alloc_params,
GstVideoAlignment * valign,
GstGLTextureTarget target,
guint tex_id,
- GDestroyNotify notify,
- gpointer user_data);
+ gpointer user_data,
+ GDestroyNotify notify);
/* subclass usage */
void gst_gl_video_allocation_params_free_data (GstGLVideoAllocationParams * params);
GstVideoInfo * info,
guint plane,
GstVideoAlignment *valign,
- GDestroyNotify notify,
- gpointer user_data);
+ gpointer user_data,
+ GDestroyNotify notify);
gboolean gst_gl_memory_copy_into (GstGLMemory *gl_mem,
guint tex_id,
_gl_mem_init (GstGLMemoryPBO * mem, GstAllocator * allocator,
GstMemory * parent, GstGLContext * context, GstGLTextureTarget target,
GstAllocationParams * params, GstVideoInfo * info,
- guint plane, GstVideoAlignment * valign, GDestroyNotify notify,
- gpointer user_data)
+ guint plane, GstVideoAlignment * valign, gpointer user_data,
+ GDestroyNotify notify)
{
gst_gl_memory_init ((GstGLMemory *) mem, allocator, parent,
- context, target, params, info, plane, valign, notify, user_data);
+ context, target, params, info, plane, valign, user_data, notify);
}
static GstGLMemoryPBO *
_gl_mem_new (GstAllocator * allocator, GstMemory * parent,
GstGLContext * context, GstGLTextureTarget target,
GstAllocationParams * params, GstVideoInfo * info,
- guint plane, GstVideoAlignment * valign, GDestroyNotify notify,
- gpointer user_data)
+ guint plane, GstVideoAlignment * valign, gpointer user_data,
+ GDestroyNotify notify)
{
GstGLMemoryPBO *mem;
mem = g_slice_new0 (GstGLMemoryPBO);
mem->mem.texture_wrapped = FALSE;
_gl_mem_init (mem, allocator, parent, context, target, params, info, plane,
- valign, notify, user_data);
+ valign, user_data, notify);
return mem;
}
_gl_mem_init (mem, GST_ALLOCATOR_CAST (allocator), NULL,
params->parent.context, params->target, params->parent.alloc_params,
- params->v_info, params->plane, params->valign, params->parent.notify,
- params->parent.user_data);
+ params->v_info, params->plane, params->valign, params->parent.user_data,
+ params->parent.notify);
if (params->
parent.alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE)
params = gst_gl_video_allocation_params_new_wrapped_data (overlay->context,
NULL, &comp_frame->info, 0, NULL, GST_GL_TEXTURE_TARGET_2D,
- comp_frame->data[0], _video_frame_unmap_and_free, comp_frame);
+ comp_frame->data[0], comp_frame, _video_frame_unmap_and_free);
comp_gl_memory =
(GstGLMemory *) gst_gl_base_memory_alloc (mem_allocator,
if (!(raw->params =
gst_gl_video_allocation_params_new_wrapped_data (raw->upload->context,
NULL, &raw->upload->priv->in_info, -1, NULL,
- GST_GL_TEXTURE_TARGET_2D, NULL,
- (GDestroyNotify) _raw_upload_frame_unref, raw->in_frame)))
+ GST_GL_TEXTURE_TARGET_2D, NULL, raw->in_frame,
+ (GDestroyNotify) _raw_upload_frame_unref)))
return FALSE;
return (raw->in_frame != NULL);
ref_count++;
params = gst_gl_video_allocation_params_new_wrapped_data (context, NULL,
&in_info, j, NULL, GST_GL_TEXTURE_TARGET_2D, frames[i].data[j],
- _frame_unref, &ref_count);
+ &ref_count, _frame_unref);
mem = gst_gl_base_memory_alloc (base_mem_alloc,
(GstGLAllocationParams *) params);