Commit graph

92 commits

Author SHA1 Message Date
Julien Isorce
f8fca66fb9 glimagesink: keep window invisible when sharing output
https://bugzilla.gnome.org/show_bug.cgi?id=739681
2015-03-14 17:56:39 +00:00
Julien Isorce
0150255a46 glimagesink: provide GstSample in client-draw signal
Instead of prividing texture and size directly.
And apply changes to examples.

https://bugzilla.gnome.org/show_bug.cgi?id=739681
2015-03-14 17:56:21 +00:00
Matthew Waters
fa61e8e4ce glsyncmeta: make context to wait and set sync explicit
otherwise we may wait on a sync object in same context by accident
2015-03-14 16:53:46 +00:00
Nicolas Dufresne
ac89e53173 glimagesink: Add NULL check in error case
Other context may be NULL if something went wrong. Avoid trying to unref
a NULL pointer.
2015-03-14 12:58:22 +00:00
Matthew Waters
2ba6bb9b93 glimagesink: add pixel-aspect-ratio property on the bin 2015-03-13 12:43:13 +00:00
Matthew Waters
4be45e5f30 glimagesink: forward ALL the properties on the bin 2015-03-13 12:30:20 +00:00
Matthew Waters
91b7642c48 gl: retreive the gldisplay/app gl context as soon as possible
fixes the usage of gst_gl_display_filter_gl_api
2015-03-13 12:30:20 +00:00
Matthew Waters
ef0bd30c87 gl: store the list of contexts within gldisplay
Removes the reliance on the allocation query to propogate GL contexts.

Allows thread safely getting a context for the a specific thread.
2015-03-12 16:45:51 +00:00
Matthew Waters
2f2470488b glimagesink: unset the current shader after rendering
fixes gltestsrc ! glimagesink when gltestsrc doesn't use a shader
2015-03-12 16:45:51 +00:00
Matthew Waters
8a0017e21d glimagesink: implement as a bin
glupload ! glcolorconvert ! sink

Some properties are manually forwarded.  The rest are available using
GstChildProxy.

The two signals are forwarded as well.
2015-03-12 16:45:50 +00:00
Nicolas Dufresne
fb4d769425 glimagesink: Only cache pool, don't manage it
GLImage does not use any kind of internal pool. There was some
remaining code and comment stating that it was managing the
pool, and it was in fact setting the active state when doing
to ready state.

* Only create the pool if requested and in propose_allocation
* Cache the pool to avoid reallocation on spurious reconfigure
* Don't try to deactivate the pool (we don't own it)

