Commit graph

3597 commits

Author SHA1 Message Date
Sebastian Dröge
b37c08ecb5 glstereomix: Fix build after deprecating misnamed GST_TYPE_GL_STEREO_DOWNMIX_MODE_TYPE 2018-10-03 16:00:23 +03:00
Sebastian Dröge
c5b78fdc93 gl: Rename GST_TYPE_GL_STEREO_DOWNMIX GType macro everywhere
The old one still exists but behind GST_DISABLE_DEPRECATED
2018-10-03 14:49:32 +03:00
Sebastian Dröge
1d271f9a15 basetextoverlay: Append our rectangle to the upstream composition, not the other way around
Upstream is supposed to be painted first, and only then our rectangle.
2018-10-01 19:21:12 +03:00
Sebastian Dröge
e9579466a3 basetextoverlay: Minor cleanup of negotiation functions 2018-10-01 19:21:09 +03:00
Sebastian Dröge
b59fcdc789 glmixerbin: "latency" property on aggregator is uint64, not int64
Also update the property description and range with aggregator's values.
2018-09-24 23:26:52 +03:00
Matthew Waters
f757da1160 glvideomixer: fix constant alpha enum value for constant alpha 2018-09-21 19:45:13 +10:00
Sebastian Dröge
55ec47f555 vorbisdec: Initialize decoder directly once we have the 3 headers
... instead of waiting for the first non-header buffer.

Also drop non-identification headers arriving after initialization or
before the identification header. We don't do anything with them and
they would just accumulate.

https://bugzilla.gnome.org/show_bug.cgi?id=796980
2018-09-21 11:48:40 +03:00
Sebastian Dröge
05d0c72a59 glvideomixer: Fix typo in property description 2018-09-19 10:28:56 +03:00
Nicolas Dufresne
46f47416fe Revert "gluploadelement: try to avoid dropping buffers"
This reverts commit 75f2532da7.
2018-09-13 20:02:34 -04:00
Marcos Kintschner
e05e8117e7 opusenc: fix segmentation fault at x86 version
The argument 0x0 is interpreted by the x86 compiler as a 32-bit int, but
it is consumed as a 64-bit uint causing a segmentation fault. We need to
explicit cast it to guint64 in order for the va_list to be built correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=797092
2018-09-13 20:00:02 -04:00
Michael Olbrich
75f2532da7 gluploadelement: try to avoid dropping buffers
Without this, a buffer is dropped if glupload indicates that it is
necessary to reconfigure.
Avoid this by explicitly reconfiguring immediately and uploading the buffer
again.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-09-10 23:29:10 -04:00
Nirbheek Chauhan
41b7a65b81 meson: Add an option for the 'Tremor' Vorbis implementation
It makes sense to control it explicitly to allow us to enable it on
platforms that don't have hardware floating-point, and to allow people
to enable the 'vorbis' plugin without having to also provide the
Tremor dependency which is useless on most devices.
2018-09-10 22:22:16 +05:30
Matthew Waters
43f0b75e55 gl/meson: add build for iOS 2018-08-31 12:23:40 +10:00
Sebastian Dröge
0619168e2a vorbisdec: Always handle in-band header packets once the first non-header packet arrives
And clean up any old pending headers if we receive a new identification
header, or if we receive a new set of headers via caps.

Otherwise it might happen that we receive one or more header but not
all, and then afterwards all headers again, and libvorbis does not like
getting headers passed multiple times and would error out.

It only makes sense to pass the very latest headers to the decoder at
the time we can actually make use of them.

