platform/upstream/gstreamer.git
7 years agoglmemorypbo: remove unused code
Matthew Waters [Wed, 6 Jan 2016 04:44:52 +0000 (15:44 +1100)]
glmemorypbo: remove unused code

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

7 years agoglupload: always add texture-target field to GL caps
Matthew Waters [Mon, 4 Jan 2016 09:26:09 +0000 (20:26 +1100)]
glupload: always add texture-target field to GL caps

1. Various elements/base classes only perform a subset check on accept-caps
2. Some GL elements have texture-target in their pad template
3. When checking subsets, only the caps to check are allowed to contain extra
   fields.  If the 'template' caps have extra fields, the subset fails.
Thus without texture-target on the caps, various accept-caps implementations
were failing.

Also, add some convenience functions for setting and retrieving
texture targets to/from GValue.

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

7 years agoglupload: passthrough composition caps features
Matthew Waters [Tue, 29 Dec 2015 07:16:04 +0000 (18:16 +1100)]
glupload: passthrough composition caps features

Don't unconditionally add it to any and all caps transformations.

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

7 years agoglviewconvert: Fix stereoscopic handling w/ texture-target
Jan Schmidt [Sun, 3 Jan 2016 14:03:08 +0000 (01:03 +1100)]
glviewconvert: Fix stereoscopic handling w/ texture-target

The addition of texture-target negotiation broke stereoscopic
handling when not in passthrough mode, so fix that.

7 years agoglmemorypbo: fix wrapping data on GL 2.1
Matthew Waters [Wed, 30 Dec 2015 01:12:17 +0000 (12:12 +1100)]
glmemorypbo: fix wrapping data on GL 2.1

GL 2.1 only supports pbo upload.

The wrapped data pointer was only being set on the pbo memory and on the
glmemory so when a download was requested (in GL 2.1), glmemory was
allocating a new data pointer and thus not returning the wrapped data.

7 years agoglmemorypbo: only create a pbo memory if the context actually supports it
Matthew Waters [Wed, 30 Dec 2015 01:11:09 +0000 (12:11 +1100)]
glmemorypbo: only create a pbo memory if the context actually supports it

e.g. GL <= 2.0 does not support pbo usage and GL 2.1 only supports pbo upload.

7 years agoglmemory: small code reformat
Matthew Waters [Wed, 30 Dec 2015 01:09:29 +0000 (12:09 +1100)]
glmemory: small code reformat

makes the alloc_params selections fit on a single line.

7 years agotests/glmemory: output data pointer values on failure
Matthew Waters [Wed, 30 Dec 2015 01:06:17 +0000 (12:06 +1100)]
tests/glmemory: output data pointer values on failure

Allows quicker inspection of what failed.

7 years agogleffects: fix shader compilation with legacy opengl
Matthew Waters [Tue, 29 Dec 2015 06:04:57 +0000 (17:04 +1100)]
gleffects: fix shader compilation with legacy opengl

All the gleffects shaders can be run against a gles2 or a legacy opengl glsl
compiler but weren't being advertised as such.

Fixes gleffects under desktop opengl < 3.2.

7 years agoglbasememory: Remove bogus NULL check
Sebastian Dröge [Tue, 29 Dec 2015 16:01:30 +0000 (18:01 +0200)]
glbasememory: Remove bogus NULL check

CID 1346534

7 years agogl: Add \0 terminators for the Apple sync extension
Sebastian Dröge [Mon, 28 Dec 2015 13:53:59 +0000 (15:53 +0200)]
gl: Add \0 terminators for the Apple sync extension

Otherwise GL initialization might check for extensions forever and never finishes.

7 years agoglcontext: Add some debug output when the GL thread is actually running
Sebastian Dröge [Mon, 28 Dec 2015 12:41:59 +0000 (14:41 +0200)]
glcontext: Add some debug output when the GL thread is actually running

7 years agoglshader: fix usage doc
Florent Thiéry [Sun, 27 Dec 2015 10:37:09 +0000 (11:37 +0100)]
glshader: fix usage doc

The property location has been changed in favor of vertex/fragment
string properties; the doc had not been updated and was still referring
to the previous property; also, now the #version header has become mandatory

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

7 years agoglimagesink: Post unhandled navigation events on the bus
Florent Thiéry [Sat, 26 Dec 2015 21:34:29 +0000 (22:34 +0100)]
glimagesink: Post unhandled navigation events on the bus

Based off xvimagesink implementation

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