https://bugzilla.gnome.org/show_bug.cgi?id=745705
2015-03-06 19:25:16 -05:00
Sebastian Dröge
b81823e7db gl: Remove format info in glcolorconvert's transform_caps function instead of on every caller
... and let glmixer actually transform the caps it is supposed to transform
instead of inventing new caps.
2015-03-06 18:53:13 +01:00
Xavier Claessens
e25f4f1a60 glimagesink: cosmetic cleanup
https://bugzilla.gnome.org/show_bug.cgi?id=745105
2015-02-24 15:22:34 -05:00
Edward Hervey
43464aa204 glimagesink: Fix debug statement 2015-02-12 17:34:10 +01:00
Edward Hervey
638f99a37a glimagesink: Sprinkle more debug 2015-02-12 15:57:55 +01:00
Matthew Waters
4f15cc8d3c glimagesink: log the converted caps 2015-02-05 11:07:19 +11:00
Matthew Waters
e7a10a2d44 glcolorconvert: put GstGLSyncMeta on output buffers
allows thread safely using the provided output buffer in a separate
thread
2015-02-03 14:32:55 +11:00
Matthew Waters
c06715bde6 glupload/download/convert: provide transform_caps functions
Allows finer grain decisions about formats and features at each
stage of the pipeline.
Also provide propose_allocation for glupload besed on the supported
methods.
2015-02-03 14:32:55 +11:00
Matthew Waters
c827d1f804 glimagesink: clobber the alpha channel by default
this can be disabled with the ignore-alpha property
2015-01-30 15:54:05 +11:00
Matthew Waters
6cf97eb221 glwindow: make showing a window explicit
Also fixes the cgl context always displaying a window to render to for
every GstGLContextCocoa created
2015-01-29 22:26:37 +11:00
Matthew Waters
ab48bb6f0f glwindow: remove width/height from _draw()
Depending on the platform, it was only ever implemented to 1) set a
default surface size, 2) resize based on the video frame or 3) nothing.
Instead, provide a set_preferred_size () that elements/applications
can use to request a certain size which may be ignored for
videooverlay/other cases.
2015-01-23 16:11:31 +11:00
Nicola Murino
907e02cfa9 glimagesink: fix memleak
https://bugzilla.gnome.org/show_bug.cgi?id=743142
2015-01-19 14:33:02 +11:00
Matthew Waters
d5c3693791 gl: split glcolorconvert usage from glupload
the separation allows the transfer operation to occur in a separate
thread/time which may increase performance in specific circumstances.
2015-01-14 22:22:13 +11:00
Matthew Waters
f021549294 gl: fixup vao and vbo usage for legacy GL 2014-12-11 19:41:23 +11:00
Matthew Waters
6361df77e8 glimagesink: properly handle the !opengl3 case
https://bugzilla.gnome.org/show_bug.cgi?id=740012
2014-11-30 00:44:46 +11:00
Matthew Waters
3c1e77eb31 gldisplay: implement runtime GL api filtering
Needed so that the pipeline/application can limit the choice of GL api
to what it supports
2014-11-28 09:14:26 +11:00
Matthew Waters
6bd1150ca8 gl: remove the use of glu 2014-11-28 09:14:26 +11:00
Matthew Waters
f2af65ee2d gl: add a sync meta for synchronizing across GL contexts
A context can create a GLsync object that can be waited on in order
to ensure that GL resources created in one context are able to be
used in another shared context without any chance of reading invalid
data.

This meta would be placed on buffers that are known to cross from
one context to another.  The receiving element would then wait
on the sync object to ensure that the data to be used is complete.
2014-11-28 09:14:25 +11:00
Matthew Waters
f0d2346c52 glimagesink: use vbo's and vao's for gl3 2014-11-28 09:14:25 +11:00
Matthew Waters
a7ce611970 glimagesink: only attempt a resize when the window has already resized
fixes a black startup screen on wayland
2014-11-27 13:03:21 +11:00
Matthew Waters
810d38c29f glupload: rearchitecture for non GLMemory inputs/outputs
Allows other memory types to be implemented/returned/used by the caller.
2014-11-23 17:13:36 +11:00
Vineeth T M
47f3a1954e glimagesink: critical error while seek playback-test(stop state)
If we seek when media is in stop state, playback-test gives
critical error, since context of glimagesink is destroyed during stop.
But since context is not present, we need not handle send_event in glimagesink
Hence adding a condition to check if context is valid.

https://bugzilla.gnome.org/show_bug.cgi?id=740305
2014-11-20 15:39:42 +11:00
Matthew Waters
5c48440c9a glimagesink: don't set the upload to NULL on the drain query
https://bugzilla.gnome.org/show_bug.cgi?id=732694
2014-11-12 11:44:43 +11:00
Julien Isorce
004a414b4a glimagesink: release stored buffers on drain query
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732694
2014-11-12 00:08:04 +00:00
Alessandro Decina
7d48fe1c1e glimagesink: don't make gst_glimage_sink_handle_events call _ensure_gl_setup
gst_glimage_sink_handle_events can be called from the overlay interface and from
the main thread before GL is setup. Before this change, that would call
_ensure_gl_setup() and deadlock on OSX.