https://bugzilla.gnome.org/show_bug.cgi?id=796980
2018-08-28 17:47:09 +03:00
Sebastian Dröge
2ace14f613 pango: Create one context per instance and remove class mutex
PangoCairo is thread-safe as long as the context and fontmap are not
shared between threads. Previously each subclass had its own context and
a class mutex for this reason, but apart from hurting performance this
was also not completely safe yet: the same fontmap might've been used by
different classes from different threads as the thread-default fontmap
(at time of class initialization) was used.
2018-08-27 15:41:31 +03:00
Sebastian Dröge
6024b8e46b oggdemux: Ensure that no pad values are set when setting up the mapper
Otherwise we might have arbitrary values set that are used later and can
cause undefined behaviour, as found by ossfuzz.
2018-08-27 11:07:47 +03:00
Tim-Philipp Müller
c1cf04f67f glcolorscale: fix compiler warning
gstglcolorscale.c(173): warning C4098: 'gst_gl_colorscale_gl_stop': 'void' function returning a value
2018-08-26 11:16:23 +02:00
Tim-Philipp Müller
e89aa2af6a meson: remove obsolete FIXME 2018-08-16 11:35:33 +01:00
Tim-Philipp Müller
cec90050b0 meson: gl: find libjpeg via pkg-config
This effectively (but optionally) requires libjpeg-turbo which
ships with a .pc file and is what pretty much everyone these days
uses anyway for libjpeg, so shouldn't be a problem hopefully.

https://bugzilla.gnome.org/show_bug.cgi?id=796947
2018-08-16 11:09:51 +01:00
Tim-Philipp Müller
4ec1ba433d meson: add option for opengl and the misc optional gl plugin deps
Finer control over the opengl integration library dependencies
is already implemented via the gl_api, gl_platform, and gl_winsys
options.

https://bugzilla.gnome.org/show_bug.cgi?id=796947
2018-08-16 10:56:58 +01:00
Alessandro Decina
06b8792a5f gl/meson: OSX support (CGL and Cocoa)
[Matthew Waters]: minor additions such as -fobjc-arc and relying on
dependency rather than cc.find_library()
2018-08-03 12:53:10 +10:00
Nicolas Dufresne
d2aff7b184 opusdec: Add property to control phase inversion
When enabled, phase-inversion slightly increase stereo quality, but
produce a stream that when downmixed to mono will present important
audio distortion. This patch disables this feature by default and
introduce a property that let user enable it if desired.

https://bugzilla.gnome.org/show_bug.cgi?id=791771
2018-08-01 09:45:07 -04:00
Nirbheek Chauhan
28caf92587 meson: Fix detection of cdparanoia library
Without this the pkg-config file is required when the plugin is enabled.
2018-07-31 13:30:46 +05:30
Nirbheek Chauhan
eadedc68f8 meson: Add feature options for all plugins
GL dependency detection is still automagic.

https://bugzilla.gnome.org/show_bug.cgi?id=795107
2018-07-27 18:42:11 +05:30
Sebastian Dröge
c2a7c93840 gl: Also don't leak floating references to elements set via properties
Fixup for 58ac815eae. Floating references
are such a mess.
2018-07-25 15:03:59 +03:00
Sebastian Dröge
58ac815eae gl: Don't steal callers reference when setting non-floating elements via properties
Introduced by fbef9220d3. The code there
is only correct for elements we get from signals.
2018-07-25 14:35:40 +03:00
Matthew Waters
5518eb26fb gluploadelement: also set the context in decide_allocation
If downstream doesn't perform allocation queries, the context would
never be set and criticals would occur.
2018-07-12 13:15:48 +10:00
Matthew Waters
3a3577f826 glvideomixer: fix default placement when different sized output
i.e. when expanding from 320x240 to 800x600, the resulting frame should
appear in the top left corner, not the middle.

https://bugzilla.gnome.org/show_bug.cgi?id=794401
2018-07-12 12:48:39 +10:00
Daniel Klamt
32c7249c5e glvideomixer: Moves the objects to zero on z axis
Matches the output from a similar glimagesink pipeline when
rotating from an upstream gltransformation passed through
the affine transformation meta with xpos/ypos being set.

