summaryrefslogtreecommitdiff
path: root/gst-libs/gst/gl
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2017-07-28 11:00:12 +0100
committerMatthew Waters <matthew@centricular.com>2017-07-28 11:00:12 +0100
commit3d2785965d19a7e71b41e285af06ec44e9df4b17 (patch)
treec23c04312d156e3c19e4b305294869b59a8fc0b9 /gst-libs/gst/gl
parent23da53306f1a2aee03adc3cdf887b54d842c86ee (diff)
gl/docs: some documentation updates
Add some missing/incomplete docs
Diffstat (limited to 'gst-libs/gst/gl')
-rw-r--r--gst-libs/gst/gl/egl/gsteglimage.h8
-rw-r--r--gst-libs/gst/gl/gstglapi.c2
-rw-r--r--gst-libs/gst/gl/gstglbasememory.c10
-rw-r--r--gst-libs/gst/gl/gstglbasememory.h31
-rw-r--r--gst-libs/gst/gl/gstglbuffer.h10
-rw-r--r--gst-libs/gst/gl/gstglcontext.c6
-rw-r--r--gst-libs/gst/gl/gstglcontext.h7
-rw-r--r--gst-libs/gst/gl/gstgldisplay.h6
-rw-r--r--gst-libs/gst/gl/gstglfilter.c3
-rw-r--r--gst-libs/gst/gl/gstglframebuffer.c2
-rw-r--r--gst-libs/gst/gl/gstglmemory.c2
-rw-r--r--gst-libs/gst/gl/gstglmemory.h17
-rw-r--r--gst-libs/gst/gl/gstglmemorypbo.h2
-rw-r--r--gst-libs/gst/gl/gstglsl.c69
-rw-r--r--gst-libs/gst/gl/gstglsl.h7
-rw-r--r--gst-libs/gst/gl/gstglupload.h1
-rw-r--r--gst-libs/gst/gl/gstglwindow.h19
17 files changed, 195 insertions, 7 deletions
diff --git a/gst-libs/gst/gl/egl/gsteglimage.h b/gst-libs/gst/gl/egl/gsteglimage.h
index 56ec7e1c0..327709d47 100644
--- a/gst-libs/gst/gl/egl/gsteglimage.h
+++ b/gst-libs/gst/gl/egl/gsteglimage.h
@@ -39,6 +39,14 @@ GType gst_egl_image_get_type (void);
typedef struct _GstEGLImage GstEGLImage;
+/**
+ * GstEGLImageDestroyNotify:
+ * @image: a #GstEGLImage
+ * @data: user data passed to gst_egl_image_new_wrapped()
+ *
+ * Function to be called when the GstEGLImage is destroyed. It should free
+ * the associated #EGLImage if necessary
+ */
typedef void (*GstEGLImageDestroyNotify) (GstEGLImage * image,
gpointer data);
diff --git a/gst-libs/gst/gl/gstglapi.c b/gst-libs/gst/gl/gstglapi.c
index bfa1c9ae2..6960a5545 100644
--- a/gst-libs/gst/gl/gstglapi.c
+++ b/gst-libs/gst/gl/gstglapi.c
@@ -20,7 +20,7 @@
/**
* SECTION:gstglapi
- * @title: GstGLApi
+ * @title: GstGLAPI
* @short_description: OpenGL API specific functionality
* @see_also: #GstGLDisplay, #GstGLContext
*
diff --git a/gst-libs/gst/gl/gstglbasememory.c b/gst-libs/gst/gl/gstglbasememory.c
index 9e89f45fa..d7bd88cb1 100644
--- a/gst-libs/gst/gl/gstglbasememory.c
+++ b/gst-libs/gst/gl/gstglbasememory.c
@@ -192,6 +192,16 @@ _align_data (gpointer data, gsize align)
}
/* subclass usage only */
+/**
+ * gst_gl_base_memory_alloc_data:
+ * @gl_mem: a #GstGLBaseMemory
+ *
+ * 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.
+ *
+ * Returns: whether the system memory could be allocated
+ */
gboolean
gst_gl_base_memory_alloc_data (GstGLBaseMemory * gl_mem)
{
diff --git a/gst-libs/gst/gl/gstglbasememory.h b/gst-libs/gst/gl/gstglbasememory.h
index 6bdadf78b..7f9e2265b 100644
--- a/gst-libs/gst/gl/gstglbasememory.h
+++ b/gst-libs/gst/gl/gstglbasememory.h
@@ -29,6 +29,12 @@
G_BEGIN_DECLS
+/**
+ * GST_GL_BASE_MEMORY_ERROR:
+ *
+ * Error domain for GStreamer's GL memory module. Errors in this domain will be
+ * from the #GstGLBaseMemoryError enumeration
+ */
#define GST_TYPE_GL_BASE_MEMORY (gst_gl_base_memory_get_type())
GST_EXPORT
GType gst_gl_base_memory_get_type(void);
@@ -145,9 +151,34 @@ typedef void (*GstGLAllocationParamsFreeFunc) (gpointer params);
GST_EXPORT
GType gst_gl_allocation_params_get_type (void);
+/**
+ * GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_ALLOC:
+ *
+ * GL Allocation flag indicating that the implementation should allocate the
+ * necessary resources.
+ */
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_ALLOC (1 << 0)
+
+/**
+ * GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_SYSMEM:
+ *
+ * GL Allocation flag for using the provided system memory data as storage.
+ */
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_SYSMEM (1 << 1)
+
+/**
+ * GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE:
+ *
+ * GL Allocation flag for using the provided GPU handle as storage.
+ */
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE (1 << 2)
+
+/**
+ * GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_USER:
+ *
+ * Values >= than #GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_USER can be used for
+ * user-defined purposes.
+ */
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_USER (1 << 16)
/**
diff --git a/gst-libs/gst/gl/gstglbuffer.h b/gst-libs/gst/gl/gstglbuffer.h
index 01deb8a8c..90f8eb260 100644
--- a/gst-libs/gst/gl/gstglbuffer.h
+++ b/gst-libs/gst/gl/gstglbuffer.h
@@ -64,6 +64,11 @@ typedef struct _GstGLBufferAllocationParams GstGLBufferAllocationParams;
GST_EXPORT
GType gst_gl_buffer_allocation_params_get_type (void);
+/**
+ * GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_BUFFER:
+ *
+ * GL allocation flag indicating the allocation of a GL buffer.
+ */
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_BUFFER (1 << 4)
/**
@@ -116,6 +121,11 @@ struct _GstGLBufferAllocatorClass
gpointer _padding[GST_PADDING];
};
+/**
+ * GST_CAPS_FEATURE_MEMORY_GL_BUFFER:
+ *
+ * Name of the caps feature indicating the use of GL buffers
+ */
#define GST_CAPS_FEATURE_MEMORY_GL_BUFFER "memory:GLBuffer"
/**
diff --git a/gst-libs/gst/gl/gstglcontext.c b/gst-libs/gst/gl/gstglcontext.c
index db35dc7bc..aed46185e 100644
--- a/gst-libs/gst/gl/gstglcontext.c
+++ b/gst-libs/gst/gl/gstglcontext.c
@@ -838,7 +838,11 @@ gst_gl_context_get_gl_api (GstGLContext * context)
* Note: On success, you need to cast the returned function pointer to the
* correct type to be able to call it correctly. On 32-bit Windows, this will
* include the %GSTGLAPI identifier to use the correct calling convention.
- * e.g. void (GSTGLAPI *PFN_glGetIntegerv) (GLenum name, GLint * ret)
+ * e.g.
+ *
+ * |[<!-- language="C" -->
+ * void (GSTGLAPI *PFN_glGetIntegerv) (GLenum name, GLint * ret)
+ * ]|
*
* Returns: a function pointer or %NULL
*
diff --git a/gst-libs/gst/gl/gstglcontext.h b/gst-libs/gst/gl/gstglcontext.h
index 031b61287..53ed34e75 100644
--- a/gst-libs/gst/gl/gstglcontext.h
+++ b/gst-libs/gst/gl/gstglcontext.h
@@ -43,6 +43,13 @@ GType gst_gl_context_get_type (void);
GST_EXPORT
GQuark gst_gl_context_error_quark (void);
+
+/**
+ * GST_GL_CONTEXT_ERROR:
+ *
+ * Error domain for GStreamer's GL context module. Errors in this domain will
+ * be from the #GstGLContextError enumeration
+ */
#define GST_GL_CONTEXT_ERROR (gst_gl_context_error_quark ())
/**
diff --git a/gst-libs/gst/gl/gstgldisplay.h b/gst-libs/gst/gl/gstgldisplay.h
index deac9dfe4..66165a9ec 100644
--- a/gst-libs/gst/gl/gstgldisplay.h
+++ b/gst-libs/gst/gl/gstgldisplay.h
@@ -50,6 +50,7 @@ GType gst_gl_display_get_type (void);
* @GST_GL_DISPLAY_TYPE_WIN32: Win32 display
* @GST_GL_DISPLAY_TYPE_DISPMANX: Dispmanx display
* @GST_GL_DISPLAY_TYPE_EGL: EGL display
+ * @GST_GL_DISPLAY_TYPE_VIV_FB: Vivante Framebuffer display
* @GST_GL_DISPLAY_TYPE_ANY: any display type
*/
typedef enum
@@ -117,6 +118,11 @@ GstGLAPI gst_gl_display_get_gl_api (GstGLDisplay * display);
GST_EXPORT
GstGLAPI gst_gl_display_get_gl_api_unlocked (GstGLDisplay * display);
+/**
+ * GST_GL_DISPLAY_CONTEXT_TYPE:
+ *
+ * The name used in #GstContext queries for requesting a #GstGLDisplay
+ */
#define GST_GL_DISPLAY_CONTEXT_TYPE "gst.gl.GLDisplay"
GST_EXPORT
void gst_context_set_gl_display (GstContext * context, GstGLDisplay * display);
diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c
index dd46aba4f..77b3e999d 100644
--- a/gst-libs/gst/gl/gstglfilter.c
+++ b/gst-libs/gst/gl/gstglfilter.c
@@ -896,8 +896,7 @@ gst_gl_filter_decide_allocation (GstBaseTransform * trans, GstQuery * query)
* @inbuf: an input buffer
* @outbuf: an output buffer
*
- * Perform automatic upload if needed, call filter_texture vfunc and then an
- * automatic download if needed.
+ * Calls filter_texture vfunc with correctly mapped #GstGLMemorys
*
* Returns: whether the transformation succeeded
*
diff --git a/gst-libs/gst/gl/gstglframebuffer.c b/gst-libs/gst/gl/gstglframebuffer.c
index 40188dc21..2e1c3bc85 100644
--- a/gst-libs/gst/gl/gstglframebuffer.c
+++ b/gst-libs/gst/gl/gstglframebuffer.c
@@ -509,6 +509,8 @@ gst_gl_framebuffer_get_effective_dimensions (GstGLFramebuffer * fb,
/**
* gst_gl_context_check_framebuffer_status:
* @context: a #GstGLContext
+ * @fbo_target: the GL value of the framebuffer target, GL_FRAMEBUFFER,
+ * GL_READ_FRAMEBUFFER, GL_DRAW_FRAMEBUFFER
*
* Returns: whether whether the current framebuffer is complete
*
diff --git a/gst-libs/gst/gl/gstglmemory.c b/gst-libs/gst/gl/gstglmemory.c
index 812367293..aba40ef1e 100644
--- a/gst-libs/gst/gl/gstglmemory.c
+++ b/gst-libs/gst/gl/gstglmemory.c
@@ -618,7 +618,7 @@ _gl_tex_unmap (GstGLMemory * gl_mem, GstMapInfo * info)
}
/**
- * gst_gl_memory_copy_texiamge:
+ * gst_gl_memory_copy_teximage:
* @gl_mem: the source #GstGLMemory
* @tex_id: the destination texture id
* @out_target: the destination #GstGLTextureTarget
diff --git a/gst-libs/gst/gl/gstglmemory.h b/gst-libs/gst/gl/gstglmemory.h
index c7de5c78c..3a4bf9f9c 100644
--- a/gst-libs/gst/gl/gstglmemory.h
+++ b/gst-libs/gst/gl/gstglmemory.h
@@ -43,7 +43,17 @@ GType gst_gl_memory_allocator_get_type(void);
#define GST_GL_MEMORY_CAST(obj) ((GstGLMemory *) obj)
+/**
+ * GST_CAPS_FEATURE_MEMORY_GL_MEMORY:
+ *
+ * Name of the caps feature for indicating the use of #GstGLMemory
+ */
#define GST_CAPS_FEATURE_MEMORY_GL_MEMORY "memory:GLMemory"
+/**
+ * GST_GL_MEMORY_VIDEO_FORMATS_STR:
+ *
+ * List of video formats that are supported by #GstGLMemory
+ */
#define GST_GL_MEMORY_VIDEO_FORMATS_STR \
"{ RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, " \
"AYUV, I420, YV12, NV12, NV21, YUY2, UYVY, Y41B, Y42B, Y444, " \
@@ -90,6 +100,11 @@ GType gst_gl_video_allocation_params_get_type (void);
typedef struct _GstGLVideoAllocationParams GstGLVideoAllocationParams;
+/**
+ * GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_VIDEO:
+ *
+ * GL allocation flag indicating the allocation of 2D video frames
+ */
#define GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_VIDEO (1 << 3)
/**
@@ -99,7 +114,7 @@ typedef struct _GstGLVideoAllocationParams GstGLVideoAllocationParams;
* @plane: the video plane index to allocate
* @valign: the #GstVideoAlignment to align the system representation to (may be %NULL for the default)
* @target: the #GstGLTextureTarget to allocate
- * @tex_fomrat: the #GstGLFormat to allocate
+ * @tex_format: the #GstGLFormat to allocate
*/
struct _GstGLVideoAllocationParams
{
diff --git a/gst-libs/gst/gl/gstglmemorypbo.h b/gst-libs/gst/gl/gstglmemorypbo.h
index f8d9ed0e7..77eff7b95 100644
--- a/gst-libs/gst/gl/gstglmemorypbo.h
+++ b/gst-libs/gst/gl/gstglmemorypbo.h
@@ -58,7 +58,7 @@ struct _GstGLMemoryPBO
};
/**
- * GST_GL_MEMORY_PBO_ALLOCATOR:
+ * GST_GL_MEMORY_PBO_ALLOCATOR_NAME:
*
* The name of the GL Memory PBO allocator
*/
diff --git a/gst-libs/gst/gl/gstglsl.c b/gst-libs/gst/gl/gstglsl.c
index 78fc45d83..81226260f 100644
--- a/gst-libs/gst/gl/gstglsl.c
+++ b/gst-libs/gst/gl/gstglsl.c
@@ -94,6 +94,12 @@ static const struct glsl_profile_string glsl_profiles[] = {
{GST_GLSL_PROFILE_COMPATIBILITY, "compatibility"},
};
+/**
+ * gst_glsl_version_to_string:
+ * @version: a #GstGLSLVersion
+ *
+ * Returns: (nullable): the name of @version or %NULL on error
+ */
const gchar *
gst_glsl_version_to_string (GstGLSLVersion version)
{
@@ -110,6 +116,12 @@ gst_glsl_version_to_string (GstGLSLVersion version)
return NULL;
}
+/**
+ * gst_glsl_version_from_string:
+ * @string: a GLSL version string
+ *
+ * Returns: the #GstGLSLVersion of @string or %GST_GLSL_VERSION_NONE on error
+ */
GstGLSLVersion
gst_glsl_version_from_string (const gchar * string)
{
@@ -133,6 +145,12 @@ gst_glsl_version_from_string (const gchar * string)
return 0;
}
+/**
+ * gst_glsl_profile_to_string:
+ * @profile: a #GstGLSLProfile
+ *
+ * Returns: (nullable): the name for @profile or %NULL on error
+ */
const gchar *
gst_glsl_profile_to_string (GstGLSLProfile profile)
{
@@ -153,6 +171,12 @@ gst_glsl_profile_to_string (GstGLSLProfile profile)
return NULL;
}
+/**
+ * gst_glsl_profile_from_string:
+ * @string: a GLSL version string
+ *
+ * Returns: the #GstGLSLProfile of @string or %GST_GLSL_PROFILE_NONE on error
+ */
GstGLSLProfile
gst_glsl_profile_from_string (const gchar * string)
{
@@ -203,6 +227,13 @@ _is_valid_version_profile (GstGLSLVersion version, GstGLSLProfile profile)
return FALSE;
}
+/**
+ * gst_glsl_version_profile_to_string:
+ * @version: a #GstGLSLVersion
+ * @profile: a #GstGLSLVersion
+ *
+ * Returns: the combined GLSL #version string for @version and @profile
+ */
gchar *
gst_glsl_version_profile_to_string (GstGLSLVersion version,
GstGLSLProfile profile)
@@ -262,6 +293,17 @@ _check_valid_version_preprocessor_string (const gchar * str)
return NULL;
}
+/**
+ * gst_glsl_version_profile_from_string:
+ * @string: a valid GLSL #version string
+ * @version_ret: (out): resulting #GstGLSLVersion
+ * @profile_ret: (out): resulting #GstGLSLVersion
+ *
+ * Note: this function expects either a #version GLSL preprocesser directive
+ * or a valid GLSL version and/or profile.
+ *
+ * Returns: TRUE if a valid #version string was found, FALSE otherwise
+ */
gboolean
gst_glsl_version_profile_from_string (const gchar * string,
GstGLSLVersion * version_ret, GstGLSLProfile * profile_ret)
@@ -417,6 +459,17 @@ _gst_glsl_shader_string_find_version (const gchar * str)
return NULL;
}
+/**
+ * gst_glsl_string_get_version_profile:
+ * @s: string to search for a valid #version string
+ * @version: (out): resulting #GstGLSLVersion
+ * @profile: (out): resulting #GstGLSLProfile
+ *
+ * Note: this function first searches the first 1 kilobytes for a #version
+ * preprocessor directive and then executes gst_glsl_version_profile_from_string().
+ *
+ * Returns: TRUE if a valid #version string was found, FALSE otherwise
+ */
gboolean
gst_glsl_string_get_version_profile (const gchar * s, GstGLSLVersion * version,
GstGLSLProfile * profile)
@@ -443,6 +496,14 @@ error:
}
}
+/**
+ * gst_gl_version_to_glsl_version:
+ * @gl_api: the #GstGLAPI
+ * @maj: the major GL version
+ * @min: the minor GL version
+ *
+ * Returns: The minimum supported #GstGLSLVersion available for @gl_api, @maj and @min
+ */
GstGLSLVersion
gst_gl_version_to_glsl_version (GstGLAPI gl_api, gint maj, gint min)
{
@@ -485,6 +546,14 @@ gst_gl_version_to_glsl_version (GstGLAPI gl_api, gint maj, gint min)
return 0;
}
+/**
+ * gst_gl_context_supports_glsl_profile_version:
+ * @context: a #GstGLContext
+ * @version: a #GstGLSLVersion
+ * @profile: a #GstGLSLProfile
+ *
+ * Returns: Whether @context supports the combination of @version with @profile
+ */
gboolean
gst_gl_context_supports_glsl_profile_version (GstGLContext * context,
GstGLSLVersion version, GstGLSLProfile profile)
diff --git a/gst-libs/gst/gl/gstglsl.h b/gst-libs/gst/gl/gstglsl.h
index 42de2b9b4..af837fd94 100644
--- a/gst-libs/gst/gl/gstglsl.h
+++ b/gst-libs/gst/gl/gstglsl.h
@@ -27,6 +27,13 @@ G_BEGIN_DECLS
GST_EXPORT
GQuark gst_glsl_error_quark (void);
+
+/**
+ * GST_GLSL_ERROR:
+ *
+ * Error domain for GStreamer's GLSL module. Errors in this domain will be
+ * from the #GstGLSLError enumeration
+ */
#define GST_GLSL_ERROR (gst_glsl_error_quark ())
/**
diff --git a/gst-libs/gst/gl/gstglupload.h b/gst-libs/gst/gl/gstglupload.h
index 7b94929a1..c672fe5e0 100644
--- a/gst-libs/gst/gl/gstglupload.h
+++ b/gst-libs/gst/gl/gstglupload.h
@@ -41,6 +41,7 @@ GType gst_gl_upload_get_type (void);
* @GST_GL_UPLOAD_DONE: No further processing required
* @GST_GL_UPLOAD_ERROR: An unspecified error occured
* @GST_GL_UPLOAD_UNSUPPORTED: The configuration is unsupported.
+ * @GST_GL_UPLOAD_RECONFIGURE: This element requires a reconfiguration.
*/
typedef enum
{
diff --git a/gst-libs/gst/gl/gstglwindow.h b/gst-libs/gst/gl/gstglwindow.h
index 5d7ced417..fccb0cff9 100644
--- a/gst-libs/gst/gl/gstglwindow.h
+++ b/gst-libs/gst/gl/gstglwindow.h
@@ -50,6 +50,12 @@ GType gst_gl_window_get_type (void);
GST_EXPORT
GQuark gst_gl_window_error_quark (void);
+/**
+ * GST_GL_WINDOW_ERROR:
+ *
+ * Error domain for GStreamer's GL window module. Errors in this domain will be
+ * from the #GstGLWindowError enumeration
+ */
#define GST_GL_WINDOW_ERROR (gst_gl_window_error_quark ())
/**
@@ -68,7 +74,20 @@ typedef enum
typedef void (*GstGLWindowCB) (gpointer data);
typedef void (*GstGLWindowResizeCB) (gpointer data, guint width, guint height);
+/**
+ * GST_GL_WINDOW_CB:
+ * @f: the function to cast
+ *
+ * Cast to the currect function type for generic window callbacks
+ */
#define GST_GL_WINDOW_CB(f) ((GstGLWindowCB) (f))
+
+/**
+ * GST_GL_WINDOW_RESIZE_CB:
+ * @f: the function to cast
+ *
+ * Cast to the currect function type for window resize callbacks
+ */
#define GST_GL_WINDOW_RESIZE_CB(f) ((GstGLWindowResizeCB) (f))
/**