![]() |
![]() |
![]() |
GStreamer Bad Plugins 1.0 Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#define GST_GL_MEMORY_VIDEO_FORMATS_STR struct GstGLVideoAllocationParams; #define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_VIDEO void gst_gl_video_allocation_params_copy_data (GstGLVideoAllocationParams *src_vid
,GstGLVideoAllocationParams *dest_vid
); void gst_gl_video_allocation_params_free_data (GstGLVideoAllocationParams *params
); gboolean gst_gl_video_allocation_params_init_full (GstGLVideoAllocationParams *params
,gsize struct_size
,guint alloc_flags
,GstGLAllocationParamsCopyFunc copy
,GstGLAllocationParamsFreeFunc free
,GstGLContext *context
,GstAllocationParams *alloc_params
,GstVideoInfo *v_info
,guint plane
,GstVideoAlignment *valign
,GstGLTextureTarget target
,gpointer wrapped_data
,guint gl_handle
,gpointer user_data
,GDestroyNotify notify
); GstGLVideoAllocationParams * gst_gl_video_allocation_params_new (GstGLContext *context
,GstAllocationParams *alloc_params
,GstVideoInfo *v_info
,guint plane
,GstVideoAlignment *valign
,GstGLTextureTarget target
); GstGLVideoAllocationParams * 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
,gpointer user_data
,GDestroyNotify notify
); GstGLVideoAllocationParams * 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
,gpointer user_data
,GDestroyNotify notify
); GstGLMemoryAllocator; GstGLMemoryAllocatorClass; GstGLMemoryAllocator * gst_gl_memory_allocator_get_default (GstGLContext *context
); void gst_gl_memory_init_once (void
); GstGLMemory; void gst_gl_memory_init (GstGLMemory *mem
,GstAllocator *allocator
,GstMemory *parent
,GstGLContext *context
,GstGLTextureTarget target
,GstAllocationParams *params
,GstVideoInfo *info
,guint plane
,GstVideoAlignment *valign
,gpointer user_data
,GDestroyNotify notify
); gboolean gst_is_gl_memory (GstMemory *mem
); #define GST_GL_MEMORY_ALLOCATOR_NAME gboolean gst_gl_memory_copy_into (GstGLMemory *gl_mem
,guint tex_id
,GstGLTextureTarget target
,GstVideoGLTextureType tex_type
,gint width
,gint height
); gboolean gst_gl_memory_copy_teximage (GstGLMemory *src
,guint tex_id
,GstGLTextureTarget out_target
,GstVideoGLTextureType out_tex_type
,gint width
,gint height
); gboolean gst_gl_memory_read_pixels (GstGLMemory *gl_mem
,gpointer read_pointer
); void gst_gl_memory_texsubimage (GstGLMemory *gl_mem
,gpointer read_pointer
); gint gst_gl_memory_get_texture_height (GstGLMemory *gl_mem
); guint gst_gl_memory_get_texture_id (GstGLMemory *gl_mem
); GstGLTextureTarget gst_gl_memory_get_texture_target (GstGLMemory *gl_mem
); GstVideoGLTextureType gst_gl_memory_get_texture_type (GstGLMemory *gl_mem
); gint gst_gl_memory_get_texture_width (GstGLMemory *gl_mem
); gboolean gst_gl_memory_setup_buffer (GstGLMemoryAllocator *allocator
,GstBuffer *buffer
,GstGLVideoAllocationParams *params
);
GObject +----GInitiallyUnowned +----GstObject +----GstAllocator +----GstGLBaseMemoryAllocator +----GstGLMemoryAllocator +----GstGLMemoryPBOAllocator
GstGLMemory is a GstGLBaseMemory subclass providing support for the mapping of OpenGL textures.
GstGLMemory is created or wrapped through gst_gl_base_memory_alloc()
with GstGLVideoAllocationParams.
Data is uploaded or downloaded from the GPU as is necessary.
struct GstGLVideoAllocationParams { GstGLAllocationParams parent; GstVideoInfo *v_info; guint plane; GstVideoAlignment *valign; GstGLTextureTarget target; };
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_VIDEO (1 << 3)
void gst_gl_video_allocation_params_copy_data (GstGLVideoAllocationParams *src_vid
,GstGLVideoAllocationParams *dest_vid
);
Copy and set any dynamically allocated resources in dest_vid
. Intended
for subclass usage only to chain up at the end of a subclass copy function.
|
source GstGLVideoAllocationParams to copy from |
|
destination GstGLVideoAllocationParams to copy into |
Since 1.8
void gst_gl_video_allocation_params_free_data
(GstGLVideoAllocationParams *params
);
Unset and free any dynamically allocated resources. Intended for subclass usage only to chain up at the end of a subclass free function.
|
a GstGLVideoAllocationParams |
Since 1.8
gboolean gst_gl_video_allocation_params_init_full (GstGLVideoAllocationParams *params
,gsize struct_size
,guint alloc_flags
,GstGLAllocationParamsCopyFunc copy
,GstGLAllocationParamsFreeFunc free
,GstGLContext *context
,GstAllocationParams *alloc_params
,GstVideoInfo *v_info
,guint plane
,GstVideoAlignment *valign
,GstGLTextureTarget target
,gpointer wrapped_data
,guint gl_handle
,gpointer user_data
,GDestroyNotify notify
);
Intended for subclass usage
|
a GstGLVideoAllocationParams to initialize |
|
the size of the struct in params
|
|
some allocation flags |
|
a copy function |
|
a free function |
|
a GstGLContext |
|
the GstAllocationParams for wrapped_data . [allow-none]
|
|
the GstVideoInfo for wrapped_data
|
|
the video plane wrapped_data represents |
|
any GstVideoAlignment applied to symem mappings of wrapped_data . [allow-none]
|
|
the GstGLTextureTarget |
|
the optional data pointer to wrap. [allow-none] |
|
the optional OpenGL handle to wrap or 0 |
|
user data to call notify with. [allow-none]
|
|
a GDestroyNotify. [allow-none] |
Returns : |
initializes params with the parameters specified |
Since 1.8
GstGLVideoAllocationParams * gst_gl_video_allocation_params_new (GstGLContext *context
,GstAllocationParams *alloc_params
,GstVideoInfo *v_info
,guint plane
,GstVideoAlignment *valign
,GstGLTextureTarget target
);
|
a GstGLContext |
|
the GstAllocationParams for wrapped_data . [allow-none]
|
|
the GstVideoInfo for wrapped_data
|
|
the video plane wrapped_data represents |
|
any GstVideoAlignment applied to symem mappings of wrapped_data . [allow-none]
|
|
the GstGLTextureTarget for wrapped_data
|
Returns : |
a new GstGLVideoAllocationParams for allocating GstGLMemory's |
Since 1.8
GstGLVideoAllocationParams * 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
,gpointer user_data
,GDestroyNotify notify
);
|
a GstGLContext |
|
the GstAllocationParams for wrapped_data . [allow-none]
|
|
the GstVideoInfo for wrapped_data
|
|
the video plane wrapped_data represents |
|
any GstVideoAlignment applied to symem mappings of wrapped_data . [allow-none]
|
|
the GstGLTextureTarget for wrapped_data
|
|
the data pointer to wrap |
|
user data to call notify with. [allow-none]
|
|
a GDestroyNotify. [allow-none] |
Returns : |
a new GstGLVideoAllocationParams for wrapping wrapped_data
|
Since 1.8
GstGLVideoAllocationParams * 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
,gpointer user_data
,GDestroyNotify notify
);
|
a GstGLContext |
|
the GstAllocationParams for tex_id . [allow-none]
|
|
the GstVideoInfo for tex_id
|
|
the video plane tex_id represents |
|
any GstVideoAlignment applied to symem mappings of tex_id . [allow-none]
|
|
the GstGLTextureTarget for tex_id
|
|
the GL texture to wrap |
|
user data to call notify with. [allow-none]
|
|
a GDestroyNotify. [allow-none] |
Returns : |
a new GstGLVideoAllocationParams for wrapping tex_id
|
Since 1.8
typedef struct _GstGLMemoryAllocator GstGLMemoryAllocator;
Opaque GstGLMemoryAllocator struct
typedef struct { GstGLBaseMemoryAllocatorClass parent_class; GstGLBaseMemoryAllocatorMapFunction map; GstGLBaseMemoryAllocatorCopyFunction copy; GstGLBaseMemoryAllocatorUnmapFunction unmap; } GstGLMemoryAllocatorClass;
The GstGLMemoryAllocatorClass only contains private data
GstGLMemoryAllocator * gst_gl_memory_allocator_get_default
(GstGLContext *context
);
|
a GstGLContext |
Returns : |
the default GstGLMemoryAllocator supported by context
|
Since 1.8
void gst_gl_memory_init_once (void
);
Initializes the GL Base Texture allocator. It is safe to call this function multiple times. This must be called before any other GstGLMemory operation.
Since 1.4
typedef struct { GstGLBaseMemory mem; guint tex_id; GstGLTextureTarget tex_target; GstVideoGLTextureType tex_type; GstVideoInfo info; GstVideoAlignment valign; guint plane; gfloat tex_scaling[2]; } GstGLMemory;
Represents information about a GL texture
GstGLBaseMemory |
the parent object |
the GL texture id for this memory | |
GstGLTextureTarget |
the GL texture target for this memory |
the texture type | |
the texture's GstVideoInfo | |
data alignment for system memory mapping | |
data plane in info
|
|
GL shader scaling parameters for valign and/or width/height |
void gst_gl_memory_init (GstGLMemory *mem
,GstAllocator *allocator
,GstMemory *parent
,GstGLContext *context
,GstGLTextureTarget target
,GstAllocationParams *params
,GstVideoInfo *info
,guint plane
,GstVideoAlignment *valign
,gpointer user_data
,GDestroyNotify notify
);
Initializes mem
with the required parameters. info
is assumed to have
already have been modified with gst_video_info_align()
.
|
the GstGLBaseMemory to initialize |
|
the GstAllocator to initialize with |
|
the parent GstMemory to initialize with. [allow-none] |
|
the GstGLContext to initialize with |
|
the GstGLTextureTarget for this GstGLMemory |
|
the GstAllocationParams to initialize with. [allow-none]
|
|
the GstVideoInfo for this GstGLMemory |
|
the plane number (starting from 0) for this GstGLMemory |
|
optional GstVideoAlignment parameters. [allow-none] |
|
a GDestroyNotify. [allow-none] |
|
user data to call notify with. [allow-none]
|
Since 1.8
gboolean gst_is_gl_memory (GstMemory *mem
);
|
a GstMemory |
Returns : |
whether the memory at mem is a GstGLMemory
|
Since 1.4
#define GST_GL_MEMORY_ALLOCATOR_NAME "GLMemory"
The name of the GL memory allocator
gboolean gst_gl_memory_copy_into (GstGLMemory *gl_mem
,guint tex_id
,GstGLTextureTarget target
,GstVideoGLTextureType tex_type
,gint width
,gint height
);
Copies gl_mem
into the texture specfified by tex_id
. The format of tex_id
is specified by tex_type
, width
and height
.
|
a GstGLMemory |
|
OpenGL texture id |
|
the GstGLTextureTarget |
|
the GstVideoGLTextureType |
|
width of tex_id
|
|
height of tex_id
|
Returns : |
Whether the copy suceeded |
Since 1.8
gboolean gst_gl_memory_copy_teximage (GstGLMemory *src
,guint tex_id
,GstGLTextureTarget out_target
,GstVideoGLTextureType out_tex_type
,gint width
,gint height
);
gboolean gst_gl_memory_read_pixels (GstGLMemory *gl_mem
,gpointer read_pointer
);
Reads the texture in GstGLMemory into read_pointer
if no buffer is bound
to GL_PIXEL_PACK_BUFFER
. Otherwise read_pointer
is the byte offset into
the currently bound GL_PIXEL_PACK_BUFFER
buffer to store the result of
glReadPixels. See the OpenGL specification for glReadPixels for more
details.
|
a GstGLMemory |
|
the data pointer to pass to glReadPixels |
Returns : |
whether theread operation succeeded |
Since 1.8
void gst_gl_memory_texsubimage (GstGLMemory *gl_mem
,gpointer read_pointer
);
See gst_gl_memory_read_pixels()
for what read_pointer
signifies.
|
a GstGLMemory |
|
the data pointer to pass to glTexSubImage |
Since 1.8
gint gst_gl_memory_get_texture_height (GstGLMemory *gl_mem
);
|
a GstGLMemory |
Returns : |
the texture height of gl_mem
|
Since 1.8
guint gst_gl_memory_get_texture_id (GstGLMemory *gl_mem
);
|
a GstGLMemory |
Returns : |
the OpenGL texture handle of gl_mem
|
Since 1.8
GstGLTextureTarget gst_gl_memory_get_texture_target (GstGLMemory *gl_mem
);
|
a GstGLMemory |
Returns : |
the GstGLTextureTarget of gl_mem
|
Since 1.8
GstVideoGLTextureType gst_gl_memory_get_texture_type (GstGLMemory *gl_mem
);
|
a GstGLMemory |
Returns : |
the GstVideoGLTextureType of gl_mem
|
Since 1.8
gint gst_gl_memory_get_texture_width (GstGLMemory *gl_mem
);
|
a GstGLMemory |
Returns : |
the texture width of gl_mem
|
Since 1.8
gboolean gst_gl_memory_setup_buffer (GstGLMemoryAllocator *allocator
,GstBuffer *buffer
,GstGLVideoAllocationParams *params
);
|
the GstGLMemoryAllocator to allocate from |
|
a GstBuffer to setup |
|
the GstGLVideoAllocationParams to allocate with |
Returns : |
whether the buffer was correctly setup |
Since 1.8