Commit graph

51 commits

Author SHA1 Message Date
Matthew Waters 28d6a3edec gl/tests: port glcontext test to opengl
Now uses vao's and vbo's when possible like the rest of the gstgl library.
2017-12-09 19:32:09 +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 332543f3cf gl: add some GLSL utility functions
Specifically parsing/setting GLSL versions and the shader related
function table.
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 8cad1e5b49 tests/glcontext: fix INVALID_ENUM GL error in test 2017-12-09 19:32:07 +00:00
Nicolas Dufresne b817307165 glcolorconvert-test: Test notify function for setup_wrapped
gst_gl_memory_setup_wrapped() now takes a destroy notify function. This
destroy notify is called to track the memory life time, hence will
notify each time a memory get destroyed. This test check that the
callback count is correct.
2017-12-09 19:32:07 +00:00
Nicolas Dufresne f4a0c062dc glcolorconvert-test: Fix build 2017-12-09 19:32:07 +00:00
Matthew Waters 66407b9877 glcontext: fix get_current_gl_api on x11/nvidia drivers
They require to get_proc_address some functions through the
platform specific {glX,egl}GetProcAddress rather than the default
GL library symbol lookup.
2017-12-09 19:32:05 +00:00
Matthew Waters 78957c45c2 glcontext: track sharedness with a cookie
The previous approach of traversing the other_context weak ref tree was
1. Less performant
2. Incorrect for context destruction removing a link in the tree

Example of 2:
c1 = context_create (NULL)
c2 = context_create (c1)
c3 = context_create (c2)
context_can_share (c1, c3) == TRUE
context_destroy (c2)
unref (c2)
context_can_share (c1, c3) returns FALSE when it should be TRUE!

This does not remove the restriction that context sharedness can only
be tracked between GstGLContext's.
2017-12-09 19:32:05 +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 900bcea9de glmemory: implement on top of glbasebuffer
Provides convenient access to PBO usage.

Currently texture updates are coupled tightly to data transfers.
2017-12-09 19:32:04 +00:00
Matthew Waters 2cbf2abea0 tests/gl: fix typo 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 ae08ada8f0 gl/tests: fix deadlock on glcontext wrapped context test 2017-12-09 19:31:57 +00:00
hoonhee.lee a4af602d0c tests: glcontext: remove unnecessary semicolon
https://bugzilla.gnome.org/show_bug.cgi?id=745875
2017-12-09 19:31:56 +00:00
Nicolas Dufresne 7c32611c87 gl-test: Port unit tests to new API 2017-12-09 19:31:55 +00:00
Matthew Waters 149cbb2e31 gl: update unit test for glmemory api change 2017-12-09 19:31:54 +00:00
Matthew Waters 8f59549ec5 gl/tests: update glwindow api change 2017-12-09 19:31:53 +00:00
Matthew Waters 1dfeae2c42 gl: split glcolorconvert usage from glupload
the separation allows the transfer operation to occur in a separate
thread/time which may increase performance in specific circumstances.
2017-12-09 19:31:52 +00:00
Matthew Waters bef3f020a6 glcontext: allow wrapped contexts to be utilised like non-wrapped contexts
Fill in the missing pieces like get_proc_address, the gl function vtable
2017-12-09 19:31:52 +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 be5d0d81e4 glcontext: add api for retreiving the current context and api
that is current in the calling thread.
2017-12-09 19:31:48 +00:00
Matthew Waters d4592ec132 tests/glcolorconvert: do reorder checking for rgba formats 2017-12-09 19:31:47 +00:00
Matthew Waters 652753de18 tests/glmemory: add simple transfer test
tests transferring to/from the GL with a 1x1 RGBA pixel.
2017-12-09 19:31:47 +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
Sebastian Dröge fcb15bd609 glcontext: Fix memory leaks 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
Luis de Bethencourt 8c46b24d51 gl: check the correct GstGLMemory in basic_test 2017-12-09 19:31:37 +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 da5b9d3e0f [900/906] tests/gstglcontext: reduce the number of frames displayed
Was causing timeouts on intel hardware due to vsync handling.
2017-12-09 19:31:34 +00:00
Matthew Waters 97f6bc0bfc [891/906] context: add support for wrapping external contexts 2017-12-09 19:31:33 +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
Matthew Waters 84425ad43d [853/906] display: remove _{set,get}_context
A GstGLDisplay doesn't need a GstGLContext and its use
was cause a reference cycle
2017-12-09 19:31:32 +00:00
Matthew Waters efa22442a9 [838/906] gl: Use GL_TEXTURE_2D instead of GL_TEXTURE_RECTANGLE
We create our textures (in Desktop GL) with GL_TEXTURE_RECTANGLE,
vaapi attempts to bind our texture to GL_TEXTURE_2D which throws a
GL_INVALID_OPERATION error and as thus, no video.

Also, by moving exclusively to GL_TEXTURE_2D and the npot extension
we also remove a difference between the Desktop GL and GLES2 code.

https://bugzilla.gnome.org/show_bug.cgi?id=712287
2017-12-09 19:31:32 +00:00
Julien Isorce 6e732b0408 [821/906] tests: fix test_share on GLESv2 2017-12-09 19:31:31 +00:00
Matthew Waters 711ad485b2 [812/906] move the GL vtable from GstGLDisplay to GstGLContext
Conflicts:
	tests/check/libs/gstglcontext.c
2017-12-09 19:31:31 +00:00
Matthew Waters adb7eddc84 [811/906] tests: update for GstGLContext addition 2017-12-09 19:31:31 +00:00
Julien Isorce ba7c562a9e [809/906] tests: port test_share to GLES2
Also add a deinit function to release fbo, tex and shader.
2017-12-09 19:31:31 +00:00
Matthew Waters 0537f8ea26 [802/906] add GstGLContext test that tests context sharing 2017-12-09 19:31:31 +00:00
Matthew Waters 761bc0156a [704/906] Use gst_object_[un]ref so we can get refcounts in the log 2017-12-09 19:31:28 +00:00
Matthew Waters 4c35d682c9 [603/906] update FSF address 2017-12-09 19:31:25 +00:00
Matthew Waters c7ddead74b [554/906] GstGLMemory: update for GstAllocator API changes 2017-12-09 19:31:24 +00:00