Commit graph

387 commits

Author SHA1 Message Date
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
Matthew Waters
36408736c0 glcolorconvertelement: propagate failure to convert buffer upstream
Rather than just silently continuing
2017-12-09 19:32:05 +00:00
Nicolas Dufresne
5f38bcf905 uploadelement: Protect against NULL pointer
I notice that if you stop the pipeline during a renegotiation
the upload may be NULL while an allocation query is being run.
In that scenario, returning FALSE to the allocation query is the
best thing.
2017-12-09 19:32:05 +00:00
Matthew Waters
b7a3b54b2a download: only start a download transfer for sysmem caps features 2017-12-09 19:32:05 +00:00
Matthew Waters
e4af6201c0 gltransformation: correct vao usage
keep the vao bound after uploading the new vertex data

fixes a mesa GL error "no vertex array object bound" on caps changes
2017-12-09 19:32:05 +00:00
Matthew Waters
afcb6aa1da gl: consolidate egl header includes to egl-only headers
They may conflict with other headers.
2017-12-09 19:32:05 +00:00
Olivier Crête
1c99bc92ca glvideomixer, glmixer: Add description and klass 2017-12-09 19:32:05 +00:00
Nicolas Dufresne
b8d3c2d2a5 gl: Don't leak pool if set_config failed 2017-12-09 19:32:05 +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
Luis de Bethencourt
237af0d21c gl: add missing break
gst_gl_view_convert_element_set_property() is missing a break at the end
of the PROP_OUTPUT_DOWNMIX_MODE case. Adding it.

CID #1308949
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
Nicolas Dufresne
44a1492c30 opengl: glstero* are only built with full OpenGL
Don't try to register the elements unless they are built.
2017-12-09 19:32:04 +00:00
Jan Schmidt
020c7f1303 gl: Add glviewconvert, glstereomix and glstereosplit elements
Conversion elements for transforming multiview/stereoscopic video

https://bugzilla.gnome.org/show_bug.cgi?id=611157
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
Matthew Waters
8c36e5193e glmixerbin: implement proper dynamic pad removal
https://bugzilla.gnome.org/show_bug.cgi?id=750881
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
2210ba5d46 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.
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
Sebastian Dröge
3bfe8fcb5b gl: Use gst_object_ref_sink() for gl{filter,mixer,src}bin too 2017-12-09 19:32:04 +00:00
Sebastian Dröge
25c554a5e4 glsinkbin: Use gst_object_ref_sink() for consistency with the video-sink property on playbin 2017-12-09 19:32:04 +00:00
Thiago Santos
33b5cd5426 Fix a common typo: retreive -> retrieve
Seems to have been copy pasted around a few places
2017-12-09 19:32:03 +00:00
Matthew Waters
1e9f7b6303 gl: consolidate internal_rgba_format into glmemory
Expose some useful value format conversion functions available in
GstGLMemory.
2017-12-09 19:32:03 +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
Julien Isorce
fce0e0ba3c 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.
2017-12-09 19:32:02 +00:00
Luis de Bethencourt
7361160673 gleffects: 'for' loop initial declaration
'for' loop initial declarations are not allowed in C89, moving the declarations
to before the 'for' loops.
2017-12-09 19:32:02 +00:00
Xavier Claessens
0280be02ca gloverlay: fix a leak
https://bugzilla.gnome.org/show_bug.cgi?id=749846
2017-12-09 19:32:02 +00:00
Xavier Claessens
01177670ea 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
2017-12-09 19:32:02 +00:00
Xavier Claessens
80914d1731 gloverlay: remove unused type_file field
https://bugzilla.gnome.org/show_bug.cgi?id=749846
2017-12-09 19:32:02 +00:00
Matthew Waters
c55790143f gleffects: properly initialize the shaders across contexts implementing multiple API's 2017-12-09 19:32:02 +00:00
Matthew Waters
b53178f724 gleffects_laplacian: fix shader compilation in gl3/gles2
https://bugzilla.gnome.org/show_bug.cgi?id=748393
2017-12-09 19:32:02 +00:00
Matthew Waters
1d796508e8 gltransformation: fix DrawElements call for element array buffers
https://bugzilla.gnome.org/show_bug.cgi?id=749734
2017-12-09 19:32:02 +00:00
Sebastian Dröge
5503937337 compositor/glvideomixer: Don't calculate PAR/DAR with unset GstVideoInfos
Otherwise we divide by zero.
2017-12-09 19:32:02 +00:00
Matthew Waters
44153e637b compositor/glvideomixer: fix up par handling
We were using the wrong formula