https://bugzilla.gnome.org/show_bug.cgi?id=794401
2018-07-12 12:46:40 +10:00
Nicolas Dufresne
443b321ca1 glvideomixer: Fix coding style 2018-07-10 09:45:31 -04:00
Nicolas Dufresne
5958b0bd32 glvideomixer: Add missing string.h include 2018-07-10 09:42:47 -04:00
Daniel Klamt
b1bd804cb3 Moved the pad offset and aspect ratio to a matrix so it will be added in view space and not in world space
https://bugzilla.gnome.org/show_bug.cgi?id=794401
2018-07-10 20:31:26 +10:00
Matthew Waters
16cba63d43 gl/utils: fixup matrix math again for column major
e4bf9ed8f0 was not quite right and changed
the wrong thing. Intead we needed to change the multiplication order
and should have kept the previous to/from matrices as is done in this
patch.
2018-07-10 20:13:22 +10:00
Tim-Philipp Müller
69534fe9a0 gl: Update for g_type_class_add_private() deprecation in recent GLib 2018-06-24 01:37:08 +02:00
Sebastian Dröge
3dd95b1311 oggdemux: Make sure that events are writable before changing their seqnum 2018-06-18 13:28:15 +03:00
Matthew Waters
6f04c3ac87 glalpha: fix compilation with msvc
It doesn't define M_PI
2018-06-07 14:23:55 +10:00
Matthew Waters
4bd93dc4d8 gldownloadelement: fix build with msvc
msvc doesn't like #ifdef inside macro expansion
2018-06-06 23:36:08 +10:00
Matthew Waters
e4bf9ed8f0 gl/utils: Fix NDC conversion matrices for column-majorness
The matrices were converting the wrong values with non-diagonal-only matrices.
e.g. a typical yflip matrix in [-1,1]^3 such as
 1  0  0  0
 0 -1  0  0
 0  0  1  0
 0  0  0  1

Would have actually required a matrix like this in [0,1]^3
 1  0  0  0
 0 -1  0  0
 0  0  1  0
 0 -2  0  1

Which is
1. not consistent with our multiplication convention and would require
   transposing matrices or changing our multiplication order (from what is
   generally used on opengl matrix guides/tutorials).
2. Produces incorrect values when input with actual vertices accounting for
   the difference in multiplication order.  e.g. some vertices multiplied by
   the yflip matrix using vertex * yflip(== transpose(yflip) * vertex):

     vertex:       -> result:           expected:
     vec4(1,0,1,1) -> vec4(1,-2,1,1)    vec4(1,1,1,1)
     vec4(1,1,1,1) -> vec4(1,-3,1,1)    vec4(1,0,1,1)

With the updated values, we now get the expected values.

Includes a test for this behaviour and the example above
2018-06-06 23:36:08 +10:00
Edward Hervey
5c118e5924 oggdemux: Properly relay seqnum of segments
Not all cases were handled regarding properly propagating the
seqnum of SEGMENT events on all downstream segment-related events
2018-06-05 17:24:05 +02:00
Edward Hervey
63e8900c47 ogg: Avoid undefined granule shift
A granule is a 64bit signed integer, shifting by 63 or more is
undefined and most likely an indication that the stream is
corrupted or invalid.

Detected by oss-fuzz
2018-05-30 10:57:14 +02:00
Jan Schmidt
567bbe3c07 glcolorbalance: Support OES textures for input/passthrough
glcolorbalance is in the default GL path inside glimagesink,
so has been causing an possibly-unnecessary extra texture copy
on Android for a while now. If we're just doing passthrough,
we can support OES directly. If not, they'll be transformed
to 2D textures and colourbalanced.
2018-05-07 01:16:27 +10:00
Sebastian Dröge
dbb21615c4 videoaggregator: Rename get_output_buffer() to create_output_buffer()
For consistency with GstAudioAggregator.
2018-05-06 16:05:28 +02:00
Sebastian Dröge
33a8e28207 videoaggregator: Switch to a GstVideoAggregatorConvertPad subclass
This moves all the conversion related code to a single place, allows
less code-duplication inside compositor and makes the glmixer code less
awkward. It's also the same pattern as used by GstAudioAggregator.
2018-05-06 15:22:51 +02:00
Sebastian Dröge
d37e778692 glmixer: Include string.h for memset()
gstglmixer.c:143:5: error: implicit declaration of function ‘memset’ [-Werror=implicit-function-declaration]
     memset (prepared_frame, 0, sizeof (GstVideoFrame));
     ^~~~~~
