platform/upstream/gst-plugins-base.git
6 years agoglimagesink: Remove unused variable
Sebastian Dröge [Tue, 17 Nov 2015 15:17:50 +0000 (17:17 +0200)]
glimagesink: Remove unused variable

gstglimagesink.c: In function 'gst_glimage_sink_on_draw':
gstglimagesink.c:1959:18: error: unused variable 'sync_meta' [-Werror=unused-variable]
   GstGLSyncMeta *sync_meta = NULL;
                  ^

6 years agoglviewconvert: String literals are const
Sebastian Dröge [Tue, 17 Nov 2015 15:09:51 +0000 (17:09 +0200)]
glviewconvert: String literals are const

gstglviewconvert.c: In function '_mangle_extensions':
gstglviewconvert.c:1511:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
     ext_str = "#extension GL_OES_EGL_image_external : require\n";
             ^

6 years agoglsyncmeta: Actually return the newly created meta from gst_buffer_add_gl_sync_meta()
Sebastian Dröge [Tue, 17 Nov 2015 15:08:14 +0000 (17:08 +0200)]
glsyncmeta: Actually return the newly created meta from gst_buffer_add_gl_sync_meta()

gstglsyncmeta.c  -fPIC -DPIC -o .libs/libgstgl_1.0_la-gstglsyncmeta.o
gstglsyncmeta.c: In function 'gst_buffer_add_gl_sync_meta':
gstglsyncmeta.c:131:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^

6 years agoglimagesink: wait on the correct sync meta when rendering
Matthew Waters [Mon, 16 Nov 2015 04:46:41 +0000 (15:46 +1100)]
glimagesink: wait on the correct sync meta when rendering

6 years agoglsyncmeta: add vfuncs for all operations
Matthew Waters [Mon, 2 Nov 2015 06:57:29 +0000 (17:57 +1100)]
glsyncmeta: add vfuncs for all operations

there could be other ways/requirements for synchronising two GPU command
streams (whether GL or platform specific).

e.g. glfencesync/eglwaitnative/cond/etc

6 years agoglimagesink: add support for rendering external-oes textures
Matthew Waters [Tue, 10 Nov 2015 04:37:05 +0000 (15:37 +1100)]
glimagesink: add support for rendering external-oes textures

https://bugzilla.gnome.org/show_bug.cgi?id=757285

6 years agoglviewconvert: add support rectangle/external-oes textures
Matthew Waters [Tue, 10 Nov 2015 03:54:02 +0000 (14:54 +1100)]
glviewconvert: add support rectangle/external-oes textures

https://bugzilla.gnome.org/show_bug.cgi?id=757285

6 years agoglimagesink: Fix structure memory leak
Vineeth TM [Tue, 17 Nov 2015 00:08:52 +0000 (09:08 +0900)]
glimagesink: Fix structure memory leak

https://bugzilla.gnome.org/show_bug.cgi?id=758205

6 years agoglsl: fix possible string overrun in gst_glsl_version_profile_from_string
Vineeth TM [Fri, 13 Nov 2015 01:41:58 +0000 (10:41 +0900)]
glsl: fix possible string overrun in gst_glsl_version_profile_from_string

given a NULL-terminated string, s.
s[i] = '\0';
i++;
does not guarentee that s[i] is NULL terminated and thus string operations
could read off the end of the array.

https://bugzilla.gnome.org/show_bug.cgi?id=758039

6 years agoglshader: don't read invalid list pointers (use after free)
Matthew Waters [Fri, 13 Nov 2015 05:50:22 +0000 (16:50 +1100)]
glshader: don't read invalid list pointers (use after free)

gst_gl_shader_detach_unlocked already removes the list entry so attempting to
use the element to iterate to the next stage could read invalid data.

Based on patch by Vineeth TM <vineeth.tm@samsung.com>

https://bugzilla.gnome.org/show_bug.cgi?id=758039

6 years agotests:glsl: version_profile_s string leak
Vineeth TM [Fri, 13 Nov 2015 01:44:26 +0000 (10:44 +0900)]
tests:glsl: version_profile_s string leak

https://bugzilla.gnome.org/show_bug.cgi?id=758039