https://bugzilla.gnome.org/show_bug.cgi?id=749634
2017-12-09 19:32:01 +00:00
Matthew Waters
f0ed0b728d caopengllayersink: static const the indices array
the contents will never change anyway.
2017-12-09 19:32:01 +00:00
Matthew Waters
56bd10a392 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
2017-12-09 19:32:01 +00:00
Matthew Waters
d6c4f850ea caopengllayersink: update for GL3 element array buffer usage
fixes blank output
2017-12-09 19:32:01 +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
Matthew Waters
72993f54fa gl: remove useless gl{En,Dis}able (GL_TEXTURE_*) calls
We are using shaders everywhere and so they are not needed
2017-12-09 19:32:01 +00:00
Matthew Waters
ac793f691d glimagesink: cleanup properties
remove unused "display-name"
ensure defaults between the bin/element are the same
2017-12-09 19:32:01 +00:00
Matthew Waters
6c9f648462 gleffects: only try the GL2 shader init path if we have a GL2 context 2017-12-09 19:32:01 +00:00
Matthew Waters
65c57b77ff 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.
2017-12-09 19:32:01 +00:00
Matthew Waters
50d3161ac5 gl: don't deadlock on context creation failure
https://bugzilla.gnome.org/show_bug.cgi?id=749284
2017-12-09 19:32:01 +00:00
Sebastian Dröge
9336d8fa80 glmixerbin: Don't unref pad templates
Otherwise we unref the reference that is owned by the element class.
2017-12-09 19:32:01 +00:00
Matthew Waters
06cbb3389b glvideomixer: implement par handling
We were previously ignoring it completely
2017-12-09 19:32:01 +00:00
Matthew Waters
5d3dd13433 glvideomixer: don't upload the vertex data every frame
Add the missing cache tracking statement.
2017-12-09 19:32:01 +00:00
Nicolas Dufresne
95eb2ef8df gluploadelement: Remove uneeded header and defines 2017-12-09 19:32:01 +00:00
Nicolas Dufresne
685250928f 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
2017-12-09 19:32:00 +00:00
Sebastian Dröge
eb626d8ddc 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.
2017-12-09 19:32:00 +00:00
Matthew Waters
b3bf122c94 gl: demote upload/convert/download elements to none
Copy paste error
2017-12-09 19:32:00 +00:00
Matthew Waters
41d3ca819d gl: expose internal glvideomixerelement\
We might want more control over the exact pipeline
Also reduces overhead
2017-12-09 19:32:00 +00:00
Matthew Waters
dfddc4b910 gl: expose internal glimagesinkelement
We might want more control over the exact pipeline.
Also reduces overhead.
2017-12-09 19:32:00 +00:00
Sebastian Dröge
3353667212 Revert "Revert "glimagesink: add pixel-aspect-ratio property on the bin""
This reverts commit d96e43b034.
2017-12-09 19:32:00 +00:00
Sebastian Dröge
b189e3fec3 Revert "Revert "glimagesink: forward ALL the properties on the bin""
This reverts commit 59fb0f830f.
2017-12-09 19:32:00 +00:00
Sebastian Dröge
7304d3cc75 Revert "Revert "glimagesink: implement as a bin""
This reverts commit be938f92d9.
2017-12-09 19:32:00 +00:00
Sebastian Dröge
51d3a0a059 Revert "gl: readd glupload/download onto element pads"
This reverts commit 87d8270f30.
2017-12-09 19:32:00 +00:00
Sebastian Dröge
3d6031b75c Revert "Revert "glvideomixer: implement with glmixerbin""
This reverts commit b4bd11f2f3.
2017-12-09 19:32:00 +00:00
Matthew Waters
296397a8b1 glimagesink: handle the local_context query
so that upstream elements can get the GL context from glimagesink
2017-12-09 19:32:00 +00:00
Matthew Waters
343947f383 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
2017-12-09 19:32:00 +00:00
Matthew Waters
eb5d578a95 Revert "glvideomixer: implement with glmixerbin"
This reverts commit 0fb56738a1.
2017-12-09 19:32:00 +00:00
Matthew Waters
d9737138ef Revert "glimagesink: implement as a bin"
This reverts commit 8a0017e21d.
2017-12-09 19:32:00 +00:00
Matthew Waters
3b0efeb731 Revert "glimagesink: forward ALL the properties on the bin"
This reverts commit 4be45e5f30.
2017-12-09 19:32:00 +00:00
Matthew Waters
0da6dbce81 Revert "glimagesink: add pixel-aspect-ratio property on the bin"
This reverts commit 2ba6bb9b93.
2017-12-09 19:32:00 +00:00
Jan Schmidt
7a61e0eca4 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.
2017-12-09 19:32:00 +00:00
Matthieu Bouron
dc36647d78 glimagesink: Use gst_pad_get_pad_template_caps in ::get_caps() 2017-12-09 19:32:00 +00:00
Matthew Waters
c902a6f525 glupload: provide the sink template caps that could be used
https://bugzilla.gnome.org/show_bug.cgi?id=746399
2017-12-09 19:32:00 +00:00
Matthieu Bouron
41015eb331 glfiltercube: Don't initialize multiple shaders on renegotiation 2017-12-09 19:32:00 +00:00
Matthieu Bouron
3a124511bb glimagesink: Remove unused stop function 2017-12-09 19:32:00 +00:00
Matthew Waters
45b50cbb72 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
2017-12-09 19:32:00 +00:00
Matthieu Bouron
cf438d7def gltransformation: Unref shader in ::stop() 2017-12-09 19:32:00 +00:00
Matthew Waters
f4f3284161 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
2017-12-09 19:32:00 +00:00
Sebastian Dröge
ee6bfe0127 glfilter: De-camelcase onInitFBO() vfunc 2017-12-09 19:31:59 +00:00
Sebastian Dröge
3613ecfd0a 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.
2017-12-09 19:31:59 +00:00
Lubosz Sarnecki
590c7032d8 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
2017-12-09 19:31:59 +00:00
Sebastian Dröge
c75f6b347f 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);
                  ^