7 years agoglbufferpool: Fix build error
Vineeth TM [Mon, 28 Dec 2015 00:04:12 +0000 (09:04 +0900)]
glbufferpool: Fix build error

When GST_GL_HAVE_PLATFORM_EGL is not defined, then info variable
will not be used and this results in build error

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

7 years agoglmemorypbo: Comment out unused functions to fix compilation with clang
Sebastian Dröge [Wed, 23 Dec 2015 08:50:13 +0000 (09:50 +0100)]
glmemorypbo: Comment out unused functions to fix compilation with clang

It's not clear if these are intentionally unused or the code should be
changed, but this fixes compilation for the time being at least.

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

7 years agoglcolorconvert: Fix name of testsuite
Sebastian Dröge [Mon, 21 Dec 2015 11:19:11 +0000 (12:19 +0100)]
glcolorconvert: Fix name of testsuite

7 years agoglcontext: Signal context creation from inside the context loop and use g_thread_join...
Sebastian Dröge [Mon, 21 Dec 2015 11:13:15 +0000 (12:13 +0100)]
glcontext: Signal context creation from inside the context loop and use g_thread_join() instead of a custom condition variable

Also protect against spurious condition variable wakeups during context
creation.

7 years agoglwindow: Hide navigation specific internal API and add API to asynchronously send...
Sebastian Dröge [Mon, 21 Dec 2015 10:27:09 +0000 (11:27 +0100)]
glwindow: Hide navigation specific internal API and add API to asynchronously send navigation events

Exposing the navigation thread's main context, GSourceFuncs and structs called
key_event and mouse_event is exposing a bit too much of the internals. Let's
just go with two functions to asynchronously send navigation events on the
window with the same API as the synchronous ones.

7 years agoglwindow: Use g_thread_join() instead of a custom condition variable for waiting...
Sebastian Dröge [Mon, 21 Dec 2015 09:46:52 +0000 (10:46 +0100)]
glwindow: Use g_thread_join() instead of a custom condition variable for waiting for the navigation thread to finish

Also hide some internal functions and fields while we're at it and fix
a race condition with the startup condition variable.

7 years agoglwindow: Fix memory leak of navigation thread
Haihua Hu [Mon, 30 Nov 2015 01:36:09 +0000 (09:36 +0800)]
glwindow: Fix memory leak of navigation thread

When stopping the navigation thread, call g_thread_join() to release
the resources hold by it.

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

7 years agoglconvert: Fix compilation of GRAY16_LE/BE shader
Nicolas Dufresne [Fri, 18 Dec 2015 20:36:40 +0000 (15:36 -0500)]
glconvert: Fix compilation of GRAY16_LE/BE shader

7 years agoglupload: Add dmabuf upload method.
Nicolas Dufresne [Fri, 13 Nov 2015 16:24:30 +0000 (17:24 +0100)]
glupload: Add dmabuf upload method.

This upload method detect and optimize uploads of DMABuf memory. This is
done by creating and caching EGLImages wrapper around DMABuf. The
EGLImages are then binded to a texture which get converter using
standard shader.

Example pipeline:

GST_GL_PLATFORM=egl \
gst-launch-1.0 v4l2src device=/dev/video1 io-mode=4 ! \
               video/x-raw,format=NV12 ! glimagesink

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

7 years agoeglimagememory: Also import BGR16, ABGR, xBGR, AYUV, GRAY16_LE/BE and Y444
Nicolas Dufresne [Fri, 18 Dec 2015 20:52:46 +0000 (15:52 -0500)]
eglimagememory: Also import BGR16, ABGR, xBGR, AYUV, GRAY16_LE/BE and Y444

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

7 years agoeglimagememory: Add RGB/BGR DMABuf importation support
Nicolas Dufresne [Fri, 18 Dec 2015 16:08:29 +0000 (11:08 -0500)]
eglimagememory: Add RGB/BGR DMABuf importation support

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

7 years agoeglimagememory: Methods to create GstGLMemory from dmabufs
Lubosz Sarnecki [Fri, 13 Nov 2015 16:40:08 +0000 (17:40 +0100)]
eglimagememory: Methods to create GstGLMemory from dmabufs

Maps GstVideoFormats to suitable DRM fourccs which work with
glcolorconvert, using gst_gl_memory_alloc(). We require mostly
only 4 formats to be supported by the driver. We require DRM
equivalent to RGB16, RGBA, R8 and RG88. This way it's compatible with
DesktopGL, since GL_TEXTURE_2D is used and limit driver requirements.
With this we can virtually support all formats the glcolorconvert
supports.

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

