Commit graph

529 commits

Author SHA1 Message Date
Matthew Waters
efc015f27d gl: GL_ARRAY_BUFFER is not a part of VAO state
As a result we need to bind it on every draw in order to have the
correct state in the GL state machine.
2017-03-14 14:15:00 +11:00
Matthew Waters
956c4d0bde gl/format: use our own GL format enum's instead of gstvideo's
They can describe in more detail (such as component sizes) the requested format.
2017-03-13 21:10:58 +11:00
Nick Kallen
82c132aa50 applemedia/gl: Fix compile issues for OSX
https://bugzilla.gnome.org/show_bug.cgi?id=778333
2017-03-08 15:23:42 +02:00
Nick Kallen
46bbc60d24 applemedia/gl: Update code to use ARC
All code interacting with Objective-C objects should now use Automated
Reference Counting rather than manual memory management or Garbage
Collection. Because ARC prohibits C-structs from containing
references to Objective-C objects, all such fields are now typed
'gpointer'. Setting and gettings Objective-C fields on such a
struct now uses explicit __bridge_* calls to tell ARC about
object lifetimes.

https://bugzilla.gnome.org/show_bug.cgi?id=777847
2017-03-07 13:37:07 +02:00
Sebastian Dröge
0661a5aded gltestsrc: Fix potential NULL pointer dereference if we fail without GError
Which can happen here if we just propagate an error that happened
elsewhere, e.g. FBO failed.

CID 1364604
2017-02-28 15:23:55 +02:00
Sebastian Dröge
a064590912 glvideomixer/compositor: Correctly error out if calculating DAR fails
CID 1320700
2017-02-28 13:06:41 +02:00
Sebastian Dröge
92bb56d137 gl: Rename gst_gl_get_affine_transformation_meta_as_ndc_ext() to prevent symbol conflict
The same symbol also exists in libgstgl, although marked as private and
internal. This has no effect when doing static linking and there's a
symbol conflict.
2017-02-28 10:55:10 +02:00
Juan Pablo Ugarte
ef739e726f GstGLSinkBin: fixed sink property leak
No need to keep an extra reference to sink since an indirect one is added by gst_bin_add()

https://bugzilla.gnome.org/show_bug.cgi?id=778452
2017-02-14 12:16:44 +02:00
Matthew Waters
7bcc44778a glmixer: ensure caps are writable after intersection
gst_caps_intersect () may return an increased reference of one of the
input caps.

Fixes critical in the simple-launch-lines test:

Unexpected critical/warning: gst_caps_set_features: assertion 'IS_WRITABLE (caps)' failed
2017-01-18 15:07:48 +11:00
Matthew Waters
03b539bdfc gl: update sys dependants for function removals
4315a4b54d forgot to change the androidmedia/videotoolbox/caopengllayer
sources as required.
2017-01-13 13:01:28 +11:00
Matthew Waters
6919b4ca66 glutils: document functions 2017-01-13 11:20:51 +11:00
Matthew Waters
4de388278a glutils: privatise matrix multiplication/videoaffinetransformation retrieval 2017-01-13 11:20:51 +11:00
Matthew Waters
4315a4b54d gl/utils: also take care of the local GL context in query functions
Simplifies a deduplicates a lot of code in elements retrieving/setting
the local OpenGL context.
2017-01-13 11:20:51 +11:00
Matthew Waters
3fba290979 glutils: remove trivial helper function
gst_gl_caps_replace_all_caps_features() is only used in two places and can
be trivially reproduced.
2017-01-13 11:20:51 +11:00
Matthew Waters
a4024b61cf gl: remove custom control binding proxy
Use the existing GstProxyControlBinding instead.
2017-01-10 13:57:37 +11:00
Haihua Hu
b1fd1d34bd gl/effects: use non-PBO GLMemory for internal textures
middle textures in gleffects do not need to use GstGLMemoryPBO as they
aren't transfering data to/from the GPU. This will cost too much DMA
memory and cause performance issue. Change the allocator to use non-PBO
GstGLMemory.