6 years agoglsl: free str while returning error
Vineeth TM [Fri, 13 Nov 2015 01:56:10 +0000 (10:56 +0900)]
glsl: free str while returning error

https://bugzilla.gnome.org/show_bug.cgi?id=758039

6 years agotests:glupload: fix caps memory leak
Vineeth TM [Fri, 13 Nov 2015 02:04:34 +0000 (11:04 +0900)]
tests:glupload: fix caps memory leak

https://bugzilla.gnome.org/show_bug.cgi?id=758039

6 years agoglslstage: Fix vertex_sources memory leak
Vineeth TM [Thu, 12 Nov 2015 07:36:03 +0000 (16:36 +0900)]
glslstage: Fix vertex_sources memory leak

vertex_sources is being allocated but not freed resulting in leak

https://bugzilla.gnome.org/show_bug.cgi?id=757974

6 years agoglcolorconvert: remove unnecessary free
Vineeth TM [Thu, 12 Nov 2015 07:26:00 +0000 (16:26 +0900)]
glcolorconvert: remove unnecessary free

version_str is already being freed. So no need to call again

https://bugzilla.gnome.org/show_bug.cgi?id=757974

6 years agoglcolorconvert: Fix string leak
Vineeth TM [Thu, 12 Nov 2015 07:18:35 +0000 (16:18 +0900)]
glcolorconvert: Fix string leak

String got using gst_glsl_version_profile_to_string, is allocated
memory and should be freed

https://bugzilla.gnome.org/show_bug.cgi?id=757974

6 years agoglcolorconvert: Fix frag_prog and frag_body memory leak
Vineeth TM [Thu, 12 Nov 2015 07:02:45 +0000 (16:02 +0900)]
glcolorconvert: Fix frag_prog and frag_body memory leak

https://bugzilla.gnome.org/show_bug.cgi?id=757974

6 years agoglcolorconvert: mangle gl_FragColor for GL3
Matthew Waters [Wed, 11 Nov 2015 12:39:35 +0000 (23:39 +1100)]
glcolorconvert: mangle gl_FragColor for GL3

Some drivers don't provide the compatibility definition and we need to provide
our own 'out vec4' variable to put the results of the fragment shader into.

https://bugzilla.gnome.org/show_bug.cgi?id=757938

6 years agotests:glcolorconvert: Fix caps memory leak
Vineeth TM [Wed, 11 Nov 2015 07:06:25 +0000 (16:06 +0900)]
tests:glcolorconvert: Fix caps memory leak

Output caps being got from video info is not getting freed

https://bugzilla.gnome.org/show_bug.cgi?id=757929

6 years agoglviewconvert: remove set_format
Matthew Waters [Tue, 10 Nov 2015 02:52:30 +0000 (13:52 +1100)]
glviewconvert: remove set_format

We need the caps to be able to
1. check the caps features
2. get the requested texture-target on input/output

6 years agoglimagesink: fix a memory leak if the view conversion fails
Matthew Waters [Tue, 10 Nov 2015 23:31:07 +0000 (10:31 +1100)]
glimagesink: fix a memory leak if the view conversion fails

6 years agoglimagesink: balance the creation/destruction of the overlay compositor
Matthew Waters [Wed, 11 Nov 2015 02:37:59 +0000 (13:37 +1100)]
glimagesink: balance the creation/destruction of the overlay compositor

Fixes some leaks/possible segfault on when failing to create the compositor.

6 years agoglshader: properly unref the stages on failure
Matthew Waters [Wed, 11 Nov 2015 01:23:30 +0000 (12:23 +1100)]
glshader: properly unref the stages on failure

When failing in the varargs functions, all the stage objects not handled need to
be unreffed to prevent a leak.

6 years agoglslstage: properly return an error when we could not create the shader stage
Matthew Waters [Wed, 11 Nov 2015 00:29:35 +0000 (11:29 +1100)]
glslstage: properly return an error when we could not create the shader stage

While it was erroring out correctly later, there were GLib warnings about
setting a GError over the top of another GError.

6 years agoglshaderstrings: fixup the external-oes fragment shader
Matthew Waters [Tue, 10 Nov 2015 14:05:20 +0000 (01:05 +1100)]
glshaderstrings: fixup the external-oes fragment shader

