Commit graph

1487 commits

Author SHA1 Message Date
Munez
cb8204f6c0 Implemented gst_video_overlay_set_window_handle()
https://bugzilla.gnome.org/show_bug.cgi?id=772608
2016-10-18 15:53:10 +11:00
Matthew Waters
5e2f9a9690 meson: gl: fix detection of glx without gl
We need to check for libGL if we may use desktop OpenGL *or* GLX.
2016-10-18 14:15:40 +11:00
Matthew Waters
b85fa6f2dd meson: gl: fix incorrect error string
Use the winsys variable for an incorrect winsys provided
2016-10-18 14:10:32 +11:00
Munez
429135face 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
2016-10-18 11:23:42 +11:00
Munez
1cf3d0a590 gl/dispmanx: Fix set_render_rectangle typo
https://bugzilla.gnome.org/show_bug.cgi?id=772698
2016-10-18 11:23:42 +11:00
Matthew Waters
9ad4c67578 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 ()
2016-10-05 18:32:09 +11:00
Matthew Waters
e20dab09ea gl/win32: remove egl implementation
It hasn't been used in ages and is dead code.
2016-10-05 12:20:52 +11:00
Gwang Yoon Hwang
b75ec0c433 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
2016-09-28 17:08:52 +10:00
Matthew Waters
c200e47ef8 gl: add necessary padding bytes to all public structs 2016-09-28 17:08:52 +10:00
Matthew Waters
bad58e2b13 gldisplay: also free the GWeakRef when removing dead contexts
Otherwise we leak GWeakRef's.

Found with make -C tests/check libs/gstglcontext.valgrind
2016-09-22 18:25:37 +10:00
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