2015-12-14 01:59:02 +00:00
|
|
|
/*
|
|
|
|
* GStreamer
|
|
|
|
* Copyright (C) 2015 Matthew Waters <matthew@centricular.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GST_GL_BASE_MEMORY_H_
|
|
|
|
#define _GST_GL_BASE_MEMORY_H_
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
#include <gst/gstallocator.h>
|
|
|
|
#include <gst/gstmemory.h>
|
|
|
|
|
|
|
|
#include <gst/gl/gstgl_fwd.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2022-02-21 12:23:27 +00:00
|
|
|
/**
|
|
|
|
* GST_TYPE_GL_BASE_MEMORY:
|
|
|
|
*
|
|
|
|
* Deprecated: 1.22: This type has no use.
|
|
|
|
*/
|
2017-01-10 08:58:48 +00:00
|
|
|
#define GST_TYPE_GL_BASE_MEMORY (gst_gl_base_memory_get_type())
|
2022-02-21 12:23:27 +00:00
|
|
|
GST_GL_DEPRECATED
|
2017-01-10 08:58:48 +00:00
|
|
|
GType gst_gl_base_memory_get_type(void);
|
|
|
|
|
2015-12-14 01:59:02 +00:00
|
|
|
#define GST_TYPE_GL_BASE_MEMORY_ALLOCATOR (gst_gl_base_memory_allocator_get_type())
|
2018-03-13 10:57:15 +00:00
|
|
|
GST_GL_API
|
2015-12-14 01:59:02 +00:00
|
|
|
GType gst_gl_base_memory_allocator_get_type(void);
|
|
|
|
|
2016-07-11 11:29:10 +00:00
|
|
|
#define GST_IS_GL_BASE_MEMORY_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GL_BASE_MEMORY_ALLOCATOR))
|
2015-12-14 01:59:02 +00:00
|
|
|
#define GST_IS_GL_BASE_MEMORY_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GL_BASE_MEMORY_ALLOCATOR))
|
|
|
|
#define GST_GL_BASE_MEMORY_ALLOCATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_GL_BASE_MEMORY_ALLOCATOR, GstGLBaseMemoryAllocatorClass))
|
|
|
|
#define GST_GL_BASE_MEMORY_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GL_BASE_MEMORY_ALLOCATOR, GstGLBaseMemoryAllocator))
|
|
|
|
#define GST_GL_BASE_MEMORY_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GL_BASE_MEMORY_ALLOCATOR, GstGLBaseMemoryAllocatorClass))
|
|
|
|
#define GST_GL_BASE_MEMORY_ALLOCATOR_CAST(obj) ((GstGLBaseMemoryAllocator *)(obj))
|
|
|
|
|
|
|
|
#define GST_GL_BASE_MEMORY_CAST(mem) ((GstGLBaseMemory *)mem)
|
|
|
|
|
2018-03-13 10:57:15 +00:00
|
|
|
GST_GL_API
|
2015-12-14 01:59:02 +00:00
|
|
|
GQuark gst_gl_base_memory_error_quark (void);
|
2018-10-02 17:59:01 +00:00
|
|
|
/**
|
|
|
|
* GST_GL_BASE_MEMORY_ERROR:
|
|
|
|
*
|
|
|
|
* Error domain for GStreamer's GL memory module. Errors in this domain will be
|
|
|
|
* from the #GstGLBaseMemoryError enumeration
|
|
|
|
*/
|
2015-12-14 01:59:02 +00:00
|
|
|
#define GST_GL_BASE_MEMORY_ERROR (gst_gl_base_memory_error_quark ())
|
|
|
|
|
2016-03-06 08:32:21 +00:00
|
|
|
/**
|
|
|
|
* GstGLBaseMemoryError:
|
2019-08-29 17:42:39 +00:00
|
|
|
* @GST_GL_BASE_MEMORY_ERROR_FAILED: generic failure
|
2016-03-06 08:32:21 +00:00
|
|
|
* @GST_GL_BASE_MEMORY_ERROR_OLD_LIBS: the implementation is too old and doesn't
|
|
|
|
* implement enough features
|
|
|
|
* @GST_GL_BASE_MEMORY_ERROR_RESOURCE_UNAVAILABLE: a resource could not be found
|
|
|
|
*/
|
2015-12-14 01:59:02 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GST_GL_BASE_MEMORY_ERROR_FAILED,
|
|
|
|
GST_GL_BASE_MEMORY_ERROR_OLD_LIBS,
|
|
|
|
GST_GL_BASE_MEMORY_ERROR_RESOURCE_UNAVAILABLE,
|
|
|
|
} GstGLBaseMemoryError;
|
|
|
|
|
2016-03-06 08:32:21 +00:00
|
|
|
/**
|
|
|
|
* GstGLBaseMemoryTransfer:
|
|
|
|
* @GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD: the texture needs downloading
|
|
|
|
* to the data pointer
|
|
|
|
* @GST_GL_BASE_MEMORY_TRANSFER_NEED_UPLOAD: the data pointer needs uploading
|
|
|
|
* to the texture
|
|
|
|
*/
|
2015-12-14 01:59:02 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD = (GST_MEMORY_FLAG_LAST << 0),
|
|
|
|
GST_GL_BASE_MEMORY_TRANSFER_NEED_UPLOAD = (GST_MEMORY_FLAG_LAST << 1)
|
|
|
|
} GstGLBaseMemoryTransfer;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_MAP_GL:
|
|
|
|
*
|
|
|
|
* Flag indicating that we should map the GL object instead of to system memory.
|
|
|
|
*
|
|
|
|
* Combining #GST_MAP_GL with #GST_MAP_WRITE has the same semantics as though
|
|
|
|
* you are writing to OpenGL. Conversely, combining #GST_MAP_GL with
|
|
|
|
* #GST_MAP_READ has the same semantics as though you are reading from OpenGL.
|
|
|
|
*/
|
|
|
|
#define GST_MAP_GL (GST_MAP_FLAG_LAST << 1)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstGLBaseMemory:
|
|
|
|
* @mem: the parent object
|
|
|
|
* @context: the #GstGLContext to use for GL operations
|
|
|
|
*
|
|
|
|
* Represents information about a GL memory object
|
|
|
|
*/
|
|
|
|
struct _GstGLBaseMemory
|
|
|
|
{
|
|
|
|
GstMemory mem;
|
|
|
|
|
|
|
|
GstGLContext *context;
|
|
|
|
|
2019-05-20 01:14:27 +00:00
|
|
|
/*< protected >*/
|
2015-12-14 01:59:02 +00:00
|
|
|
GMutex lock;
|
|
|
|
|
|
|
|
GstMapFlags map_flags; /* cumulative map flags */
|
|
|
|
gint map_count;
|
|
|
|
gint gl_map_count;
|
|
|
|
|
|
|
|
gpointer data;
|
|
|
|
|
2016-01-11 02:30:05 +00:00
|
|
|
GstGLQuery *query;
|
|
|
|
|
2019-05-20 01:14:27 +00:00
|
|
|
/*< private >*/
|
2015-12-15 03:14:36 +00:00
|
|
|
gsize alloc_size; /* because maxsize is used for mapping */
|
2015-12-14 01:59:02 +00:00
|
|
|
gpointer alloc_data;
|
|
|
|
|
|
|
|
GDestroyNotify notify;
|
|
|
|
gpointer user_data;
|
2016-09-28 05:20:25 +00:00
|
|
|
|
|
|
|
gpointer _padding[GST_PADDING];
|
2015-12-14 01:59:02 +00:00
|
|
|
};
|
|
|
|
|
2015-12-16 07:13:21 +00:00
|
|
|
typedef struct _GstGLAllocationParams GstGLAllocationParams;
|
2016-03-06 08:32:21 +00:00
|
|
|
/**
|
|
|
|
* GstGLAllocationParamsCopyFunc:
|
|
|
|
* @src: the source #GstGLAllocationParams to copy from
|
|
|
|
* @dest: the source #GstGLAllocationParams to copy
|
|
|
|
*
|
|
|
|
* Copies the parameters from @src into @dest. The subclass must compose copy
|
|
|
|
* functions from the superclass.
|
|
|
|
*/
|
2015-12-16 07:13:21 +00:00
|
|
|
typedef void (*GstGLAllocationParamsCopyFunc) (GstGLAllocationParams * src, GstGLAllocationParams * dest);
|
2016-03-06 08:32:21 +00:00
|
|
|
/**
|
|
|
|
* GstGLAllocationParamsFreeFunc:
|
|
|
|
* @params: a #GstGLAllocationParams
|
|
|
|
*
|
|
|
|
* Free any dynamically allocated data. The subclass must call the superclass'
|
|
|
|
* free.
|
|
|
|
*/
|
2015-12-16 07:13:21 +00:00
|
|
|
typedef void (*GstGLAllocationParamsFreeFunc) (gpointer params);
|
|
|
|
|
|
|
|
#define GST_TYPE_GL_ALLOCATION_PARAMS (gst_gl_allocation_params_get_type())
|
2018-03-13 10:57:15 +00:00
|
|
|
GST_GL_API
|
2015-12-16 07:13:21 +00:00
|
|
|
GType gst_gl_allocation_params_get_type (void);
|
|
|
|
|
2017-07-28 10:00:12 +00:00
|
|
|
/**
|
|
|
|
* GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_ALLOC:
|
|
|
|
*
|
|
|
|
* GL Allocation flag indicating that the implementation should allocate the
|
|
|
|
* necessary resources.
|
|
|
|
*/
|
2015-12-16 07:13:21 +00:00
|
|
|
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_ALLOC (1 << 0)
|
2017-07-28 10:00:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_SYSMEM:
|
|
|
|
*
|
|
|
|
* GL Allocation flag for using the provided system memory data as storage.
|
|
|
|
*/
|
2015-12-16 07:13:21 +00:00
|
|
|
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_SYSMEM (1 << 1)
|
2017-07-28 10:00:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE:
|
|
|
|
*
|
|
|
|
* GL Allocation flag for using the provided GPU handle as storage.
|
|
|
|
*/
|
2015-12-16 07:13:21 +00:00
|
|
|
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE (1 << 2)
|
2017-07-28 10:00:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_USER:
|
|
|
|
*
|
|
|
|
* Values >= than #GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_USER can be used for
|
|
|
|
* user-defined purposes.
|
|
|
|
*/
|
2015-12-16 07:13:21 +00:00
|
|
|
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_USER (1 << 16)
|
|
|
|
|
2016-03-06 08:32:21 +00:00
|
|
|
/**
|
|
|
|
* GstGLAllocationParams:
|
|
|
|
* @struct_size: the size of the struct (including and subclass data)
|
|
|
|
* @copy: a #GstGLAllocationParamsCopyFunc
|
|
|
|
* @free: a #GstGLAllocationParamsFreeFunc
|
|
|
|
* @alloc_flags: allocation flags
|
|
|
|
* @alloc_size: the allocation size
|
|
|
|
* @alloc_params: the #GstAllocationParams
|
|
|
|
* @context: a #GstGLContext
|
|
|
|
* @notify: a #GDestroyNotify
|
|
|
|
* @user_data: argument to call @notify with
|
|
|
|
* @wrapped_data: the wrapped data pointer
|
|
|
|
* @gl_handle: the wrapped OpenGL handle
|
|
|
|
*/
|
2015-12-16 07:13:21 +00:00
|
|
|
/* Because GstAllocationParams is not subclassable, start our own subclass
|
|
|
|
* chain. FIXME: 2.0 make GstAllocationParams subclassable */
|
|
|
|
struct _GstGLAllocationParams
|
|
|
|
{
|
|
|
|
gsize struct_size;
|
|
|
|
GstGLAllocationParamsCopyFunc copy;
|
|
|
|
GstGLAllocationParamsFreeFunc free;
|
|
|
|
|
|
|
|
guint alloc_flags;
|
|
|
|
gsize alloc_size;
|
|
|
|
GstAllocationParams *alloc_params;
|
|
|
|
GstGLContext *context;
|
|
|
|
GDestroyNotify notify;
|
|
|
|
gpointer user_data;
|
|
|
|
|
|
|
|
/* GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_SYSMEM only */
|
|
|
|
gpointer wrapped_data;
|
|
|
|
/* GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE only */
|
2016-05-03 14:19:44 +00:00
|
|
|
gpointer gl_handle;
|
2016-09-28 05:20:25 +00:00
|
|
|
|
2019-05-20 01:14:27 +00:00
|
|
|
/*< private >*/
|
2016-09-28 05:20:25 +00:00
|
|
|
gpointer _padding[GST_PADDING];
|
2015-12-16 07:13:21 +00:00
|
|
|
};
|
|
|
|
|
2018-03-13 10:57:15 +00:00
|
|
|
GST_GL_API
|
2015-12-16 07:13:21 +00:00
|
|
|
gboolean gst_gl_allocation_params_init (GstGLAllocationParams * params,
|
|
|
|
gsize struct_size,
|
|
|
|
guint alloc_flags,
|
|
|
|
GstGLAllocationParamsCopyFunc copy,
|
|
|
|
GstGLAllocationParamsFreeFunc free,
|
|
|
|
GstGLContext * context,
|
|
|
|
gsize alloc_size,
|
2021-01-04 22:25:10 +00:00
|
|
|
const GstAllocationParams * alloc_params,
|
2015-12-16 07:13:21 +00:00
|
|
|
gpointer wrapped_data,
|
2016-05-03 14:19:44 +00:00
|
|
|
gpointer gl_handle,
|
2015-12-17 04:23:13 +00:00
|
|
|
gpointer user_data,
|
|
|
|
GDestroyNotify notify);
|
2015-12-16 07:13:21 +00:00
|
|
|
|
|
|
|
/* free with gst_gl_allocation_params_free */
|
2018-03-13 10:57:15 +00:00
|
|
|
GST_GL_API
|
2015-12-16 07:13:21 +00:00
|
|
|
GstGLAllocationParams * gst_gl_allocation_params_copy (GstGLAllocationParams * src);
|
2017-08-11 13:55:48 +00:00
|
|
|
|
2018-03-13 10:57:15 +00:00
|
|
|
GST_GL_API
|
2015-12-16 07:13:21 +00:00
|
|
|
void gst_gl_allocation_params_free (GstGLAllocationParams * params);
|
|
|
|
|
|
|
|
/* subclass usage */
|
2018-03-13 10:57:15 +00:00
|
|
|
GST_GL_API
|
2015-12-16 07:13:21 +00:00
|
|
|
void gst_gl_allocation_params_free_data (GstGLAllocationParams * params);
|
2017-08-11 13:55:48 +00:00
|
|
|
|
2015-12-16 07:13:21 +00:00
|
|
|
/* subclass usage */
|
2018-03-13 10:57:15 +00:00
|
|
|
GST_GL_API
|
2015-12-16 07:13:21 +00:00
|
|
|
void gst_gl_allocation_params_copy_data (GstGLAllocationParams * src,
|
|
|
|
GstGLAllocationParams * dest);
|
|
|
|
|
2016-03-06 08:32:21 +00:00
|
|
|
/**
|
|
|
|
* GstGLBaseMemoryAllocatorAllocFunction:
|
|
|
|
* @allocator: a #GstGLBaseMemoryAllocator
|
|
|
|
* @params: the #GstGLAllocationParams to allocate the memory with
|
|
|
|
*
|
|
|
|
* Note: not called with a GL context current
|
|
|
|
*
|
|
|
|
* Returns: a newly allocated #GstGLBaseMemory from @allocator and @params
|
|
|
|
*
|
|
|
|
* Since: 1.8
|
|
|
|
*/
|
2015-12-16 07:13:21 +00:00
|
|
|
typedef GstGLBaseMemory * (*GstGLBaseMemoryAllocatorAllocFunction) (GstGLBaseMemoryAllocator * allocator,
|
|
|
|
GstGLAllocationParams * params);
|
2016-03-06 08:32:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstGLBaseMemoryAllocatorCreateFunction:
|
|
|
|
* @mem: a #GstGLBaseMemory
|
|
|
|
* @error: a #GError to use on failure
|
|
|
|
*
|
|
|
|
* As this virtual method is called with an OpenGL context current, use this
|
|
|
|
* function to allocate and OpenGL resources needed for your application
|
|
|
|
*
|
|
|
|
* Returns: whether the creation succeeded
|
|
|
|
*
|
|
|
|
* Since: 1.8
|
|
|
|
*/
|
2015-12-16 07:13:21 +00:00
|
|
|
typedef gboolean (*GstGLBaseMemoryAllocatorCreateFunction) (GstGLBaseMemory * mem,
|
|
|
|
GError ** error);
|
2016-03-06 08:32:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstGLBaseMemoryAllocatorMapFunction:
|
|
|
|
* @mem: a #GstGLBaseMemory
|
|
|
|
* @info: a #GstMapInfo to map with
|
|
|
|
* @maxsize: the size to map
|
|
|
|
*
|
|
|
|
* Also see gst_memory_map();
|
|
|
|
*
|
|
|
|
* Returns: the mapped pointer
|
|
|
|
*
|
|
|
|
* Since: 1.8
|
|
|
|
*/
|
2015-12-16 07:13:21 +00:00
|
|
|
typedef gpointer (*GstGLBaseMemoryAllocatorMapFunction) (GstGLBaseMemory * mem,
|
|
|
|
GstMapInfo * info,
|
|
|
|
gsize maxsize);
|
2016-03-06 08:32:21 +00:00
|
|
|
/**
|
|
|
|
* GstGLBaseMemoryAllocatorUnmapFunction:
|
|
|
|
* @mem: a #GstGLBaseMemory
|
|
|
|
* @info: a #GstMapInfo to map with
|
|
|
|
*
|
|
|
|
* Also see gst_memory_unmap();
|
|
|
|
*
|
|
|
|
* Since: 1.8
|
|
|
|
*/
|
2015-12-16 07:13:21 +00:00
|
|
|
typedef void (*GstGLBaseMemoryAllocatorUnmapFunction) (GstGLBaseMemory * mem,
|
|
|
|
GstMapInfo * info);
|
2016-03-06 08:32:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstGLBaseMemoryAllocatorCopyFunction:
|
|
|
|
* @mem: a #GstGLBaseMemory
|
|
|
|
* @offset: the offset to copy from
|
|
|
|
* @size: the number of bytes to copy
|
|
|
|
*
|
|
|
|
* Also see gst_memory_copy();
|
|
|
|
*
|
|
|
|
* Returns: the newly copied #GstGLMemory or %NULL
|
|
|
|
*
|
|
|
|
* Since: 1.8
|
|
|
|
*/
|
2015-12-16 07:13:21 +00:00
|
|
|
typedef GstGLBaseMemory * (*GstGLBaseMemoryAllocatorCopyFunction) (GstGLBaseMemory * mem,
|
|
|
|
gssize offset,
|
|
|
|
gssize size);
|
2016-03-06 08:32:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstGLBaseMemoryAllocatorDestroyFunction:
|
|
|
|
* @mem: a #GstGLBaseMemory
|
|
|
|
*
|
|
|
|
* Destroy any resources allocated throughout the lifetime of @mem
|
|
|
|
*
|
|
|
|
* Since: 1.8
|
|
|
|
*/
|
2015-12-16 07:13:21 +00:00
|
|
|
typedef void (*GstGLBaseMemoryAllocatorDestroyFunction) (GstGLBaseMemory * mem);
|
2015-12-14 01:59:02 +00:00
|
|
|
|
|
|
|
/**
|
2018-04-02 06:34:58 +00:00
|
|
|
* GstGLBaseMemoryAllocator:
|
2015-12-14 01:59:02 +00:00
|
|
|
*
|
2016-03-06 08:32:21 +00:00
|
|
|
* Opaque #GstGLBaseMemoryAllocator struct
|
|
|
|
*
|
|
|
|
* Since: 1.8
|
2015-12-14 01:59:02 +00:00
|
|
|
*/
|
|
|
|
struct _GstGLBaseMemoryAllocator
|
|
|
|
{
|
2016-03-06 08:32:21 +00:00
|
|
|
/*< private >*/
|
2015-12-14 01:59:02 +00:00
|
|
|
GstAllocator parent;
|
|
|
|
GstMemoryCopyFunction fallback_mem_copy;
|
2016-09-28 05:20:25 +00:00
|
|
|
|
|
|
|
gpointer _padding[GST_PADDING];
|
2015-12-14 01:59:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstGLBaseMemoryAllocatorClass:
|
2016-03-06 08:32:21 +00:00
|
|
|
* @parent_class: the parent class
|
2017-01-10 09:06:07 +00:00
|
|
|
* @alloc: a #GstGLBaseMemoryAllocatorAllocFunction
|
2016-03-06 08:32:21 +00:00
|
|
|
* @create: a #GstGLBaseMemoryAllocatorCreateFunction
|
|
|
|
* @map: a #GstGLBaseMemoryAllocatorMapFunction
|
|
|
|
* @unmap: a #GstGLBaseMemoryAllocatorUnmapFunction
|
|
|
|
* @copy: a #GstGLBaseMemoryAllocatorCopyFunction
|
|
|
|
* @destroy: a #GstGLBaseMemoryAllocatorDestroyFunction
|
2015-12-14 01:59:02 +00:00
|
|
|
*
|
2016-03-06 08:32:21 +00:00
|
|
|
* Since: 1.8
|
2015-12-14 01:59:02 +00:00
|
|
|
*/
|
|
|
|
struct _GstGLBaseMemoryAllocatorClass
|
|
|
|
{
|
|
|
|
GstAllocatorClass parent_class;
|
|
|
|
|
2015-12-16 07:13:21 +00:00
|
|
|
GstGLBaseMemoryAllocatorAllocFunction alloc;
|
|
|
|
|
2015-12-14 01:59:02 +00:00
|
|
|
GstGLBaseMemoryAllocatorCreateFunction create;
|
|
|
|
GstGLBaseMemoryAllocatorMapFunction map;
|
2016-09-28 05:20:25 +00:00
|
|
|
GstGLBaseMemoryAllocatorUnmapFunction unmap;
|
|
|
|
GstGLBaseMemoryAllocatorCopyFunction copy;
|
|
|
|
GstGLBaseMemoryAllocatorDestroyFunction destroy;
|
|
|
|
|
2019-05-20 01:14:27 +00:00
|
|
|
/*< private >*/
|
2016-09-28 05:20:25 +00:00
|
|
|
gpointer _padding[GST_PADDING];
|
2015-12-14 01:59:02 +00:00
|
|
|
};
|
|
|
|
|
2017-07-07 15:15:12 +00:00
|
|
|
#include <gst/gl/gstglconfig.h>
|
|
|
|
#include <gst/gl/gstglformat.h>
|
2015-12-14 01:59:02 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_GL_BASE_MEMORY_ALLOCATOR_NAME:
|
|
|
|
*
|
|
|
|
* The name of the GL buffer allocator
|
2016-03-06 08:32:21 +00:00
|
|
|
*
|
|
|
|
* Since: 1.8
|
2015-12-14 01:59:02 +00:00
|
|
|
*/
|
|
|
|
#define GST_GL_BASE_MEMORY_ALLOCATOR_NAME "GLBaseMemory"
|
|
|
|
|
2018-03-13 10:57:15 +00:00
|
|
|
GST_GL_API
|
2015-12-14 01:59:02 +00:00
|
|
|
void gst_gl_base_memory_init_once (void);
|
2017-08-11 13:55:48 +00:00
|
|
|
|
2018-03-13 10:57:15 +00:00
|
|
|
GST_GL_API
|
2015-12-14 01:59:02 +00:00
|
|
|
gboolean gst_is_gl_base_memory (GstMemory * mem);
|
|
|
|
|
2018-03-13 10:57:15 +00:00
|
|
|
GST_GL_API
|
2015-12-14 01:59:02 +00:00
|
|
|
void gst_gl_base_memory_init (GstGLBaseMemory * mem,
|
|
|
|
GstAllocator * allocator,
|
|
|
|
GstMemory * parent,
|
|
|
|
GstGLContext * context,
|
2021-01-04 22:25:10 +00:00
|
|
|
const GstAllocationParams * params,
|
2016-03-06 08:32:21 +00:00
|
|
|
gsize size,
|
2015-12-17 04:23:13 +00:00
|
|
|
gpointer user_data,
|
|
|
|
GDestroyNotify notify);
|
2015-12-14 01:59:02 +00:00
|
|
|
|
2018-03-13 10:57:15 +00:00
|
|
|
GST_GL_API
|
2015-12-14 01:59:02 +00:00
|
|
|
gboolean gst_gl_base_memory_alloc_data (GstGLBaseMemory * gl_mem);
|
2017-08-11 13:55:48 +00:00
|
|
|
|
2018-03-13 10:57:15 +00:00
|
|
|
GST_GL_API
|
2015-12-14 01:59:02 +00:00
|
|
|
gboolean gst_gl_base_memory_memcpy (GstGLBaseMemory * src,
|
|
|
|
GstGLBaseMemory * dest,
|
|
|
|
gssize offset,
|
|
|
|
gssize size);
|
|
|
|
|
2018-03-13 10:57:15 +00:00
|
|
|
GST_GL_API
|
2015-12-16 07:13:21 +00:00
|
|
|
GstGLBaseMemory * gst_gl_base_memory_alloc (GstGLBaseMemoryAllocator * allocator,
|
|
|
|
GstGLAllocationParams * params);
|
|
|
|
|
2015-12-14 01:59:02 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* _GST_GL_BUFFER_H_ */
|