platform/upstream/gstreamer.git
6 years agogl/utils: also take care of the local GL context in query functions
Matthew Waters [Thu, 12 Jan 2017 10:35:25 +0000 (21:35 +1100)]
gl/utils: also take care of the local GL context in query functions

Simplifies a deduplicates a lot of code in elements retrieving/setting
the local OpenGL context.

6 years agoglutils: remove trivial helper function
Matthew Waters [Wed, 11 Jan 2017 14:57:29 +0000 (01:57 +1100)]
glutils: remove trivial helper function

gst_gl_caps_replace_all_caps_features() is only used in two places and can
be trivially reproduced.

6 years agogl/docs: add symbols from -unused.txt
Matthew Waters [Wed, 11 Jan 2017 05:09:31 +0000 (16:09 +1100)]
gl/docs: add symbols from -unused.txt

6 years agogl/docs: some type fixes of type names
Matthew Waters [Wed, 11 Jan 2017 05:09:03 +0000 (16:09 +1100)]
gl/docs: some type fixes of type names

6 years agoglwindow: use the same parameter names between vfuncs and functions of the same name
Matthew Waters [Tue, 10 Jan 2017 09:07:09 +0000 (20:07 +1100)]
glwindow: use the same parameter names between vfuncs and functions of the same name

Silences GI warnings about symbol's not being used from source code
comment block

6 years agoglbasememory: type fix for GstGLBaseMemoryAllocatorAllocFunction
Matthew Waters [Tue, 10 Jan 2017 09:06:07 +0000 (20:06 +1100)]
glbasememory: type fix for GstGLBaseMemoryAllocatorAllocFunction

6 years agogldisplay: add missing transfer annotations
Matthew Waters [Tue, 10 Jan 2017 09:05:42 +0000 (20:05 +1100)]
gldisplay: add missing transfer annotations

6 years agogl: add skip annotations to non-GI possible struct constructors
Matthew Waters [Tue, 10 Jan 2017 09:04:30 +0000 (20:04 +1100)]
gl: add skip annotations to non-GI possible struct constructors

6 years agoglbasememory: remove unused and #if 0'ed function definitions
Matthew Waters [Tue, 10 Jan 2017 09:03:09 +0000 (20:03 +1100)]
glbasememory: remove unused and #if 0'ed function definitions

6 years agogl: add necessary get_type() functions for allocation params structures
Matthew Waters [Tue, 10 Jan 2017 08:58:48 +0000 (19:58 +1100)]
gl: add necessary get_type() functions for allocation params structures

All using the existing GstGLAllocationParams infrastructure

6 years agogldisplay: some annotation updates/typo fixes
Matthew Waters [Tue, 10 Jan 2017 04:35:52 +0000 (15:35 +1100)]
gldisplay: some annotation updates/typo fixes

6 years agogl: remove reference to non-existant header
Matthew Waters [Tue, 10 Jan 2017 03:29:46 +0000 (14:29 +1100)]
gl: remove reference to non-existant header

../../../../gst-libs/gst/gl/gl.h:57:45: fatal error: gst/gl/gstglcontrolbindingproxy.h: No such file or directory
 #include <gst/gl/gstglcontrolbindingproxy.h>
                                             ^

6 years agogl: remove custom control binding proxy
Matthew Waters [Tue, 10 Jan 2017 01:51:51 +0000 (12:51 +1100)]
gl: remove custom control binding proxy

Use the existing GstProxyControlBinding instead.

6 years agogl/pkg-config: add the configured platform/api/winsys
Matthew Waters [Thu, 17 Nov 2016 06:15:55 +0000 (17:15 +1100)]
gl/pkg-config: add the configured platform/api/winsys

Allows users to query this from pkg-config instead of requiring them to
compile mini programs checking defines in gstglconfig.h

6 years agogl: remove unneeded gst_gl_buffer_alloc from header file
Matthew Waters [Thu, 17 Nov 2016 14:06:51 +0000 (01:06 +1100)]
gl: remove unneeded gst_gl_buffer_alloc from header file

