| GStreamer Bad Plugins 1.0 Library Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
GstGLAllocator; GstGLAllocatorClass; #define GST_MAP_GL #define GST_GL_MEMORY_ALLOCATOR enum GstGLMemoryFlags; #define GST_GL_MEMORY_FLAGS (mem) #define GST_GL_MEMORY_FLAG_IS_SET (mem, flag) #define GST_GL_MEMORY_FLAG_SET (mem, flag) #define GST_GL_MEMORY_FLAG_UNSET (mem, flag) GstGLMemory; void gst_gl_memory_init (void); GstMemory * gst_gl_memory_alloc (GstGLContext *context,GstVideoGLTextureType tex_type,gint width,gint height,gint stride); GstGLMemory * gst_gl_memory_wrapped (GstGLContext *context,GstVideoGLTextureType tex_type,gint width,gint height,gint stride,gpointer data,gpointer user_data,GDestroyNotify notify); GstGLMemory * gst_gl_memory_wrapped_texture (GstGLContext *context,guint texture_id,GstVideoGLTextureType tex_type,gint width,gint height,gpointer user_data,GDestroyNotify notify); gboolean gst_gl_memory_copy_into_texture (GstGLMemory *gl_mem,guint tex_id,GstVideoGLTextureType tex_type,gint width,gint height,gint stride,gboolean respecify); gboolean gst_gl_memory_setup_buffer (GstGLContext *context,GstVideoInfo *info,GstBuffer *buffer); gboolean gst_gl_memory_setup_wrapped (GstGLContext *context,GstVideoInfo *info,gpointer data[GST_VIDEO_MAX_PLANES],GstGLMemory *textures[GST_VIDEO_MAX_PLANES]); GstVideoGLTextureType gst_gl_texture_type_from_format (GstGLContext *context,GstVideoFormat v_format,guint plane); gboolean gst_is_gl_memory (GstMemory *mem);
GObject
+----GInitiallyUnowned
+----GstObject
+----GstAllocator
+----GstGLAllocator
GstGLMemory is a GstMemory subclass providing support for the mapping of GL textures.
GstGLMemory is created through gst_gl_memory_alloc() or system memory can
be wrapped through gst_gl_memory_wrapped().
Data is uploaded or downloaded from the GPU as is necessary.
typedef struct {
GstAllocatorClass parent_class;
} GstGLAllocatorClass;
The GstGLAllocatorClass only contains private data
#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_MEMORY_ALLOCATOR "GLMemory"
The name of the GL memore allocator
typedef enum {
GST_GL_MEMORY_FLAG_DOWNLOAD_INITTED = (GST_MEMORY_FLAG_LAST << 0),
GST_GL_MEMORY_FLAG_UPLOAD_INITTED = (GST_MEMORY_FLAG_LAST << 1),
GST_GL_MEMORY_FLAG_NEED_DOWNLOAD = (GST_MEMORY_FLAG_LAST << 2),
GST_GL_MEMORY_FLAG_NEED_UPLOAD = (GST_MEMORY_FLAG_LAST << 3)
} GstGLMemoryFlags;
Flags indicating the current state of a GstGLMemory
#define GST_GL_MEMORY_FLAGS(mem) GST_MEMORY_FLAGS(mem)
Get the currently set flags on mem
|
a GstGLMemory |
#define GST_GL_MEMORY_FLAG_IS_SET(mem,flag) GST_MEMORY_FLAG_IS_SET(mem,flag)
Whether flag is set on mem
|
a GstGLMemory |
|
a flag |
#define GST_GL_MEMORY_FLAG_SET(mem,flag) GST_MINI_OBJECT_FLAG_SET(mem,flag)
Set flag on mem
|
a GstGLMemory |
|
a flag |
#define GST_GL_MEMORY_FLAG_UNSET(mem,flag) GST_MEMORY_FLAG_UNSET(mem,flag)
Unset flag on mem
|
a GstGLMemory |
|
a flag |
typedef struct {
GstMemory mem;
GstGLContext *context;
guint tex_id;
GstVideoGLTextureType tex_type;
gint width;
gint height;
gint stride;
gfloat tex_scaling[2];
} GstGLMemory;
Represents information about a GL texture
| the parent object | |
GstGLContext * |
the GstGLContext to use for GL operations |
| the texture id for this memory | |
| width of the texture | |
| height of the texture | |
void gst_gl_memory_init (void);
Initializes the GL Memory allocator. It is safe to call this function multiple times. This must be called before any other GstGLMemory operation.
GstMemory * gst_gl_memory_alloc (GstGLContext *context,GstVideoGLTextureType tex_type,gint width,gint height,gint stride);
|
a GstGLContext |
|
the GstVideoInfo of the memory |
Returns : |
a GstMemory object with a GL texture specified by v_info
from context
|
GstGLMemory * gst_gl_memory_wrapped (GstGLContext *context,GstVideoGLTextureType tex_type,gint width,gint height,gint stride,gpointer data,gpointer user_data,GDestroyNotify notify);
|
a GstGLContext |
|
the GstVideoInfo of the memory and data |
|
the data to wrap |
|
data called with for notify
|
|
function called with user_data when data needs to be freed |
Returns : |
a GstGLMemory object with a GL texture specified by v_info
from context and contents specified by data
|
GstGLMemory * gst_gl_memory_wrapped_texture (GstGLContext *context,guint texture_id,GstVideoGLTextureType tex_type,gint width,gint height,gpointer user_data,GDestroyNotify notify);
gboolean gst_gl_memory_copy_into_texture (GstGLMemory *gl_mem,guint tex_id,GstVideoGLTextureType tex_type,gint width,gint height,gint stride,gboolean respecify);
Copies gl_mem into the texture specfified by tex_id. The format of tex_id
is specified by tex_type, width and height.
If respecify is TRUE, then the copy is performed in terms of the texture
data. This is useful for splitting RGBA textures into RG or R textures or
vice versa. The requirement for this to succeed is that the backing texture
data must be the same size, i.e. say a RGBA8 texture is converted into a RG8
texture, then the RG texture must have twice as many pixels available for
output as the RGBA texture.
Otherwise, if respecify is FALSE, then the copy is performed per texel
using glCopyTexImage. See the OpenGL specification for details on the
mappings between texture formats.
|
a GstGLMemory |
|
OpenGL texture id |
|
a GstVideoGLTextureType |
|
width of tex_id
|
|
height of tex_id
|
|
stride of the backing texture data |
|
whether to copy the data or copy per texel |
Returns : |
Whether the copy suceeded |
gboolean gst_gl_memory_setup_buffer (GstGLContext *context,GstVideoInfo *info,GstBuffer *buffer);
Adds the required GstGLMemorys with the correct configuration to
buffer based on info.
|
a GstGLContext |
|
a GstVideoInfo |
|
a GstBuffer |
Returns : |
whether the memory's were sucessfully added. |
gboolean gst_gl_memory_setup_wrapped (GstGLContext *context,GstVideoInfo *info,gpointer data[GST_VIDEO_MAX_PLANES],GstGLMemory *textures[GST_VIDEO_MAX_PLANES]);
Wraps per plane data pointer in data into the corresponding entry in
textures based on info.
|
a GstGLContext |
|
a GstVideoInfo |
|
a list of per plane data pointers |
|
a list of GstGLMemory. [transfer out] |
Returns : |
whether the memory's were sucessfully created. |
GstVideoGLTextureType gst_gl_texture_type_from_format (GstGLContext *context,GstVideoFormat v_format,guint plane);
gboolean gst_is_gl_memory (GstMemory *mem);
|
a GstMemory |
Returns : |
whether the memory at mem is a GstGLMemory
|