7 years agobuild: Add dmabuf build condition.
Lubosz Sarnecki [Fri, 2 Oct 2015 11:31:39 +0000 (13:31 +0200)]
build: Add dmabuf build condition.

configure.ac: Build dmabuf when EGL and drm_fourcc.h is available.
gl: Link gst-allocators.

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

7 years agoglimagesink: Show error when video frame is not mapped.
Lubosz Sarnecki [Fri, 13 Nov 2015 16:09:13 +0000 (17:09 +0100)]
glimagesink: Show error when video frame is not mapped.

Adds more meaningful error than
"Failed to convert multiview video buffer", which is always used
when prepare_next_buffer() fails in gst_glimage_sink_prepare().

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

7 years agogstglcontext_egl: Expose gst_gl_context_egl_get_error_string.
Lubosz Sarnecki [Fri, 13 Nov 2015 16:05:11 +0000 (17:05 +0100)]
gstglcontext_egl: Expose gst_gl_context_egl_get_error_string.

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

7 years agoglmemory: add gst_gl_memory_allocator_get_default
Alessandro Decina [Fri, 18 Dec 2015 02:17:34 +0000 (13:17 +1100)]
glmemory: add gst_gl_memory_allocator_get_default

Add gst_gl_memory_allocator_get_default to get the default allocator based on
the opengl version. Allows us to stop hardcoding the PBO allocator which isn't
supported on gles2.

Fixes GL upload on iOS9 among other things.

7 years agoglimagesink: don't deadlock on resize
Matthew Waters [Fri, 18 Dec 2015 00:49:25 +0000 (11:49 +1100)]
glimagesink: don't deadlock on resize

Performing any GL function marshalling off the GL thread with glimagesink's
render lock is prone to deadlocks between the GL thread and the non-GL thread.

What can happen is this:
1. non-GL thread attempts to function marshal to the GL thread.
2. while 1 is happening, the winsys gives an event (say resize)
3. This calls back into glimagesink which taks the render lock.
4. As the GL function marshalling is attempting to run on the GL
   and already has glimagesink's render lock locked.  This deadlocks
   as the threads are waiting for each other.

7 years agoglbasememory: don't unconditionally add the alignment bytes to the size
Matthew Waters [Tue, 15 Dec 2015 03:14:36 +0000 (14:14 +1100)]
glbasememory: don't unconditionally add the alignment bytes to the size

e.g when wrapping a data pointer we don't want to map/unmap off the end of
pointer with the alignment bytes.

Instead track that information separately as maxsize is used for mapping by
GstMemory and thus represents a size without any alignment padding bytes.

7 years agoglbuffer: add a name to the allocator
Matthew Waters [Thu, 17 Dec 2015 04:50:40 +0000 (15:50 +1100)]
glbuffer: add a name to the allocator

7 years agogl*memory*: reverse the parameter order of user_data and destroy notify
Matthew Waters [Thu, 17 Dec 2015 04:23:13 +0000 (15:23 +1100)]
gl*memory*: reverse the parameter order of user_data and destroy notify

The convention is to have the destroy notify last after any user data

7 years agoglmemorypbo: remove our own alloc()/wrapped()/etc functions
Matthew Waters [Wed, 16 Dec 2015 07:41:06 +0000 (18:41 +1100)]
glmemorypbo: remove our own alloc()/wrapped()/etc functions

replaced by equivalent functionality within gst_gl_base_memory_alloc()

7 years agoglmemory: document gst_gl_memory_init
Matthew Waters [Wed, 16 Dec 2015 07:39:32 +0000 (18:39 +1100)]
glmemory: document gst_gl_memory_init

7 years agoglbuffer: remove unneeded gst_gl_buffer_alloc()
Matthew Waters [Wed, 16 Dec 2015 07:38:19 +0000 (18:38 +1100)]
glbuffer: remove unneeded gst_gl_buffer_alloc()

Replaced by gst_gl_base_memory_alloc()

7 years agoglbasememory: document some functions
Matthew Waters [Wed, 16 Dec 2015 07:37:11 +0000 (18:37 +1100)]
glbasememory: document some functions

7 years agoglmemory: add a default copy implementation
Matthew Waters [Wed, 16 Dec 2015 07:36:13 +0000 (18:36 +1100)]
glmemory: add a default copy implementation

Subclasses still need to override this to copy into the correct memory type.

7 years agoglbufferpool: use gst_gl_base_memory_alloc as a generic GL allocation framework
Matthew Waters [Wed, 16 Dec 2015 07:32:40 +0000 (18:32 +1100)]
glbufferpool: use gst_gl_base_memory_alloc as a generic GL allocation framework