There's no implementation anymore!

6 years agogl/egl: remove use of texture orientation
Matthew Waters [Thu, 17 Nov 2016 07:00:39 +0000 (18:00 +1100)]
gl/egl: remove use of texture orientation

6 years agogl/pkg-config: don't advertise all our dependent libraries as deps
Matthew Waters [Thu, 17 Nov 2016 06:51:54 +0000 (17:51 +1100)]
gl/pkg-config: don't advertise all our dependent libraries as deps

If an application/library explicitly needs a library, it needs to link
against it itself.

6 years agoglcontext/egl: don't overwrite set GError
Matthew Waters [Mon, 9 Jan 2017 14:00:12 +0000 (01:00 +1100)]
glcontext/egl: don't overwrite set GError

Doing so is an error and will cause a glib warning to be printed.

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

6 years agomeson: generate pkg-config -uninstalled pc files
Guillaume Desmottes [Wed, 4 Jan 2017 15:51:10 +0000 (16:51 +0100)]
meson: generate pkg-config -uninstalled pc files

Generating those files is useful for users building the GStreamer stack
using meson and having to link it to another project which is still
using the autotools.

While doing so, fix some -uninstalled pc files which were using a
suspicious 'pcfiledir' which was never replaced or defined.

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

6 years agogl/format: use the unsized format for RGB on GLES2
Matthew Waters [Fri, 16 Dec 2016 14:00:00 +0000 (01:00 +1100)]
gl/format: use the unsized format for RGB on GLES2

In GLES2 GL_RGB8 doesn't exist so we cannot use it, use GL_RGB
instead.

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

6 years agogl/window: remove unused priv variable
Matthew Waters [Thu, 15 Dec 2016 13:22:41 +0000 (00:22 +1100)]
gl/window: remove unused priv variable

https://ci.gstreamer.net/job/GStreamer-master/7989/console

6 years agogl/window: remove use of main_context_push/pop_thread_default()
Matthew Waters [Wed, 14 Dec 2016 13:59:45 +0000 (00:59 +1100)]
gl/window: remove use of main_context_push/pop_thread_default()

No-one's using/depending on it (it would have criticalled and not worked)
and it's causing more problems than it's solving.  Store the GMainContext
in the public struct instead for subclasses to optionally use instead of
relying on the push/pop state to be correct.

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

6 years agogl/effects: use non-PBO GLMemory for internal textures
Haihua Hu [Wed, 7 Dec 2016 08:51:27 +0000 (16:51 +0800)]
gl/effects: use non-PBO GLMemory for internal textures

middle textures in gleffects do not need to use GstGLMemoryPBO as they
aren't transfering data to/from the GPU. This will cost too much DMA
memory and cause performance issue. Change the allocator to use non-PBO
GstGLMemory.

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

6 years agoglvideomixer: Reject multiview video
Sebastian Dröge [Wed, 14 Dec 2016 13:53:41 +0000 (15:53 +0200)]
glvideomixer: Reject multiview video

glvideomixer does not support it currently and it needs special support
for handling this correctly, and is rather non-trivial to implement for
all formats.

6 years agogst: Don't declare variables inside the for loop header
Sebastian Dröge [Tue, 13 Dec 2016 20:39:01 +0000 (22:39 +0200)]
gst: Don't declare variables inside the for loop header

This is a C99 feature.

6 years agogstglupload: relax EGL context check
Julien Isorce [Thu, 1 Dec 2016 09:24:18 +0000 (09:24 +0000)]
gstglupload: relax EGL context check

Check for GST_GL_PLATFORM_EGL enum instead of type GstGLContextEGL.

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

6 years agogstglcontext: is_shared should return FALSE if no group
Julien Isorce [Wed, 30 Nov 2016 09:22:17 +0000 (09:22 +0000)]
gstglcontext: is_shared should return FALSE if no group

If a sub class of GstGLContext does not create a group
then it currently crashes:

0 g_atomic_int_get (&share->refcount)
1 _context_share_group_is_shared (context->priv->sharegroup)
2 gst_gl_context_is_shared
3 _default_set_sync_gl

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

6 years agoglmemoryegl: remove spurious #if GST_GL_HAVE_DMABUF conditions
Matthew Waters [Wed, 30 Nov 2016 08:26:51 +0000 (19:26 +1100)]
glmemoryegl: remove spurious #if GST_GL_HAVE_DMABUF conditions

8c2118823b3d42840cc6f48cbdc0e1b342f90b80 had some incorrect preprocessor
conditions that aren't actually needed.  Remove them.

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

6 years agoglwindow: move g_main_context_push/pop_thread_default() to run()
Matthew Waters [Mon, 28 Nov 2016 03:22:05 +0000 (14:22 +1100)]
glwindow: move g_main_context_push/pop_thread_default() to run()

Calling g_main_context_push_thread and then g_main_context_invoke()
(used by gst_gl_window_send_message_async()) in the same thread will
cause the invoked function to run immediately instead of being delayed.

This had implications for the creation of the OpenGL context not waiting
until the main loop had completely started up and as a result would
sometimes deadlock in short create/destroy scenarios.

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

6 years agoglcontext: fix race between creation/shutdown
Matthew Waters [Mon, 28 Nov 2016 03:19:18 +0000 (14:19 +1100)]
glcontext: fix race between creation/shutdown

626bcccff96f624f59c5212b3e21e472240171fd removed some locks that
allowed the main loop quit to occur before the context was fully
created.

2776cef25d2a98668b73272aecfe77e684e6627e attempted to readd them but
missed the scop of the quit() call.

Also remove the use of g_thread_join() as that's not safe to use when
it's possible to lose the last reference from the GL thread.

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

6 years agogl/x11: Remove unused static function
Sebastian Dröge [Fri, 25 Nov 2016 21:44:25 +0000 (23:44 +0200)]
gl/x11: Remove unused static function

6 years agogldownload: fix element description (was "OpenGL uploader")
Florent Thiéry [Tue, 22 Nov 2016 17:06:52 +0000 (18:06 +0100)]
gldownload: fix element description (was "OpenGL uploader")

6 years agogl/contextglx: error out on more invalid display/window combinations
Matthew Waters [Wed, 23 Nov 2016 06:04:34 +0000 (17:04 +1100)]
gl/contextglx: error out on more invalid display/window combinations

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

6 years agogl: add necessary context_egl.h #includes to the source files
Matthew Waters [Wed, 23 Nov 2016 04:57:05 +0000 (15:57 +1100)]
gl: add necessary context_egl.h #includes to the source files

6 years agogl/memoryegl: remove access to private header gstglcontext_egl.h
Matthew Waters [Wed, 23 Nov 2016 02:32:38 +0000 (13:32 +1100)]
gl/memoryegl: remove access to private header gstglcontext_egl.h

It's been removed and thus compiling anything against GstGLMemoryEGL
would error with:

In file included from gstomxvideodec.c:41:0:
usr/include/gstreamer-1.0/gst/gl/egl/gstglmemoryegl.h:32:41: fatal error: gst/gl/egl/gstglcontext_egl.h: No such file or directory
 #include <gst/gl/egl/gstglcontext_egl.h>
                                         ^

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

6 years agogl: add gstreamer-video to pkg-config path
David Evans [Thu, 17 Nov 2016 15:41:00 +0000 (15:41 +0000)]
gl: add gstreamer-video to pkg-config path

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

6 years agogl/tests: fix glimagesink element test on OSX
Matthew Waters [Thu, 17 Nov 2016 03:35:26 +0000 (14:35 +1100)]
gl/tests: fix glimagesink element test on OSX

It was suffering a race starting up the thread that could cause the main
loop to quit before the main loop had started.

6 years agomeson: gl/egl: add missing source file
Matthew Waters [Thu, 17 Nov 2016 03:32:10 +0000 (14:32 +1100)]
meson: gl/egl: add missing source file