The wrong sampler type was used
s/sampler2DExternalOES/samplerExternalOES/

6 years agoglcolorconvert: try to keep the same texture-target if possible
Matthew Waters [Tue, 10 Nov 2015 12:41:24 +0000 (23:41 +1100)]
glcolorconvert: try to keep the same texture-target if possible

Fixes issues attempting to passthrough external-oes textures

6 years agoglcolorconvert: fix rendering rectangular textures with GL3
Matthew Waters [Tue, 10 Nov 2015 11:41:57 +0000 (22:41 +1100)]
glcolorconvert: fix rendering rectangular textures with GL3

Rectangular textures are unavailable in unextended
GLES2 #version 100 shaders.

Fixes
texture-target=rectangle ! glcolorconvert ! texture-target=2D

There's a couple of differences between GL3 and GLES2/GL

- varying -> in or out depending on the stage (vertex/fragment)
- attribute -> in
- filtered texture access is a single function, texture()

6 years agoglcolorconvert: properly use the other texture-target on fixation
Matthew Waters [Tue, 10 Nov 2015 09:20:29 +0000 (20:20 +1100)]
glcolorconvert: properly use the other texture-target on fixation

6 years agoglslstage: add debug as to why _set_strings() failed
Matthew Waters [Tue, 10 Nov 2015 09:15:56 +0000 (20:15 +1100)]
glslstage: add debug as to why _set_strings() failed

6 years agoglsl: fix check for glsl version against GL context inversion
Matthew Waters [Tue, 10 Nov 2015 09:13:53 +0000 (20:13 +1100)]
glsl: fix check for glsl version against GL context inversion

Any GLSL version that was less than the provided GL version would fail

6 years agogl: forward declare some enums
Matthew Waters [Tue, 10 Nov 2015 02:13:50 +0000 (13:13 +1100)]
gl: forward declare some enums

Specifically the GstGLTextureTarget enum

6 years agoglslstage: expose the default shader strings as public
Matthew Waters [Tue, 10 Nov 2015 02:11:37 +0000 (13:11 +1100)]
glslstage: expose the default shader strings as public

Add some other simple strings for external-oes textures or transforming
the texture coordinates with a transformation matrix

6 years agoglcolorconvert: wait on the sync meta for input buffers
Matthew Waters [Thu, 5 Nov 2015 16:05:31 +0000 (03:05 +1100)]
glcolorconvert: wait on the sync meta for input buffers

6 years agoglimagesink: wait on the provided sync meta provided to glimagesink
Matthew Waters [Wed, 4 Nov 2015 13:13:01 +0000 (00:13 +1100)]
glimagesink: wait on the provided sync meta provided to glimagesink

6 years agoglcolorconvert: use the correct oes target string in the template caps
Matthew Waters [Sun, 8 Nov 2015 11:14:01 +0000 (22:14 +1100)]
glcolorconvert: use the correct oes target string in the template caps

6 years agoglshader, tsdemux: simplify code
Tim-Philipp Müller [Fri, 6 Nov 2015 12:31:09 +0000 (12:31 +0000)]
glshader, tsdemux: simplify code

Jus use _delete_link() instead of _remove_link() + _free1()

6 years agoglmixerbin: fix minor leak
Tim-Philipp Müller [Fri, 6 Nov 2015 12:30:12 +0000 (12:30 +0000)]
glmixerbin: fix minor leak

Don't leak removed list node.

6 years agogstglutils: fix shader compilation on Mountain Lion
Alessandro Decina [Mon, 2 Nov 2015 01:10:44 +0000 (12:10 +1100)]
gstglutils: fix shader compilation on Mountain Lion

Make gst_gl_context_gen_shader/_compile_shader assume GST_GLSL_PROFILE_ES |
GST_GLSL_PROFILE_COMPATIBILITY as the profile. Without this, the shader compiler
doesn't inject the #version tag resulting in a compilation error on Mountain
Lion.

This is a workaround for old code using gst_gl_context_gen_shader. New code
should use the gst_glsl_stage_* API directly which allows the caller to
explicitly specify version/profile.