gstglmixer.c:143:5: error: incompatible implicit declaration of built-in function ‘memset’ [-Werror]
2018-05-05 17:48:30 +02:00
Sebastian Dröge
1c8110ab17 videoaggregator: Move aggregated_frame and the pad buffer into the private struct
The aggregated_frame is now called prepared_frame and passed to the
prepare_frame and cleanup_frame virtual methods directly. For the
currently queued buffer there is a method on the video aggregator pad
now.
2018-05-05 16:32:19 +02:00
Matthew Waters
c150928756 glbasefilter: expose finding the local GL context
And use it to attempt to find the GL context sooner for upload and color
conversion caps transformations.
2018-05-05 21:24:25 +10:00
Matthew Waters
af5b0ee7d0 gl: add glalpha element that is similar to the alpha element
It performs similarly to the existing alpha element however performs
calculations in floating point rather than with small (guint8) integers
so some differences are to be expected.

https://bugzilla.gnome.org/show_bug.cgi?id=794070
2018-05-05 21:24:25 +10:00
Sebastian Dröge
404b802846 glmixer: Move frame/texture mapping/unmapping into prepare/clean_frame
Previously we assumed that the texture ID is going to be valid even
after unmapping the frame, as it was immediately unmapped before even
being used. Now we only unmap once we're done with the texture.
2018-05-05 12:17:34 +02: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
Sebastian Dröge
a240fb7997 videoaggregator: Move GstChildProxy implementations into leaf classes
Not every subclass will want to expose the pads via the interface.

https://bugzilla.gnome.org/show_bug.cgi?id=739011
2018-05-04 16:13:16 +02:00
Xavier Claessens
201e7c7803 Meson: Generate pc file for all plugins in base
https://bugzilla.gnome.org/show_bug.cgi?id=794568
2018-04-25 11:05:56 +01:00
Tim-Philipp Müller
762733c3d8 meson: gl: fix 'invalid keyword argument' meson warnings
Required is not a valid kwarg for cc.has_header()
2018-04-20 11:44:55 +01:00
Mathieu Duponchelle
32ca1701b7 alsamidisrc: unref buffer_list before early return 2018-04-13 01:07:21 +02:00
Mathieu Duponchelle
44ea6f4c06 vorbisenc: do not map input buffer in WRITE mode 2018-04-12 15:47:27 +02:00
Sebastian Dröge
43145292d4 gl: Disable glmixerbin for the time being too
Otherwise we have one copy in gst-plugins-bad and one (unused) here,
which makes static linking unhappy.
2018-03-25 12:48:43 +03:00
Edward Hervey
17d5f08316 oggstream: protect against out-of-bounds read
We need at least 17 bytes of data for a valid flac header

oss-fuzz #6974
2018-03-17 06:34:47 +01:00
Tim-Philipp Müller
ae9911617e Revert "alsasrc: lock calls to snd_pcm_delay() with mutex as in alsasink"
This reverts commit 4f88125b3d.

This seems to have undesirable side-effects and needs more
investigation first.

https://bugzilla.gnome.org/show_bug.cgi?id=746015
2018-03-07 18:50:25 +00:00
Mathieu Duponchelle
b59da8eced Port to latest GstAggregator segment API
The aggregator segment is now exposed on the src pad

https://bugzilla.gnome.org/show_bug.cgi?id=793946
2018-03-01 15:37:06 +01:00
Mathieu Duponchelle
22981e8a42 Port to latest GstAggregator segment API
The aggregator segment is now exposed on the src pad

