Commit graph

2545 commits

Author SHA1 Message Date
Matthew Waters
be9739cd2f gl/wayland: run each window on a separate queue
Based on patch by Julien Isorce <julien.isorce@collabora.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=709747
2015-05-31 16:04:12 +10:00
Jan Schmidt
845256bf61 gl: Don't leak temp strings in _RGB_pixel_order()
Fix a memory leak of temporary strings when computing
swizzling of RGB formats.
2015-05-30 02:46:24 +10:00
Jan Schmidt
5543803acf glfilter: Add transform_internal_caps() vfunc
Add a vfunc that is called by glfilter before it sets
caps features and intersects with the peer caps, and
move removing the size from caps into its default
implementation. Allows sub-classes to do more
sophisticated management of the size fields in case they
don't support arbitrary resizing or have distinct
preferences.
2015-05-30 02:31:39 +10:00
Jan Schmidt
b6002141ab glfilter: Don't remove size fields from caps
Instead of removing size fields, set them to the full range
like videoscale does, so the caps are clearly unfixed in
all cases.
2015-05-30 02:31:39 +10:00
Jan Schmidt
37298354ff videoaggregator: Add class property to disable caps scaling
Add preserve_update_caps_result boolean on the class to allow
sub-classes to disable videoaggregator removing sizes and framerate
from the update_caps() return result.
2015-05-30 01:33:49 +10:00
Jan Schmidt
6dabd46a2d videoaggregator: Catch errors, and allow sub-class to return NULL from get_output_buffer()
A return value of GST_FLOW_OK with a NULL buffer from get_output_buffer()
means the sub-class doesn't want to produce an output buffer, so
skip it.

If gst_videoaggregator_do_aggregate() generates an error, make sure
to propagate it - don't just ignore and discard the error by
over-writing it with the gst_pad_push() result.
2015-05-30 01:33:49 +10:00
Julien Isorce
b377112ee3 gl: add GstGLContextGPUProcess backend
It builds its GL vtable from a proc address provided
by the application.
2015-05-27 17:22:40 +01:00
Julien Isorce
ba5bf50d5f gl: add and use gst_gl_internal_format_rgba
Previously when compiling GstGL with both GL and GLES2,
GL_RGBA8 was picked from GL/gl.h. But a clash may happen at
runtime when one is selecting GLES2.

gst_gl_internal_format_rgba allows to check at runtime
if it should use GL_RGBA or GL_RGBA8.
2015-05-27 17:20:05 +01:00
Julien Isorce
c5f8c789a3 glwindow_x11: use parent default implementation 2015-05-27 17:10:32 +01:00
Julien Isorce
48751c8d8a glcontext_glx: rename variable from window to context 2015-05-27 17:10:19 +01:00
Julien Isorce
9364fc5d7f glwindow: initialize debug in class_init
Useful if one uses gst_gl_window_x11_new directly
instead of gst_gl_window_new.
2015-05-27 17:10:08 +01:00
Julien Isorce
3bc4f55d3d glcontext: initialize debug in class_init
Useful if one uses gst_gl_context_egl_new directly
instead of gst_gl_context_new.
2015-05-27 17:09:53 +01:00
Julien Isorce
71b8103cbd glcontext: add gst_gl_context_set_display helper 2015-05-27 17:09:42 +01:00
Julien Isorce
8ad3c0a7b9 glcontext: add missing _CAST after G_TYPE_CHECK_CLASS 2015-05-27 17:09:31 +01:00
Julien Isorce
411488598e glwindow: add missing _CAST after G_TYPE_CHECK_CLASS 2015-05-27 17:09:23 +01:00
Julien Isorce
072183ce61 glwindow: provides some default implementations to factorize with all backends 2015-05-27 17:08:11 +01:00
Jan Schmidt
e3ec07220b aggregator: Push EOS on error return.
Before shutting down the srcpad task due to a
downstream error, push an EOS to give downstream
a chance to shut down somewhat cleanly.
2015-05-28 01:03:15 +10:00
Xavier Claessens
7bfd2703c6 gl: propagate return value from filter and filter_texture
https://bugzilla.gnome.org/show_bug.cgi?id=749846
2015-05-26 16:49:55 -04:00
Luis de Bethencourt
6857048079 adaptivedemux: 'for' loop initial declaration
'for' loop initial declarations are only allowed in C89, moving the declaration
to before the 'for' loop.
2015-05-26 15:24:55 +01:00
Matthew Waters
656918d5d6 gl/wayland: remove dead event source code 2015-05-25 17:39:14 +10:00
Matthew Waters
2704fdaa59 gl/wayland: add GstGLDisplayWayland
Simple implementation split from GstGLWindowWayland

