Commit graph

2296 commits

Author SHA1 Message Date
Matthew Waters b8b87694a1 glformat: add test for formats 2018-05-05 21:29:40 +10:00
Matthew Waters 131f9b4e2b gl/memory/tests: split test into separate subtests
Allows for more fine-grained notification of failures
2018-05-05 21:24:25 +10:00
Sebastian Dröge 51c359dda6 videoaggregator: Rename ignore-eos pad property to repeat-after-eos
What it does is to repeat the last frame forever after EOS, it does not
literally ignore EOS.
2018-05-04 16:46:00 +02:00
Michael Olbrich 1b36477d9e videodecoder: add test for event order
When frames are dropped or reordered then the serialized events are
collected and pushed with the next frame. This test verifies that the
order is preserved.

https://bugzilla.gnome.org/show_bug.cgi?id=794192
2018-04-26 17:05:04 -04:00
Zeeshan Ali cc3942e673 tests: videodecoder: Fix a minor c&p mistake
This completes what commit 0de0f3b2c should have already done. :)

https://bugzilla.gnome.org/show_bug.cgi?id=795483
2018-04-23 15:31:27 +01:00
Zeeshan Ali 0de0f3b2c4 tests: videodecoder: Fix a minor c&p mistake
https://bugzilla.gnome.org/show_bug.cgi?id=795483
2018-04-23 11:29:47 +01:00
Mathieu Duponchelle 8467939538 rtpbasedepayload: condition the sending of gap events
The default implementation for packet loss handling previously
always sent a gap event.

While this is correct as long as we know the packet that was
lost was actually a media packet, with ULPFEC this becomes
a bit more complicated, as we do not know whether the packet
that was lost was a FEC packet, in which case it is better
to not actually send any gap events in the default implementation.

Some payloaders can be more clever about, for example VP8 can
use the picture-id, and the M and S bits to determine whether
the missing packet was inside an encoded frame or outside,
and thus whether if it was a media packet or a FEC packet,
which is why ulpfecdec still lets these lost events go through,
though stripping them of their seqnum, and appending a new
"might-have-been-fec" field to them.

This is all a bit terrible, but necessary to have ULPFEC
integrate properly with the rest of our RTP stack.

https://bugzilla.gnome.org/show_bug.cgi?id=794909
2018-04-19 16:39:06 +02:00
Mathieu Duponchelle d00e0b612d appsink: Reuse sample object in pull_sample if possible
Simple optimization to reduce memory allocations.

https://bugzilla.gnome.org/show_bug.cgi?id=795145
2018-04-19 16:14:12 +02:00
Mathieu Duponchelle d767773a47 meson: move some dependency checks to the top level
The newly-added build definitions for test/icles relied
on dependencies that were only defined when the examples
are enabled, thus breaking meson build -Ddisable_examples=true
2018-04-18 17:24:35 +02:00
Tim-Philipp Müller 3a669b7413 tests: make getaddrinfo suppression more generic
So it works for me on debian sid.
2018-04-13 01:23:38 +01:00
Mathieu Duponchelle 89222216f0 valgrind supps: ignore leaks where pango is the first frame 2018-04-13 01:07:21 +02:00
Mathieu Duponchelle bc3d1fbfb6 valgrind supps: ignore intentional leak in GL test 2018-04-13 01:07:21 +02:00
Mathieu Duponchelle ab1cc64a62 valgrind supps: conditional moves in nvidia-glcore
Not much we can do here
2018-04-13 01:07:21 +02:00
Mathieu Duponchelle 04ea088891 valgrind supps: getaddrinfo leaks when resolving addresses
https://lists.debian.org/debian-glibc/2016/03/msg00243.html
2018-04-13 01:07:21 +02:00
Mathieu Duponchelle 225651e6c5 tests/audiomixer: fix caps leak 2018-04-13 01:07:21 +02:00
Mathieu Duponchelle b003cb8cdf valgrind supps: ignore bash leaks
gst_install_plugins_* can instantiate bash
2018-04-13 01:07:21 +02:00
Mathieu Duponchelle ae7a213628 valgrind suppressions: ignore XInitThreads leaks
As we load that symbol dynamically, valgrind gets confused
when it leaks and reports the leak against an unrelated library
and an unknown (??) symbol.