https://bugzilla.gnome.org/show_bug.cgi?id=793944
2018-03-01 15:33:25 +01:00
Jan Schmidt
09584edc9a glimagesink: Correct PAR in output caps when transforming
When doing a 3D/multiview transformation and rescaling to
match the output window size, the resulting PAR may
not match the input any more and needs recalculating,
or else the GstSample reported to client-draw has the
wrong PAR.
2018-02-23 19:39:37 +11:00
Sebastian Dröge
1cfe070de7 gl: Link to libgstallocators for the dmabuf allocator 2018-02-17 18:34:58 +02:00
Tim-Philipp Müller
466b868459 vorbisparse: error out when headers are missing
https://bugzilla.gnome.org/show_bug.cgi?id=791606
2018-02-14 00:22:38 +00:00
Edward Hervey
aab5cccc34 vorbisdec: Improve "new headers while initialized" handling
If new headers arrive after we are initialized, we need to make
sure that they are indeed valid.

A vorbis bitstream always begins with three header packets and must
be in order.

Also some streams have unframed (invalid?) headers that might
confuse and disrupt the decoding process.

Therefore if ever we see new headers, we accumulate them and once
we get a non-header packet we check them to make sure that:
* We have at least 3 headers
* They are the expected ones (identification, comments and setup)
* They are in order
* Any other "header" is ignored

If those conditions are met, we reset and reconfigure the decoder

https://bugzilla.gnome.org/show_bug.cgi?id=784530
2018-02-13 08:41:29 +01:00
Jan Schmidt
46260654a4 glimagesink: Always display with requested stereo display mode
Even if the input is monoscopic, the app might want to display
it in a different layout, to do side-by-side for VR for example,
so if the app changes the output-multiview-mode always use that.
2018-02-09 18:16:04 +11: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
Matthew Waters
0d69b9d3cc gldownload: remove texture-target field from dmabuf/sysmem caps
https://bugzilla.gnome.org/show_bug.cgi?id=792342
2018-02-09 12:33:28 +11:00
Edward Hervey
0d14819ef2 oggdemux: Handle invalid-sized packets
On invalid packets there is the possibility we might end up wanting
to trim/offset more than what is available.

oss-fuzz issue #5866
2018-02-01 10:51:21 +01:00
Nicolas Dufresne
17b118c120 glimagesink: Allow resetting render rectangle
As documented, passing -1 to x and/or y should reset the render
rectangle to the window/display size.

https://bugzilla.gnome.org/show_bug.cgi?id=792798
2018-01-30 09:58:14 +00:00
Nicolas Dufresne
3b317ea6c2 glimagesink: Add render-rectangle property
This allow controlling the render rectangle from gst-launch-1.0.

https://bugzilla.gnome.org/show_bug.cgi?id=792798
2018-01-30 09:58:14 +00:00
Vincent Penquerc'h
6df4606044 glvideomixer: fix vertex_buffer leak
We call the base class first as this will remove the pad from
the aggregator, thus stopping misc callbacks from being called,
one of which (process_textures) will recreate the vertex_buffer
if it is destroyed

https://bugzilla.gnome.org/show_bug.cgi?id=760873
2018-01-29 09:58:00 +00:00
Branislav Katreniak
4f88125b3d alsasrc: lock calls to snd_pcm_delay() with mutex as in alsasink
Alsasrc introduced delay_lock in commit 519f85a43e73efb8f3fb2c7be45226e
because alsa-lib is not thread safe for the same handle.
Alsasrc uses the same threading pattern, it should be locked too.

https://bugzilla.gnome.org/show_bug.cgi?id=746015
2018-01-22 20:24:00 +00:00
Edward Hervey
d36a22553b theoradec: Check for valid width/height
If width or height are zero ... there's no video :)
2018-01-17 14:35:51 +01: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
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
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
26b3955aba gl: use #ifdef HAVE_* instead of #if HAVE_FOO 2017-12-19 12:01:41 +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
729b500208 opus: remove unused build variable and define 2017-12-19 12:01:32 +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
Víctor Manuel Jáquez Leal
8f0bf85cfe gldownload: fix wrong enum
When compiling with clang, an enum conversion error is triggered
since GstVideoFrameFlags are not GstVideoFlags.

