Commit graph

1477 commits

Author SHA1 Message Date
Matthew Waters
32273c2c9c meson/gl: use separate deps for gl and glx
e.g. passing with_gl_api=gles2 would still build the glx code but not be
linking against the libGL library which is where the glX* functions are
located and would result in a linker error.

Solved by checking for the libGL library if either opengl or glx may be
needed and then disabling the corresponding deps as requested.
2016-09-09 23:26:24 +10:00
Matthew Waters
b5b7a3aec3 meson: add some starting build files for GL
Currently only works on linux with egl/glx + wayland/x11 but the general
principals have been layed out for adding the other GL platforms/winsys'.
2016-09-09 11:22:47 +10:00
Alistair Buxton
c3d5057185 gl: Remove duplicate GL_CFLAGS in Makefile.am.
https://bugzilla.gnome.org/show_bug.cgi?id=771021
2016-09-08 09:45:18 +10:00
Jan Schmidt
840c2729cc gl: Remove extra duplicate typedef of GstGLFramebuffer
It's triggering a warning building git master on OSX
2016-08-31 04:27:09 +10:00
Alessandro Decina
a7dccec0ff glupload: fix tests and check for the new RECONFIGURE behaviour
The tests were broken since 91fea30, which changed glupload to return
GST_GL_UPLOAD_RECONFIGURE if the texture target in the input buffers doesn't
match the texture-target configured in the output caps.

This commit fixes that and adds more checks for the new behaviour.
2016-08-29 16:06:06 +10:00
Alessandro Decina
91fea30ff4 gstglupload: make the GLMemoryUpload method output the correct texture-target
Now when used with video/x-raw as input, the GLMemoryUpload method checks for
->tex_target in input GLMemory(es) and sets the output texture-target
accordingly.

Fixes video corruption with a pipeline like avfvideosrc ! video/x-raw !
glimagesink where on macos avfvideosrc pushes RECTANGLE textures but glupload
was configuring texture-target=2D as output.
2016-08-26 17:44:33 +10:00
Jan Schmidt
45df74868c glviewconvert: Fix texture target fixation
Don't set the chosen texture-target into the wrong structure.
The input caps may not be writable, and in any case - the
intention was to configure the othercaps. Also, remove an
extra unref - the othercaps ref is consumed by
gst_caps_make_writable already.
2016-08-26 03:25:49 +10:00
Nirbheek Chauhan
42af2d66d8 Add support for Meson as alternative/parallel build system
https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Matej Knopp <matej.knopp@gmail.com>
Jussi Pakkanen <jpakkane@gmail.com> (original port)

Highlights of the features provided are:
* Faster builds on Linux (~40-50% faster)
* The ability to build with MSVC on Windows
* Generate Visual Studio project files
* Generate XCode project files
* Much faster builds on Windows (on-par with Linux)
* Seriously fast configure and building on embedded

... and many more. For more details see:

http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html
http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html

Building with Meson should work on both Linux and Windows, but may
need a few more tweaks on other operating systems.
2016-08-20 11:35:54 +01:00
Matthew Waters
306e610547 glwindow: marshal gst_gl_window_resize through the window loop
saves having every caller do it themselves.
2016-08-19 16:07:07 +10:00
Matthew Waters
05a0f0002c gl/wayland: use multi-threaded safe event wayland API
Multiple threads may be accessing the wayland fd at the same time which
requires the use of special wayland API to deal with to ensure nobody
will steal reads and cause a stall for anyone else.
2016-08-19 16:06:26 +10:00
Matthew Waters
0fc3c0f9dc gl/egl: fix inverted typedef
2b6841d had an inverted typedef defining ginptr and EGLAttrib.  Fix that.
2016-08-16 20:34:37 +10:00
Matthew Waters
2b6841da32 gl/build: add configure check for possibly missing EGLAttrib
Fixes the build on older android targets.
2016-08-16 16:51:02 +10:00
Song Bing
4e04f28478 gl/egl/dmabuf: Wrong attribute list type for EGL 1.5
For EGL 1.5 spec, the attribute list type should be EGLAttrib.

https://bugzilla.gnome.org/show_bug.cgi?id=768602
2016-08-16 15:34:08 +10:00
Vincent Penquerc'h
2776cef25d glcontext: fix race joining thread on finalize
https://bugzilla.gnome.org/show_bug.cgi?id=769939
2016-08-16 13:10:30 +10:00
Matthew Waters
402ab38f07 glcolorconvert: add missing rgb16 and bgr16 video formats in switch
Fixes an assertion that code should not be reached