2017-12-09 19:31:59 +00:00
Matthieu Bouron
4e05044734 glcolorconvert: Keep colorimetry and chroma-site fields if passthrough
https://bugzilla.gnome.org/show_bug.cgi?id=748141
2017-12-09 19:31:59 +00:00
Matthew Waters
5fbc9bd5e0 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.
2017-12-09 19:31:59 +00:00
Matthieu Bouron
6d75eaf005 glupload: Release glupload buffer when caps are changed
https://bugzilla.gnome.org/show_bug.cgi?id=748371
2017-12-09 19:31:59 +00:00
Vineeth T M
41af2f4ad8 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
2017-12-09 19:31:59 +00:00
Michał Dębski
7ec1246730 gleffects: Create element for each effect
https://bugzilla.gnome.org/show_bug.cgi?id=746209
2017-12-09 19:31:59 +00:00
Michał Dębski
afdc3c8ee3 gleffects: Merge laplacian filter into effects
https://bugzilla.gnome.org/show_bug.cgi?id=746209
2017-12-09 19:31:59 +00:00
Michał Dębski
befbf3733b gleffects: Merge sobel filter into effects
https://bugzilla.gnome.org/show_bug.cgi?id=746209
2017-12-09 19:31:59 +00:00
Michał Dębski
208b5f999e gleffects: Merge blur filter into effects
https://bugzilla.gnome.org/show_bug.cgi?id=746209
2017-12-09 19:31:59 +00:00
Michał Dębski
a2ef6757f0 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
2017-12-09 19:31:59 +00:00
Michał Dębski
eb326ba4c2 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
2017-12-09 19:31:59 +00:00
Lubosz Sarnecki
85d9185b0c gltransformation: fix shader memory leak 2017-12-09 19:31:59 +00:00
Matthew Waters
03908c679e 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.
2017-12-09 19:31:59 +00:00
Guillaume Desmottes
e6c5410a2a 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>
2017-12-09 19:31:59 +00:00
Guillaume Desmottes
ce76c66f92 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>
2017-12-09 19:31:59 +00:00
Guillaume Desmottes
0511d12e4a 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>
2017-12-09 19:31:59 +00:00
Sebastian Dröge
3acaa0eb0f gldownloadelement: Download *from* OpenGL, not into 2017-12-09 19:31:59 +00:00
Matthieu Bouron
15785f794e gluploadelement: Unref GstGLUpload object and caps in ::stop()
Fix leak of the GstGLUpload object.

https://bugzilla.gnome.org/show_bug.cgi?id=748033
2017-12-09 19:31:59 +00:00
Sebastian Dröge
bff8cde2ea gl: Remove some empty ::finalize() implementations 2017-12-09 19:31:59 +00:00
Sebastian Dröge
c4713af2ef gldownloadelement: Fix element description 2017-12-09 19:31:59 +00:00