https://bugzilla.gnome.org/show_bug.cgi?id=776072
2016-12-16 00:02:47 +11:00
Sebastian Dröge
5e3157098a glvideomixer: Reject multiview video
glvideomixer does not support it currently and it needs special support
for handling this correctly, and is rather non-trivial to implement for
all formats.
2016-12-14 15:53:41 +02:00
Sebastian Dröge
5c99f9cf37 gst: Don't declare variables inside the for loop header
This is a C99 feature.
2016-12-13 22:39:01 +02:00
Florent Thiéry
a0558d6e85 gldownload: fix element description (was "OpenGL uploader") 2016-11-25 16:52:35 +11:00
Matthew Waters
e9b4dfa550 gl: remove empty BUGS file
We use bugzilla for bug tracking
2016-11-16 16:41:59 +11:00
Matthew Waters
6b06a4274c gl/build: add missing build files
3f7b549881 was incomplete :(
2016-11-10 20:34:53 +11:00
Matthew Waters
3f7b549881 gl/utils: move gen_shader() to the plugin and remove del_shader()
gst_gl_context_del_shader() can be replaced by a g_object_unref().
gst_gl_context_gen_shader() should be replaced by using GstGLSLStage.
2016-11-10 20:11:03 +11:00
Matthew Waters
01fa90c1e7 glwindow: remove is_running() function
It isn't necessary in correctly written programs.
2016-11-10 20:05:45 +11:00
Matthew Waters
e811ed18ba glfiltershader: expand the docs slightly
Add an example OpenGL shader
2016-11-08 15:14:27 +11:00
Matthew Waters
cafcde5586 glfilter: remove display_init/reset
They are mirrors of GstGLBaseFilter's gl_start() and gl_stop() virtual methods
so use them instead.
2016-11-08 02:21:20 +11:00
Matthew Waters
41a6448918 gl: GST_GL_TYPE -> GST_TYPE_GL
Some deprecated symbols are kept for backwards compatibility
2016-11-03 16:16:12 +11:00
Nirbheek Chauhan
bb0a83b018 plugins: Use explicit type conversion from enums
MSVC warns about this because it's a C++ compiler, and this actually
results in useful things such as the incorrect 'gboolean' return value
for functions that return GstFlowReturn, so let's do explicit
conversions to reduce the noise and increase its efficacy.
2016-10-27 23:06:26 +05:30
Nirbheek Chauhan
f790863755 Explicitly define float constants as float
With MSVC, this gives the following warning:

warning C4305: 'function': truncation from 'double' to 'gfloat'

Apparently, MSVC does not figure out what type to use for constants
based on the assignment. This warning is very spammy, so let's try to
fix it.
2016-10-27 23:06:26 +05:30
Nirbheek Chauhan
83df90ed6c Fix incorrect return type in several functions
All these should return GstFlowReturn, not gboolean
2016-10-27 23:06:26 +05:30
Nirbheek Chauhan
49ab51dc7d ext/gl: Don't define boolean on Windows with MSVC
The headers we include already define boolean on Windows with MSVC, and
it leads to a typedef redefinition error with jpeglib.h which tries to
redefine it in jmorecfg.h
2016-10-27 23:06:25 +05:30
Matthew Waters
c36ea6f56f meson: gl: add support for building with dispmanx on the rpi 2016-10-19 17:10:48 +11:00
Matthew Waters
1ffe22240a gluploadelement: fix leak of upload library object
When only linking the element, the upload object will be created from
_transform_caps() but will never be unreffed as the only case is in _stop().

Add an unref if non-NULL to a new finalize handler for this case.
2016-10-05 18:28:48 +11:00
Matthew Waters
78e91a731f glcolorbalance: reconfigure on passthrough changes
Fixes an assertion when moving from passthrough to non-passthrough

Without an explicit reconfigure, glfiter won't have created the GL
resources such as the FBO, GL bufferpool, etc and basetransform will
allocate sysmem buffers instead.
2016-09-19 16:58:34 +10:00
Matthew Waters
b5b7a3aec3 meson: add some starting build files for GL
Currently only works on linux with egl/glx + wayland/x11 but the general
principals have been layed out for adding the other GL platforms/winsys'.
2016-09-09 11:22:47 +10:00
Alessandro Decina
c16d57cc9a glupload: create the GstGLUpload object in ::transform_caps
Previously it was created in the init function and destroyed in ::stop, which
lead to segfaults when reusing the element.

Now the upload object is created in ::transform_caps if it is NULL, which is the
earliest we need it. The other vfuncs already bail out if the upload object is
NULL, which means that negotiation wasn't done.
2016-09-05 14:44:24 +10:00
Alessandro Decina
91fea30ff4 gstglupload: make the GLMemoryUpload method output the correct texture-target
Now when used with video/x-raw as input, the GLMemoryUpload method checks for
->tex_target in input GLMemory(es) and sets the output texture-target
accordingly.

Fixes video corruption with a pipeline like avfvideosrc ! video/x-raw !
glimagesink where on macos avfvideosrc pushes RECTANGLE textures but glupload
was configuring texture-target=2D as output.
2016-08-26 17:44:33 +10:00
Jan Schmidt
9afd71a507 gl: Update glvideomixer doc 2016-08-26 03:25:49 +10:00
Jan Schmidt
9e516b35e3 gl: Add/update docs for glviewconvert, glstereomix
Add some example pipelines for glstereomix, and fix up
the example pipelines for glviewconvert
2016-08-26 03:25:49 +10:00
Jan Schmidt
3ca79c93ba glstereomix: Fix caps negotiation
The videoaggregator negotiation sequence changed some time
back and broke glstereomix. Instead of doing nego incorrectly
in the find_best_format() vfunc, do it directly in the
update_caps() method.
2016-08-26 03:25:49 +10:00
Xabier Rodriguez Calvar
8ada38e8f4 glvideoflip: implement GstVideoDirection interface
It implements now this interface with its video-direction
property. Values are changed to GstVideoOrientationMethod but they have
the same value than the originals.

https://bugzilla.gnome.org/show_bug.cgi?id=768687
2016-08-25 10:17:43 +03:00
Matthew Waters
9d66a3447f gltransformation: rewrite the inverse transformation logic
It now returns the correct values for both orthographic and perspective
projections and takes into account the aspect ratio of the video, handles
the Y-flipping in GL and by us and uses some more helpers from graphene.
2016-08-19 16:09:04 +10:00
Haihua Hu
87a86b78b5 glimagesink: Fix horizontal/vertical flip matrizes
They were swapped.

https://bugzilla.gnome.org/show_bug.cgi?id=769371
2016-08-02 14:51:33 +03:00
Matthew Waters
dba5d3a37a caopengllayersink: remove unused to_quit variable
It was always 0 and never set to anything meaningful.
2016-07-26 16:02:11 +10:00
Matthew Waters
5da138d1ae glfilter: rewrite subclasses for filter_texture() occuring on GL thread
There's no need for the jump to an extra thread in most cases, especially
when relying solely on a shader to render.  We can use the provided
render_to_target() functions to simplify filter writing.
2016-07-26 14:07:24 +10:00
Matthew Waters
06b4b52a20 glcontext: remove not thread-safe get/set_error()
Use GError's instead if necessary.
2016-07-26 14:07:24 +10:00
Matthew Waters
518e8a3fd2 glframebuffer: rewrite for a more consistent API
Facilities are given to create fbo's and attach GL memory (renderbuffers
or textures).  It also keeps track of the renderable size for use with
effective use with glViewport().
2016-07-26 14:07:24 +10:00
Matthew Waters
aa109016a3 gl: use GLMemory for accessing textures everywhere
This simplifies and consolidates a lot of duplicated code creating
and modifying textures.
2016-07-26 14:07:24 +10:00
Matthew Waters
f10a67ec44 glfilter: rename draw_texture to draw_fullscreen_quad
And remove unused arguments.
2016-07-26 14:07:24 +10:00
Matthew Waters
e9df4f0890 gleffects: fix xray to use the correct function
Instead of duplicating the sin effect
2016-07-26 14:07:24 +10:00
Matthew Waters
989200820d glmemory: add the texture type to allocate to parameters
Rather than assuming something.  e.g. zerocopy on iOS with GLES3 requires
the use of Luminance/Luminance Alpha formats and does not work with
Red/RG textures.
2016-06-29 18:04:28 +10:00