https://bugzilla.gnome.org/show_bug.cgi?id=769462
2016-08-04 23:16:14 +10:00
Haihua Hu
fa37e3588e glwindow: Fix glimagesink cannot show frame when connect to qmlglsrc
When connect to qmlglsrc, x11 event loop will be replace by qt event loop
which will cause the window cannot receive event from xserver, such as resize

https://bugzilla.gnome.org/show_bug.cgi?id=768160
2016-08-03 22:10:56 +10:00
Hyunjun Ko
2bb3baa8c9 glupload: Use bufferpool to allocate new buffer in GLTextureUploadMeta
To improve performace of upload with GLTextureUploadMeta,
use bufferpool instead of allocating new buffer every time.

https://bugzilla.gnome.org/show_bug.cgi?id=769293
2016-08-03 21:16:47 +10:00
Matthew Waters
a46d4f3b57 glwindow: move unsetting queue_resize to _resize() instead of _draw()
Makes infinitely more sense and implementation were expecting that behaviour
anyway and would enter a resize, draw, resize, draw, ... cycle instead of only
resizing once.
2016-08-03 21:15:01 +10:00
Matthew Waters
01157c4433 glframebuffer: add compatibility definition for GL_DEPTH_STENCIL_ATTACHMENT
GLES2 doesn't have it defined...
2016-07-26 15:57:54 +10:00
Matthew Waters
5da138d1ae glfilter: rewrite subclasses for filter_texture() occuring on GL thread
There's no need for the jump to an extra thread in most cases, especially
when relying solely on a shader to render.  We can use the provided
render_to_target() functions to simplify filter writing.
2016-07-26 14:07:24 +10:00
Matthew Waters
6edd89c883 glutils: remove unused GstGLDisplayProjection 2016-07-26 14:07:24 +10:00
Matthew Waters
06b4b52a20 glcontext: remove not thread-safe get/set_error()
Use GError's instead if necessary.
2016-07-26 14:07:24 +10:00
Matthew Waters
518e8a3fd2 glframebuffer: rewrite for a more consistent API
Facilities are given to create fbo's and attach GL memory (renderbuffers
or textures).  It also keeps track of the renderable size for use with
effective use with glViewport().
2016-07-26 14:07:24 +10:00
Matthew Waters
aa109016a3 gl: use GLMemory for accessing textures everywhere
This simplifies and consolidates a lot of duplicated code creating
and modifying textures.
2016-07-26 14:07:24 +10:00
Matthew Waters
f10a67ec44 glfilter: rename draw_texture to draw_fullscreen_quad
And remove unused arguments.
2016-07-26 14:07:24 +10:00
Matthew Waters
9e06a75018 gl: add memory type for renderbuffer's
Soon to be used for framebuffers for e.g. depth buffers or throwaway color
buffers.
2016-07-26 14:07:24 +10:00
Matthew Waters
0daa380245 glformat: define our own set of formats from the GL defines
also add some depth/stencil formats
2016-07-26 14:07:24 +10:00
Matthew Waters
6f4091bbd3 glbasememory: assert for a valid allocator instead of segfaulting 2016-07-26 14:07:24 +10:00
Tim-Philipp Müller
c593e0a17f gl: wayland: improve debug message when connecting to display
And another copy'n'paste-o.

https://bugzilla.gnome.org/show_bug.cgi?id=768929
2016-07-18 17:47:50 +01:00
Matthew Waters
087bb0ed6a glviewconvert: fix transformation matrix usage
Calling glUniformMatrix before the shader is bound is invalid and
would result in errors like:

GL_INVALID_OPERATION in glUniformMatrix(program not linked)

Move glUniformMatrix() to after the gst_gl_shader_use() call.
2016-06-30 21:54:03 +10:00
Matthew Waters
e0ecd774dd glupload: fix raw data uploader with addition of GstVideoGLTextureType
Fixes regression from 989200820d

https://bugzilla.gnome.org/show_bug.cgi?id=768217
2016-06-30 14:07:32 +10:00
Olivier Crête
461201c396 glvideoconvert: RG/LA is available in OpenGL ES 3, so let that through 2016-06-29 23:55:18 -04:00
Matthew Waters
5592a966c6 Revert "Revert "gl/eagl: try getting a gles3 context""
This reverts commit eb14273631.

vtdec now successfully outputs textures that can be converted by
glcolorconvert in GLES3 contexts.
2016-06-29 18:04:28 +10:00
Matthew Waters
989200820d glmemory: add the texture type to allocate to parameters
Rather than assuming something.  e.g. zerocopy on iOS with GLES3 requires
the use of Luminance/Luminance Alpha formats and does not work with
Red/RG textures.
2016-06-29 18:04:28 +10:00
Matthew Waters
6958b7a014 glcolorconvert: don't assume Red/RG textures will be used
Take the used texture type from the memory instead.