To address that, put the loading and calling of that symbol
in a separate function, and ignore any malloc leak happening
in that function.
2018-04-12 19:08:41 +02:00
Mathieu Duponchelle fe5b775060 valgrind supps: ignore leak in XextCreateExtension
Searching for that specific function in other suppression files
on the Internet shows a few projects ignoring it

eg: https://github.com/XCSoar/XCSoar/blob/master/valgrind.suppressions
2018-04-12 19:08:41 +02:00
Mathieu Duponchelle ac8215b9fe meson: port tests/icles
https://bugzilla.gnome.org/show_bug.cgi?id=795198
2018-04-12 15:08:29 +02:00
Zeeshan Ali 45dba0ac67 tests: Enable tests for videodecoder
The tests pass fine here so don't see any reason to keep them disabled.

https://bugzilla.gnome.org/show_bug.cgi?id=795005
2018-04-05 14:23:33 -03:00
Edward Hervey cb28f49625 tools: Fix discoverer deprecation
The only information provided by "misc" was the missing plugins which
is already handled with another API
2018-04-02 08:53:28 +02:00
Edward Hervey 1b23c388ad check: Remove old structures from ABI check
Just in case someone still tries to run it on 32bit osx
2018-04-02 08:33:58 +02:00
Tim-Philipp Müller 57516c5153 tests: audiomixer: remove unistd.h include
Not needed and breaks the build with MVSC.
2018-03-16 09:29:41 +00:00
Tim-Philipp Müller 556bc04f1c tests: tags: add unit test for ID3 v2.4 extended headers
https://bugzilla.gnome.org/show_bug.cgi?id=792983
2018-03-01 12:43:25 +00:00
Mathieu Duponchelle 10835e9919 audioaggregator: refactor conversion API
For the rationale, see:

https://bugzilla.gnome.org/show_bug.cgi?id=793917

Also test audiomixer conversion of current output buffer
2018-03-01 00:40:24 +01:00
Tim-Philipp Müller fb77e4db30 tests: videoscale: simplify test and make it more robust
test_negotiation would occasionally time out, for unknown reasons.
Simplify the test setup and get rid of the main loop, busses, and
notify signals. With this I can no longer easily reproduce the
timeout. Fingers crossed.
2018-02-19 17:50:51 +00:00
Tim-Philipp Müller 1ba8cb2207 icles: add appsink and appsrc benchmarks
These are very much artificial of course, but got to
measure something. appsink one contains lots of buffer
creation/free overhead, while appsrc one does not.
2018-02-19 16:00:52 +00:00
Tim-Philipp Müller ea30f86ccc Dist compositor crossfade example and pythons script for meson build
And add to autotools build so it gets disted.
2018-02-15 18:51:44 +00:00
Tim-Philipp Müller 8c5725c4ea audiomixer, audiointerleave: add to build
https://bugzilla.gnome.org/show_bug.cgi?id=791218
2018-02-13 16:38:32 +00:00
Tim-Philipp Müller ab758a9a39 audioaggregator, audiomixer, audiointerleave: move from -bad to -base
https://bugzilla.gnome.org/show_bug.cgi?id=791218
2018-02-13 15:56:49 +00:00
Matthew Waters fbef9220d3 gl*bin: fix transfer semantics for the create-element signal
We can either receive an element that is floating or not and need to
accomodate that in the signal return values.  Do so by removing the
floating flag.

https://bugzilla.gnome.org/show_bug.cgi?id=792597
2018-02-09 17:15:30 +11:00
Nicolas Dufresne 8b6706b683 meson: Enable libs_video unit test
It does not timeout anymore, even though it's a very slow test. For the
context, this test runs routines for a fixes amount of time and prints
the throughput. Which means the test takes more time everytime a pixel
format is added. If that becomes a problem again, we should disable the
benchmarks by default.
2018-02-06 16:29:11 -05:00
Tim-Philipp Müller 92048b81c0 tests: sdp: relicense code snippet from GPLv3 to LGPLv2.1+
Relicense with approval from Jose and Miguel. Code snippet
was supposed to be LGPL from the beginning.

https://bugzilla.gnome.org/show_bug.cgi?id=697808#c14
https://bugzilla.gnome.org/show_bug.cgi?id=697808#c15
2018-02-01 19:39:13 +00:00
Vincent Penquerc'h 63a8376825 gst-plugins-base.supp: add gl suppressions for one off init allocations
Add to valgrind suppressions file.

