| Top |
GBoxed ╰── GstGLAllocationParams GObject ╰── GInitiallyUnowned ╰── GstObject ╰── GstAllocator ╰── GstGLBaseMemoryAllocator ├── GstGLBufferAllocator ├── GstGLMemoryAllocator ╰── GstGLRenderbufferAllocator
GstGLBaseMemory is a GstMemory subclass providing the basis of support for the mapping of GL buffers.
Data is uploaded or downloaded from the GPU as is necessary.
void (*GstGLAllocationParamsCopyFunc) (GstGLAllocationParams *src,GstGLAllocationParams *dest);
Copies the parameters from src
into dest
. The subclass must compose copy
functions from the superclass.
src |
the source GstGLAllocationParams to copy from |
|
dest |
the source GstGLAllocationParams to copy |
void
(*GstGLAllocationParamsFreeFunc) (gpointer params);
Free any dynamically allocated data. The subclass must call the superclass' free.
gboolean gst_gl_allocation_params_init (GstGLAllocationParams *params,gsize struct_size,guint alloc_flags,GstGLAllocationParamsCopyFunc copy,GstGLAllocationParamsFreeFunc free,GstGLContext *context,gsize alloc_size,GstAllocationParams *alloc_params,gpointer wrapped_data,gpointer gl_handle,gpointer user_data,GDestroyNotify notify);
notify
will be called once for each allocated memory using these params
when freeing the memory.
[skip]
params |
the GstGLAllocationParams to initialize |
|
struct_size |
the struct size of the implementation |
|
alloc_flags |
some alloc flags |
|
copy |
a copy function |
|
free |
a free function |
|
context |
a GstGLContext. |
[transfer none] |
alloc_size |
the number of bytes to allocate. |
|
alloc_params |
a GstAllocationParams to apply. |
[transfer none][allow-none] |
wrapped_data |
a sysmem data pointer to initialize the allocation with. |
[transfer none][allow-none] |
gl_handle |
a GL handle to initialize the allocation with. |
[transfer none] |
user_data |
user data to call |
[transfer none][allow-none] |
notify |
[allow-none] |
Since: 1.8
GstGLAllocationParams *
gst_gl_allocation_params_copy (GstGLAllocationParams *src);
Since: 1.8
void
gst_gl_allocation_params_free (GstGLAllocationParams *params);
Frees the GstGLAllocationParams and all associated data.
Since: 1.8
void
gst_gl_allocation_params_free_data (GstGLAllocationParams *params);
Frees the dynamically allocated data in params
. Direct subclasses
should call this function in their own overriden free function.
Since: 1.8
void gst_gl_allocation_params_copy_data (GstGLAllocationParams *src,GstGLAllocationParams *dest);
Copies the dynamically allocated data from src
to dest
. Direct subclasses
should call this function in their own overriden copy function.
Since: 1.8
void
gst_gl_base_memory_init_once (void);
Initializes the GL Base Memory allocator. It is safe to call this function multiple times. This must be called before any other GstGLBaseMemory operation.
Since: 1.8
void gst_gl_base_memory_init (GstGLBaseMemory *mem,GstAllocator *allocator,GstMemory *parent,GstGLContext *context,GstAllocationParams *params,gsize size,gpointer user_data,GDestroyNotify notify);
Initializes mem
with the required parameters
mem |
the GstGLBaseMemory to initialize |
|
allocator |
the GstAllocator to initialize with |
|
parent |
the parent GstMemory to initialize with. |
[allow-none] |
context |
the GstGLContext to initialize with |
|
params |
the |
[allow-none] |
size |
the number of bytes to be allocated |
|
user_data |
user data to call |
[allow-none] |
notify |
[allow-none] |
Since: 1.8
GstGLBaseMemory * (*GstGLBaseMemoryAllocatorAllocFunction) (GstGLBaseMemoryAllocator *allocator,GstGLAllocationParams *params);
Note: not called with a GL context current
Since: 1.8
gboolean (*GstGLBaseMemoryAllocatorCreateFunction) (GstGLBaseMemory *mem,GError **error);
As this virtual method is called with an OpenGL context current, use this function to allocate and OpenGL resources needed for your application
Since: 1.8
gpointer (*GstGLBaseMemoryAllocatorMapFunction) (GstGLBaseMemory *mem,GstMapInfo *info,gsize maxsize);
Also see gst_memory_map();
Since: 1.8
void (*GstGLBaseMemoryAllocatorUnmapFunction) (GstGLBaseMemory *mem,GstMapInfo *info);
Also see gst_memory_unmap();
Since: 1.8
GstGLBaseMemory * (*GstGLBaseMemoryAllocatorCopyFunction) (GstGLBaseMemory *mem,gssize offset,gssize size);
Also see gst_memory_copy();
Since: 1.8
void
(*GstGLBaseMemoryAllocatorDestroyFunction)
(GstGLBaseMemory *mem);
Destroy any resources allocated throughout the lifetime of mem
Since: 1.8
GstGLBaseMemory * gst_gl_base_memory_alloc (GstGLBaseMemoryAllocator *allocator,GstGLAllocationParams *params);
Since: 1.8
gboolean
gst_gl_base_memory_alloc_data (GstGLBaseMemory *gl_mem);
Note: only intended for subclass usage to allocate the sytem memory buffer
on demand. If there is already a non-NULL data pointer in gl_mem->data
,
then this function imply returns TRUE.
gboolean gst_gl_base_memory_memcpy (GstGLBaseMemory *src,GstGLBaseMemory *dest,gssize offset,gssize size);
src |
the source GstGLBaseMemory |
|
dest |
the destination GstGLBaseMemory |
|
offset |
the offset to start at |
|
size |
the number of bytes to copy |
Since: 1.8
typedef struct _GstGLBaseMemoryAllocator GstGLBaseMemoryAllocator;
Opaque GstGLBaseMemoryAllocator struct
Since: 1.8
typedef struct {
GstAllocatorClass parent_class;
GstGLBaseMemoryAllocatorAllocFunction alloc;
GstGLBaseMemoryAllocatorCreateFunction create;
GstGLBaseMemoryAllocatorMapFunction map;
GstGLBaseMemoryAllocatorUnmapFunction unmap;
GstGLBaseMemoryAllocatorCopyFunction copy;
GstGLBaseMemoryAllocatorDestroyFunction destroy;
} GstGLBaseMemoryAllocatorClass;
Since: 1.8
#define GST_GL_BASE_MEMORY_ALLOCATOR_NAME "GLBaseMemory"
The name of the GL buffer allocator
Since: 1.8
#define GST_MAP_GL (GST_MAP_FLAG_LAST << 1)
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_GL_BASE_MEMORY_ERROR (gst_gl_base_memory_error_quark ())
Error domain for GStreamer's GL memory module. Errors in this domain will be from the GstGLBaseMemoryError enumeration
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 */
gpointer gl_handle;
};
gsize |
the size of the struct (including and subclass data) |
|
guint |
allocation flags |
|
gsize |
the allocation size |
|
GstAllocationParams * |
||
GstGLContext * |
||
GDestroyNotify |
||
gpointer |
argument to call |
|
gpointer |
the wrapped data pointer |
|
gpointer |
the wrapped OpenGL handle |
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_ALLOC (1 << 0)
GL Allocation flag indicating that the implementation should allocate the necessary resources.
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_SYSMEM (1 << 1)
GL Allocation flag for using the provided system memory data as storage.
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE (1 << 2)
GL Allocation flag for using the provided GPU handle as storage.
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_USER (1 << 16)
Values >= than GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_USER can be used for user-defined purposes.
typedef struct {
GstMemory mem;
GstGLContext *context;
} GstGLBaseMemory;
Represents information about a GL memory object
GstMemory |
the parent object |
|
GstGLContext * |
the GstGLContext to use for GL operations |