Change things so that it's always safe to call gst_glimage_sink_handle_events()
without stuff deadlocking.
2014-11-07 00:22:09 +01:00
Alessandro Decina
b60fe0271f glimagesink: fix possible deadlock on osx
Remove gst_glimage_sink_handle_events call in gst_glimage_sink_init. It was
unnecessary and when the element was instantiated from the main thread, caused a
deadlock in OSX creating the context (thread).
2014-11-07 00:22:09 +01:00
Matthew Waters
7e62c790d2 glimagesink: clamp the resize width/height to >= 1 to avoid a GL error 2014-11-07 10:03:08 +11:00
Lubosz Sarnecki
6702811e14 glimagesink: implement gst_video_overlay_handle_events
https://bugzilla.gnome.org/show_bug.cgi?id=736035
2014-11-06 16:04:11 +11:00
Matthew Waters
0537cbfa5b glimagesink: resize the viewport correctly on a caps change
with force-aspect-ratio=true, if the width or height changed, the
viewport wasn't being updated to respect the new video width and height
until a resize occured.
2014-10-31 21:29:26 +11:00
Lubosz Sarnecki
27da1e5aaf satisfy gst-indent 2014-10-29 23:42:54 +11:00
Matthew Waters
e40d70c69a gl: propogate other-context using GstContext 2014-10-23 23:58:33 +11:00
Sebastian Dröge
302034ac4c glimagesink: Only finalize the other context in finalize()
Otherwise we change a value of a property when going to READY state,
which is unexpected behaviour.
2014-10-13 13:28:57 +02:00
Sebastian Dröge
d8a262a589 glimagesink: Don't leak other-context 2014-10-13 11:57:22 +02:00
Matthew Waters
5b8d7a443e glupload: provide the output buffer that is rendered into
Allows callers to properly reference count the buffers used for
rendering.

Fixes a redraw race in glimagesink where the previous buffer
(the one used for redraw operations) is freed as soon as the next
buffer is uploaded.

1. glimagesink uploads in _prepare() to texture n
1.1 glupload holds buffer n
2. glimagesink _render()s texture n
3. glimagesink uploads texture n+1
3.1 glupload free previous buffer which deletes texture n
3.2 glupload holds buffer n+1
4. glwindow resize/expose
5. glimagesink redraws with texture n

The race is that the buffer n (the one used for redrawing) is freed as soon as
the buffer n+1 arrives.  There could be any amount of time and number of
redraws between this event and when buffer n+1 is actually rendered and thus
replaces buffer n as the redraw source.

https://bugzilla.gnome.org/show_bug.cgi?id=736740
2014-09-21 21:36:49 +10:00
Sanjay NM
a1ae26acbd gl: Removed unreachable break, unused variable
https://bugzilla.gnome.org/show_bug.cgi?id=736957
2014-09-19 21:48:14 +10:00
Sebastian Dröge
e4b084acd9 glimagesink: Add missing break to switch
CID 1232801
2014-08-28 16:42:30 +03:00
Lubosz Sarnecki
ddaaff3376 glimagesink: expose context
* expose context in draw / reshape callbacks
* add context property

https://bugzilla.gnome.org/show_bug.cgi?id=734482
2014-08-21 17:38:57 +10:00
Matthew Waters
c6706adfcc glimagesink: unref the window on navigation event
plugs a memory leak
2014-08-19 14:24:02 +10:00
Tim-Philipp Müller
c81a2d1c6c opengl: update element docs for 1.x 2014-08-10 18:07:28 +01:00
Vasilis Liaskovitis
4dacc4ba55 GstGLWindow, GstGLImagesink, x11: Scale navigation events on resized windows
If window is resized, GstStructure pointer values have to be rescaled to
original geometry. A get_surface_dimensions GLWindow class method is added for
this purpose and used in the navigation send_event function.

https://bugzilla.gnome.org/show_bug.cgi?id=703486
2014-08-07 13:55:02 +10:00