https://bugzilla.gnome.org/show_bug.cgi?id=781021
2018-01-24 00:47:20 +00:00
Tim-Philipp Müller ab87478bdc tests: audioconvert: fix up check for lost channel positions
The caps field is channel-mask these days, so that code path
was never active.
2018-01-19 18:50:07 +00:00
Jimmy Ohn 4876fe04f5 tests: audioconvert: Fix memory leak in failure path
Don't set a bad example by leaking things, even if calling
g_error() will make the process abort.

https://bugzilla.gnome.org/show_bug.cgi?id=783418
2018-01-19 18:47:06 +00:00
Tim-Philipp Müller e7f77f3a01 tests: fix build on Windows with MSVC 2018-01-16 20:13:45 +00:00
Tim-Philipp Müller d09c38faf7 meson: tests: fix build of tcp test on unix
Need to add gio-unix-2.0 dep to pipelines/tcp test otherwise it
won't find the gio/gunixfdmessage.h header which is not in the
same dir as the other gio headers. This issue was masked before
because we didn't include config.h so HAVE_GIO_UNIX_2_0
wasn't defined.
2018-01-16 19:22:16 +00:00
Tim-Philipp Müller 9297da71ce meson: tests: skip allocators dmabuf test on non-Linux 2018-01-16 19:21:53 +00:00
Tim-Philipp Müller 3f184c3abc tests: include config.h and don't include unix headers
In many cases the unistd.h includes weren't actually needed.

Don't build tests that need it on windows with MSVC
(multifdsink, multisocketsink, pipelines/tcp).

Preparation for making tests work on Windows with MSVC.
2018-01-16 18:14:59 +00:00
Tim-Philipp Müller c4be7eca5d examples: playback: don't use deprecated font button API
playback-test.c:2587:3: error: "gtk_font_button_get_font_name" is deprecated
2018-01-08 14:21:29 +00:00
Matthew Waters 7cc1431a56 libs/glheaders: move object creation to the gl thread where necessary
Some GL platforms (EGL, WGL) require deactivating the OpenGL context in
one thread before it can be used in another thread which this test
currently violates and would e.g. result in EGL_BAD_ACCESS errors from
gst_gl_context_activate().

Fix by moving the object creation into the GL thread instead and not
requiring additional gst_gl_context_activate() calls.

https://bugzilla.gnome.org/show_bug.cgi?id=792158
2018-01-03 23:11:54 +11:00
Matthew Waters 9e563a20c2 tests/glheaders: use #if for platform selection
GST_GL_HAVE_* are always defined to 0 or 1 so an #ifdef will always
succeed which is not the intention here.
2018-01-03 23:09:20 +11:00
Tim-Philipp Müller 2ee4ab1ebb meson: gl: define HAVE_PNG etc. in config.h instead of c_args
So that the tests have access to them as well (gl-launch-lines.c)
2017-12-22 22:28:20 +01:00
Miguel Paris bae3636197 rtp: fix gst_rtp_buffer_ext_timestamp taking into account backwards
If timestamp goes forwards more than allowed, we consider that the
timestamp belongs to the previous counting, so the extended timestamp
is unwrapped.

https://bugzilla.gnome.org/show_bug.cgi?id=783443
2017-12-21 17:27:42 -05:00
Mathieu Duponchelle c56323e821 tests: add missing comma 2017-12-21 19:32:03 +01:00
Mathieu Duponchelle 1382f69861 tests: conditionally define the glimagesink test as well
Forgotten in previous commit
2017-12-21 19:28:00 +01:00
Mathieu Duponchelle b0d795263f tests: fix build when not building gstgl
gstgl_dep is only defined when build_gstgl is true
2017-12-21 19:25:48 +01:00
Mathieu Duponchelle 164b5a7f94 audioaggregator: implement input conversion
https://bugzilla.gnome.org/show_bug.cgi?id=786344
2017-12-19 23:39:37 +01:00
Tim-Philipp Müller 0dd66648c3 gl: fix up a few more #if HAVE_FOO
error: "HAVE_PNG" is not defined, evaluates to 0 [-Werror=undef]
2017-12-19 16:51:24 +00:00
Tim-Philipp Müller d85a7a9b2e gl: hook up tests
Also move over simple gl launch line test.
2017-12-19 12:01:51 +00:00
Tim-Philipp Müller 8227135f3b gl: hook up to build system
Tests and documentation will follow separately.