This patch sets GST_VIDEO_FRAME_FLAG_NONE to the added video meta.

https://bugzilla.gnome.org/show_bug.cgi?id=791251
2017-12-09 19:32:31 +00:00
Nicolas Dufresne
dc5dd864e6 gldownload: Add missing ifdef for dmabuf and egl
This fixes the build for platforms that don't support one or the other.
2017-12-09 19:32:31 +00:00
Matt Fischer
c98f92ee03 gldownload: Add dmabuf exporting
This patch adds code to gldownload to export the image as a
dmabuf if requested.  The element now exposes memory:DMABuf as
a cap feature, and if it is selected, the element exports the
texture to an EGL image and then a dmabuf. It also implements a
fallback to system memory download in case the exportation failed.

https://bugzilla.gnome.org/show_bug.cgi?id=776927
2017-12-09 19:32:31 +00:00
Tim-Philipp Müller
b5dee0fe5b Remove GstAggregator from -bad, moved to core
https://bugzilla.gnome.org/show_bug.cgi?id=739010
2017-12-09 19:32:31 +00:00
Matthew Waters
1abd0804f4 gl/caopengllayer: use public GstGLContext instead of Cocoa-specific one
Allows keeping the GstGLCAOpenGLLayer public but not the winsys-specific
context/display/window.
2017-12-09 19:32:31 +00:00
Mathieu Duponchelle
d5addcb352 aggregator: Remove klass->sinkpads_type
This posed problems for the python bindings (and possibly others).

Instead, subclasses now use add_pad_template_with_gtype.

https://bugzilla.gnome.org/show_bug.cgi?id=789986
2017-12-09 19:32:31 +00:00
Matthew Waters
0063e63fe3 gltestsrc: guard stop in gl thread
So we don't result in a critical when we've never created the GL context:

gst_gl_context_thread_add: assertion 'GST_IS_GL_CONTEXT (context)' failed
2017-12-09 19:32:31 +00:00
Matthew Waters
5793dfe881 gltestsrc: free in the GL thread on stop
Calling GL functions not on the GL thread may crash in some GL
implementations.

https://bugzilla.gnome.org/show_bug.cgi?id=789665
2017-12-09 19:32:30 +00:00
Tim-Philipp Müller
77277c46f9 gl: use new gst_element_foreach_sink_pad()
Instead of gst_aggregator_iterate_sinkpads() which will
soon be removed.

https://bugzilla.gnome.org/show_bug.cgi?id=785679
2017-12-09 19:32:30 +00:00
Ponnam Srinivas
601e274c95 glmixer: Unmap video frame in error case
https://bugzilla.gnome.org/show_bug.cgi?id=788127
2017-12-09 19:32:30 +00:00
Haihua Hu
29973b7d6c glvidemixer: need reconfigure output gemotry after caps renegotiated 2017-12-09 19:32:30 +00:00
Matthew Waters
9fbd1930b7 Revert "glvideomixer: need update output geometry after src caps reconfigure"
This reverts commit d6e538dc56.
2017-12-09 19:32:30 +00:00
Haihua Hu
60eeef12a0 glvideomixer: need update output geometry after src caps reconfigure
Need update output geometry when sink caps changed and use
gst_structure_set to update caps if structure is fixed

https://bugzilla.gnome.org/show_bug.cgi?id=787820
2017-12-09 19:32:30 +00:00
Haihua Hu
4fa5c37878 glimagesink: expose should do redisplay all the time
when using internal window, window resize should work
when pause state, but expose only do redisplay when
window_id is valid. So expose should do redisplay all
the time.

https://bugzilla.gnome.org/show_bug.cgi?id=787394
2017-12-09 19:32:30 +00:00
Nicolas Dufresne
707385690d Request minimum buffer even if need_pool is FALSE
When tee is used, it will not request a pool, but still it wants to
know how many buffers are required.

