![]() |
![]() |
![]() |
GStreamer Bad Plugins 1.0 Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
GstGLBaseMemoryAllocator; GstGLBaseMemoryAllocatorClass; #define GST_GL_BASE_MEMORY_ALLOCATOR_NAME #define GST_MAP_GL enum GstGLBaseMemoryError; #define GST_GL_BASE_MEMORY_ERROR enum GstGLBaseMemoryTransfer; struct GstGLAllocationParams; void (*GstGLAllocationParamsCopyFunc) (GstGLAllocationParams *src
,GstGLAllocationParams *dest
); void (*GstGLAllocationParamsFreeFunc) (gpointer params
); #define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_ALLOC #define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_SYSMEM #define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE #define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_USER 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
,guint gl_handle
,gpointer user_data
,GDestroyNotify notify
); GstGLAllocationParams * gst_gl_allocation_params_copy (GstGLAllocationParams *src
); void gst_gl_allocation_params_free (GstGLAllocationParams *params
); void gst_gl_allocation_params_free_data (GstGLAllocationParams *params
); void gst_gl_allocation_params_copy_data (GstGLAllocationParams *src
,GstGLAllocationParams *dest
); GstGLBaseMemory; void gst_gl_base_memory_init_once (void
); void gst_gl_base_memory_init (GstGLBaseMemory *mem
,GstAllocator *allocator
,GstMemory *parent
,GstGLContext *context
,GstAllocationParams *params
,gsize size
,gpointer user_data
,GDestroyNotify notify
); gboolean gst_is_gl_base_memory (GstMemory *mem
); GstGLBaseMemory * (*GstGLBaseMemoryAllocatorAllocFunction) (GstGLBaseMemoryAllocator *allocator
,GstGLAllocationParams *params
); gboolean (*GstGLBaseMemoryAllocatorCreateFunction) (GstGLBaseMemory *mem
,GError **error
); gpointer (*GstGLBaseMemoryAllocatorMapFunction) (GstGLBaseMemory *mem
,GstMapInfo *info
,gsize maxsize
); void (*GstGLBaseMemoryAllocatorUnmapFunction) (GstGLBaseMemory *mem
,GstMapInfo *info
); GstGLBaseMemory * (*GstGLBaseMemoryAllocatorCopyFunction) (GstGLBaseMemory *mem
,gssize offset
,gssize size
); void (*GstGLBaseMemoryAllocatorDestroyFunction) (GstGLBaseMemory *mem
); GstGLBaseMemory * gst_gl_base_memory_alloc (GstGLBaseMemoryAllocator *allocator
,GstGLAllocationParams *params
); gboolean gst_gl_base_memory_alloc_data (GstGLBaseMemory *gl_mem
); gboolean gst_gl_base_memory_memcpy (GstGLBaseMemory *src
,GstGLBaseMemory *dest
,gssize offset
,gssize size
);
GObject +----GInitiallyUnowned +----GstObject +----GstAllocator +----GstGLBaseMemoryAllocator +----GstGLBufferAllocator +----GstGLMemoryAllocator
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.
typedef struct _GstGLBaseMemoryAllocator GstGLBaseMemoryAllocator;
Opaque GstGLBaseMemoryAllocator struct
Since 1.8
typedef struct { GstAllocatorClass parent_class; GstGLBaseMemoryAllocatorAllocFunction alloc; GstGLBaseMemoryAllocatorCreateFunction create; GstGLBaseMemoryAllocatorMapFunction map; #if 0 GstGLBaseMemoryAllocatorFlushFunction flush; /* make CPU writes visible to the GPU */ GstGLBaseMemoryAllocatorInvalidateFunction invalidate; /* make GPU writes visible to the CPU */ #endif 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.
typedef enum { GST_GL_BASE_MEMORY_ERROR_FAILED, GST_GL_BASE_MEMORY_ERROR_OLD_LIBS, GST_GL_BASE_MEMORY_ERROR_RESOURCE_UNAVAILABLE, } GstGLBaseMemoryError;
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;
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 */ guint gl_handle; };
the size of the struct (including and subclass data) | |
a GstGLAllocationParamsCopyFunc | |
a GstGLAllocationParamsFreeFunc | |
allocation flags | |
the allocation size | |
the GstAllocationParams | |
GstGLContext * |
a GstGLContext |
a GDestroyNotify | |
argument to call notify with |
|
the wrapped data pointer | |
the wrapped OpenGL handle |
void (*GstGLAllocationParamsCopyFunc) (GstGLAllocationParams *src
,GstGLAllocationParams *dest
);
Copies the parameters from src
into dest
. The subclass must compose copy
functions from the superclass.
|
the source GstGLAllocationParams to copy from |
|
the source GstGLAllocationParams to copy |
void (*GstGLAllocationParamsFreeFunc) (gpointer params
);
Free any dynamically allocated data. The subclass must call the superclass' free.
|
a GstGLAllocationParams |
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_ALLOC (1 << 0)
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_SYSMEM (1 << 1)
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE (1 << 2)
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
,guint gl_handle
,gpointer user_data
,GDestroyNotify notify
);
notify
will be called once for each allocated memory using these params
when freeing the memory.
|
the GstGLAllocationParams to initialize |
|
the struct size of the implementation |
|
some alloc flags |
|
a copy function |
|
a free function |
|
a GstGLContext. [transfer none] |
|
the number of bytes to allocate. |
|
a GstAllocationParams to apply. [transfer none][allow-none] |
|
a sysmem data pointer to initialize the allocation with. [transfer none][allow-none] |
|
a GL handle to initialize the allocation with. [transfer none] |
|
user data to call notify with. [transfer none][allow-none]
|
|
a GDestroyNotify. [allow-none] |
Returns : |
whether the paramaters could be initialized |
Since 1.8
GstGLAllocationParams * gst_gl_allocation_params_copy (GstGLAllocationParams *src
);
|
the GstGLAllocationParams to initialize |
Returns : |
a copy of the GstGLAllocationParams specified by src or NULL on
failure |
Since 1.8
void gst_gl_allocation_params_free (GstGLAllocationParams *params
);
Frees the GstGLAllocationParams and all associated data.
|
the GstGLAllocationParams to initialize |
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.
|
the source GstGLAllocationParams |
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.
|
the source GstGLAllocationParams |
|
the destination GstGLAllocationParams |
Since 1.8
typedef struct { GstMemory mem; GstGLContext *context; } GstGLBaseMemory;
Represents information about a GL memory object
the parent object | |
GstGLContext * |
the GstGLContext to use for GL operations |
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
|
the GstGLBaseMemory to initialize |
|
the GstAllocator to initialize with |
|
the parent GstMemory to initialize with. [allow-none] |
|
the GstGLContext to initialize with |
|
the GstAllocationParams to initialize with. [allow-none]
|
|
the number of bytes to be allocated |
|
user data to call notify with. [allow-none]
|
|
a GDestroyNotify. [allow-none] |
Since 1.8
gboolean gst_is_gl_base_memory (GstMemory *mem
);
|
a GstMemory |
Returns : |
whether the memory at mem is a GstGLBaseMemory
|
Since 1.8
GstGLBaseMemory * (*GstGLBaseMemoryAllocatorAllocFunction) (GstGLBaseMemoryAllocator *allocator
,GstGLAllocationParams *params
);
Note: not called with a GL context current
|
a GstGLBaseMemoryAllocator |
|
the GstGLAllocationParams to allocate the memory with |
Returns : |
a newly allocated GstGLBaseMemory from allocator and params
|
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
|
a GstGLBaseMemory |
|
a GError to use on failure |
Returns : |
whether the creation succeeded |
Since 1.8
gpointer (*GstGLBaseMemoryAllocatorMapFunction) (GstGLBaseMemory *mem
,GstMapInfo *info
,gsize maxsize
);
Also see gst_memory_map()
;
|
a GstGLBaseMemory |
|
a GstMapInfo to map with |
|
the size to map |
Returns : |
the mapped pointer |
Since 1.8
void (*GstGLBaseMemoryAllocatorUnmapFunction) (GstGLBaseMemory *mem
,GstMapInfo *info
);
Also see gst_memory_unmap()
;
|
a GstGLBaseMemory |
|
a GstMapInfo to map with |
Since 1.8
GstGLBaseMemory * (*GstGLBaseMemoryAllocatorCopyFunction) (GstGLBaseMemory *mem
,gssize offset
,gssize size
);
Also see gst_memory_copy()
;
|
a GstGLBaseMemory |
|
the offset to copy from |
|
the number of bytes to copy |
Returns : |
the newly copied GstGLMemory or NULL
|
Since 1.8
void (*GstGLBaseMemoryAllocatorDestroyFunction)
(GstGLBaseMemory *mem
);
Destroy any resources allocated throughout the lifetime of mem
|
a GstGLBaseMemory |
Since 1.8
GstGLBaseMemory * gst_gl_base_memory_alloc (GstGLBaseMemoryAllocator *allocator
,GstGLAllocationParams *params
);
|
a GstGLBaseMemoryAllocator |
|
the GstGLAllocationParams to allocate the memory with |
Returns : |
a new GstGLBaseMemory from allocator with the requested params . |
Since 1.8
gboolean gst_gl_base_memory_memcpy (GstGLBaseMemory *src
,GstGLBaseMemory *dest
,gssize offset
,gssize size
);
|
the source GstGLBaseMemory |
|
the destination GstGLBaseMemory |
|
the offset to start at |
|
the number of bytes to copy |
Returns : |
whether the copy suceeded. |
Since 1.8