Commit graph

165 commits

Author SHA1 Message Date
Matthew Waters
9829245b2b glimagesink: support the affine transformation meta for any texture target 2017-12-09 19:32:18 +00:00
Vineeth TM
e92bbb2a83 bad: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763081
2017-12-09 19:32:18 +00:00
Vineeth TM
cd696a0b79 glimagesink: Fix window memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=763356
2017-12-09 19:32:17 +00:00
Matthew Waters
9ac6c546de glimagesink: remove unsed reconfigure variable 2017-12-09 19:32:16 +00:00
Matthew Waters
5694cdd8ca 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
2017-12-09 19:32:16 +00:00
Matthew Waters
b25ce3f334 glimagesink: remove reduntant glimagesink from debug logging 2017-12-09 19:32:14 +00:00
Florent Thiéry
f18d14db45 glimagesink: Post unhandled navigation events on the bus
Based off xvimagesink implementation

https://bugzilla.gnome.org/show_bug.cgi?id=759869
2017-12-09 19:32:13 +00:00
Lubosz Sarnecki
dbcea228b2 glimagesink: Show error when video frame is not mapped.
Adds more meaningful error than
"Failed to convert multiview video buffer", which is always used
when prepare_next_buffer() fails in gst_glimage_sink_prepare().

https://bugzilla.gnome.org/show_bug.cgi?id=743345
2017-12-09 19:32:13 +00:00
Matthew Waters
09677a4d30 glimagesink: don't deadlock on resize
Performing any GL function marshalling off the GL thread with glimagesink's
render lock is prone to deadlocks between the GL thread and the non-GL thread.

What can happen is this:
1. non-GL thread attempts to function marshal to the GL thread.
2. while 1 is happening, the winsys gives an event (say resize)
3. This calls back into glimagesink which taks the render lock.
4. As the GL function marshalling is attempting to run on the GL
   and already has glimagesink's render lock locked.  This deadlocks
   as the threads are waiting for each other.
2017-12-09 19:32:13 +00:00
Sebastian Dröge
c9fafe8445 glimagesink: Remove unused variable
gstglimagesink.c: In function 'gst_glimage_sink_on_draw':
gstglimagesink.c:1959:18: error: unused variable 'sync_meta' [-Werror=unused-variable]
   GstGLSyncMeta *sync_meta = NULL;
                  ^
2017-12-09 19:32:11 +00:00
Matthew Waters
9fd665c90d glimagesink: wait on the correct sync meta when rendering 2017-12-09 19:32:11 +00:00
Matthew Waters
ad237e792e glimagesink: add support for rendering external-oes textures
https://bugzilla.gnome.org/show_bug.cgi?id=757285
2017-12-09 19:32:11 +00:00
Vineeth TM
15d9267ed5 glimagesink: Fix structure memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=758205
2017-12-09 19:32:11 +00:00
Matthew Waters
b8c1ecf268 glviewconvert: remove set_format
We need the caps to be able to
1. check the caps features
2. get the requested texture-target on input/output
2017-12-09 19:32:11 +00:00
Matthew Waters
bb1ae9042b glimagesink: fix a memory leak if the view conversion fails 2017-12-09 19:32:11 +00:00
Matthew Waters
7c52793e7c glimagesink: balance the creation/destruction of the overlay compositor
Fixes some leaks/possible segfault on when failing to create the compositor.
2017-12-09 19:32:11 +00:00
Matthew Waters
c4452041a8 glimagesink: wait on the provided sync meta provided to glimagesink 2017-12-09 19:32:10 +00:00
Matthew Waters
681cb5b16d glmemory: add support for rectangle textures
Add the various tokens/strings for the differnet texture types (2D, rect, oes)

Changes the GLmemory api to include the GstGLTextureTarget in all relevant
functions.

Update the relevant caps/templates for 2D only textures.
2017-12-09 19:32:10 +00:00
Matthew Waters
c3b69f3478 glimagesink: create a context in NULL_READY
So that it's possible for decoders et al. to request the OpenGL context
in their READY_PAUSED transition with decodebin/playbin.
2017-12-09 19:32:09 +00:00
Matthew Waters
06de6998e5 gl: be consistent in gobject boilerpate
GST_GL_IS_* vs GST_IS_GL_*

