Commit graph

372 commits

Author SHA1 Message Date
Nicolas Dufresne
c2b49fa732 opengl: glstero* are only built with full OpenGL
Don't try to register the elements unless they are built.
2015-06-18 22:11:05 -04:00
Jan Schmidt
eefdb2ed86 gl: Add glviewconvert, glstereomix and glstereosplit elements
Conversion elements for transforming multiview/stereoscopic video

https://bugzilla.gnome.org/show_bug.cgi?id=611157
2015-06-19 01:49:33 +10:00
Jan Schmidt
00d6fe9068 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
2015-06-19 01:49:33 +10:00
Matthew Waters
890de823e6 glimagesink: add missing handle-events/ignore-alpha property to the bin 2015-06-15 22:44:31 +10:00
Matthew Waters
4796cef882 glmixerbin: implement proper dynamic pad removal
https://bugzilla.gnome.org/show_bug.cgi?id=750881
2015-06-13 18:47:13 +10:00
Nicolas Dufresne
c72213ff8b 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
2015-06-12 20:14:37 -04:00
Matthew Waters
c3a47c910d glmemory: separate pbo transfer from texture transfers
When supported, the potentially longer pbo upload/download can be
initiated before the texture upload/download, potentially increasing
throughput.
2015-06-12 16:59:20 +10:00
Matthew Waters
cd2669fad1 gl: move basesink properties from glimagesinkbin to glsinkbin 2015-06-12 00:34:58 +10:00
Sebastian Dröge
e8a97877b4 gl: Use gst_object_ref_sink() for gl{filter,mixer,src}bin too 2015-06-11 15:22:04 +02:00
Sebastian Dröge
c1b43742bf glsinkbin: Use gst_object_ref_sink() for consistency with the video-sink property on playbin 2015-06-11 15:17:55 +02:00
Thiago Santos
045bfa10fe Fix a common typo: retreive -> retrieve
Seems to have been copy pasted around a few places
2015-06-05 09:43:35 -03:00
Matthew Waters
d914cc6e72 gl: consolidate internal_rgba_format into glmemory
Expose some useful value format conversion functions available in
GstGLMemory.
2015-06-02 16:33:44 +10:00
Matthew Waters
fac0cdc7ac glwindow: handle gst_video_overlay_set_render_rectangle 2015-05-31 16:04:13 +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
Luis de Bethencourt
666a80236c gleffects: 'for' loop initial declaration
'for' loop initial declarations are not allowed in C89, moving the declarations
to before the 'for' loops.
2015-05-27 13:05:15 +01:00
Xavier Claessens
2bb01f9601 gloverlay: fix a leak
https://bugzilla.gnome.org/show_bug.cgi?id=749846
2015-05-26 16:49:55 -04:00
Xavier Claessens
53cd9e3e0e gloverlay: properly handle errors while loading file
Post an error on the bus if anything bad happens while reading
and parsing the image file.

https://bugzilla.gnome.org/show_bug.cgi?id=749846
2015-05-26 16:49:55 -04:00
Xavier Claessens
02b2c2edf6 gloverlay: remove unused type_file field
https://bugzilla.gnome.org/show_bug.cgi?id=749846
2015-05-26 16:49:55 -04:00
Matthew Waters
db9e0cf5c7 gleffects: properly initialize the shaders across contexts implementing multiple API's 2015-05-26 12:50:58 +10:00
Matthew Waters
cb482f13be gleffects_laplacian: fix shader compilation in gl3/gles2
https://bugzilla.gnome.org/show_bug.cgi?id=748393
2015-05-26 12:50:58 +10:00
Matthew Waters
9dcefacb3d gltransformation: fix DrawElements call for element array buffers
https://bugzilla.gnome.org/show_bug.cgi?id=749734
2015-05-25 17:39:08 +10:00
Sebastian Dröge
3230e51993 compositor/glvideomixer: Don't calculate PAR/DAR with unset GstVideoInfos
Otherwise we divide by zero.
2015-05-21 16:24:48 +03:00
Matthew Waters
d1419afef1 compositor/glvideomixer: fix up par handling
We were using the wrong formula

https://bugzilla.gnome.org/show_bug.cgi?id=749634
2015-05-21 01:04:38 +10:00
Matthew Waters
8157574d0f caopengllayersink: static const the indices array
the contents will never change anyway.
2015-05-20 00:56:44 +10:00
Matthew Waters
057130b93d caopengllayersink: 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.