d42145e8c1ba3bc0445506b92bb7ac04ae98f4dd didn't add the necessary
meson build changes.

6 years agogl/egl: remove EGLImage functions from egl context
Matthew Waters [Wed, 16 Nov 2016 15:41:14 +0000 (02:41 +1100)]
gl/egl: remove EGLImage functions from egl context

By adding the necessary GstEGLImage entry points to create a GstEGLImage
from a GstGLMemory.

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

6 years agoglcontext: add vfunc to retrieve the OpenGL platform version
Matthew Waters [Wed, 16 Nov 2016 14:45:38 +0000 (01:45 +1100)]
glcontext: add vfunc to retrieve the OpenGL platform version

i.e. the version of EGL, GLX, etc implemented.

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

6 years agogl/egl: move get_error_string() into gstegl
Matthew Waters [Wed, 16 Nov 2016 14:38:32 +0000 (01:38 +1100)]
gl/egl: move get_error_string() into gstegl

So others can use it without #include-ing a private header

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

6 years agodisplay/egl: implement getting the EGLDisplay of a specific platform
Matthew Waters [Thu, 27 Nov 2014 04:50:04 +0000 (15:50 +1100)]
display/egl: implement getting the EGLDisplay of a specific platform

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

6 years agogl/egl: check the feature in the extensions list
Víctor Manuel Jáquez Leal [Wed, 16 Nov 2016 12:05:11 +0000 (13:05 +0100)]
gl/egl: check the feature in the extensions list

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

6 years agogl/tests: don't use the default framebuffer
Matthew Waters [Wed, 16 Nov 2016 06:30:54 +0000 (17:30 +1100)]
gl/tests: don't use the default framebuffer

Create our own instead as the default framebuffer may require special
fiddling (like having a visible window) to correctly display/be renderable.

Fixes the remaining GL library tests on OS X

6 years agoglcontext/cocoa: implement empty swap_buffers
Matthew Waters [Wed, 16 Nov 2016 02:39:32 +0000 (13:39 +1100)]
glcontext/cocoa: implement empty swap_buffers

Fixes some GL tests on OS X.

6 years agogl: remove empty BUGS file
Matthew Waters [Wed, 16 Nov 2016 05:41:59 +0000 (16:41 +1100)]
gl: remove empty BUGS file

We use bugzilla for bug tracking

6 years agoglwindow/cocoa: remove unneeded window code in NSWindow
Matthew Waters [Tue, 15 Nov 2016 13:01:00 +0000 (00:01 +1100)]
glwindow/cocoa: remove unneeded window code in NSWindow

This is all taken care of by GstGLWindowCocoa/GstGLNSView now.

6 years agoglwindow/cocoa: remove our view from the parent when closing
Matthew Waters [Tue, 15 Nov 2016 11:56:25 +0000 (22:56 +1100)]
glwindow/cocoa: remove our view from the parent when closing

Otherwise, when the application reuses the same UIView, we were getting
draw notifications on the previous view/layer's which weren't valid anymore
and were referencing pointers that had been freed.

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

6 years agogl/caopengllayer: add a debug category
Matthew Waters [Tue, 15 Nov 2016 10:43:59 +0000 (21:43 +1100)]
gl/caopengllayer: add a debug category

6 years agoglbufferpool: introduce check for GLMemory allocators
Matthew Waters [Tue, 15 Nov 2016 03:36:11 +0000 (14:36 +1100)]
glbufferpool: introduce check for GLMemory allocators

The last missing piece of EGLImage support has been pushed.

6 years agogl: x11-xcb is not a required dependency
Tim-Philipp Müller [Fri, 11 Nov 2016 01:05:55 +0000 (01:05 +0000)]
gl: x11-xcb is not a required dependency

Don't fail if it's not found..

6 years agogl/build: add missing build files
Matthew Waters [Thu, 10 Nov 2016 09:34:53 +0000 (20:34 +1100)]
gl/build: add missing build files