Can now have multiple glimagesink elements all displaying output
linked via GL or otherwise (barring GL platform limitations).

The intel driver is racy and can crash setting up the two glimagesink contexts.

e.g.
videotestsrc ! tee name=t ! queue ! glupload ! glimagesinkelement
  t. ! queue ! gleffects_blur ! glimagesinkelement

videotestsrc ! glupload ! glfiltercube ! tee name=t ! queue ! glimagesinkelement
  t. ! queue ! gleffects_blur ! glimagesinkelement
2015-05-25 17:39:14 +10:00
Matthew Waters
dec8139e65 gl/calayer: provide the exact GL api version for the wrapped context
Otherwise we could end up being mistaken for the diference between a
gl3 and a gl2 context resulting in a failure getting the list of
extensions from the wrapped context due to the difference between
glGetString and glGetStringi for the GL_EXTENSIONS token.

https://bugzilla.gnome.org/show_bug.cgi?id=749728
2015-05-23 01:26:05 +10:00
Xavier Claessens
1a98face84 gl: win32: do not call SetParent in release_parent_win_id()
When called from gst_gl_window_win32_close(), internal window
could not exist, and if it does it's going to be destroyed just
after that anyway. Also it causes window_proc() to be called
and crash because it gets a NULL context.

When called from gst_gl_window_win32_set_window_handle() we are
going to set another parent anyway, and it's probably better to
reparent directly instead of passing by a NULL parent which could
cause the internal window to popup briefly.

https://bugzilla.gnome.org/show_bug.cgi?id=749601
2015-05-21 16:58:11 -04:00
Xavier Claessens
ae77afeb74 gl: win32: remove unused code
https://bugzilla.gnome.org/show_bug.cgi?id=749601
2015-05-21 16:58:11 -04:00
Xavier Claessens
247697ce62 gl: win32: fix crash when finalizing GstGLContext
gst_gl_context_finalize() is calling gst_gl_window_win32_quit()
which was posting a message. But then window_proc takes window's
context and get a NULL.

Now that we've got a GMainLoop we can do like other backends and
simply call g_main_loop_quit().

This also remove duplicated code to release the parent window and
potential crash there because parent_proc could be NULL if we never
created the internal window. That could happen for example if setting
state to READY then setting a window_handle, and go back to NULL state.

https://bugzilla.gnome.org/show_bug.cgi?id=749601
2015-05-21 14:33:53 -04:00
Xavier Claessens
e1a827822e gl: win32: Fix leaked GstGLContext
https://bugzilla.gnome.org/show_bug.cgi?id=749601
2015-05-21 14:33:53 -04:00
Xavier Claessens
0acc18c60f gl: win32: set the parent window when creating internal window
When _set_window_handle() was called in READY state, it wasn't
set to the internal window created later.

https://bugzilla.gnome.org/show_bug.cgi?id=749601
2015-05-21 14:33:52 -04:00
Xavier Claessens
e24bc348bd gl: win32: use a GMainContext to dispatch win32 messages
gst_gl_window_win32_send_message_async() could be called before the
internal window is created so we cannot use PostMessage there.

x11 and wayland backends both create a custom GSource for this,
so there is no reason to not do that for win32.

https://bugzilla.gnome.org/show_bug.cgi?id=749601
2015-05-21 14:33:52 -04:00
Jan Schmidt
c9372ae33f glupload: Don't leak all memory uploaded via raw uploads.
Remove an extra ref missed when switching over to not
reusing output textures
2015-05-22 00:28:25 +10:00
Matthew Waters
e9f0d0fb51 glcontext: require a shader version to initialize.
It's very near pointless to try our GL implementation without shaders.

