gst-libs: gl: Fix documentation typo and clarify gl_memory_texsubimage

`gst_gl_memory_read_pixels` reads pixels from `GLMemory` into the
pointer, effectively writing to it. This is opposite from
`gst_gl_memory_texsubimage` which reads texture data from `read_pointer`
into `GLMemory`.

Both cases are clarified by changing `read_pointer` to `write_pointer`,
and explaining what `gst_gl_memory_texsubimage` does in addition to
referring back to `gst_gl_memory_read_pixels`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/806>
This commit is contained in:
Marijn Suijten 2020-09-03 21:19:29 +02:00 committed by GStreamer Merge Bot
parent 1208d4e635
commit 0ea3279df1
4 changed files with 12 additions and 10 deletions

View file

@ -360,10 +360,10 @@ gst_gl_memory_init (GstGLMemory * mem, GstAllocator * allocator,
/**
* gst_gl_memory_read_pixels:
* @gl_mem: a #GstGLMemory
* @read_pointer: the data pointer to pass to glReadPixels
* @write_pointer: the data pointer to pass to glReadPixels
*
* 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
* Reads the texture in #GstGLMemory into @write_pointer if no buffer is bound
* to `GL_PIXEL_PACK_BUFFER`. Otherwise @write_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.
@ -373,7 +373,7 @@ gst_gl_memory_init (GstGLMemory * mem, GstAllocator * allocator,
* Since: 1.8
*/
gboolean
gst_gl_memory_read_pixels (GstGLMemory * gl_mem, gpointer read_pointer)
gst_gl_memory_read_pixels (GstGLMemory * gl_mem, gpointer write_pointer)
{
GstGLContext *context = gl_mem->mem.context;
const GstGLFuncs *gl = context->gl_vtable;
@ -419,7 +419,7 @@ gst_gl_memory_read_pixels (GstGLMemory * gl_mem, gpointer read_pointer)
_gst_gl_memory_start_log (gl_mem, "glReadPixels");
gl->ReadPixels (0, 0, gl_mem->tex_width, GL_MEM_HEIGHT (gl_mem), format,
type, read_pointer);
type, write_pointer);
_gst_gl_memory_end_log (gl_mem);
gl->BindFramebuffer (GL_FRAMEBUFFER, 0);
@ -518,6 +518,8 @@ _upload_cpu_write (GstGLMemory * gl_mem, GstMapInfo * info, gsize maxsize)
* @gl_mem: a #GstGLMemory
* @read_pointer: the data pointer to pass to glTexSubImage
*
* Reads the texture in @read_pointer into @gl_mem.
*
* See gst_gl_memory_read_pixels() for what @read_pointer signifies.
*
* Since: 1.8
@ -982,7 +984,7 @@ gst_gl_memory_allocator_init (GstGLMemoryAllocator * allocator)
* @width: width of @tex_id
* @height: height of @tex_id
*
* Copies @gl_mem into the texture specfified by @tex_id. The format of @tex_id
* Copies @gl_mem into the texture specified by @tex_id. The format of @tex_id
* is specified by @tex_format, @width and @height.
*
* Returns: Whether the copy succeeded

View file

@ -285,7 +285,7 @@ gboolean gst_gl_memory_copy_teximage (GstGLMemory * src,
GST_GL_API
gboolean gst_gl_memory_read_pixels (GstGLMemory * gl_mem,
gpointer read_pointer);
gpointer write_pointer);
GST_GL_API
void gst_gl_memory_texsubimage (GstGLMemory * gl_mem,
gpointer read_pointer);

View file

@ -701,7 +701,7 @@ gst_gl_memory_pbo_allocator_init (GstGLMemoryPBOAllocator * allocator)
* @stride: stride of the backing texture data
* @respecify: whether to copy the data or copy per texel
*
* Copies @gl_mem into the texture specfified by @tex_id. The format of @tex_id
* Copies @gl_mem into the texture specified by @tex_id. The format of @tex_id
* is specified by @tex_format, @width and @height.
*
* If @respecify is %TRUE, then the copy is performed in terms of the texture

View file

@ -411,7 +411,7 @@ gst_video_color_matrix_get_Kr_Kb (GstVideoColorMatrix matrix, gdouble * Kr,
* Depending on @func, different formulas might be applied. Some formulas
* encode a linear segment in the lower range.
*
* Returns: the gamme encoded value of @val
* Returns: the gamma encoded value of @val
*
* Since: 1.6
*/
@ -529,7 +529,7 @@ gst_video_color_transfer_encode (GstVideoTransferFunction func, gdouble val)
* Depending on @func, different formulas might be applied. Some formulas
* encode a linear segment in the lower range.
*
* Returns: the gamme decoded value of @val
* Returns: the gamma decoded value of @val
*
* Since: 1.6
*/