3f7b54988186de17ec4e5b5566074cfaa392819a was incomplete :(

6 years agogl/utils: move gen_shader() to the plugin and remove del_shader()
Matthew Waters [Thu, 10 Nov 2016 08:14:24 +0000 (19:14 +1100)]
gl/utils: move gen_shader() to the plugin and remove del_shader()

gst_gl_context_del_shader() can be replaced by a g_object_unref().
gst_gl_context_gen_shader() should be replaced by using GstGLSLStage.

6 years agoglwindow: remove unused field in public struct
Matthew Waters [Wed, 26 Oct 2016 05:53:27 +0000 (16:53 +1100)]
glwindow: remove unused field in public struct

6 years agoglwindow: remove is_running() function
Matthew Waters [Wed, 26 Oct 2016 05:30:43 +0000 (16:30 +1100)]
glwindow: remove is_running() function

It isn't necessary in correctly written programs.

6 years agomeson/gl: XCB changes also need x11-xcb as a dependency
Nirbheek Chauhan [Tue, 8 Nov 2016 12:20:51 +0000 (17:50 +0530)]
meson/gl: XCB changes also need x11-xcb as a dependency

https://ci.gstreamer.net/job/GStreamer-master-meson/380/console

[...]
gst-libs/gst/gl/x11/xcb_event_source.c:98: undefined reference to `xcb_get_file_descriptor'

6 years agogl/x11: fix meson build
Philippe Normand [Tue, 8 Nov 2016 08:52:48 +0000 (09:52 +0100)]
gl/x11: fix meson build

The x11_event_source.[ch] files were renamed in
4f6c226bd24ae3ef66bd8f4c17b001444c9b0bf1.

6 years agoexamples/gl/qt: fix the examples for the use of newer API
Matthew Waters [Tue, 8 Nov 2016 04:04:29 +0000 (15:04 +1100)]
examples/gl/qt: fix the examples for the use of newer API

gstgl doesn't undo/overwrite what GL state the examples are changing
anymore.  As such, the examples need to reset the GL state themselves
to be able to play nice with libgstgl

6 years agoglfiltershader: expand the docs slightly
Matthew Waters [Tue, 8 Nov 2016 02:35:33 +0000 (13:35 +1100)]
glfiltershader: expand the docs slightly

Add an example OpenGL shader

6 years agoglwindow: remove the navigation thread
Matthew Waters [Thu, 30 Jun 2016 14:31:07 +0000 (00:31 +1000)]
glwindow: remove the navigation thread

This functionality can now effectively be implemented with the display event
thread.

6 years agogl/x11: use xcb instead of libX11
Matthew Waters [Thu, 30 Jun 2016 14:07:23 +0000 (00:07 +1000)]
gl/x11: use xcb instead of libX11

- xcb is supposedly thread-safe!

videotestsrc ! glimagesink now doesn't spuriously result in a
'call XInitThreads()' error however if anybody else is using X11,
then XInitThreads() still needs to be called and multiple glimagesink's
still need XInitThreads().

Everything still takes libX11 handles as they are compatible with the xcb
variants.  Unfortunately we cannot move fully over to xcb due to GLX being
entirely based on Xlib.  It's also impossible to transform a xcb_connection
to a Display which means we require X11 handles.

6 years agogldisplay: add a list of glwindow's
Matthew Waters [Thu, 30 Jun 2016 13:12:33 +0000 (23:12 +1000)]
gldisplay: add a list of glwindow's

With the event thread on the display, for a particular winsys event
we need to be able to retreive the window that the event matches.

6 years agogldisplay: add a dedicated event thread
Matthew Waters [Thu, 30 Jun 2016 13:04:16 +0000 (23:04 +1000)]
gldisplay: add a dedicated event thread

Will take the place of the navigation event thread for dealing with
winsys events.

6 years agogl: don't expose OpenGL prototypes
Matthew Waters [Tue, 8 Nov 2016 01:44:45 +0000 (12:44 +1100)]
gl: don't expose OpenGL prototypes

We roll our own to avoid depending a certain OpenGL header version

6 years agogl/cocoa: don't install the gstglcontext_cocoa.h header
Matthew Waters [Mon, 7 Nov 2016 15:56:44 +0000 (02:56 +1100)]
gl/cocoa: don't install the gstglcontext_cocoa.h header

It's not needed to be exposed

6 years agogl/android: don't install the android window header
Matthew Waters [Mon, 7 Nov 2016 15:52:37 +0000 (02:52 +1100)]
gl/android: don't install the android window header

It's not needed

6 years agogl: add padding to all exposed winsys/platform-specific structs
Matthew Waters [Mon, 7 Nov 2016 15:50:41 +0000 (02:50 +1100)]
gl: add padding to all exposed winsys/platform-specific structs

6 years agogl/wayland: install the gstgldisplay_wayland.h header
Matthew Waters [Mon, 7 Nov 2016 15:47:36 +0000 (02:47 +1100)]
gl/wayland: install the gstgldisplay_wayland.h header

As it is used by other OpenGL sinks (gtkglsink, qmlglsink)

6 years agogl/egl: don't install the gstglcontext_egl.h header
Matthew Waters [Mon, 7 Nov 2016 15:44:30 +0000 (02:44 +1100)]
gl/egl: don't install the gstglcontext_egl.h header

It's not needed to be exposed and there are no users of the API.

6 years agoglfilter: remove display_init/reset
Matthew Waters [Mon, 7 Nov 2016 15:21:20 +0000 (02:21 +1100)]
glfilter: remove display_init/reset

They are mirrors of GstGLBaseFilter's gl_start() and gl_stop() virtual methods
so use them instead.

6 years agogldisplay: Fix inverted precondition
Matthew Waters [Thu, 3 Nov 2016 07:19:58 +0000 (18:19 +1100)]
gldisplay: Fix inverted precondition

A GError argument must either be null or point to a NULL GError.

https://developer.gnome.org/glib/stable/glib-Error-Reporting.html

6 years agogl/gi: some annotation updates for called functions
Matthew Waters [Thu, 3 Nov 2016 05:14:37 +0000 (16:14 +1100)]
gl/gi: some annotation updates for called functions

With scope, closure, destroy annotations

6 years agogl/gi: also include GstVideo
Matthew Waters [Thu, 3 Nov 2016 05:12:32 +0000 (16:12 +1100)]
gl/gi: also include GstVideo

Removes all the unknown type GstVideo* warnings while building the GIR
file.

6 years agoglfeature: move internal functions into a private header
Matthew Waters [Thu, 27 Oct 2016 05:19:04 +0000 (16:19 +1100)]
glfeature: move internal functions into a private header

Don't expose them to the outside world

6 years agogl: GST_GL_TYPE -> GST_TYPE_GL
Matthew Waters [Wed, 5 Oct 2016 01:19:12 +0000 (12:19 +1100)]
gl: GST_GL_TYPE -> GST_TYPE_GL

Some deprecated symbols are kept for backwards compatibility

6 years agogl/docs: massive update
Matthew Waters [Thu, 3 Nov 2016 01:03:24 +0000 (12:03 +1100)]
gl/docs: massive update

- add Since: markers where necessary.
- document structs
- add documentation headers for each module (short_description,
  see_also, etc)
- reduce the number of warnings gtk-doc outputs
- fix spelling mistakes

6 years agogl/docs: document new API added in 1.10
Matthew Waters [Wed, 2 Nov 2016 10:21:33 +0000 (21:21 +1100)]
gl/docs: document new API added in 1.10

GstGLRenderbuffer
GstGLFramebuffer
GstGLQuery
GstEGLImage
GstGLMemoryEGL

6 years agoglsl: fix #version 150 not working with profiles
Matthew Waters [Tue, 1 Nov 2016 06:30:03 +0000 (17:30 +1100)]
glsl: fix #version 150 not working with profiles

The spec allows the core/compatibility profiles to be used
with #version 150.

Also tighten up the tests to check for default profiles being chosen
correctly.

6 years agobuild: Also need to define GST_EXPORTS for Autotools
Nirbheek Chauhan [Fri, 28 Oct 2016 01:47:56 +0000 (07:17 +0530)]
build: Also need to define GST_EXPORTS for Autotools

The change to use GST_EXPORT for symbols under Windows requires
GST_EXPORTS for internal use, and that is also needed under Autotools.
The same thing is done for gstreamer-1.0.dll in -core.

6 years agogstgl: Re-enable WINAPI on _MSC_VER
Nirbheek Chauhan [Fri, 28 Oct 2016 00:53:02 +0000 (06:23 +0530)]
gstgl: Re-enable WINAPI on _MSC_VER

The calling convention may be deprecated, but we still need it for
OpenGL. The build issue was caused by an incorrect syntax being used for
the WINAPI (__stdcall) prototype in function pointers which was accepted
by GCC but is rejected by MSVC.

6 years agoplugins: Use explicit type conversion from enums
Nirbheek Chauhan [Thu, 27 Oct 2016 03:55:20 +0000 (09:25 +0530)]
plugins: Use explicit type conversion from enums

MSVC warns about this because it's a C++ compiler, and this actually
results in useful things such as the incorrect 'gboolean' return value
for functions that return GstFlowReturn, so let's do explicit
conversions to reduce the noise and increase its efficacy.

6 years agoExplicitly define float constants as float
Nirbheek Chauhan [Thu, 27 Oct 2016 03:41:26 +0000 (09:11 +0530)]
Explicitly define float constants as float

With MSVC, this gives the following warning:

warning C4305: 'function': truncation from 'double' to 'gfloat'

Apparently, MSVC does not figure out what type to use for constants
based on the assignment. This warning is very spammy, so let's try to
fix it.

6 years agoFix incorrect return type in several functions
Nirbheek Chauhan [Thu, 27 Oct 2016 03:38:41 +0000 (09:08 +0530)]
Fix incorrect return type in several functions

All these should return GstFlowReturn, not gboolean

6 years agogstgl: Add GST_EXPORT to all symbols used on Windows
Nirbheek Chauhan [Thu, 27 Oct 2016 02:47:58 +0000 (08:17 +0530)]
gstgl: Add GST_EXPORT to all symbols used on Windows

This is a requirement for those symbols to be exported in gstgl-1.0.dll
when building with the MSVC compiler

6 years agomeson: Add support for building WGL on Windows
Nirbheek Chauhan [Thu, 27 Oct 2016 01:59:36 +0000 (07:29 +0530)]
meson: Add support for building WGL on Windows

Currently only tested with MSVC.

6 years agoext/gl: Don't define boolean on Windows with MSVC
Nirbheek Chauhan [Thu, 27 Oct 2016 03:40:03 +0000 (09:10 +0530)]
ext/gl: Don't define boolean on Windows with MSVC

The headers we include already define boolean on Windows with MSVC, and
it leads to a typedef redefinition error with jpeglib.h which tries to
redefine it in jmorecfg.h

6 years agogstgl: Porting fixes for MSVC with Meson
Nirbheek Chauhan [Thu, 27 Oct 2016 02:00:19 +0000 (07:30 +0530)]
gstgl: Porting fixes for MSVC with Meson

GL/gl.h needs windows.h on MSVC

WINAPI should not be used with MSVC. It also causes a build error.

6 years agoglsyncmeta: don't glFinish() everytime a sync point is set
Matthew Waters [Fri, 21 Oct 2016 02:10:47 +0000 (13:10 +1100)]
glsyncmeta: don't glFinish() everytime a sync point is set

At minimum, we only need to glFlush() if we are in a shared GL context
environment.  Move the glFinish() to when the actual wait is requested
which may be never.  Improves the throughput on older GL systems without
GL3/GLES3 and/or fence sync objects.

6 years agomeson: gl: add support for building with dispmanx on the rpi
Matthew Waters [Wed, 19 Oct 2016 05:11:58 +0000 (16:11 +1100)]
meson: gl: add support for building with dispmanx on the rpi

6 years agogl/eglimage: Fix passing the destroy function to gst_egl_image_new_wrapped
Matthew Waters [Tue, 18 Oct 2016 11:29:19 +0000 (22:29 +1100)]
gl/eglimage: Fix passing the destroy function to gst_egl_image_new_wrapped

The function pointer and the user data arguments were swapped in both
uses.

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

6 years agoImplemented gst_video_overlay_set_window_handle()
Munez [Tue, 11 Oct 2016 11:36:23 +0000 (17:06 +0530)]
Implemented gst_video_overlay_set_window_handle()

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

6 years agomeson: gl: fix detection of glx without gl
Matthew Waters [Tue, 18 Oct 2016 03:11:26 +0000 (14:11 +1100)]
meson: gl: fix detection of glx without gl

We need to check for libGL if we may use desktop OpenGL *or* GLX.

6 years agomeson: gl: fix incorrect error string
Matthew Waters [Tue, 18 Oct 2016 03:10:32 +0000 (14:10 +1100)]
meson: gl: fix incorrect error string

Use the winsys variable for an incorrect winsys provided

6 years agogl/dispmanx: egl_show should resize the window only if there is no render rectangle set
Munez [Tue, 11 Oct 2016 11:28:48 +0000 (16:58 +0530)]
gl/dispmanx: egl_show should resize the window only if there is no render rectangle set

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

6 years agogl/dispmanx: Fix set_render_rectangle typo
Munez [Tue, 11 Oct 2016 11:25:17 +0000 (16:55 +0530)]
gl/dispmanx: Fix set_render_rectangle typo

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

6 years agoglwindow: don't use g_thread_join() to join the navigation thread
Matthew Waters [Wed, 5 Oct 2016 07:32:09 +0000 (18:32 +1100)]
glwindow: don't use g_thread_join() to join the navigation thread

Using g_thread_join() in _finalize() handlers may result in a deadlock
joining the current thread when the last reference is held by a signal
handler.

e.g.:

error 'Resource deadlock avoided' during 'pthread_join (pt->system_thread, NULL)'

The backtrace looks like this:
[...]
g_thread_join ()
gst_gl_window_finalize ()
gst_gl_window_x11_finalize ()
g_object_unref ()
g_value_unset ()
g_signal_emit_valist ()
g_signal_emit ()
gst_gl_window_send_mouse_event ()
gst_gl_window_mouse_event_cb ()
g_main_dispatch ()
[..]
g_main_loop_run ()
gst_gl_window_navigation_thread ()
g_thread_proxy ()
start_thread ()
clone ()

6 years agogluploadelement: fix leak of upload library object
Matthew Waters [Wed, 5 Oct 2016 07:28:48 +0000 (18:28 +1100)]
gluploadelement: fix leak of upload library object

When only linking the element, the upload object will be created from
_transform_caps() but will never be unreffed as the only case is in _stop().

Add an unref if non-NULL to a new finalize handler for this case.

6 years agotests/gl: make sure all GL commands are executed on the GL thread
Matthew Waters [Thu, 29 Sep 2016 01:45:57 +0000 (11:45 +1000)]
tests/gl: make sure all GL commands are executed on the GL thread

e.g. the final glGetError() must also be completed on the GL thread

6 years agogl/win32: remove egl implementation
Matthew Waters [Wed, 28 Sep 2016 08:04:21 +0000 (18:04 +1000)]
gl/win32: remove egl implementation

It hasn't been used in ages and is dead code.

6 years agogl/dispmanx: Implements set_render_rectangle to adjust the position of window
Gwang Yoon Hwang [Thu, 5 May 2016 06:53:57 +0000 (15:53 +0900)]
gl/dispmanx: Implements set_render_rectangle to adjust the position of window

We cannot set the x, y coordinate of the video frame at the dispmanx at
this point. We need to teach dispmanx backend to understand about
set_render_rectangle API to draw a video with other UI.

This patch keeps the current behavior which places video frame at the
center of the display if there is no set_render_rectangle call to the
dispmanx window.

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