git grep -l 'GST_GL_IS_' | xargs sed -i 's/GST_GL_IS_/GST_IS_GL_/g'
2017-12-09 19:32:09 +00:00
Matthew Waters
f688a8f0b2 glshader: port to using GstGLSLStage objects for string management
A GstGLShader is now simply a collection of stages that are
compiled and linked together into a program.  The uniform/attribute
interface has remained the same.
2017-12-09 19:32:09 +00:00
Matthew Waters
8187171908 gl: chain up to the parent class for GstElement::set_context
https://bugzilla.gnome.org/show_bug.cgi?id=705579
2017-12-09 19:32:08 +00:00
Matthew Waters
bf98930546 gl: sprinkle some debug markers to ease debugging 2017-12-09 19:32:08 +00:00
Matthew Waters
25c109f850 glimagesink: request a resize on caps/3d mode changes
Fixes incorrect aspect ratio on OSX when changing caps or the 3d
output mode.

https://bugzilla.gnome.org/show_bug.cgi?id=755111
2017-12-09 19:32:08 +00:00
Matthew Waters
b537e98ae7 glimagesink: avoid updating the viewport in the draw loop
Fixes flashes/incorrect aspect ratio when resizing glimagesink on OSX.
2017-12-09 19:32:08 +00:00
Nicolas Dufresne
369acd42c9 glimagesink: update display size before sending event
This is minor issue, as the reconfigure event is asynchronous.
Basically, update width/height before sending the event.
2017-12-09 19:32:08 +00:00
Nicolas Dufresne
a342d95ca6 glsink: Enable sync meta on pools we offer
As the upload is asynchronous, we need to enable the sync meta to
gain correct rendering. The buffer pool receiver don't know about
that.
2017-12-09 19:32:07 +00:00
Nicolas Dufresne
a3a0e0db30 glimagesink: Move overlay rendering after video rendering
This is mostly cosmetic, but heoretically it reduces the amount of
required object in the context at one point. It also avoids potential
conflicts.
2017-12-09 19:32:07 +00:00
Matthew Waters
83716a0586 glimagesink: take into account non 1/1 par for navigation
The current code was ignoring the par/dar aspect when transforming
from window coordinates to stream coordinates resulting in incorrect
coordinates being sent upstream in the navigation events.
2017-12-09 19:32:07 +00:00
Tim-Philipp Müller
0a2f2426b0 glimagesink: fix allocation meta structure leak
gst_query_add_allocation_meta() does not take ownership
of the structure, for some reason.

CID 1312135
2017-12-09 19:32:06 +00:00
Nicolas Dufresne
1812c19291 composition-overlay: Positions are relative to texture
The coordinate are relative to the texture dimension and not
the window dimension now. There is no need to pass the window
dimension or to update the overlay if the dimension changes.

https://bugzilla.gnome.org/show_bug.cgi?id=745107
2017-12-09 19:32:06 +00:00
Lubosz Sarnecki
8abd2bbe35 gloverlaycompositor: Create own shader object
Make gloverlaycompositor independent of the shader used in the sink.

https://bugzilla.gnome.org/show_bug.cgi?id=745107
2017-12-09 19:32:06 +00:00
Nicolas Dufresne
1fae4b199a glimagesink: Properly handle compsositor life time
Should be created in READY_TO_PAUSED, not PAUSED_TO_PLAYING.
Should be cleared in PAUSED_TO_READY.

https://bugzilla.gnome.org/show_bug.cgi?id=745107
2017-12-09 19:32:06 +00:00
Lubosz Sarnecki
91d4cfe2b0 glimagesink: Send reconfigure event when window size changes
https://bugzilla.gnome.org/show_bug.cgi?id=745107
2017-12-09 19:32:06 +00:00
Lubosz Sarnecki
052b0a1caf glimagesinkbin: Add allocation query for GstVideoOverlayComposition
Adds an GST_VIDEO_OVERLAY_COMPOSITION_META_API_TYPE query to glupload
and glimagesink.  Detects the query from the downstream elements, so
it is executed only when downstream supports the overlay API.

