platform/upstream/gst-plugins-base.git
6 years agogl: Fix compiler warning about unused const variable with gcc 6
Sebastian Dröge [Thu, 18 Feb 2016 08:33:20 +0000 (10:33 +0200)]
gl: Fix compiler warning about unused const variable with gcc 6

  CC       libgstgl_x11_la-gstglcontext_glx.lo
In file included from gstglcontext_glx.c:39:0:
../utils/opengl_versions.h:52:43: error: ‘gles2_versions’ defined but not used [-Werror=unused-const-variable]
 static const struct { int major, minor; } gles2_versions[] = {
                                           ^~~~~~~~~~~~~~

6 years agogl: Move private headers from SOURCES to noinst_HEADERS
Sebastian Dröge [Thu, 18 Feb 2016 08:29:21 +0000 (10:29 +0200)]
gl: Move private headers from SOURCES to noinst_HEADERS

6 years agoglfilter: insert the debug marker from the GL thread
Matthew Waters [Wed, 17 Feb 2016 02:00:46 +0000 (13:00 +1100)]
glfilter: insert the debug marker from the GL thread

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

6 years agoglimagesink: remove unsed reconfigure variable
Matthew Waters [Wed, 17 Feb 2016 00:42:23 +0000 (11:42 +1100)]
glimagesink: remove unsed reconfigure variable

6 years agoglimagesink: don't push a reconfigure event from the GL thread
Matthew Waters [Wed, 13 Jan 2016 02:17:56 +0000 (13:17 +1100)]
glimagesink: don't push a reconfigure event from the GL thread

Doing so may cause deadlocks when other elements attempt destroy or created
GL resources.

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

6 years agoglvideomixer: don't leak pad's vertex buffer on release_pad
Wang Xin-yu (王昕宇) [Thu, 21 Jan 2016 02:40:36 +0000 (10:40 +0800)]
glvideomixer: don't leak pad's vertex buffer on release_pad

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

6 years agoglmixer: Remove usage of GstGLMixerFrameData
Matthew Waters [Tue, 16 Feb 2016 14:08:18 +0000 (01:08 +1100)]
glmixer: Remove usage of GstGLMixerFrameData

Subclasses can just iterate over the list of pads themselves

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

6 years agoglmixer: don't hold the object lock while calling into GL
Matthew Waters [Wed, 13 Jan 2016 03:41:22 +0000 (14:41 +1100)]
glmixer: don't hold the object lock while calling into GL

Doing so can deadlock between the GL thread and the object lock e.g.
when performing reconfigure events in glimagesink on a resize event.

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

6 years agogl: Remove leftover g_prints
Sebastian Dröge [Tue, 16 Feb 2016 06:48:23 +0000 (08:48 +0200)]
gl: Remove leftover g_prints

One was commented out, but we also don't use // comments :)

6 years agogldebug: use the correct spelling for behavior
Matthew Waters [Tue, 16 Feb 2016 03:41:37 +0000 (14:41 +1100)]
gldebug: use the correct spelling for behavior

The headers use the american spelling of behavior not the UK/AUS version with
the extra U.

6 years agoglcontext: don't enable GL debug for messages that won't be logged
Matthew Waters [Tue, 16 Feb 2016 02:58:42 +0000 (13:58 +1100)]
glcontext: don't enable GL debug for messages that won't be logged

This is an optimization to avoid pointless string processing.

6 years agoglvideoflip: don't ignore method changes when caps aren't set (yet)
Alessandro Decina [Tue, 16 Feb 2016 02:01:20 +0000 (13:01 +1100)]
glvideoflip: don't ignore method changes when caps aren't set (yet)

6 years agogl: syncmeta: define GL_TIMEOUT_IGNORED in more portable way
Tim-Philipp Müller [Wed, 10 Feb 2016 10:31:19 +0000 (10:31 +0000)]
gl: syncmeta: define GL_TIMEOUT_IGNORED in more portable way

6 years agogstglshader: cache uniform locations
Alessandro Decina [Wed, 10 Feb 2016 05:37:22 +0000 (16:37 +1100)]
gstglshader: cache uniform locations

Avoid redundant calls to glGetUniformLocation. The results can be cached once
the shader has been linked.

6 years agogstglcontext: micro optimization to gst_gl_context_thread_add
Alessandro Decina [Wed, 10 Feb 2016 02:08:43 +0000 (13:08 +1100)]
gstglcontext: micro optimization to gst_gl_context_thread_add

Invoke the callback right away when called on the context thread. Removes
overhead when nesting libgstgl calls (for example when working with the sync
meta).

6 years agoglsyncmeta: add compatibility definition for GL_TIMEOUT_IGNORED
Matthew Waters [Tue, 9 Feb 2016 02:08:21 +0000 (13:08 +1100)]
glsyncmeta: add compatibility definition for GL_TIMEOUT_IGNORED

6 years agoglsyncmeta: separate out gpu/cpu waits.
Matthew Waters [Tue, 9 Feb 2016 01:14:04 +0000 (12:14 +1100)]
glsyncmeta: separate out gpu/cpu waits.

CPU waits are more expensive and are only required if the CPU is ever going to
access the data. GPU waits perform inter-context synchronisation and are cheaper
as they don't require CPU intervention.

6 years agogleffects: identity: add the shader to the hash table
Matthew Waters [Mon, 8 Feb 2016 01:23:12 +0000 (12:23 +1100)]
gleffects: identity: add the shader to the hash table

So that we don't recreate it every frame and leak memory.

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

6 years agogl: add .def file for msvc builds
Matthew Waters [Thu, 4 Feb 2016 23:43:49 +0000 (10:43 +1100)]
gl: add .def file for msvc builds

Also internalize some API from being exported.

6 years agoglquery: remove unnecessary pointer check
Luis de Bethencourt [Thu, 4 Feb 2016 12:17:31 +0000 (12:17 +0000)]
glquery: remove unnecessary pointer check

All uses of query->context in gstglquery.c assume it exists. We can assume
this as well before unrefing it. Furthermore, gst_object_unref() will just
silently return if it ever were to not exist.

6 years agoglbasefilter: enable qos by default
Matthew Waters [Thu, 4 Feb 2016 06:31:03 +0000 (17:31 +1100)]
glbasefilter: enable qos by default

Improves the responsiveness of the pipeline when resources are close/above the
limitations of the hardware.

Any subclass that wishes not to enable qos can do so themselves.

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

6 years agogltransformation: reconfigure the src when changing to/from passthrough
Matthew Waters [Tue, 2 Feb 2016 23:59:23 +0000 (10:59 +1100)]
gltransformation: reconfigure the src when changing to/from passthrough

Otherwise it's very possible that any GL resources have not been created yet.

6 years agoglvideoflip: correctly update the output caps on method changes
Matthew Waters [Tue, 2 Feb 2016 23:52:08 +0000 (10:52 +1100)]
glvideoflip: correctly update the output caps on method changes

When changing methods we may need different output caps.

6 years agoRevert "gl/eagl: try getting a gles3 context"
Matthew Waters [Tue, 2 Feb 2016 07:36:34 +0000 (18:36 +1100)]
Revert "gl/eagl: try getting a gles3 context"

This reverts commit 96b9666d596be115fd4b446ef846508b7fd05c24.
This reverts commit d11385d167d8843604ea23a05e2dea40b8bbac35.

This breaks the texture sharing with the applemedia elements as
CVOpenGLESTextureCache seems to have an arbitrary restriction on GLES2 only.

6 years agoglcolorconvert: don't skip subset structures
Matthew Waters [Tue, 2 Feb 2016 05:21:14 +0000 (16:21 +1100)]
glcolorconvert: don't skip subset structures

We may need them to transform into a different set of formats.

Fixes YUV->YUV with two glcolorconverts, e.g:

format=I420 ! glcolorconvert ! glcolorconvert ! format=NV12

6 years agoglbasefilter: always call gl_start when not called already
Matthew Waters [Tue, 2 Feb 2016 05:19:54 +0000 (16:19 +1100)]
glbasefilter: always call gl_start when not called already

Fixes elements transitioning out of passthrough mode using GL resources that
hadn'e been allocated yet.

6 years agoglcolorconvert: fix RGB,rectangle->planar YUV conversion
Matthew Waters [Tue, 2 Feb 2016 04:14:25 +0000 (15:14 +1100)]
glcolorconvert: fix RGB,rectangle->planar YUV conversion

Converting to GRAY is no fun.  Another case of normalized vs unnormalized
texture coordinates.

6 years agoglcolorconvert: fix YUY2/UYVY,rectangle->RGB conversion
Matthew Waters [Tue, 2 Feb 2016 02:51:18 +0000 (13:51 +1100)]
glcolorconvert: fix YUY2/UYVY,rectangle->RGB conversion

1.0 / width does not offset by one pixel in rectangular textures (which use
unnormalized coordinates).

Provide the actual pixel offset as a uniform to the shader.

6 years agoglcolorconvert: perform better negotiation
Matthew Waters [Tue, 2 Feb 2016 01:50:26 +0000 (12:50 +1100)]
glcolorconvert: perform better negotiation

1. Correctly describe what we can caps we can transform to/from.
   i.e. no YUV->YUV or GRAY->YUV or YUV->GRAY (except for passthrough).
2. Prefer similar formats and ignore incompatible formats on fixation.

6 years agogstglwindow: initialize navigation_loop to NULL
Julien Isorce [Mon, 1 Feb 2016 12:23:32 +0000 (12:23 +0000)]
gstglwindow: initialize navigation_loop to NULL

Useful when gst_gl_window.c::gst_gl_window_new is not used.
This is the case when using a custom GstGLWindow.
(ex: GstGLWindowGPUProcess from Chromium)

6 years agogl: eagl: fix build
Tim-Philipp Müller [Mon, 1 Feb 2016 09:26:37 +0000 (09:26 +0000)]
gl: eagl: fix build

gstglcontext_eagl.m:238:45: error: too few arguments to function call,
expected at least 4, have 3

6 years agogldownload: allow video/x-raw as input
Alessandro Decina [Mon, 1 Feb 2016 04:13:03 +0000 (15:13 +1100)]
gldownload: allow video/x-raw as input

...and just passthrough. This is useful for pipelines where downstream must be
non-GL but upstream can optionally be GL.

6 years agogl/eagl: try getting a gles3 context
Matthew Waters [Mon, 1 Feb 2016 01:57:32 +0000 (12:57 +1100)]
gl/eagl: try getting a gles3 context

Fallback to a gles2 context if that fails

6 years agoglvideomixer: fix checker vbo leak
Wang Xin-yu (王昕宇) [Thu, 21 Jan 2016 08:10:48 +0000 (16:10 +0800)]
glvideomixer: fix checker vbo leak

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

6 years agoglprototypes: fix parameter type of glGenBuffers
Wang Xin-yu (王昕宇) [Fri, 29 Jan 2016 02:35:15 +0000 (10:35 +0800)]
glprototypes: fix parameter type of glGenBuffers

The number of buffers should be GLsizei instead of GLuint.

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

6 years agogleffects: fix gleffects fisheye shader compile error
Haihua Hu [Tue, 8 Dec 2015 06:09:58 +0000 (14:09 +0800)]
gleffects: fix gleffects fisheye shader compile error

On some embedded systems, sqrt() is not supported in the shader,
use the actual value of sqrt(2) instead.

Signed-off-by: Haihua Hu <b55597@freescale.com>
Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=761271

6 years agoglvideomixer: par may not exist in the caps
Matthew Waters [Fri, 29 Jan 2016 03:03:26 +0000 (14:03 +1100)]
glvideomixer: par may not exist in the caps

Fixes a critical in the gst-validate tests:

gst_structure_fixate_field_nearest_fraction: assertion 'gst_structure_has_field
(structure, field_name)

6 years agoglcontext: back out unintended lost_context changes
Matthew Waters [Fri, 29 Jan 2016 01:45:57 +0000 (12:45 +1100)]
glcontext: back out unintended lost_context changes

6 years agoegl: implement selecting opengl3 contexts
Matthew Waters [Thu, 28 Jan 2016 05:39:07 +0000 (16:39 +1100)]
egl: implement selecting opengl3 contexts

6 years agogl/egl: pass the error value to get_error_string()
Matthew Waters [Thu, 28 Jan 2016 03:31:33 +0000 (14:31 +1100)]
gl/egl: pass the error value to get_error_string()

6 years agopkg-config: Don't generate and install pkg-config with relative paths
Jan Schmidt [Thu, 28 Jan 2016 17:50:42 +0000 (04:50 +1100)]
pkg-config: Don't generate and install pkg-config with relative paths

Don't put relative paths in pkg-config files, including uninstalled
ones. For those, use @abs_topbuilddir@ and @abs_topsrcdir@ as we
do elsewhere.

Remove libraries= directives, which doesn't seem to be a pkg-config
variable that actually exists, but has been in all our pkg-config
files for as long as they've existed.

6 years agovideoaggregator: don't do caps processing that is not overridable
Matthew Waters [Wed, 14 Oct 2015 10:13:57 +0000 (21:13 +1100)]
videoaggregator: don't do caps processing that is not overridable

Allows the subclass to completely override the chosen src caps.

This is needed as videoaggregator generally has no idea exactly
what operation is being performed.

- Adds a fixate_caps vfunc for fixation
- Merges gst_video_aggregator_update_converters() into
  gst_videoaggregator_update_src_caps() as we need some of its info
  for proper caps handling.
- Pass the downstream caps to the update_caps vfunc

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

6 years agoglcolorbalance: return HARDWARE from get_balance_type
Matthew Waters [Wed, 27 Jan 2016 09:23:21 +0000 (20:23 +1100)]
glcolorbalance: return HARDWARE from get_balance_type

6 years agoglsinkbin: add glcolorbalance element
Matthew Waters [Wed, 27 Jan 2016 09:04:00 +0000 (20:04 +1100)]
glsinkbin: add glcolorbalance element

This makes playbin not plug videobalance as glcolorbalance already exists and
implements the GstColorBalance interface.

6 years agogl: move control binding proxy implementation from glvideomixer
Matthew Waters [Wed, 27 Jan 2016 08:56:36 +0000 (19:56 +1100)]
gl: move control binding proxy implementation from glvideomixer

Other elements may need to use it's functionality

6 years agoglcolorbalance: create the shader if it doesn't exist in the render callback
Matthew Waters [Wed, 27 Jan 2016 07:17:06 +0000 (18:17 +1100)]
glcolorbalance: create the shader if it doesn't exist in the render callback

Changing the properties may result in glcolorbalance moving from passthrough to
non-passthrough and we weren't creating the shader in that case.

6 years agoglvideoflip: incorporate the aspect ratio into the scale_x calculations
Matthew Waters [Mon, 25 Jan 2016 08:11:38 +0000 (19:11 +1100)]
glvideoflip: incorporate the aspect ratio into the scale_x calculations

1. Otherwise rotating the video will clip and show black bars due to
   gltransformation's implementation.
2. The other option of make gltransformation aspect-agnostic produces
   incorrect output with perspective transformations.

6 years agoglwindow: Fix android build
Holger Kaelberer [Thu, 21 Jan 2016 22:13:36 +0000 (23:13 +0100)]
glwindow: Fix android build

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

6 years agogl: fix compiler warnings with gcc-6
Tim-Philipp Müller [Tue, 19 Jan 2016 13:20:23 +0000 (13:20 +0000)]
gl: fix compiler warnings with gcc-6

In file included from effects/gstgleffectrgbtocurve.c:25:0:
effects/gstgleffectscurves.h:174:32: error: 'xray_curve' defined but not used
 static const GstGLEffectsCurve xray_curve = {
...

6 years agolibs: g-i: fix init section to avoid compiler warnings
Tim-Philipp Müller [Tue, 19 Jan 2016 08:39:58 +0000 (08:39 +0000)]
libs: g-i: fix init section to avoid compiler warnings

..GstPlayer-1.0.c: In function ‘main’:
..GstPlayer-1.0.c:587:3: warning: implicit declaration of function ‘gst_init’

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

6 years agoglfilter: First make caps writable in fixate_caps(), then truncate them
Sebastian Dröge [Sat, 16 Jan 2016 15:14:54 +0000 (17:14 +0200)]
glfilter: First make caps writable in fixate_caps(), then truncate them

Truncating requires writable caps.

6 years agoglcolorconvert: Caps passed to fixate_caps() are not owned by us and guaranteed to...
Sebastian Dröge [Sat, 16 Jan 2016 15:12:29 +0000 (17:12 +0200)]
glcolorconvert: Caps passed to fixate_caps() are not owned by us and guaranteed to be fixed

So don't try to fixate them, which takes ownership and steals them from
basetransform.

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

6 years agoRevert "glpool: fix caps refcount issue"
Sebastian Dröge [Sat, 16 Jan 2016 14:55:42 +0000 (16:55 +0200)]
Revert "glpool: fix caps refcount issue"

This reverts commit 3bdcdedfa00b87f1db505218789178318a16c743.

gst_caps_replace() takes a new reference already, if there is a problem then
it is elsewhere. And there are a few problems, see
https://bugzilla.gnome.org/show_bug.cgi?id=760696

6 years agoglquery: provide compat definition for GL_QUERY_RESULT
Matthew Waters [Fri, 15 Jan 2016 06:00:55 +0000 (17:00 +1100)]
glquery: provide compat definition for GL_QUERY_RESULT

e.g. android doesn't have it

While we're here move a state specific assertion after the supported check.
Removes an assertion on GLES

6 years agogl: add compatibility definition of GLint64
Matthew Waters [Fri, 15 Jan 2016 05:07:27 +0000 (16:07 +1100)]
gl: add compatibility definition of GLint64

e.g. anrdoid doesn't have it

6 years agoglpool: fix caps refcount issue
Matthew Waters [Fri, 15 Jan 2016 03:00:56 +0000 (14:00 +1100)]
glpool: fix caps refcount issue

The caps are from an allocation query which are transfer none but were being
treated as transfer full.

6 years agoglmemory: log the time for glTexSubImage/glReadPixels
Matthew Waters [Mon, 11 Jan 2016 02:30:05 +0000 (13:30 +1100)]
glmemory: log the time for glTexSubImage/glReadPixels

6 years agogl: add a gstglquery object for arbitrary GL queries
Matthew Waters [Fri, 8 Jan 2016 07:36:54 +0000 (18:36 +1100)]
gl: add a gstglquery object for arbitrary GL queries

Currently only GL_TIME_ELAPSED and GL_TIMESTAMP are supported

6 years agogldebug: implement a delayed debug system
Matthew Waters [Mon, 11 Jan 2016 06:22:26 +0000 (17:22 +1100)]
gldebug: implement a delayed debug system

The messages are stored by gst_gl_async_debug_store_log_msg() and output later
by a corresponding store(), output() or an unset()/free().

Some wrapper macros are provided to avoid callers explicitly using __FILE__,
GST_FUNCTION and __LINE__

6 years agogldebug: use gst_info_vasprintf in insert_debug_marker()
Matthew Waters [Mon, 11 Jan 2016 06:26:08 +0000 (17:26 +1100)]
gldebug: use gst_info_vasprintf in insert_debug_marker()

Allows expansion of GST_PTR_FORMAT and GST_SEGMENT_FORMAT arguments.

6 years agogl: add a videoflip element
Matthew Waters [Fri, 15 Jan 2016 00:22:40 +0000 (11:22 +1100)]
gl: add a videoflip element

Behaves exactly the same as the non-GL videoflip element

6 years agoglfilter: recreate the fbo on caps changes
Matthew Waters [Thu, 14 Jan 2016 13:04:20 +0000 (00:04 +1100)]
glfilter: recreate the fbo on caps changes

The width/height may change which requires recreating the depth buffer.

6 years agoglbasefilter: add a class function on set_caps (from GL)
Matthew Waters [Thu, 14 Jan 2016 13:02:43 +0000 (00:02 +1100)]
glbasefilter: add a class function on set_caps (from GL)

This is simply a convenience to avoid duplicating the thread marshalling on
set_caps.

6 years agogltransformation: always build a valid mvp matrix
Matthew Waters [Thu, 14 Jan 2016 13:00:29 +0000 (00:00 +1100)]
gltransformation: always build a valid mvp matrix

The default case is to build an identity matrix.

6 years agogltransformation: support negative scales
Matthew Waters [Thu, 14 Jan 2016 08:03:04 +0000 (19:03 +1100)]
gltransformation: support negative scales

A scale of -1.0 means to flip the video.

6 years agogltransformation: implement passthrough handling
Matthew Waters [Thu, 14 Jan 2016 07:42:05 +0000 (18:42 +1100)]
gltransformation: implement passthrough handling

6 years agogltransformation: implement navigation events
Matthew Waters [Thu, 14 Jan 2016 06:45:03 +0000 (17:45 +1100)]
gltransformation: implement navigation events

Reverses the transformation applied through the properties and forwards the
event.

The process for finding the coordinates on the video are as follows:
1. Convert the given pointer_x and pointer_y to model space at the near and far planes
2. Get the equation of the video plane
3. Find where the ray in 1 intersects the plane
4. Profit!

6 years agoglimagesink: remove reduntant glimagesink from debug logging
Matthew Waters [Thu, 14 Jan 2016 05:59:12 +0000 (16:59 +1100)]
glimagesink: remove reduntant glimagesink from debug logging

6 years agogl/x11/navigation: add button press to the selected event mask
Matthew Waters [Thu, 14 Jan 2016 05:57:40 +0000 (16:57 +1100)]
gl/x11/navigation: add button press to the selected event mask

Otherwise we won't get the button press events and GstNavigation fails.

6 years agoglcolorconvert: try harder to passthrough
Alessandro Decina [Thu, 14 Jan 2016 05:00:00 +0000 (16:00 +1100)]
glcolorconvert: try harder to passthrough

This makes a pipeline like:

... ! video/x-raw(memory:GLMemory),format=UYVY ! glcolorconvert !
video/x-raw(memory:GLMemory),format={UYVY, NV12} ! ...

passthrough instead of converting UYVY => NV12. The conversion would happen
before this change since the element (and basetransform) transform the src caps
to format={NV12, UYVY} (since NV12 comes first in the glcolorconvert:src
template) and then the default caps fixate func would fixate to NV12. Blah.

Also there's no need to intersect against the template caps in ::transform_caps
since basetransform does that right after calling the vfunc.

6 years agogl: implement a colorbalance element
Matthew Waters [Tue, 12 Jan 2016 07:31:29 +0000 (18:31 +1100)]
gl: implement a colorbalance element

It performs the exact same operation as videobalance but with opengl shaders and
was tested with glvideomixer by comparing frames from videobalance and
glcolorbalance.

6 years agoglvideomixer: implement glBlendFunc and glBlendEquation
Matthew Waters [Tue, 12 Jan 2016 07:21:50 +0000 (18:21 +1100)]
glvideomixer: implement glBlendFunc and glBlendEquation

Allows more blending options than just A over B

e.g. frame comparisons are now possible.
  glvideomixer name=m
    sink_0::zorder=0
    sink_1::zorder=1
    sink_1::blend-equation-rgb={subtract,reverse-subtract}
    sink_1::blend-function-src-rgb=src-color
    sink_1::blend-function-dst-rgb=dst-color
  ! glimagesinkelement
  videotestsrc pattern=checkers-4 ! m.sink_0
  videotestsrc pattern=checkers-8 ! m.sink_1

6 years agogldebug: add a specific category for the debug spam from the driver
Matthew Waters [Fri, 8 Jan 2016 07:38:46 +0000 (18:38 +1100)]
gldebug: add a specific category for the debug spam from the driver

6 years agoglbasememory: Free the actual memory object when requested
Matthew Waters [Thu, 7 Jan 2016 09:56:54 +0000 (20:56 +1100)]
glbasememory: Free the actual memory object when requested

Otherwise we are leaking ~400B on each GstMemory allocation.

Freeing in the base class matches the GObject semantics.

6 years agoglmemorypbo: don't double read pixels
Matthew Waters [Thu, 7 Jan 2016 09:54:41 +0000 (20:54 +1100)]
glmemorypbo: don't double read pixels

The optimistic download_transfer was not setting the required flag to not
perform glReadPixels on subsequent map (READ). resulting in glReadPixels
happening twice.

6 years agoglmemory: expose gst_gl_memory_texsubimage
Matthew Waters [Thu, 7 Jan 2016 07:47:37 +0000 (18:47 +1100)]
glmemory: expose gst_gl_memory_texsubimage

Removes extremely similar code from glmemorypbo.

6 years agoglfeature add a specific debug category
Matthew Waters [Thu, 7 Jan 2016 07:05:23 +0000 (18:05 +1100)]
glfeature add a specific debug category

Saves having to trawl through the 'default' category when function retrieval
goes wrong.

6 years agoglsyncmeta: only flush with a shared context
Matthew Waters [Thu, 7 Jan 2016 03:08:39 +0000 (14:08 +1100)]
glsyncmeta: only flush with a shared context

The wait code will flush for us for single context pipelines.

6 years agoglcontext: implement checking whether a context has been shared
Matthew Waters [Thu, 7 Jan 2016 03:02:52 +0000 (14:02 +1100)]
glcontext: implement checking whether a context has been shared

Some operations are unnecessary when running with only a single GL
context.
e.g. glFlush when setting a fence object as the flush happens on wait.

API: gst_gl_context_is_shared

6 years agoglcolorconvert: implement usage of a buffer pool
Matthew Waters [Wed, 6 Jan 2016 05:25:38 +0000 (16:25 +1100)]
glcolorconvert: implement usage of a buffer pool

Saves unnecessary glGenTextures and glDeleteTextures which may have a
non-trivial cost.

6 years agoglbasememory: fix copying GstGLAllocationParams
Matthew Waters [Wed, 6 Jan 2016 04:50:07 +0000 (15:50 +1100)]
glbasememory: fix copying GstGLAllocationParams

Fixes a GST_IS_GL_CONTEXT critical

6 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

6 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

6 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

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

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

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

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

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

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

6 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

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

6 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

6 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

6 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

6 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

6 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

6 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

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

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