The mixer elements in the opengl plugin need to stay
in -bad for now since they use GstVideoAggregator.

https://bugzilla.gnome.org/show_bug.cgi?id=754094
2017-12-19 12:01:48 +00:00
Tim-Philipp Müller 0eefcb23b4 gl: examples: fix c++ code for -Wreturn-aggregate
.. and use #ifdef instead of #if
2017-12-19 12:01:44 +00:00
Tim-Philipp Müller 59fe9c9122 gl: remove GST_USE_UNSTABLE_API bits 2017-12-19 12:01:37 +00:00
Tim-Philipp Müller cdbb261d9c Move OpenGL library and plugin from -bad
Merge branch 'opengl-move'

https://bugzilla.gnome.org/show_bug.cgi?id=754094
2017-12-19 12:00:43 +00:00
Nicolas Dufresne ecab99a7a9 sdlshare: Destroy GL backend buffer before the GL Context
This was otherwise leading to a deadlock in the GL library.
2017-12-09 19:32:31 +00:00
Nicolas Dufresne 9e208ba0b6 sdlshare2: Fix race conditions
The client-draw callback is running on the GL Thread, which will
be required to map the buffer. Map early, and pass the mapped
frame instead. On top of that, make sure to signal any pending
draw before trying to push EOS, as some pad locks might be taken.
This is the cost of using the same thread to control GStreamer and
to render GL.
2017-12-09 19:32:31 +00:00
Nicolas Dufresne dea918a835 meson: Build gl/sdl examples 2017-12-09 19:32:31 +00:00
Jan Schmidt bbe084de9d 3dvideo example: Correct video overlay for HiDPI
Use the GTK scaling factor to scale the video allocation
so video displays correctly on hi-dpi screens
2017-12-09 19:32:31 +00:00
Matthew Waters d7f43bb06b gl/tests: add some simple shader testing
Making sure that the default shaders compile and are usable
2017-12-09 19:32:31 +00:00
Matthew Waters fab729c61f gl/query: split tests and fix some corresponding issues in usage 2017-12-09 19:32:30 +00:00
Jérôme Laheurte 247e232ec4 Use value instead of version macro when testing for mac OS version
https://bugzilla.gnome.org/show_bug.cgi?id=788404
2017-12-09 19:32:30 +00:00
Philippe Normand b9a2c64d8d examples/gl/gtk: build fix for the 3dvideo example on macOS 2017-12-09 19:32:30 +00:00
Philippe Normand 0559b42d6c examples/gl/gtk: fix overlay handling for macOS
The GTK+ window requires a NSView sub-view, not an NSWindow.
2017-12-09 19:32:30 +00:00
Matthew Waters 9620edc49e gl/checks: fix build 2017-12-09 19:32:30 +00:00
Matthew Waters 21252d450c glutils: fix matrix operations everywhere
- correct the matrix multiplication
- Use column-major matrices
  - reverse order of matrix multiplications

https://bugzilla.gnome.org/show_bug.cgi?id=785980
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
Tim-Philipp Müller 996b8c746f examples: gl: remove ancient bitrotten .vcproj files 2017-12-09 19:32:28 +00:00
Josep Torra c020f421e1 examples: fix macOS 9.12 deprecation warnings
Add #defines to allow older versions of macOS to use the new constant names.
2017-12-09 19:32:28 +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
Nick Kallen 7b42f26b80 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-12-09 19:32:27 +00:00
Matthew Waters fc8217ae8d gl/tests: fix glimagesink element test on OSX
It was suffering a race starting up the thread that could cause the main
loop to quit before the main loop had started.
2017-12-09 19:32:25 +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 263255137e examples/gl/qt: fix the examples for the use of newer API
gstgl doesn't undo/overwrite what GL state the examples are changing
anymore.  As such, the examples need to reset the GL state themselves
to be able to play nice with libgstgl
2017-12-09 19:32:24 +00:00
Matthew Waters 18ac98c58b gl: GST_GL_TYPE -> GST_TYPE_GL
Some deprecated symbols are kept for backwards compatibility
2017-12-09 19:32:23 +00:00
Matthew Waters 8faebcf915 glsl: fix #version 150 not working with profiles
The spec allows the core/compatibility profiles to be used
with #version 150.