Fixes conversion from multi-planar YUV formats with two components per plane
(NV12, NV21, YUY2, UYVY, GRAY16_*, etc) with Luminance Alpha input textures.

This is also needed for zerocopy decoding on iOS with GLES 3.x.
2016-06-29 18:04:28 +10:00
Matthew Waters
b9cdc9d4b0 glcontext: correct precondition for get_gl_version
The intention was to assert if both maj and min were NULL (as there would be no
point calling the function).  Instead if either maj or min were NULL, the assert
would occur.

Fix that.
2016-06-29 18:04:28 +10:00
Sebastian Dröge
0e58e86c4c eglimage: Only register debug category if dmabuf support is enabled
It's not used otherwise currently and causes compiler warnings.
2016-06-23 16:00:00 +03:00
Wang Xin-yu (王昕宇)
6ed2ca373a glcontext/wgl: try wglCreateContextAttribsARB even not gl3 core profile
https://bugzilla.gnome.org/show_bug.cgi?id=764018
2016-06-21 22:57:13 +10:00
Matthew Waters
8a67cd90b3 glcontext: fix get_current_gl_api() on win32
Another case of incorrect calling conventions.

Using this function on win32 would corrupt the stack pointer and end in
massive hilarity.
2016-06-21 22:57:00 +10:00
Matthew Waters
d3f3787d64 glsl: fixup external-oes shaders by mangling the required extension
Newer devices require using a different GLSL extension for accessing
external-oes textures in a shader using the texture() functions.

While the GL_OES_EGL_image_external_essl3 should supposedly be supported
on a any GLES3 android device, the extension was defined after a lot of the
older drivers were built so they will not know about it.  Thus there are two
possible interpretations of which of texture[2D]() should be supported for
external-oes textures.  Strict adherence to the GL_OES_EGL_image_external
extension spec which uses texture2D() or following GLES3's pattern, also
allowing texture() as a function for accessing external-oes textures

This adds another mangling pass to convert
 #extension GL_OES_EGL_image_external : ...
into
 #extension GL_OES_EGL_image_external_essl3 : ...
on GLES3 and when the GL_OES_EGL_image_external_essl3 extension is supported.

Only uses texture() when the GLES3 and the GL_OES_EGL_image_external_essl3
extension is supported for external-oes textures.
Uses GLES2 + texture2D() + GL_OES_EGL_image_external in all other external-oes
cases.

https://bugzilla.gnome.org/show_bug.cgi?id=766993
2016-06-21 21:27:47 +10:00
Sergey Borovkov
180405714c qml: Enable qmlglsink for eglfs
https://bugzilla.gnome.org/show_bug.cgi?id=763044
2016-06-16 01:49:16 +10:00
Matthew Waters
861ce43cd8 glsl: add some debugging 2016-06-15 18:10:59 +10:00
Matthew Waters
27e4288de4 glutils: remove unused functions for texture creation/deletion
Everyone uses GstGLMemory now and any future code should as well.
2016-06-15 16:08:57 +10:00
Matthew Waters
216b8eea6c glfilter: remove unused class fields in/out_tex_id
The functionality is not used by any subclass nor are the values set anywhere.
2016-06-15 15:47:47 +10:00
Matthew Waters
6b7f94abb2 gl/upload/meta: remove unneeded texture deletion
The textures are managed by the GstGLMemory inside the output buffer.  Freeing
them prematurely may result in a use-after-free.
2016-06-15 14:40:40 +10:00
Guillaume Desmottes
991d9a6f5f gst-libs: gl, video: use MAY_BE_LEAKED flag
https://bugzilla.gnome.org/show_bug.cgi?id=767162
2016-06-03 00:59:12 +01:00
Havard Graff
63a05aff6a gl: glquery: cast to silence compiler warning
https://bugzilla.gnome.org/show_bug.cgi?id=766973
2016-05-28 22:28:06 +01:00
Matthew Waters
e597e45008 gldisplay: always unref the context on a collision
Otherwise we will leak GstGLContext's when adding the same context more than
once.

Fixes a regression caused by 5f9d10f603 in the
gstglcontext unit test that failed with:

Assertion 'tmp == NULL' failed
2016-05-26 20:19:13 +10:00
Xavier Claessens
b2cfc56e83 gl: win32: Add debug category in gstglcontext_wgl.c
https://bugzilla.gnome.org/show_bug.cgi?id=766867
2016-05-25 23:10:44 +10:00
Haihua Hu
a5cb746983 glimagesink: support video rotation using transform matrix
Add "rotate-method" to glimagesink and apply transform matrix
to vertex coordinate to control rotation.

https://bugzilla.gnome.org/show_bug.cgi?id=765795
2016-05-25 18:28:20 +10:00