https://bugzilla.gnome.org/show_bug.cgi?id=749284
2015-05-21 15:07:38 +10:00
Xavier Claessens
7ca9f52ccb gl: fix crash on windows with intel driver
https://bugzilla.gnome.org/show_bug.cgi?id=749430
2015-05-20 00:56:44 +10:00
Matthew Waters
2e58daf196 gl/calayer: provide a current wrapped GstGLContext for callbacks
So that the draw and resize callbacks can get the current GstGLContext.
2015-05-20 00:36:48 +10:00
Matthew Waters
81e46e8b75 glsyncmeta: ensure that the Fence is going to be executed
Otherwise it could stay client side without being submitted to the GL
server resulting in another context waiting on a Fence that will never
become signalled causing a deadlock.
2015-05-20 00:36:48 +10:00
Matthew Waters
2747eb1232 glupload: don't reuse output textures for raw data upload
Causes stale textures to be used further down the chain.
2015-05-20 00:36:48 +10:00
Matthew Waters
2352545bee glframebuffer: don't clear the framebuffer
Breaks attempting to blend with the destination buffer and should be done
explicitly by the callback anyway.
2015-05-19 11:11:02 +10:00
Matthew Waters
ddc4f1ffbd glbasefilter: track gl_start/stop correctly
Don't start multiple times without calling gl_stop.
2015-05-19 11:09:54 +10:00
Matthew Waters
1e9c30223e glcontext/cocoa: implement GL3 core context selection 2015-05-14 20:35:18 +10:00
Matthew Waters
0870e8785e gl: remove useless gl{En,Dis}able (GL_TEXTURE_*) calls
We are using shaders everywhere and so they are not needed
2015-05-14 16:42:09 +10:00
Matthew Waters
e1b077d6af glshader: attempt to detect the gles2 inside opengl3 case
This is necessary to use gles2 shaders in a GL 3 core context on
OS X which fails without a proper #version being set on the shaders.
2015-05-14 14:58:07 +10:00
Matthew Waters
3d0bc93edc glshader: remove references to gl3 specific shaders
We rely specifically on gles2 shaders being supported by the GL
implementation with GL3 core profile.
2015-05-14 14:58:07 +10:00
Matthew Waters
7f7a9dd3ec gl: element buffers are part of vao state
Use them as such.  They are also required for GL3 core profile support
with glDrawElements on OS X.
2015-05-14 14:58:07 +10:00
Matthew Waters
ba5130fe01 glmemory: properly detect (hopefully) the correct ext_rg/arb_rg variant
GL_EXT_texture_rg is only valid for GLES2. GLES3 uses similar wording to
the GL_ARB_texture_rg which requires a sized internal format that the
GL_EXT_texture_rg does not require.

https://www.khronos.org/registry/gles/extensions/EXT/EXT_texture_rg.txt
https://www.opengl.org/registry/specs/ARB/texture_rg.txt
2015-05-14 14:58:07 +10:00
Matthew Waters
0871b7b43d compositor: implement proper par handling
We were previously failing on different input and output par
2015-05-14 14:58:07 +10:00
Thiago Santos
61cad123d7 adaptivedemux: drop debug message that was wrong
EOS doesn't necessarily mean that no fragment was downloaded
2015-05-13 13:35:14 -03:00
Thiago Santos
8331b083ee adaptivedemux: run gst-indent
To allow commiting on this file cleanly
2015-05-13 13:35:14 -03:00
Matthew Waters
07dffe9e5b glcontext: propagate the version/extension failure upwards
Otherwise the calling code has no idea that the context failed to
be created fully.

https://bugzilla.gnome.org/show_bug.cgi?id=749284
2015-05-13 23:56:48 +10:00
Matthew Waters
1853e455ac gl: don't deadlock on context creation failure
https://bugzilla.gnome.org/show_bug.cgi?id=749284
2015-05-13 23:56:48 +10:00
Sebastian Dröge
53c79cbf86 Revert "gl: readd glupload/download onto element pads"
This reverts commit 87d8270f30.
2015-05-06 15:46:49 +02:00
Jimmy Ohn
868472affb adaptivedemux: only update stream position if query success
We don't need to check about the query fail case.
because it is update to segment position even though query fail.

https://bugzilla.gnome.org/show_bug.cgi?id=748529
2015-05-05 14:33:41 -03:00
Matthew Waters
6f85a17ab3 glsyncmeta: fixup size declaration 2015-05-05 14:46:17 +10:00