Also tighten up the tests to check for default profiles being chosen
correctly.
2017-12-09 19:32:23 +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
Alistair Buxton 6d8456e018 gl/examples: Really remove references to $(GST_PLUGINS_GL_*).
These seem to have been missed in the previous commit to this file.

https://bugzilla.gnome.org/show_bug.cgi?id=771023
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 061049dd73 gl/examples/fxtest: fix up for wayland support
- Pass the wayland display to gst
- Redrawing on resize is no longer needed.
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 4bbda2b626 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().
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 f077d937ad glimagesink: fix query leak in test
https://bugzilla.gnome.org/show_bug.cgi?id=766663
2017-12-09 19:32:20 +00:00
Guillaume Desmottes a7f21fedc5 glimagesink: properly setup/teardown tests
tcase_add_checked_fixture() is suppose to call the setup and teardown
functions so the tests don't have to do it manually.

https://bugzilla.gnome.org/show_bug.cgi?id=766663
2017-12-09 19:32:20 +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 ce72589510 tests/glcontext: update test for gen,del_texture removal 2017-12-09 19:32:20 +00:00
Matthew Waters e3b5214ac6 gl/examples: fix switchvideooverlay for wayland
and call XInitThreads() for X11
2017-12-09 19:32:18 +00:00
Matthew Waters df6a85725f gl/examples: remove duplicated videooverlay example
filtervideooverlay proved the exact same example (only with a extra glfiltercube).
2017-12-09 19:32:18 +00:00
Matthew Waters ed1ff251db gl/examples/3d: additions for wayland support 2017-12-09 19:32:18 +00:00
Sebastian Dröge 82a39d2227 gl/gtk: Fix compiler warning in example
fxtest.c: In function ‘main’:
fxtest.c:190:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
   GtkWidget *window;
   ^~~~~~~~~
2017-12-09 19:32:18 +00:00
Matthew Waters 015ec7587f gl/examples/qt: restrict the GL API to opengl where needed
Until the examples are ported to opengl3/gles2, they will not work with any
other GL api.
2017-12-09 19:32:18 +00:00
Matthew Waters d2542993dd gl/examples/gtk: call XInitThreads
Fixes some sporadic X11 threading assertions.
2017-12-09 19:32:18 +00:00
Matthew Waters 34e12a8837 gl/examples/cube*: choose opengl by default
The examples don't work with any other GL API.

Also fix the yuv example to not translate the cube out of the clipping area.
2017-12-09 19:32:17 +00:00
Matthew Waters c3e362a8a9 gl/examples/fxtest: add needed glupload to the pipeline
Fixes a negotiation failure in the example
2017-12-09 19:32:17 +00:00
Matthew Waters eb1a9bb9b0 gldisplay: make readding the same context a no-op
With e38af23044 returning the correct contexts,
gst_gl_display_add_context() was susceptible to causing infinte loops when
adding the same GstGLContext more than once.  Fix and add a test for
gst_gl_display_add_context().

Fixes glvideomixer gst-validate tests.
2017-12-09 19:32:17 +00:00
Matthew Waters 65533b807c gl: add a gstglquery object for arbitrary GL queries
Currently only GL_TIME_ELAPSED and GL_TIMESTAMP are supported
2017-12-09 19:32:15 +00:00
Matthew Waters 472970324c glcontext: implement checking whether a context has been shared
Some operations are unnecessary when running with only a single GL
context.
e.g. glFlush when setting a fence object as the flush happens on wait.

API: gst_gl_context_is_shared
2017-12-09 19:32:14 +00:00
Matthew Waters 9328ec33f3 tests/glmemory: output data pointer values on failure
Allows quicker inspection of what failed.
2017-12-09 19:32:14 +00:00
Sebastian Dröge eeb4fe6f63 glcolorconvert: Fix name of testsuite 2017-12-09 19:32:13 +00:00
Matthew Waters 09c8c23842 gl*memory*: reverse the parameter order of user_data and destroy notify
The convention is to have the destroy notify last after any user data
2017-12-09 19:32:13 +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
Sebastian Dröge f2e4344385 clutter: Fix compilation error in GL examples
Include gst/gl.h instead of specific headers to prevent such problems also in
the future.