Similar to the change with the same name for glimagesink
2015-05-20 00:36:48 +10:00
Matthew Waters
49c4d0850d caopengllayersink: update for GL3 element array buffer usage
fixes blank output
2015-05-20 00:36:48 +10:00
Matthew Waters
6a2d12bf47 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.
2015-05-20 00:36:48 +10:00
Matthew Waters
c6abd1632f glimagesink: free the vertex buffer when done
fixes a memory leak
2015-05-14 21:21:01 +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
1f89d1dce2 glimagesink: cleanup properties
remove unused "display-name"
ensure defaults between the bin/element are the same
2015-05-14 15:10:59 +10:00
Matthew Waters
a852146624 gleffects: only try the GL2 shader init path if we have a GL2 context 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
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
5f6bddf719 glmixerbin: Don't unref pad templates
Otherwise we unref the reference that is owned by the element class.
2015-05-13 15:42:50 +03:00
Matthew Waters
725c1147bc glvideomixer: implement par handling
We were previously ignoring it completely
2015-05-13 17:44:08 +10:00
Matthew Waters
21a6cfcc18 glvideomixer: don't upload the vertex data every frame
Add the missing cache tracking statement.
2015-05-13 17:44:04 +10:00
Nicolas Dufresne
f01d47d0f2 gluploadelement: Remove uneeded header and defines 2015-05-12 16:36:58 -04:00
Nicolas Dufresne
df3d415906 gltestsrc: Use default get_caps implementation
The custom code is wrong as it ignores the templates, which leads to
missing fields in the result. Instead, simply use the default get_caps
implementation which does it correctly (get the template, intersect
with filter and return).

https://bugzilla.gnome.org/show_bug.cgi?id=749237
2015-05-11 15:02:02 -04:00
Sebastian Dröge
b8941efc4a glmixer: Implement GstVideoAggregator::find_best_format()
Without this, we will fixate weird pixel-aspect-ratios like 1/2147483647. But
in the end, all the negotiation code in videoaggregator needs a big cleanup
and videoaggregator needs to get rid of the software-mixer specific things
everywhere.
2015-05-11 16:34:26 +03:00
Matthew Waters
628d8d9599 gl: demote upload/convert/download elements to none
Copy paste error
2015-05-11 22:58:45 +10:00
Matthew Waters
bd1a0cfec2 gl: expose internal glvideomixerelement\
We might want more control over the exact pipeline
Also reduces overhead
2015-05-11 22:58:45 +10:00
Matthew Waters
d2a6e8a92e gl: expose internal glimagesinkelement
We might want more control over the exact pipeline.
Also reduces overhead.
2015-05-11 22:58:37 +10:00
Sebastian Dröge
541c3049dc Revert "Revert "glimagesink: add pixel-aspect-ratio property on the bin""
This reverts commit d96e43b034.
2015-05-06 15:47:27 +02:00
Sebastian Dröge
8c28a51ee1 Revert "Revert "glimagesink: forward ALL the properties on the bin""
This reverts commit 59fb0f830f.
2015-05-06 15:47:20 +02:00
Sebastian Dröge
35d5c648c6 Revert "Revert "glimagesink: implement as a bin""
This reverts commit be938f92d9.
2015-05-06 15:47:04 +02: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
Sebastian Dröge
21413ff3fc Revert "Revert "glvideomixer: implement with glmixerbin""
This reverts commit b4bd11f2f3.
2015-05-06 15:43:32 +02:00
Matthew Waters
8ef4b12ab8 glimagesink: handle the local_context query
so that upstream elements can get the GL context from glimagesink
2015-05-04 23:44:17 +10:00
Matthew Waters
87d8270f30 gl: readd glupload/download onto element pads
Allows insertion of gl elements into non-gl pipelines without converter
(upload/download) elements.

https://bugzilla.gnome.org/show_bug.cgi?id=743974
2015-04-30 11:26:33 +10:00
Matthew Waters
b4bd11f2f3 Revert "glvideomixer: implement with glmixerbin"
This reverts commit 0fb56738a1.
2015-04-30 11:26:33 +10:00
Matthew Waters
be938f92d9 Revert "glimagesink: implement as a bin"
This reverts commit 8a0017e21d.
2015-04-30 11:26:33 +10:00
Matthew Waters
59fb0f830f Revert "glimagesink: forward ALL the properties on the bin"
This reverts commit 4be45e5f30.
2015-04-30 11:26:32 +10:00
Matthew Waters
d96e43b034 Revert "glimagesink: add pixel-aspect-ratio property on the bin"
This reverts commit 2ba6bb9b93.
2015-04-30 11:26:32 +10:00
Jan Schmidt
ff12434b9f glimagesink: Cache caps for passing to the client draw call
Don't convert the GstVideoInfo to caps on every draw call,
just cache the caps and pass them into the GstSample.
2015-04-29 02:52:40 +10:00
Matthieu Bouron
17d3a75583 glimagesink: Use gst_pad_get_pad_template_caps in ::get_caps() 2015-04-28 20:14:07 +10:00
Matthew Waters
0b7f65bbc3 glupload: provide the sink template caps that could be used
https://bugzilla.gnome.org/show_bug.cgi?id=746399
2015-04-28 20:13:48 +10:00
Matthieu Bouron
e765a9bb00 glfiltercube: Don't initialize multiple shaders on renegotiation 2015-04-27 14:52:37 +02:00
Matthieu Bouron
4ca63b01ab glimagesink: Remove unused stop function 2015-04-27 18:27:48 +10:00
Matthew Waters
05109be4a0 glimagesink: unref the pool in the correct place
Otherwise we could hold a pool to a context that is never going to be used.