https://bugzilla.gnome.org/show_bug.cgi?id=730758
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
Matthew Waters
1dc074d401 gltransformation: draw with GL_TRIANGLES
Drawing 5 vertices with GL_TRIANGLE_STRIP will draw an extra unneeded
triangle.
2017-12-09 19:32:30 +00:00
Julien Isorce
d5563a0c06 gl: fix broken build due to previous commit 2fd84a6c
Can reproduce after installing libgraphene-dev

Also fixes caopengllayersink.h to anticipate build error on osx.

https://bugzilla.gnome.org/show_bug.cgi?id=784779
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
Jan Schmidt
632015a9e8 gldownload: Micro-optimisation. Don't check output caps on every buffer
The output caps will only change on a set_caps() call, so check if
they contain the SystemMemory feature then and save some
per-buffer CPU.
2017-12-09 19:32:29 +00:00
Jan Schmidt
76bf415a96 glfilter: Remove hard-coded pad templates
Add a function to install the default RGBA pad templates,
but don't make them required so that there can be
GstGLFilter sub-classes with different input/output
caps if they want. Remove the hard-coded RGBA restriction in
the set_caps_features call, as it will be taken care
of by intersecting with the pad templates.

Update all the sub-classes to match
2017-12-09 19:32:29 +00:00
Nicolas Dufresne
e0d351c798 gl: Add dependency to gstallocators 2017-12-09 19:32:28 +00:00
Anders Jonsson
4179109ba2 gltestsrc: Fix typo (occured->occurred)
https://bugzilla.gnome.org/show_bug.cgi?id=782947
2017-12-09 19:32:28 +00:00
Olivier Crête
28b7954ea1 glbasemixer: Remove unused negotiated member
This is now all handled in GstAggregator, so this code is not
called anymore.
2017-12-09 19:32:28 +00:00
Olivier Crête
00760618df gl*mixer: Use propose_allocation from the GstAggregator base class
https://bugzilla.gnome.org/show_bug.cgi?id=782918
2017-12-09 19:32:28 +00:00
Olivier Crête
5bb22d8f12 glbasemixer: Remove own decide_allocation, use GstAggregator's
https://bugzilla.gnome.org/show_bug.cgi?id=746529
2017-12-09 19:32:28 +00:00
Olivier Crête
7eaafa62a8 glbasemixer: Use aggregator for allocation handling
https://bugzilla.gnome.org/show_bug.cgi?id=746529
2017-12-09 19:32:28 +00:00
Olivier Crête
74db4fa64e videoaggregator: Get the buffer from the pool if available
https://bugzilla.gnome.org/show_bug.cgi?id=746529
2017-12-09 19:32:28 +00:00
Matthew Waters
ffe51f38fc aggregator: add simple support for caps handling
Modelled off the videoaggregator caps handling as that seems the most
mature aggregtor-using implementation that has caps handling there is.

