Commit graph

899 commits

Author SHA1 Message Date
Matthew Waters
51fdeef98b gl/eglimage: add eglimage context feature
Allows us to selectively use EGLImages only when available

https://bugzilla.gnome.org/show_bug.cgi?id=728234
2017-12-09 19:31:41 +00:00
Matthew Waters
166d7b505c gl/context: add generic feature checking
At the moment it simply delegates to the subclass.
2017-12-09 19:31:40 +00:00
Sebastian Dröge
8b7d8a95ea glimagesink: Check if context creation failed before trying to use it
Otherwise we will cause assertions everywhere by passing NULL to functions
and eventually crash when dereferencing a NULL pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=730069
2017-12-09 19:31:40 +00:00
Sebastian Dröge
9fd7e34fee glcontext: Add more assertions to make sure that everything sets the GError during context creation if something fails 2017-12-09 19:31:40 +00:00
Matthew Waters
9172cb8839 gl/download: update to be similar to the glupload semantics 2017-12-09 19:31:40 +00:00
Matthew Waters
5efb69304a gl/colorconvert: fix up alpha clobbering
Previously it would only work if the alpha value was in the last
component (RGBx, BGRx).  Now it works wherever the alpha value may
be (xRGB, xBGR, etc).
2017-12-09 19:31:40 +00:00
Nicolas Dufresne
b4a0a26ddd glfilter: Fix building without EGL support
This fixes the OSX build and any builds with --disable-egl. That issue
was introduced in "glfilter: rewrite transform_caps to preserve caps fields".

https://bugzilla.gnome.org/show_bug.cgi?id=729861
2017-12-09 19:31:40 +00:00
Julien Isorce
a7156df9f4 glfilter: rewrite transform_caps to preserve caps fields
https://bugzilla.gnome.org/show_bug.cgi?id=729861
2017-12-09 19:31:40 +00:00
Matthew Waters
07b6bfeaa7 gl/colorconvert: use the texture scaling from the gl memory
The colorconvert values were not being used at all.

https://bugzilla.gnome.org/show_bug.cgi?id=729896
2017-12-09 19:31:40 +00:00
Nicolas Dufresne
157607989a glmemory: Fix handling of stride with alignement larger then 8
Setting a scaled factor for X coordinate is not enough as the indexer
will still think stride is shorter and will not fully skip it. Instead,
update width, so the lines are as expected. Combined with the scale, it
will hide the cropped portion.

https://bugzilla.gnome.org/show_bug.cgi?id=729896
2017-12-09 19:31:40 +00:00
Nicolas Dufresne
030fc8b7d0 glupload: Ensure we still have a texture after upload_set_format()
gst_gl_upload_set_format() resets the upload, hence the texture.
So we need to ensure we have a texture after this call when
uploading.
2017-12-09 19:31:40 +00:00
Nicolas Dufresne
b70edbff15 glupload: Correctly update the video info from video meta
Using gst_video_info_set_format() isn't complete when updating
a video info from video meta.
2017-12-09 19:31:40 +00:00
Nicolas Dufresne
2f705ac9ca glupload: Correctly update video info in upload fallback
When the upload accelerated method fails, we fallback to an upload,
but the video info was not correctly updated.
2017-12-09 19:31:40 +00:00
Julien Isorce
c16ab9e66b gl/upload: set out_tex after reset, not before
Fix a regression introduced recently with the lazy init.
It was happening when calling gst_video_gl_texture_upload_meta_upload
from an aplication. So not using gst_gl_upload_perform_with_buffer.
2017-12-09 19:31:40 +00:00
Matthew Waters
5cdfd51172 gl/upload: update the video info on mapping a video frame
The buffer should contain the most specific data on how the data is
formatted.  We should use this information.

https://bugzilla.gnome.org/show_bug.cgi?id=729896
2017-12-09 19:31:40 +00:00
Matthew Waters
480784e368 gl/convert: clobber alpha channel when needed
Needed in the conversion from padded RGB formats to formats with an
alpha channel.  e.g. BGRx -> ABGR, etc

https://bugzilla.gnome.org/show_bug.cgi?id=729742
2017-12-09 19:31:40 +00:00
Matthew Waters
59c388abca gl/upload: avoid performing color conversion when there is no need
One such example is when the buffer contains GstGLMemory in the
RGBA format