https://bugzilla.gnome.org/show_bug.cgi?id=748405
2015-04-27 18:21:01 +10:00
Matthieu Bouron
c6ec145a95 gltransformation: Unref shader in ::stop() 2015-04-27 10:16:24 +02:00
Matthew Waters
bd940327ef gl: unref display/other-context in the correct place
Otherwise state changes from PLAYING->READY->PAUSED will cause there to
to be no display configured on the element.

https://bugzilla.gnome.org/show_bug.cgi?id=748405
2015-04-27 15:20:56 +10:00
Sebastian Dröge
e7aa25ca6f glfilter: De-camelcase onInitFBO() vfunc 2015-04-26 21:42:03 +02:00
Sebastian Dröge
c638477c48 glfilter: Remove onStart/onStop vfuncs, and unused onReset()
onStart/onStop are just duplicates of the basetransform ones, onReset
was never called but was used everywhere when stop should've been used.
2015-04-26 21:39:06 +02:00
Lubosz Sarnecki
51daa8b9e2 gltransformation: don't initialize multiple shaders on renegotiation
https://bugzilla.gnome.org/show_bug.cgi?id=748407

* delete shader if one exists
* set it to NULL after unrefing
2015-04-26 21:23:16 +02:00
Sebastian Dröge
a8d498919e glcolorconvert: Fix compiler warning
gstglcolorconvertelement.c:230:19: error: unused variable 'in_structure'
      [-Werror,-Wunused-variable]
    GstStructure *in_structure = gst_caps_get_structure (caps, 0);
                  ^
2015-04-26 21:11:17 +02:00
Matthieu Bouron
76b2cefd2d glcolorconvert: Keep colorimetry and chroma-site fields if passthrough
https://bugzilla.gnome.org/show_bug.cgi?id=748141
2015-04-26 20:31:53 +02:00
Matthew Waters
b216629941 glimagesink: balance change_state display ref/unref
the display was being unreffed on the incorrect state change causing
invalid state when changing from PLAYING/PAUSED->READY->PAUSED/PLAYING.
2015-04-24 17:16:18 +10:00
Matthieu Bouron
8f740fb484 glupload: Release glupload buffer when caps are changed
https://bugzilla.gnome.org/show_bug.cgi?id=748371
2015-04-24 00:55:58 +10:00
Vineeth T M
7e3cd63f87 glmixer: Possible null pointer dereference
While printing error message when context fails, error variable is not being used anymore
so it will lead to null pointer dereference

https://bugzilla.gnome.org/show_bug.cgi?id=748287
2015-04-22 22:33:28 +10:00
Michał Dębski
b12f975e0a gleffects: Create element for each effect
https://bugzilla.gnome.org/show_bug.cgi?id=746209
2015-04-21 13:03:11 +01:00
Michał Dębski
532f332c2f gleffects: Merge laplacian filter into effects
https://bugzilla.gnome.org/show_bug.cgi?id=746209
2015-04-21 13:03:06 +01:00
Michał Dębski
0165b163db gleffects: Merge sobel filter into effects
https://bugzilla.gnome.org/show_bug.cgi?id=746209
2015-04-21 13:02:57 +01:00
Michał Dębski
7770fb2f57 gleffects: Merge blur filter into effects
https://bugzilla.gnome.org/show_bug.cgi?id=746209
2015-04-21 13:02:53 +01:00
Michał Dębski
ff4bc2364c gleffects: Correct attributes for hconv and vconv shaders
Width and height were switched for glow shaders. For blur
filter attributes names were obsolete.

https://bugzilla.gnome.org/show_bug.cgi?id=746209
2015-04-21 13:01:04 +01:00
Michał Dębski
40422d03c6 gleffects: Fix fisheye shader - pass float to sqrt
On OSX passing literal int to sqrt() in GLSL results in error.

