Commit graph

35 commits

Author SHA1 Message Date
Sebastian Dröge acc098a736 gl: Only unbind buffers/vertex attrib arrays if we can't directly bind the vertex array to 0
Binding the vertex array to 0 will unbind everything else already.

In the previous order older versions of the Intel GL driver caused
errors to be printed for every single call when disabling the vertex
attrib arrays after binding the vertex array to 0.
2019-01-16 14:09:18 +02:00
Nicolas Dufresne c2ec68f0c7 glupload-test: Don't use gboolean to store enums
The unit test makes mixed usage of ret value. Sometimes its does
stores an enum and at other moment a boolean. Also fix test
using boolean instead of the correct enum value.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-11-01 06:22:28 -04:00
Matthew Waters 9620edc49e gl/checks: fix build 2017-12-09 19:32:30 +00:00
Julien Isorce 4952fdd956 gl: do not include GL headers in public gstgl headers
Except for gst/gl/gstglfuncs.h

It is up to the client app to include these headers.
It is coherent with the fact that gstreamer-gl.pc does not
require any egl.pc/gles.pc. I.e. it is the responsability
of the app to search these headers within its build setup.

For example gstreamer-vaapi includes explicitly EGL/egl.h
and search for it in its configure.ac.

For example with this patch, if an app includes the headers
  gst/gl/egl/gstglcontext_egl.h
  gst/gl/egl/gstgldisplay_egl.h
  gst/gl/egl/gstglmemoryegl.h
it will *no longer* automatically include EGL/egl.h and GLES2/gl2.h.
Which is good because the app might want to use the gstgl api only
without the need to bother about gl headers.

Also added a test: cd tests/check && make libs/gstglheaders.check

https://bugzilla.gnome.org/show_bug.cgi?id=784779
2017-12-09 19:32:29 +00:00
Matthew Waters 61ee2685c0 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-12-09 19:32:27 +00:00
Matthew Waters 66468b4245 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-12-09 19:32:27 +00:00
Matthew Waters 8b9a29a97c gl/tests: don't use the default framebuffer
Create our own instead as the default framebuffer may require special
fiddling (like having a visible window) to correctly display/be renderable.

Fixes the remaining GL library tests on OS X
2017-12-09 19:32:24 +00:00
Matthew Waters 7ab50a8e8f tests/gl: make sure all GL commands are executed on the GL thread
e.g. the final glGetError() must also be completed on the GL thread
2017-12-09 19:32:22 +00:00
Matthew Waters 00aa5748d3 tests/glupload: support opengl3 properly instead of spewing GL errors 2017-12-09 19:32:22 +00:00
Alessandro Decina 29d6825f11 glupload: fix tests and check for the new RECONFIGURE behaviour
The tests were broken since 91fea30, which changed glupload to return
GST_GL_UPLOAD_RECONFIGURE if the texture target in the input buffers doesn't
match the texture-target configured in the output caps.

This commit fixes that and adds more checks for the new behaviour.
2017-12-09 19:32:22 +00:00
Matthew Waters 3c1c5e9d83 glcontext: remove not thread-safe get/set_error()
Use GError's instead if necessary.
2017-12-09 19:32:21 +00:00
Matthew Waters 1153684a94 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.
2017-12-09 19:32:21 +00:00
Guillaume Desmottes e7217fad33 glupload: fix shader leak in test
https://bugzilla.gnome.org/show_bug.cgi?id=766663
2017-12-09 19:32:20 +00:00
Matthew Waters 1673a6192f glmemorypbo: remove our own alloc()/wrapped()/etc functions
replaced by equivalent functionality within gst_gl_base_memory_alloc()
2017-12-09 19:32:13 +00:00
Matthew Waters 56c3d97421 tests: update for glmemory api changes 2017-12-09 19:32:12 +00:00
Matthew Waters cd584d215c gluploadmeta; remove convenience helper API
It was not really useful as if one knows about libgstgl, one can just use
GLMemory objects directly.
2017-12-09 19:32:12 +00:00
Vineeth TM 606e3dee98 tests:glupload: fix caps memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=758039
2017-12-09 19:32:11 +00:00
Matthew Waters 25e3e1eb7b gl/tests: update for glmemory api changes 2017-12-09 19:32:10 +00:00
Matthew Waters f688a8f0b2 glshader: port to using GstGLSLStage objects for string management
A GstGLShader is now simply a collection of stages that are
compiled and linked together into a program.  The uniform/attribute
interface has remained the same.
2017-12-09 19:32:09 +00:00
Matthew Waters 73bad9e856 glupload: remove useless release_buffer
It's a leftover from when we weren't outputting GstBuffer's and
returning raw texture id's.
2017-12-09 19:32:09 +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 8f59549ec5 gl/tests: update glwindow api change 2017-12-09 19:31:53 +00:00
Nicolas Dufresne 7c7af39c4a gltest: Port to new API
https://bugzilla.gnome.org/show_bug.cgi?id=740900
2017-12-09 19:31:52 +00:00
Matthew Waters 00506bf183 glupload: rearchitecture for non GLMemory inputs/outputs
Allows other memory types to be implemented/returned/used by the caller.
2017-12-09 19:31:50 +00:00
Matthew Waters d946559238 gl/tests: update for upload API changes 2017-12-09 19:31:46 +00:00
Matthew Waters 5e2f15403c gl/tests: update for API changes 2017-12-09 19:31:45 +00:00
Sebastian Dröge 7ba2288f3e glupload: Fix memory leak in unit test 2017-12-09 19:31:44 +00:00
Matthew Waters f01472f5a2 tests: update for glupload changes 2017-12-09 19:31:42 +00:00
Matthew Waters 1f48a074be tests: update for recent glupload changes
GstGLUploadMeta object is now the GstVideoGLTextureUploadMeta
provider.
2017-12-09 19:31:41 +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 30c6efc432 gl/mem: allocate the memory per plane
This patch provides the basic infrastructure required for this.
Upload and Download has been ported to this.

Has the nice effect of allowing GstGLMemory to be our
refcounted texture object for any texture type (not just RGBA).

Should not lose any features/video formats.
2017-12-09 19:31:36 +00:00
Tim-Philipp Müller efeaf7467b tests: fix gl unit tests for recent API changes 2017-12-09 19:31:35 +00:00
Matthew Waters e225af3e0d gl: silence all the compiler warnings 2017-12-09 19:31:34 +00:00
Matthew Waters 54d70702cc [878/906] tests: update for glmem api change 2017-12-09 19:31:33 +00:00
Matthew Waters 970fbacf96 [869/906] tests: add some upload tests 2017-12-09 19:31:33 +00:00