https://bugzilla.gnome.org/show_bug.cgi?id=776931
2017-12-09 19:32:28 +00:00
Nicolas Dufresne
e004cfd6fe Remove plugin specific static build option
Static and dynamic plugins now have the same interface. The standard
--enable-static/--enable-shared toggle are sufficient.
2017-12-09 19:32:27 +00:00
Tim-Philipp Müller
7ee90afce2 glvideomixer: fix whole example launch line actually 2017-12-09 19:32:27 +00:00
Tim-Philipp Müller
c6ab669b52 glvideomixer: remove extraneous \ from example launch line in docs 2017-12-09 19:32:27 +00:00
Thibault Saunier
95ac4d5175 docs: Port all docstring to gtk-doc markdown 2017-12-09 19:32:27 +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
e7bf6689bb applemedia/gl: Fix compile issues for OSX
https://bugzilla.gnome.org/show_bug.cgi?id=778333
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
Sebastian Dröge
cb0dba6188 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-12-09 19:32:26 +00:00
Sebastian Dröge
0e2f93589d glvideomixer/compositor: Correctly error out if calculating DAR fails
CID 1320700
2017-12-09 19:32:26 +00:00
Sebastian Dröge
dc28155e21 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-12-09 19:32:26 +00:00
Juan Pablo Ugarte
5ffa05081f 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-12-09 19:32:26 +00:00
Matthew Waters
6211661fd4 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-12-09 19:32:26 +00:00
Matthew Waters
ad20a945de gl: update sys dependants for function removals
4315a4b54d forgot to change the androidmedia/videotoolbox/caopengllayer
sources as required.
2017-12-09 19:32:26 +00:00
Matthew Waters
69da104456 glutils: document functions 2017-12-09 19:32:26 +00:00
Matthew Waters
de6c39189f glutils: privatise matrix multiplication/videoaffinetransformation retrieval 2017-12-09 19:32:26 +00:00
Matthew Waters
ceda9dc1aa 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-12-09 19:32:26 +00:00
Matthew Waters
d00a13f01d glutils: remove trivial helper function
gst_gl_caps_replace_all_caps_features() is only used in two places and can
be trivially reproduced.
2017-12-09 19:32:26 +00:00
Matthew Waters
cfc16f6dae gl: remove custom control binding proxy
Use the existing GstProxyControlBinding instead.
2017-12-09 19:32:25 +00:00
Haihua Hu
09952ddc4b 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
2017-12-09 19:32:25 +00:00
Sebastian Dröge
faf1e388f7 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.
2017-12-09 19:32:25 +00:00
Sebastian Dröge
aeb5d4edaf gst: Don't declare variables inside the for loop header
This is a C99 feature.
2017-12-09 19:32:25 +00:00
Florent Thiéry
2faef638ed gldownload: fix element description (was "OpenGL uploader") 2017-12-09 19:32:25 +00:00
Matthew Waters
737505f7ed gl: remove empty BUGS file
We use bugzilla for bug tracking
2017-12-09 19:32:24 +00:00
Matthew Waters
695601b7e0 gl/build: add missing build files
3f7b549881 was incomplete :(
2017-12-09 19:32:24 +00:00
Matthew Waters
8a1d31f6ab 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.
2017-12-09 19:32:24 +00:00
Matthew Waters
2b89a2c348 glwindow: remove is_running() function
It isn't necessary in correctly written programs.
2017-12-09 19:32:24 +00:00
Matthew Waters
85feb6d6f2 glfiltershader: expand the docs slightly
Add an example OpenGL shader
2017-12-09 19:32:24 +00:00
Matthew Waters
181dacc77e glfilter: remove display_init/reset
They are mirrors of GstGLBaseFilter's gl_start() and gl_stop() virtual methods
so use them instead.
2017-12-09 19:32:23 +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
Nirbheek Chauhan
48fcf632bd 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.
2017-12-09 19:32:23 +00:00
Nirbheek Chauhan
503822eb20 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.
2017-12-09 19:32:23 +00:00
Nirbheek Chauhan
9758f25430 Fix incorrect return type in several functions
All these should return GstFlowReturn, not gboolean
2017-12-09 19:32:23 +00:00
Nirbheek Chauhan
0d37cc3b11 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
2017-12-09 19:32:23 +00:00
Matthew Waters
99f5ac40db meson: gl: add support for building with dispmanx on the rpi 2017-12-09 19:32:23 +00:00
Matthew Waters
c0cb6eacb5 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.
2017-12-09 19:32:23 +00:00
Matthew Waters
cb0f02c78a 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.
2017-12-09 19:32:22 +00:00
Matthew Waters
8d60fa2327 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'.
2017-12-09 19:32:22 +00:00
Alessandro Decina
acd33a240f 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.
2017-12-09 19:32:22 +00:00
Alessandro Decina
cc9f65f191 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.
2017-12-09 19:32:22 +00:00
Jan Schmidt
bcc29643db gl: Update glvideomixer doc 2017-12-09 19:32:22 +00:00
Jan Schmidt
fb0f015dfe gl: Add/update docs for glviewconvert, glstereomix
Add some example pipelines for glstereomix, and fix up
the example pipelines for glviewconvert
2017-12-09 19:32:22 +00:00