platform/upstream/gstreamer.git
6 years agoclutter: Fix compilation error in GL examples
Sebastian Dröge [Mon, 14 Dec 2015 08:38:41 +0000 (09:38 +0100)]
clutter: Fix compilation error in GL examples

Include gst/gl.h instead of specific headers to prevent such problems also in
the future.

In file included from ../../../../gst-libs/gst/gl/gl.h:47:0,
                 from ../../../../gst-libs/gst/gl/gstglbasememory.h:137,
                 from ../../../../gst-libs/gst/gl/gstglmemory.h:29,
                 from cluttershare.c:39:
../../../../gst-libs/gst/gl/gstglmemorypbo.h:51:20: error: field ‘mem’ has incomplete type
   GstGLMemory      mem;
                    ^
../../../../gst-libs/gst/gl/gstglmemorypbo.h:124:24: error: field ‘parent’ has incomplete type
   GstGLMemoryAllocator parent;
                        ^
../../../../gst-libs/gst/gl/gstglmemorypbo.h:134:29: error: field ‘parent_class’ has incomplete type
   GstGLMemoryAllocatorClass parent_class;
                             ^

6 years agotests: update for glmemory api changes
Matthew Waters [Mon, 14 Dec 2015 07:41:30 +0000 (18:41 +1100)]
tests: update for glmemory api changes

6 years agoglbuffer: bind/unbind on map/unmap for GL mappings
Matthew Waters [Mon, 14 Dec 2015 07:20:23 +0000 (18:20 +1100)]
glbuffer: bind/unbind on map/unmap for GL mappings

Bind the handle to the GL target on map/unmap to save the caller from
handling this themselves.

6 years agoglbuffer: remove buffer specific transfer flags
Matthew Waters [Mon, 14 Dec 2015 07:19:37 +0000 (18:19 +1100)]
glbuffer: remove buffer specific transfer flags

Instead rely on GstGLBaseMemory's transfer handling

6 years agoglmemorypbo: map/unmap pbo memory correctly for state tracking
Matthew Waters [Mon, 14 Dec 2015 07:18:20 +0000 (18:18 +1100)]
glmemorypbo: map/unmap pbo memory correctly for state tracking

Otherwise some downloads will fail to occur from the PBO.

6 years agotests/glmemory: include the generic gl header
Matthew Waters [Mon, 14 Dec 2015 07:15:42 +0000 (18:15 +1100)]
tests/glmemory: include the generic gl header

Including gstglmemory.h directly results in the compiler complaining
about incomplete types.

6 years agoglformat: add compatibility definitions for OES/rectangle textures
Matthew Waters [Mon, 14 Dec 2015 06:05:31 +0000 (17:05 +1100)]
glformat: add compatibility definitions for OES/rectangle textures

6 years agoglbasebuffer: remove unsed memory subclass
Matthew Waters [Mon, 14 Dec 2015 02:49:18 +0000 (13:49 +1100)]
glbasebuffer: remove unsed memory subclass

The functionality has been split into GstGLBaseMemory and GstGLBuffer.

6 years agoglmemory: base classify and add the pbo memory on top
Matthew Waters [Mon, 14 Dec 2015 02:43:59 +0000 (13:43 +1100)]
glmemory: base classify and add the pbo memory on top

The base class is useful for having multiple backing memory types other
than the default.  e.g. IOSurface, EGLImage, dmabuf?

The PBO transfer logic is now inside GstGLMemoryPBO which uses GstGLBuffer
to manage the PBO memory.

This also moves the format utility functions into their own file.

6 years agogl: add a GL buffer based GstMemory
Matthew Waters [Mon, 14 Dec 2015 02:08:10 +0000 (13:08 +1100)]
gl: add a GL buffer based GstMemory

Heavily based on GstGLBaseBuffer that is a subclass of GstGLBaseMemory.
Provides GPU and CPU accessible GL buffer objects by GL handle or by
sysmem data pointer.

6 years agogl: add a base memory object
Matthew Waters [Mon, 14 Dec 2015 01:59:02 +0000 (12:59 +1100)]
gl: add a base memory object

It handles the following
- GstAllocationParams -> gst_memory_init transformation
- Makes sure that map/unmap/create/destroy happen on the GL thread with
  a GL context current.
- Holds a possible sysmem accessible data pointer with alignment.
- Holds the need upload/download transfer state