Requires the usage of GstGLVideoAllocationParams however any user can set their
own parameters along with an allocator which will be used to allocate the
correct memory type.

7 years agoglmemorypbo: implement GstGLBaseMemory:alloc
Matthew Waters [Wed, 16 Dec 2015 07:30:59 +0000 (18:30 +1100)]
glmemorypbo: implement GstGLBaseMemory:alloc

Uses the GstGLVideoAllocationParams parameters

7 years agoglbuffer: implements GstGLBaseMemory::alloc
Matthew Waters [Wed, 16 Dec 2015 07:23:31 +0000 (18:23 +1100)]
glbuffer: implements GstGLBaseMemory::alloc

Create GstGLBufferAllocationParams which is subclass of GstGLAllocationParams

7 years agoglmemory: implement GstGLBaseMemory::alloc
Matthew Waters [Wed, 16 Dec 2015 07:20:17 +0000 (18:20 +1100)]
glmemory: implement GstGLBaseMemory::alloc

- Create GstGLVideoAllocationParams which is a GstGLAllocationParams subclass.
- Make it possible to allocate glmemory objects directly if no frills are
  needed.

7 years agoglbasememory: add a generic interface for allocating GL memories
Matthew Waters [Wed, 16 Dec 2015 07:13:21 +0000 (18:13 +1100)]
glbasememory: add a generic interface for allocating GL memories

This is made possible by a subclassable GstGLAllocationParams that holds
the allocation parameters

Every allocation would now go through gst_gl_base_memory_alloc with the
allocation parameters now being specified in a single struct to allow
extension by different allocators.

7 years agoRevert "glbuffer: Don't pass allocation params"
Matthew Waters [Thu, 17 Dec 2015 00:06:34 +0000 (11:06 +1100)]
Revert "glbuffer: Don't pass allocation params"

This reverts commit 052f41e5c293ec17c038467ed1e7b92b04d494b0.

This is incorrect and will affect any other glbuffer user that needs/wants to
perform data alignment.

7 years agoglbuffer: Don't pass allocation params
Nicolas Dufresne [Wed, 16 Dec 2015 16:56:08 +0000 (11:56 -0500)]
glbuffer: Don't pass allocation params

The imported memory has already been allocated, passing allocation
parameters with alignment confuses the memory which endup with a
size different from maxsize and lead to overrun when the memory
is being copied.

7 years agoglupload: fix allocator name after GLMemory API changes
Alessandro Decina [Tue, 15 Dec 2015 03:17:16 +0000 (14:17 +1100)]
glupload: fix allocator name after GLMemory API changes

7 years agogl: Allow using non-system mesa with both GL and GLES
Nicolas Dufresne [Wed, 16 Dec 2015 00:25:16 +0000 (19:25 -0500)]
gl: Allow using non-system mesa with both GL and GLES

GCC automatically disable redundance warnings for system headers. As
soon as we start using a non-system installed mesa, we would start
having issues. The test for both wasn't setting any flags, so it would
work but then fail at runtime.

This is being fixed by disabling in the code (where needed only) that
GCC warning. The test is also fixed to avoid the false positive we had.

7 years agoplugins-bad: Fix example pipelines
Vineeth TM [Mon, 14 Dec 2015 02:09:46 +0000 (11:09 +0900)]
plugins-bad: Fix example pipelines

rename gst-launch --> gst-launch-1.0
replace old elements with new elements(ffmpegcolorspace -> videoconvert, ffenc_** -> avenc_**)
fix caps in examples

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

7 years agobad: Add g_autoptr() support to all types
Xavier Claessens [Mon, 14 Dec 2015 19:44:31 +0000 (14:44 -0500)]
bad: Add g_autoptr() support to all types

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

7 years agoglviewconvert: check pointer before dereferencing
Luis de Bethencourt [Mon, 14 Dec 2015 12:31:52 +0000 (12:31 +0000)]
glviewconvert: check pointer before dereferencing

priv->primary_out could be NULL, check before dereferencing it in
GST_BUFFER_FLAG_SET ()

CID 1308945

7 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;
                             ^

7 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

7 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.

7 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

7 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.

7 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.

7 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

7 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.

7 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.

7 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.

7 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

7 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.

7 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.

7 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.

7 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.

7 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.

7 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.

7 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.

7 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.

7 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

7 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

7 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

7 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

7 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

7 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;
                  ^

7 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";
             ^

7 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]
 }
 ^

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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.

7 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.

7 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.

7 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/