In file included from ../../../../gst-libs/gst/gl/gl.h:47:0,
                 from ../../../../gst-libs/gst/gl/gstglbasememory.h:137,
                 from ../../../../gst-libs/gst/gl/gstglmemory.h:29,
                 from cluttershare.c:39:
../../../../gst-libs/gst/gl/gstglmemorypbo.h:51:20: error: field ‘mem’ has incomplete type
   GstGLMemory      mem;
                    ^
../../../../gst-libs/gst/gl/gstglmemorypbo.h:124:24: error: field ‘parent’ has incomplete type
   GstGLMemoryAllocator parent;
                        ^
../../../../gst-libs/gst/gl/gstglmemorypbo.h:134:29: error: field ‘parent_class’ has incomplete type
   GstGLMemoryAllocatorClass parent_class;
                             ^
2017-12-09 19:32:12 +00:00
Matthew Waters 56c3d97421 tests: update for glmemory api changes 2017-12-09 19:32:12 +00:00
Matthew Waters ba03bc2cba tests/glmemory: include the generic gl header
Including gstglmemory.h directly results in the compiler complaining
about incomplete types.
2017-12-09 19:32:12 +00:00
Matthew Waters 76a38dd66a glmemory: base classify and add the pbo memory on top
The base class is useful for having multiple backing memory types other
than the default.  e.g. IOSurface, EGLImage, dmabuf?

The PBO transfer logic is now inside GstGLMemoryPBO which uses GstGLBuffer
to manage the PBO memory.

This also moves the format utility functions into their own file.
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 0adc7e1bc4 tests:glsl: version_profile_s string leak
https://bugzilla.gnome.org/show_bug.cgi?id=758039
2017-12-09 19:32:11 +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
Vineeth TM 2c4a14f7c7 tests:glcolorconvert: Fix caps memory leak
Output caps being got from video info is not getting freed

https://bugzilla.gnome.org/show_bug.cgi?id=757929
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 681cb5b16d glmemory: add support for rectangle textures
Add the various tokens/strings for the differnet texture types (2D, rect, oes)

Changes the GLmemory api to include the GstGLTextureTarget in all relevant
functions.

Update the relevant caps/templates for 2D only textures.
2017-12-09 19:32:10 +00:00
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
Vineeth TM def421acf6 gstreamer: bad: Fix memory leaks when context parse fails
When g_option_context_parse fails, context and error variables are not getting free'd
which results in memory leaks. Free'ing the same.

And replacing g_error_free with g_clear_error, which checks if the error being passed
is not NULL and sets the variable to NULL on free'ing.

https://bugzilla.gnome.org/show_bug.cgi?id=753854
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
Edward Hervey 7e62a38569 checks: Ensure thread-safe libX11/GL when running tests 2017-12-09 19:32:07 +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
Jan Schmidt c096fec277 3dvideo: Add simple gtk example stereoscopic video player
https://bugzilla.gnome.org/show_bug.cgi?id=611157
2017-12-09 19:32:04 +00:00
Matthew Waters aff768f34c gl/examples: update qt examples for api changes 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 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
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
Julien Isorce 66c8c8ad87 gl/example: fix build error when compiling cocoa-videooverlay
libtool: error: ignoring unknown tag OBJC
and
clang: error: argument unused during compilation: '-pthread'
2017-12-09 19:32:03 +00:00
Edward Hervey 786b857e62 examples: Fix gl usage without wayland support
Not all platforms have wayland support. Handle that gracefully at
compile time
2017-12-09 19:32:03 +00:00
Matthew Waters 411d4d13b4 gl/examples: update gtk examples for glupload 2017-12-09 19:32:03 +00:00
Matthew Waters 81485d0b22 gl/examples: update gtk examples for wayland 2017-12-09 19:32:03 +00:00
Matthew Waters 70ccb610f6 tests/gl/gtk: implement setting a wayland display/surface 2017-12-09 19:32:03 +00:00
Jan Schmidt 506129ed42 Fix flags order in GL examples for uninstalled build 2017-12-09 19:32:01 +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 a4287991ae gl/examples: fixup generic cube example for NDC
translating outside the clip region doesn't work
2017-12-09 19:31:58 +00:00
Julien Isorce 8ca59af389 gl/examples: add sdlshare2 that uses glimagesink to output textures
https://bugzilla.gnome.org/show_bug.cgi?id=739681
2017-12-09 19:31:58 +00:00
Julien Isorce 1d88b95201 glimagesink: provide GstSample in client-draw signal
Instead of prividing texture and size directly.
And apply changes to examples.