6 years agogl: add convenience function for the start of a video frame
Matthew Waters [Mon, 14 Dec 2015 01:26:01 +0000 (12:26 +1100)]
gl: add convenience function for the start of a video frame

Get's the start of the video frame based on a GstVideoInfo and
GstVideoAlignment.

6 years agogluploadmeta; remove convenience helper API
Matthew Waters [Fri, 11 Dec 2015 05:07:36 +0000 (16:07 +1100)]
gluploadmeta; remove convenience helper API

It was not really useful as if one knows about libgstgl, one can just use
GLMemory objects directly.

6 years agogldownload: remove helper api from the library
Matthew Waters [Fri, 11 Dec 2015 04:39:57 +0000 (15:39 +1100)]
gldownload: remove helper api from the library

It was never used by anyone and is not needed anymore with the element
and GstGLMemory's transparent support for downloading textures.

6 years agogltransformation: clear to transparent
Matthew Waters [Fri, 11 Dec 2015 22:33:38 +0000 (09:33 +1100)]
gltransformation: clear to transparent

Otherwise composition will result in a black frame outside the transformed
video.

6 years agolibgstgl: gstglcontext_cocoa: kCGLPFAStereo has been deprecated in 10.11
Alessandro Decina [Thu, 10 Dec 2015 03:41:44 +0000 (14:41 +1100)]
libgstgl: gstglcontext_cocoa: kCGLPFAStereo has been deprecated in 10.11

Also since the version scheme has changed (to include the micro number) since
10.10, use the MAC_OS_X_VERSION_* macro to avoid confusion.

6 years agoglbufferpool: relax check for multiple texture targets
Alessandro Decina [Thu, 10 Dec 2015 01:41:00 +0000 (12:41 +1100)]
glbufferpool: relax check for multiple texture targets

Only complain about multiple texture targets when _different_ texture targets
are configured.

6 years agoglmemory: take subsampling into account for rectangle textures
Alessandro Decina [Thu, 10 Dec 2015 01:33:52 +0000 (12:33 +1100)]
glmemory: take subsampling into account for rectangle textures

Rectangle textures don't use normalized coordinates so subsampling needs to be
factored in explicitly.

Fixes YUV => RGB conversion for rectangle textures.

6 years agoglproto: include function definitions for GL_APPLE_sync
Matthew Waters [Tue, 8 Dec 2015 05:35:45 +0000 (16:35 +1100)]
glproto: include function definitions for GL_APPLE_sync

Provides a performance improvement on iOS where we were falling back to glFinish
on settting sync points.

6 years agoglupload: Only offer custom allocator with caps features
Nicolas Dufresne [Tue, 1 Dec 2015 23:09:25 +0000 (18:09 -0500)]
glupload: Only offer custom allocator with caps features

To use GLMemory and EGLImage allocators, one need to know the
libgstgl API. This is only expected if the associated caps features
have been negotiated. Generic element that otherwise receive those
allocators may fail, resulting in broken pieline. We don't want to
force all generic element to check if the allocator is a custom
allocator or a normal allocator (which implement the _alloc method).

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

6 years agoglcolorconvert: improve the YUY2/UYVY->RGBA conversion shader
Matthew Waters [Wed, 2 Dec 2015 11:42:39 +0000 (22:42 +1100)]
glcolorconvert: improve the YUY2/UYVY->RGBA conversion shader

Don't offset the y-axis.  We only need to offset on the x-axis.

Removes a sawtooth pattern on horizontal and vertical edges.

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

6 years agoglcolorconvert: improve RGBA->YUY2/UYVY conversion shader
Matthew Waters [Wed, 2 Dec 2015 11:40:06 +0000 (22:40 +1100)]
glcolorconvert: improve RGBA->YUY2/UYVY conversion shader

We should only average the chroma samples not the luma sample.

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

6 years agoDrop usage of deprecated g-ir-scanner --strip-prefix flag
Reynaldo H. Verdejo Pinochet [Wed, 2 Dec 2015 07:20:45 +0000 (23:20 -0800)]
Drop usage of deprecated g-ir-scanner --strip-prefix flag

6 years agoRemove unnecessary NULL checks before g_free()
Reynaldo H. Verdejo Pinochet [Tue, 17 Nov 2015 23:23:17 +0000 (15:23 -0800)]
Remove unnecessary NULL checks before g_free()

g_free() is NULL-safe

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