https://bugzilla.gnome.org/show_bug.cgi?id=729278
2017-12-09 19:31:40 +00:00
Matthew Waters
ae283ec9da gl/colorconvert: choose the right alpha component for AYUV -> RGBA 2017-12-09 19:31:40 +00:00
Matthew Waters
9fffa2cbc6 gl/upload: update the respective state when we cache textures/data 2017-12-09 19:31:40 +00:00
Matthew Waters
484ae5a8c5 gl/upload: cache the textures that we are using 2017-12-09 19:31:40 +00:00
Matthew Waters
a64efacd0e gl/upload: avoid recreating the GLMemory struct for output textures 2017-12-09 19:31:40 +00:00
Nicolas Dufresne
5c8acc21fe gl: Fix some of the error handling 2017-12-09 19:31:40 +00:00
Nicolas Dufresne
94aa3ea228 glupload: Update GstVideoInfo after the buffer is mapped
gst_video_frame_map() will store an updated video info base
on the video meta. In order to have the right stride and offset
we should update that video info accordingly.
2017-12-09 19:31:40 +00:00
Sebastian Dröge
43866270ef gl: Fix memory leak
CID #1212171
2017-12-09 19:31:40 +00:00
Matthew Waters
f213321083 gl/colorconvert: preserve alpha in AYUV <-> RGBA conversions
https://bugzilla.gnome.org/show_bug.cgi?id=729743
2017-12-09 19:31:40 +00:00
Matthew Waters
977c326c59 gl/colorconvert: implement lazy init 2017-12-09 19:31:40 +00:00
Julien Isorce
17ba668c7a gl/upload: set initted to TRUE when _init_upload succeeded 2017-12-09 19:31:40 +00:00
Sebastian Dröge
228eccdbdf gldisplay: Use GST_STR_NULL() for printing possibly NULL strings and print all variables we use
Fixes compiler warning about set but not used platform_choice variable
among other things.
2017-12-09 19:31:40 +00:00
Julien Isorce
17946cc0a9 gleffects: use gl_vtable 2017-12-09 19:31:40 +00:00
Matthew Waters
83c2b906d1 gl/upload: fix compilation on OS X 2017-12-09 19:31:40 +00:00
Matthew Waters
862df41b2d gl/upload: fail propoerly if init fails 2017-12-09 19:31:39 +00:00
Matthew Waters
857200ff40 gl: make all GObjects inherit from GstObject
Aids memory leak debugging with GST_TRACE=mem-live
2017-12-09 19:31:39 +00:00
Matthew Waters
6c1a4e30c4 gl/upload: implement lazy init
Rename init_format to set_format
2017-12-09 19:31:39 +00:00
Matthew Waters
cda89d7ce0 gl/upload: add get_format method
Simply retreives the format set by init_format
2017-12-09 19:31:39 +00:00
Matthew Waters
6e5494d729 gl/filter: attempt to passthrough the pool if the caps are the same
Reduces the number of glbufferpool instances required for >=2
consecutive GL elements in a pipeline.
2017-12-09 19:31:39 +00:00
Matthew Waters
6872ad5ff5 gl/filter: always initialize the upload object 2017-12-09 19:31:39 +00:00
Matthew Waters
8fd450b941 gl: advertise GstGLMemory usage in the caps as capsfeatures
https://bugzilla.gnome.org/show_bug.cgi?id=729658
2017-12-09 19:31:39 +00:00
Matthew Waters
2246e51250 gl/examples: fix compilation for clutter examples
ClutterX11TexturePixmap is deprecated in Clutter 1.6 and we ask for
at least 1.8
2017-12-09 19:31:39 +00:00
Matthew Waters
90bf46484d gl/display: avoid endless recursion for cocoa 2017-12-09 19:31:39 +00:00
Matthew Waters
a865a931fc gl/sink: make sure we always initialize the upload object
https://bugzilla.gnome.org/show_bug.cgi?id=729542
2017-12-09 19:31:39 +00:00
Julien Isorce
d7c5444447 gl: do not allocate the target texture of an EGLImage
The target texture of an EGLImage is the texture bind just
before calling glEGLImageTargetTexture2D.

As we currently only support a gl texture as the source of an EGLImage
the gl texture is actually already allocated when creating the eglimage.

I also see some cases where it fails to upload an eglimage when
glTexImage2D is called on the target.
2017-12-09 19:31:39 +00:00
Julien Isorce
4bc96ae4cd gl: allow to avoid calling glTexImage2D(w, h, NULL) when generating a texture
Just pass 0 as width or height to gst_gl_context_gen_texture.
2017-12-09 19:31:39 +00:00
Julien Isorce
88864ea2cc gl: no need to initialize a frame buffer object to upload an eglimage
Fix https://bugzilla.gnome.org/show_bug.cgi?id=729588
2017-12-09 19:31:39 +00:00
Julien Isorce
bcc633ed2c gl: use GST_CAT_ERROR instead of GST_ERROR_OBJECT
It fixes segault when GST_DEBUG is at least level 1 and eglCreateImage fails
2017-12-09 19:31:39 +00:00
Julien Isorce
dd1c2b4c4c gl: delete texture used with GstVideoGLTextureUploadMeta 2017-12-09 19:31:39 +00:00
Julien Isorce
4b0e037fa4 gl: use gst_gl_context_gen_shader helper instead of duplicating code 2017-12-09 19:31:39 +00:00
Matthew Waters
59592f9bfc gl/display: clean up pre gstglcontext api and struct fields
https://bugzilla.gnome.org/show_bug.cgi?id=729551
2017-12-09 19:31:39 +00:00
Matthew Waters
f6ed9a685b gl/display: add get_handle_type
https://bugzilla.gnome.org/show_bug.cgi?id=729551
2017-12-09 19:31:39 +00:00
Matthew Waters
c5a11aa448 gl/display: avoid opening the X11 display on systems with Cocoa (OS X)
https://bugzilla.gnome.org/show_bug.cgi?id=729551
2017-12-09 19:31:39 +00:00
Matthew Waters
6a2f2088e9 gl/window: fix string length check for eagl 2017-12-09 19:31:39 +00:00