https://bugzilla.gnome.org/show_bug.cgi?id=739681
2017-12-09 19:31:58 +00:00
Julien Isorce 0f90283520 sdlshare: use glupload and unmap frame 2017-12-09 19:31:58 +00:00
Julien Isorce 74b8117e53 examples: initialize NSApp at the beginning 2017-12-09 19:31:58 +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 07d41de7c4 gl/qt/examples: update for NSOpenGL -> CGL 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 b99d53e0ff gl/examples: fixup sdl example for gluPerspective removal 2017-12-09 19:31:51 +00:00
Thijs Vermeir 035f6f975a gl/cocoa: Fix example on Mac OS X 10.10
Using NSApp directly seems to confuse something, as the compiler
was expecting an id<NSFileManagerDelegate>. Switched to using
[NSApplication sharedApplication], and specified the delegate
protocol on the window class as well.

Similar to https://bugzilla.gnome.org/show_bug.cgi?id=738740
2017-12-09 19:31:51 +00:00
Matthew Waters 892d056a44 gl: remove the use of glu 2017-12-09 19:31:51 +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
Sebastian Dröge 673b0190af gl/cocoa: Remove GNUStep support
Until gcc and GNUStep properly support Objective-C blocks and other
"new" features of Objective-C we can't properly support them without
making the code much more ugly.

https://bugzilla.gnome.org/show_bug.cgi?id=739152
2017-12-09 19:31:50 +00:00
Julien Isorce 56c9d7f111 gl: add unit test that checks for glimagesink drain query handling
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732694
2017-12-09 19:31:49 +00:00
Matthew Waters 6811c39ff9 gl/examples: update for other-context property removal 2017-12-09 19:31:49 +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
Jan Schmidt 6b96a87003 examples: Fix Qt/GL qglwtextureshare example for X11
We need to pass the X11 display to GstGL or else it will
use its own X11 Display pointer, and the GL Context won't get shared
correctly on newer X servers
2017-12-09 19:31:47 +00:00
Jan Schmidt 491513adf6 examples: port GL/Qt examples to Qt5
Update the GL Qt integration examples for Qt5 changes and for GstGL
signal signature changes.
2017-12-09 19:31:47 +00:00
Matthew Waters b2df178d41 examples/gl: update for signal signature change 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 821bc8da5b examples/gl/gtk: use the sync bus callback to set the window handle
And output error messages.
2017-12-09 19:31:46 +00:00
Wang Xin-yu (王昕宇) a8093c56d5 gl: qglwtextureshare demo fixes and cleanup
1. glcontextid function is replaced by gstreamer gst_gl_context_new_wrapped .
2. call gst_init before gst_gl_display_new , seems gst_gl_display_new depends
   on gst_allocator_register , which only worked after gst_init called
3. flush gstreamer OpenGL context before using shared texture, fix
   flicker problem.

https://bugzilla.gnome.org/show_bug.cgi?id=735566
2017-12-09 19:31:46 +00:00
Lubosz Sarnecki f3311f2b1e examples: fix gtk+ 3.14 deprecation error
https://developer.gnome.org/gtk3/3.13/GtkWidget.html#gtk-widget-set-double-buffered

https://bugzilla.gnome.org/show_bug.cgi?id=734482
2017-12-09 19:31:45 +00:00
Sebastian Rasmussen 06961ea200 examples/gl: unref bus and element after usage
gst_pipeline_get_bus() and gst_bin_get_by_interface() both
return references that need to be unreferenced after usage.