https://bugzilla.gnome.org/show_bug.cgi?id=746209
2015-04-21 11:56:16 +01:00
Lubosz Sarnecki
5c07218bd2 gltransformation: fix shader memory leak 2015-04-21 16:37:17 +10:00
Matthew Waters
6cb6d8f9e8 gldisplay: synchronize the searching and creation of GstGLContext's
Ootherwise we could end up with multiple elements in different chains
each creating a context.  Fixes context creation with glvideomixer.
2015-04-21 12:55:24 +10:00
Guillaume Desmottes
ac5e25937b glmixer: fix caps leak in gst_gl_mixer_pad_sink_getcaps()
Caps refcounting was all wrong in this function. Rewrote it and add some
comments to make it clearer.

Fix caps leaks with the
validate.file.glvideomixer.simple.play_15s.synchronized scenario.

https://bugzilla.gnome.org/show_bug.cgi?id=747915

Signed-off-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2015-04-20 09:05:11 +01:00
Guillaume Desmottes
fae93514e4 glmixer: unref owned caps when finalizing the mixer
Fix a caps leak with the
validate.file.glvideomixer.simple.play_15s.synchronized scenario.

https://bugzilla.gnome.org/show_bug.cgi?id=747915

Signed-off-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2015-04-17 14:28:37 +01:00
Guillaume Desmottes
481b1c921e glmixer: pass the proper free function to frames and buffers array
'array_buffers' contain borrowed GstBuffer and so shouldn't have a free
function. 'frames' is the one containing GstGLMixerFrameData and so should use
_free_glmixer_frame_data as free function.

Fix GstGLMixerFrameData leaks with the
validate.file.glvideomixer.simple.play_15s.synchronized scenario.

https://bugzilla.gnome.org/show_bug.cgi?id=747913

Signed-off-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2015-04-17 14:28:25 +01:00
Sebastian Dröge
917c395403 gldownloadelement: Download *from* OpenGL, not into 2015-04-17 15:20:12 +02:00
Matthieu Bouron
f283d72636 gluploadelement: Unref GstGLUpload object and caps in ::stop()
Fix leak of the GstGLUpload object.

https://bugzilla.gnome.org/show_bug.cgi?id=748033
2015-04-17 14:17:55 +02:00
Sebastian Dröge
c1cac829ef gl: Remove some empty ::finalize() implementations 2015-04-17 14:09:47 +02:00
Sebastian Dröge
9ee29626c4 gldownloadelement: Fix element description 2015-04-17 14:06:03 +02:00
Sebastian Dröge
758fea90aa gldownloadelement: Remove unused ::finalize() implementation 2015-04-17 14:05:44 +02:00
Sebastian Dröge
53ed701974 glcolorconvertelement: Also unref caps in ::stop() already
They are not useful anymore afterwards, so keeping them until ::finalize()
might only cause someone to use them later and then fail.
2015-04-17 14:04:14 +02:00
Guillaume Desmottes
17446a420c glcolorconvertelement: fix GstGLColorConvert leak
convert->convert was never unreffed.

This can be reproduce with the
validate.file.glvideomixer.simple.play_15s.synchronized scenario.

https://bugzilla.gnome.org/show_bug.cgi?id=747911
2015-04-17 14:04:14 +02:00
Sebastian Dröge
25561db099 glimagesink: Disconnect mouse/key event signal handlers from window when shutting down context 2015-04-06 20:28:22 -07:00
Sebastian Dröge
a72e204eae glimagesink: Guard against disconnecting invalid signal ids 2015-04-06 20:24:06 -07:00
Edward Hervey
90028d68fe glvideomixer: Don't use context if not present
Avoids assertions at runtime
2015-03-31 16:31:18 +02:00
Anton Obzhirov
4504356dda gleffects: port all effects to GLES2.0
https://bugzilla.gnome.org/show_bug.cgi?id=745955
2015-03-30 19:06:44 +01:00
Nicola Murino
0719c8c766 glimagesink: fix caps leak
https://bugzilla.gnome.org/show_bug.cgi?id=746541
2015-03-21 16:52:08 +00:00
Víctor Manuel Jáquez Leal
d925e7fd19 glupload: move meta-data copy into gst-gl library
In some upload implementations the out buffer has more than one references,
turning the buffer not writable, so it won't be possible to modify its
meta-data.

This patch moves the meta-data copy before increasing the reference of the out
buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=746173
2015-03-14 19:53:02 +00:00
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
0c8ede8565 glupload/colorconvert: only copy timestamps if the input buffer != output 2015-03-14 10:39:06 +00:00
Matthew Waters
a29a18cc3a glshader: attribute locations are -1 on error 2015-03-13 17:41:17 +00:00