6 years agoglbufferpool: explicitly initialize a possibly uninitialized variable
Matthew Waters [Sat, 31 Oct 2015 12:28:20 +0000 (23:28 +1100)]
glbufferpool: explicitly initialize a possibly uninitialized variable

The ret variable may be uninitialized and so its contents were undefined and
the results were erratic (failing with glvideomixer, succeeding in other cases)

P.S. No idea why gcc/clang et al never picked up on this like they normally do
(probably due to some optimisation pass figuring out it's only set once...)

6 years agogl/tests: update for glmemory api changes
Matthew Waters [Fri, 30 Oct 2015 04:00:23 +0000 (15:00 +1100)]
gl/tests: update for glmemory api changes

6 years agoglcolorconvert: remove unused ret variable
Matthew Waters [Fri, 30 Oct 2015 03:43:23 +0000 (14:43 +1100)]
glcolorconvert: remove unused ret variable

6 years agoglslstage: remove typedefs from the header
Matthew Waters [Fri, 30 Oct 2015 03:40:35 +0000 (14:40 +1100)]
glslstage: remove typedefs from the header

They are already defined in the forward decleration header and defining them
more than once will give an error with OSX's clang about typedef redefinition
being a C11 feature.

6 years agoglcolorconvert: follow the correct texture target names
Matthew Waters [Fri, 30 Oct 2015 03:38:05 +0000 (14:38 +1100)]
glcolorconvert: follow the correct texture target names

6 years agoglupload: explicitly configure the texture target on the gl buffer pool
Matthew Waters [Thu, 29 Oct 2015 14:42:42 +0000 (01:42 +1100)]
glupload: explicitly configure the texture target on the gl buffer pool

If we don't, then the pool could end up allocating 2D textures when the
caps explictly state they should be rectangle textures.

6 years agoglbufferpool: add bufferpool options for the various texture targets
Matthew Waters [Thu, 29 Oct 2015 14:27:36 +0000 (01:27 +1100)]
glbufferpool: add bufferpool options for the various texture targets

This was chosen over relying solely on the caps as glupload needs to propose an
allocation and set the texture target based on the output caps.  Setting the
caps in the config is currently pointless as they are overwritten in a lot of
element's decide_allocation functions.

This provides a mechanism for the buffer pool to be configured for a certain
texture target when none has been configured.

6 years agoglcolorconvert: add support for converting texture targets
Matthew Waters [Thu, 29 Oct 2015 02:04:31 +0000 (13:04 +1100)]
glcolorconvert: add support for converting texture targets

Solved with a simple shader templating mechanism and string replacements
of the necessary sampler types/texture accesses and texture coordinate
mangling for rectangular and external-oes textures.

6 years agoglmemory: add support for rectangle textures
Matthew Waters [Wed, 28 Oct 2015 13:44:26 +0000 (00:44 +1100)]
glmemory: add support for rectangle textures

Add the various tokens/strings for the differnet texture types (2D, rect, oes)

Changes the GLmemory api to include the GstGLTextureTarget in all relevant
functions.

Update the relevant caps/templates for 2D only textures.

6 years agoglcolorconvert: order the caps template so that RGBA is first
Matthew Waters [Thu, 29 Oct 2015 14:45:13 +0000 (01:45 +1100)]
glcolorconvert: order the caps template so that RGBA is first

glcolorconvert ! glcolorconvert would sometimes negotiated RGB
(the first list entry) otherwise.

6 years agoglbufferpool: move typedef's into the forward decleration file
Matthew Waters [Thu, 29 Oct 2015 14:16:02 +0000 (01:16 +1100)]
glbufferpool: move typedef's into the forward decleration file

Otherwise, for example, clang will warn about typedef redefinitions
being a C11 feature.

6 years agoglslstage: initialize output params to 0 before calling gl functions
Julien Isorce [Wed, 28 Oct 2015 14:41:54 +0000 (14:41 +0000)]
glslstage: initialize output params to 0 before calling gl functions

The client side API of the Chromium's GPU Process has asserts
in debug mode that check that output params are initialized to 0.

6 years agoopengl: build/provide glstereomix/split on gles only systems
Matthew Waters [Mon, 26 Oct 2015 13:36:41 +0000 (00:36 +1100)]
opengl: build/provide glstereomix/split on gles only systems

6 years agoglcolorconvert: allow outputting multiple textures for gles3 contexts
Matthew Waters [Mon, 26 Oct 2015 07:26:18 +0000 (18:26 +1100)]
glcolorconvert: allow outputting multiple textures for gles3 contexts

the USING_GLES2 includes all GLES3 contexts as well which does support
drawing to multiple buffers.  Instead make or decision solely based on
whether glDrawBuffers is available or not.

6 years agoglviewconvert: expose the element on gles2 platforms
Matthew Waters [Mon, 26 Oct 2015 06:36:21 +0000 (17:36 +1100)]
glviewconvert: expose the element on gles2 platforms

We can do everything with gles3 however gles2 restricts us not allowing
separated or frame-by-frame multiview modes due to multiple draw buffers.

6 years agoglshaderelement: free the vertex and fragment strings on finalize
Matthew Waters [Tue, 20 Oct 2015 18:34:18 +0000 (05:34 +1100)]
glshaderelement: free the vertex and fragment strings on finalize

Fixes a memory leak when using the vertex/fragment properties.

6 years agoglshaderelement: remove unneeded reference to <gst/gl/gstglshadervariables.h>
Matthew Waters [Tue, 20 Oct 2015 18:00:11 +0000 (05:00 +1100)]
glshaderelement: remove unneeded reference to <gst/gl/gstglshadervariables.h>

6 years agogl: fix usage of string.h and stdio.h functions without including the headers
Matthew Waters [Tue, 20 Oct 2015 17:44:50 +0000 (04:44 +1100)]
gl: fix usage of string.h and stdio.h functions without including the headers

e.g:
gstglcontext_egl.c:613:7: error: implicit declaration of function 'strcmp'
[-Werror=implicit-function-declaration]
   if (strcmp (G_MODULE_SUFFIX, "so") == 0)

6 years agoglimagesink: create a context in NULL_READY
Matthew Waters [Thu, 15 Oct 2015 20:03:06 +0000 (07:03 +1100)]
glimagesink: create a context in NULL_READY

So that it's possible for decoders et al. to request the OpenGL context
in their READY_PAUSED transition with decodebin/playbin.

6 years agogl: remove unneeded shader variable parsing code
Matthew Waters [Tue, 20 Oct 2015 16:59:33 +0000 (03:59 +1100)]
gl: remove unneeded shader variable parsing code

6 years agoglshaderelement: implement setting arbitrary uniforms
Matthew Waters [Tue, 20 Oct 2015 16:23:30 +0000 (03:23 +1100)]
glshaderelement: implement setting arbitrary uniforms

Currently float and int are supported by default. vec2, vec3, vec4
and mat4 are supported if graphene is used.  Of course if one wants
to set custom uniforms they can also be set using the create-shader
signal.

6 years agogl: be consistent in gobject boilerpate
Matthew Waters [Mon, 19 Oct 2015 04:15:30 +0000 (15:15 +1100)]
gl: be consistent in gobject boilerpate

GST_GL_IS_* vs GST_IS_GL_*

git grep -l 'GST_GL_IS_' | xargs sed -i 's/GST_GL_IS_/GST_IS_GL_/g'

6 years agoglshaderelement: implement on-demand create-shader signalling
Matthew Waters [Sat, 17 Oct 2015 04:26:46 +0000 (15:26 +1100)]
glshaderelement: implement on-demand create-shader signalling

One may not have an GstGLContext available or current in the thread where one
would need to update the shader.  Support this by signalling create-shader
whenever the one-shot 'update-shader' is set to TRUE.

6 years agogl/calayer: don't leak a gl shader object
Matthew Waters [Fri, 16 Oct 2015 15:42:47 +0000 (02:42 +1100)]
gl/calayer: don't leak a gl shader object

We will always overwrite the ca_sink->redisplay_shader without freeing the
object.

6 years agoglslstage: add brackets around pointer dereference referencing an array
Matthew Waters [Thu, 15 Oct 2015 15:57:19 +0000 (02:57 +1100)]
glslstage: add brackets around pointer dereference referencing an array

While technically, i is always 0 and *vertex_sources[i++] is equivalant
to (*vertex_sources)[i++].  Be future-proof in the case of code
moves/changes/etc.

CID 1327406

6 years agogl/caopengllayersink: port to new GstGLShader API
Matthew Waters [Thu, 15 Oct 2015 12:47:11 +0000 (23:47 +1100)]
gl/caopengllayersink: port to new GstGLShader API

fixes build error:
"undefined symbols for architecture:
gst_gl_shader_compile_with_default_vf_and_check"

6 years agogl/tests: port glcontext test to opengl
Matthew Waters [Thu, 15 Oct 2015 11:42:26 +0000 (22:42 +1100)]
gl/tests: port glcontext test to opengl

Now uses vao's and vbo's when possible like the rest of the gstgl library.

6 years agoglshader: port element to GstGLSLStage
Matthew Waters [Fri, 4 Sep 2015 06:16:51 +0000 (16:16 +1000)]
glshader: port element to GstGLSLStage

- Provide a shader property to set the full shader pipeline
- Provide vertex and fragment properties for just providing simple
  shader sources.

6 years agoglshader: port to using GstGLSLStage objects for string management
Matthew Waters [Fri, 4 Sep 2015 06:02:32 +0000 (16:02 +1000)]
glshader: port to using GstGLSLStage objects for string management

A GstGLShader is now simply a collection of stages that are
compiled and linked together into a program.  The uniform/attribute
interface has remained the same.

6 years agoglsl: add a shader stage object GstGLSLStage
Matthew Waters [Fri, 4 Sep 2015 04:36:47 +0000 (14:36 +1000)]
glsl: add a shader stage object GstGLSLStage

Represents a stage (vertex, geometry, fragment, etc) in the shader
pipeline.

6 years agogl/shader/variables: include generic gl.h header
Matthew Waters [Thu, 3 Sep 2015 14:09:09 +0000 (00:09 +1000)]
gl/shader/variables: include generic gl.h header

Otherwise we may miss some forward declarations

Fixes build error: undefined reference to GstGLSLStage

6 years agogl: add some GLSL utility functions
Matthew Waters [Thu, 20 Aug 2015 05:11:06 +0000 (15:11 +1000)]
gl: add some GLSL utility functions

Specifically parsing/setting GLSL versions and the shader related
function table.

6 years agogl: fix leak in gst_gl_insert_debug_marker()
Guillaume Desmottes [Tue, 13 Oct 2015 10:40:04 +0000 (12:40 +0200)]
gl: fix leak in gst_gl_insert_debug_marker()

The string allocated by g_vasprintf() was leaked.

Reproduced using the
validate.file.compositor.simple.play_15s.synchronized validate scenario.

https://bugzilla.gnome.org/show_bug.cgi?id=756492

6 years agoglvideomixer: Proxy the ignore-eos videoaggregator property as well
Nirbheek Chauhan [Tue, 6 Oct 2015 15:53:11 +0000 (21:23 +0530)]
glvideomixer: Proxy the ignore-eos videoaggregator property as well

Identical to how the z-order property is proxied

6 years agogstreamer: bad: Fix memory leaks when context parse fails
Vineeth TM [Thu, 20 Aug 2015 07:03:29 +0000 (16:03 +0900)]
gstreamer: bad: Fix memory leaks when context parse fails

When g_option_context_parse fails, context and error variables are not getting free'd
which results in memory leaks. Free'ing the same.

And replacing g_error_free with g_clear_error, which checks if the error being passed
is not NULL and sets the variable to NULL on free'ing.

https://bugzilla.gnome.org/show_bug.cgi?id=753854

6 years agogl: move debugging related functions to their own file
Matthew Waters [Thu, 1 Oct 2015 15:01:42 +0000 (01:01 +1000)]
gl: move debugging related functions to their own file

6 years agoglcolorscale: use glbasefilter vfuncs
Matthew Waters [Thu, 1 Oct 2015 13:20:19 +0000 (23:20 +1000)]
glcolorscale: use glbasefilter vfuncs

Uses less code \o/
Fixes legacy opengl rendering \o/

6 years agogl: Pass GL_CFLAGS to g-ir-scanner
Antoine Jacoutot [Wed, 30 Sep 2015 06:36:15 +0000 (08:36 +0200)]
gl: Pass GL_CFLAGS to g-ir-scanner

This unbreaks building when some headers are under a non-standard path.
e.g. /usr/X11R6/include as on OpenBSD.

https://bugzilla.gnome.org/show_bug.cgi?id=755850

6 years agoglcontext: fixup strstr lengths so we don't overrun
Matthew Waters [Wed, 30 Sep 2015 05:17:38 +0000 (15:17 +1000)]
glcontext: fixup strstr lengths so we don't overrun

6 years agoglupload: remove useless release_buffer
Matthew Waters [Wed, 30 Sep 2015 03:31:50 +0000 (13:31 +1000)]
glupload: remove useless release_buffer

It's a leftover from when we weren't outputting GstBuffer's and
returning raw texture id's.

6 years agoglutils: use gst_element_set_context for setting display/other_context
Matthew Waters [Tue, 29 Sep 2015 15:53:53 +0000 (01:53 +1000)]
glutils: use gst_element_set_context for setting display/other_context

1. So we get tracking inside GstElement properly when e.g. adding to a bin
2. Removes redundant code.  Now only one place where
   GstContext->GstGLDisplay/GstGLContext transformation occurs
3. Fixes a memory leak in the process
4. Make the retrieval of debug categories thread safe

6 years agogl/eagl: use the default GL context debug category
Matthew Waters [Thu, 17 Sep 2015 06:59:16 +0000 (16:59 +1000)]
gl/eagl: use the default GL context debug category

6 years agogl: set the context on the element on a context query
Matthew Waters [Mon, 28 Sep 2015 12:31:09 +0000 (22:31 +1000)]
gl: set the context on the element on a context query

Otherwise it's possible to lose the context information if the
context is only propagated through queries.

6 years agogl: chain up to the parent class for GstElement::set_context
Matthew Waters [Mon, 28 Sep 2015 12:20:29 +0000 (22:20 +1000)]
gl: chain up to the parent class for GstElement::set_context

https://bugzilla.gnome.org/show_bug.cgi?id=705579

6 years agogl: sprinkle some debug markers to ease debugging
Matthew Waters [Mon, 31 Aug 2015 09:21:54 +0000 (19:21 +1000)]
gl: sprinkle some debug markers to ease debugging

6 years agogl/utils: add a function to insert a debug marker
Matthew Waters [Mon, 31 Aug 2015 09:18:23 +0000 (19:18 +1000)]
gl/utils: add a function to insert a debug marker

These markers are visible in tools that record the GL function calls
such as apitrace, et al.

Makes it easier to match up GL draw commands with specific elements.

6 years agogl: add some debugging prototypes
Matthew Waters [Mon, 31 Aug 2015 09:17:21 +0000 (19:17 +1000)]
gl: add some debugging prototypes

6 years agoglwindow: remove unused draw_unlocked function
Matthew Waters [Sat, 26 Sep 2015 09:19:50 +0000 (19:19 +1000)]
glwindow: remove unused draw_unlocked function

The functionality is provided by draw anyway and is leftover from
X11's specific threading requirements that no longer apply.

6 years agoglfilter: use GL_ELEMENT_ARRAY_BUFFER for vbo indices
Julien Isorce [Fri, 25 Sep 2015 09:32:00 +0000 (10:32 +0100)]
glfilter: use GL_ELEMENT_ARRAY_BUFFER for vbo indices

Fixes this error with chromium gpu process:
GL_INVALID_OPERATION, glBindBuffer: buffer bound to more than 1 target

https://bugzilla.gnome.org/show_bug.cgi?id=755618

6 years agoglmemory: fix texture leak in _gl_mem_copy
Julien Isorce [Thu, 17 Sep 2015 13:17:09 +0000 (14:17 +0100)]
glmemory: fix texture leak in _gl_mem_copy

https://bugzilla.gnome.org/show_bug.cgi?id=755456

6 years agogl/dispmanx: fix rendering with recent resize state tracking
Matthew Waters [Mon, 21 Sep 2015 08:04:40 +0000 (08:04 +0000)]
gl/dispmanx: fix rendering with recent resize state tracking

557ca6fda5f831be4aba5819bf7b30b296e575cd didn't change to the
necessary gst_gl_window_resize() call for the dispmanx backend.

6 years agoDon't throw compiler warnings with G_DISABLE_ASSERT
Jan Schmidt [Thu, 17 Sep 2015 14:20:13 +0000 (00:20 +1000)]
Don't throw compiler warnings with G_DISABLE_ASSERT

Disable code that warns about unused variables when G_DISABLE_ASSERT
is defined, as it is in tarballs and pre-releases.

6 years agogl/caopengllayer: fix non-existent selector warning
Matthew Waters [Thu, 17 Sep 2015 12:17:24 +0000 (22:17 +1000)]
gl/caopengllayer: fix non-existent selector warning

557ca6fda5f831be4aba5819bf7b30b296e575cd introduced the queueResize
call without implementing the selector

6 years agoglwindow: Fix g_return_val_if_fail in a void function
Jan Schmidt [Thu, 17 Sep 2015 11:31:39 +0000 (21:31 +1000)]
glwindow: Fix g_return_val_if_fail in a void function

6 years agoglimagesink: request a resize on caps/3d mode changes
Matthew Waters [Thu, 17 Sep 2015 07:22:47 +0000 (17:22 +1000)]
glimagesink: request a resize on caps/3d mode changes

Fixes incorrect aspect ratio on OSX when changing caps or the 3d
output mode.

https://bugzilla.gnome.org/show_bug.cgi?id=755111

6 years agoglwindow: add API to request a resize event on the next draw
Matthew Waters [Thu, 17 Sep 2015 07:06:37 +0000 (17:06 +1000)]
glwindow: add API to request a resize event on the next draw

- glimagesink needs to be able to resize the viewport on aspect ratio
  changes resulting from either caps changes or 3d output mode changes.
- Performing a glViewport outside the GstGLWindow::resize callback
  will not have the winsys' stack of viewports required to correctly
  place the output frame.

Provide a function to request a resize on the next draw event from the
winsys.

Also track size changes inside the base GstGLWindow class rather
than in each subclass.

https://bugzilla.gnome.org/show_bug.cgi?id=755111

6 years agogl/uploadelement: fail earlier if we could not upload the buffer
Matthew Waters [Thu, 17 Sep 2015 06:55:11 +0000 (16:55 +1000)]
gl/uploadelement: fail earlier if we could not upload the buffer

6 years agogl/x11: store the correct dimension from the resize events
Matthew Waters [Thu, 17 Sep 2015 06:05:21 +0000 (16:05 +1000)]
gl/x11: store the correct dimension from the resize events

small typo s/width/height/

6 years agogl: Fix GError leaks during failures
Vineeth T M [Thu, 17 Sep 2015 04:35:02 +0000 (13:35 +0900)]
gl: Fix GError leaks during failures

https://bugzilla.gnome.org/show_bug.cgi?id=755140

6 years agoglimagesink: avoid updating the viewport in the draw loop
Matthew Waters [Wed, 16 Sep 2015 07:28:05 +0000 (17:28 +1000)]
glimagesink: avoid updating the viewport in the draw loop

Fixes flashes/incorrect aspect ratio when resizing glimagesink on OSX.

6 years agogl: bufferpool take into account video stride alignment requirements
Tim-Philipp Müller [Tue, 15 Sep 2015 10:34:12 +0000 (11:34 +0100)]
gl: bufferpool take into account video stride alignment requirements

when allocating memory. Fixes crashes with avdec_h265 in the AVX2
code path which requires 32-byte stride alignment, but the
GstAllocationParams only specified a 16-byte alignment.

https://bugzilla.gnome.org/show_bug.cgi?id=754120

6 years agogl/api: use public rather than private define
Matthew Waters [Wed, 9 Sep 2015 13:53:57 +0000 (23:53 +1000)]
gl/api: use public rather than private define

HAVE_IOS is only defined for the build of this module so
attempting to use gstgl in iOS would result in incorrect GL
includes.
Use GST_GL_HAVE_PLATFORM_EAGL instead for choosing the iOS GL
header.