https://bugzilla.gnome.org/show_bug.cgi?id=734527
2017-12-09 19:31:45 +00:00
Matthew Waters 5e2f15403c gl/tests: update for API changes 2017-12-09 19:31:45 +00:00
Руслан Ижбулатов 7c62b9ceaa gl: Reorder CFLAGS to include in-source dirs first in examples
https://bugzilla.gnome.org/show_bug.cgi?id=733426
2017-12-09 19:31:44 +00:00
Tim-Philipp Müller 59f0f140ae examples: fix compilation of gl fxtest example on win32 with Gtk+ 3.0
https://bugzilla.gnome.org/show_bug.cgi?id=733063
2017-12-09 19:31:44 +00:00
Matthew Waters cd467278e8 gl/examples: gitignore generated files 2017-12-09 19:31:44 +00:00
Wang Xin-yu (王昕宇) 869f9da13f gl : fix qglwtextureshare demo 2017-12-09 19:31:44 +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 2ddcde1acb gl/examples: update for TEXTURE_2D change 2017-12-09 19:31:43 +00:00
Matthew Waters c3fb73335f gl/examples: add GST_PLUGINS_BASE_CFLAGS 2017-12-09 19:31:43 +00:00
Matthew Waters 3a9803f31f gl/examples: remove spurious include for doublecube example 2017-12-09 19:31:43 +00:00
Matthew Waters 21e9ad2b8e gl/examples: add the srcdir and builddir includes
And remove references to $(GST_PLUGINS_GL_*)
2017-12-09 19:31:42 +00:00
Matthew Waters e523cdd21a glfilterapp: remove the reshape/draw properties
The reshape property was never used.
Replace the draw property with a signal.

Based on patch by Mathieu Duponchelle <mathieu.duponchelle@epitech.eu>

https://bugzilla.gnome.org/show_bug.cgi?id=704507
2017-12-09 19:31:42 +00:00
Matthew Waters 31ee764a8a gl/examples: Port to using signals instead of properties
Based on patch by Mathieu Duponchelle <mathieu.duponchelle@epitech.eu>

https://bugzilla.gnome.org/show_bug.cgi?id=704507
2017-12-09 19:31:42 +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
Julien Isorce b84a2eaf9f gl: rename platform cocoa to cgl
Before:
GST_GL_PLATFORM=cocoa GST_GL_WINDOW=cocoa
gst-launch-1.0 videotestsrc ! glimagesink

After:
GST_GL_PLATFORM=cgl GST_GL_WINDOW=cocoa
gst-launch-1.0 videotestsrc ! glimagesink

but still pass --enable-cocoa to configure script
because currently it can only be used with cocoa API.

We could later have cgl/gstglcontext_cgl.h that manages
a CGLContextObj directly and cocoa/gstglcontext_cocoa.h
would just wrap it.
So that it could be used with other Apple's window APIs.

https://bugzilla.gnome.org/show_bug.cgi?id=729245
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 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
Luis de Bethencourt 64a144f114 gl/clutter: safer check for cogl version
Use COGL_VERSION_ENCODE to check for the minimum required and maximum allowed
cogl version. In certain situations just using the COGL_VERSION_* macro name can
give you the following error:

error "COGL_VERSION_MAX_ALLOWED must be >= COGL_VERSION_MIN_REQUIRED"
2017-12-09 19:31:39 +00:00
Luis de Bethencourt f29a98cc5f gl/examples/generic: remove trailing whitespaces 2017-12-09 19:31:39 +00:00
Sebastian Dröge ea7c8f9771 examples: Fix CFLAGS in clutter GL examples 2017-12-09 19:31:39 +00:00
Sebastian Dröge 405774bf2b examples: Add all gl subdirs to DIST_SUBDIRS to fix the build 2017-12-09 19:31:39 +00:00
Julien Isorce 70bc469a8a gl: pass NSView instead of NSWindow in cocoa-videooverlay example
https://bugzilla.gnome.org/show_bug.cgi?id=728451
2017-12-09 19:31:39 +00:00
Julien Isorce e0f94ae094 gl: add copyright to cocoa example 2017-12-09 19:31:38 +00:00
Julien Isorce 5150408da3 gl: rename cocoa example and move it to its parent directory 2017-12-09 19:31:38 +00:00
Julien Isorce a6b2cd4c14 gl: remove unuseful README for cocoa example 2017-12-09 19:31:38 +00:00
Thiago Santos 72f3b228c8 examples: gl: add missing entry to cflags to find gst/gl/gl.h
Otherwise build fails
2017-12-09 19:31:38 +00:00
Stefan Sauer 2cb93951df tests: drop direct include
It is only allowed to include gdk/gdkx.h and that will bring all the x11 things.
2017-12-09 19:31:38 +00:00
Jan Schmidt 6b1b6d25de gl/sdl example: Fix uninstalled build 2017-12-09 19:31:38 +00:00
Matthew Waters 84459c386b gl/examples/sdl: update for the latest gstgl changes 2017-12-09 19:31:38 +00:00