This makes pipelines with textoverlay ! glupload ! gldownload ! xvimagesink possible.
Uses allocation meta struct for passing the window size upstream.

https://bugzilla.gnome.org/show_bug.cgi?id=745107
2017-12-09 19:32:06 +00:00
Lubosz Sarnecki
dc47e6d3c0 glimagesinkbin: Add GstVideoOverlayCompositionMeta caps features
https://bugzilla.gnome.org/show_bug.cgi?id=745107
2017-12-09 19:32:06 +00:00
Lubosz Sarnecki
1c0ddbd9a8 glimagesink: Upload and draw overlays with GstGLOverlayCompositor
Receives the GstOverlayComposition buffer in the glimagesink and draws them.

https://bugzilla.gnome.org/show_bug.cgi?id=745107
2017-12-09 19:32:06 +00:00
Vineeth TM
5229b50125 glimagesink: use g_clear_error instead of g_error_free
replace g_error_free with g_clear_error, as it internally
checks if error variable is valid or not.

https://bugzilla.gnome.org/show_bug.cgi?id=751823
2017-12-09 19:32:05 +00:00
Nicolas Dufresne
0f3c34f05f glimagesink: Don't leak pool
gst_query_add_allocation_pool is transfer none. Also unref
if there was a configuration error.
2017-12-09 19:32:05 +00:00
Julien Isorce
76983d4454 gldisplay: add gst_gl_display_create_context
It also emits a create-context signal so that an application
can provide an external GstGLContext backend.

https://bugzilla.gnome.org/show_bug.cgi?id=750310
2017-12-09 19:32:04 +00:00
Julien Isorce
e29e67fa6e Revert "gl: add GstGLContextGPUProcess backend"
This reverts commit b377112ee3.
2017-12-09 19:32:04 +00:00
Jan Schmidt
dad74d40e1 glimagesink: Remove duplicate, useless line of code 2017-12-09 19:32:04 +00:00
Jan Schmidt
77676ffc90 glimagesink: Support multiview/stereoscopic video
Support video with multiview info in the caps, transform
it to mono anaglyph by default, but allow for configuring
other output modes and handoff to the app via
the draw signal.

https://bugzilla.gnome.org/show_bug.cgi?id=611157
2017-12-09 19:32:04 +00:00
Matthew Waters
5276b7ccbf glimagesink: add missing handle-events/ignore-alpha property to the bin 2017-12-09 19:32:04 +00:00
Nicolas Dufresne
ccc410e73c glimagesink: Don't do pool caching
We now know that pool caching can cause renegotiation issues
when an element in the pipeline change from passthrough to not
passthrough. As it's not needed, don't cache existing pools.

https://bugzilla.gnome.org/show_bug.cgi?id=748344
2017-12-09 19:32:04 +00:00
Matthew Waters
dffa2857d7 gl: move basesink properties from glimagesinkbin to glsinkbin 2017-12-09 19:32:04 +00:00
Matthew Waters
6c56aba687 glwindow: handle gst_video_overlay_set_render_rectangle 2017-12-09 19:32:03 +00:00
Julien Isorce
238edceda4 gl: add GstGLContextGPUProcess backend
It builds its GL vtable from a proc address provided
by the application.
2017-12-09 19:32:02 +00:00
Matthew Waters
f272500ccb glimagesink: correctly use the sync meta across multiple contexts
1. Set the sync point after the (possible) upload has occured
2. Wait in the correct GL context (the draw context)

Note: We don't add the GL sync meta to the input buffer as it's not
writable and a copy would be expensive.
2017-12-09 19:32:01 +00:00
Matthew Waters
0e2fe3c2e9 glimagesink: free the vertex buffer when done
fixes a memory leak
2017-12-09 19:32:01 +00:00