Commit graph

7966 commits

Author SHA1 Message Date
Haelwenn (lanodan) Monnier
e08dcdf622 gl: Try GLVND 'opengl' and 'glx' first
This fixes targetting desktop OpenGL without libGL.so

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1143>
2021-07-13 13:42:13 +00:00
Sebastian Dröge
9243418a23 audioaggregator: Only post QoS messages if the property is enabled
Previously one of the branches did not check for the property value. To
avoid this in the future, check inside the QoS calculation function
instead.

As a side effect this now always prints the debug messages into the logs
when samples are dropped, which is useful information even without the
QoS messages.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1224>
2021-07-12 09:42:39 +03:00
Sebastian Dröge
71e46bcf38 audioaggregator: Resync on the next buffer when dropping a buffer on discont resyncing
If a buffer is dropped during resyncing on a discont because either its
end offset is already before the current output offset of the
aggregator or because it fully overlaps with the part of the current
output buffer that was already filled, then don't just assume that the
next buffer is going to start at exactly the expected offset. It might
still require some more dropping of samples.

This caused the input to be mixed with an offset to its actual position
in the output stream, causing additional latency and wrong
synchronization between the different input streams.

Instead consider each buffer after a discont as a discont until the
aggregator actually resynced and starts mixing samples from the input
again.

Also update the start output offset of a new input buffer if samples
have to be dropped at the beginning. Otherwise it might be mixed too
early into the output and overwrite part of the output buffer that
already took samples from this input into account.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/912
which is a regression introduced by https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1180/

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1224>
2021-07-12 09:42:39 +03:00
Olivier Crête
49f6d3bf33 audio aggregator: Post QoS message when dropping audio
Post a QoS message every time some audio samples are dropped.
Also print log messages to make it easier to debug

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1209>
2021-07-08 23:01:13 -04:00
Olivier Crête
ea516aee33 audio aggregator: Count samples that are dropped or processed
Keep a count of samples that are dropped or processed as statistics

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1209>
2021-07-08 23:01:13 -04:00
Olivier Crête
e3be1b8490 audio aggregator: Add QoS property to pad
Add a property to emit a QoS message whenever any data is dropped.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1209>
2021-07-08 23:01:13 -04:00
Olivier Crête
1eff5ffef6 audio aggregator: Rename property enum to match class name
Add "CONVERT" into the property enum as we're going to add an
enum specifically for the base pad.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1209>
2021-07-08 22:34:49 +00:00
Stéphane Cerveau
63de6d564e videodecoder: add API to receive subframes
A video decoder can now receive subframes and start decoding
instead of waiting for the full frame to be complete.
Subframe support will reduce latency as described in the
video encoder base class.

A unit test illustrating this API is available in
tests/check/libs/videodecoder.c.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/454>
2021-07-08 13:19:21 +02:00
Seungha Yang
aa34710bb6 gl/context/wgl: Add missing NULL init
The value of uninitialized local variable is varying depending
on compiler and not guaranteed to be NULL initialized.
That results in pointing random address instead of expected function pointer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1222>
2021-07-03 11:40:25 +00:00
Michael de Gans
d8a7fc0a0b appsink: fix incorrect return nullability
This commit fixes the annoations for return nullability on several
GstAppSink functions. This was causing bindings to be generated
incorrectly.

Fixes #914

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1203>
2021-06-30 18:46:37 +00:00
Seungha Yang
2551b1d976 video: Deprecate gst_video_sink_center_rect()
... and add gst_video_center_rect() method as a replacement.
The method is useful for outside of videosink subclasses as well
but the old naming might be able to mislead people.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1156>
2021-06-29 18:00:43 +09:00
Jakub Adam
556ce36ce4 rtpbasepayload: don't write empty extension header
When some header extensions are present but none decides to write any
data to the currently processed RTP buffer, remove the extension data
section.

Resulting RTP buffer wasn't formatted correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1173>
2021-06-28 19:28:41 +02:00
Jakub Adam
d294d7da36 rtpbuffer: Add gst_rtp_buffer_remove_extension_data()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1173>
2021-06-28 19:28:41 +02:00
Jakub Adam
e2e9e321f6 rtpbasepayload: map RTP buffer READWRITE when setting headers
GstRTPHeaderExtension::write can map the RTP buffer for reading. If that
happens on a buffer that is already mapped WRITE-only by the payloader,
the payloader's mapping gets invalidated (GstRTPBuffer::map will point
to a different instance of GstMemory).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1173>
2021-06-28 19:07:44 +02:00
Olivier Crête
b4caa6cbdd rtphdrext: Make all fields private
The presence of a method and a field with the same name confuses the C#
binding generator. As there are accessor functions for all the fields,
let's just make them private.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1218>
2021-06-28 18:07:56 +03:00
Olivier Crête
0adc6ccc01 gst: don't use volatile to mean atomic
volatile is not sufficient to provide atomic guarantees and real atomics
should be used instead.  GCC 11 has started warning about using volatile
with atomic operations.

https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719

Discovered in gst-plugins-good#868

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1219>
2021-06-26 12:50:58 -04:00
Jan Schmidt
8c04f4bdae video-converter: Set up matrix tables only once.
When configuring a multi-thread converter, only allocate the
shared colour conversion matrices once for the first thread,
to avoid allocating multiple times and leaking memory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1216>
2021-06-26 04:00:08 +00:00
Jan Alexander Steffens (heftig)
ef324fa068 video-converter: Set up gamma tables only once
When the video converter is using multiple threads, the gamma tables
were created multiple times, leaking the tables set up for the previous
thread.

Only calculate the tables once.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1140>
2021-06-25 13:55:39 +00:00
Jan Alexander Steffens (heftig)
b835356d6c audio-converter: Free config when gst_audio_converter_new fails
The config got leaked when parameter validation fails.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1140>
2021-06-25 13:55:39 +00:00
Seungha Yang
f8dc833975 glprototypes: Add GST_GL_API_OPENGL to available version of sync
Make sync APIs usable if supported, even when GST_GL_API_OPENGL3 is
not selected

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1215>
2021-06-25 10:30:35 +00:00
Per Förlin
30f88aa7c8 gstrtspconnection: Add IPv6 support for tunneled mode
An IPv6 address must be specified within [] brackets.
Add brackets for IPv6 address used for tunneled mode,
for non-tunneled this is already supported.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1145>
2021-06-24 06:10:19 +00:00
Nicolas Dufresne
be6793d0d1 videodecoder: Call drain() rather then finish() on segment-done
The finish() virtual function documentation state that "Sub-classes can refuse
to decode new data after." Though, it is very common to issue a non-flushing
seek after that event in gapless playback uses case. This fixes potential
stalls with code using segment seeks, by using drain() virtual funciton
instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1206>
2021-06-23 20:31:06 +00:00
Sergei Kovalev
ba4f031864 audiobasesink: Fix of double lock release
Add missing "return;" which prevents double lock release.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1208>
2021-06-21 15:58:01 +00:00
Matthew Waters
aa8b27d45a gl/context: fill a GError on platform-specific fill_info() error
Fixes bindings assuming that GError is always set on error:
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/809#note_957493
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/809#note_957494
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/809#note_957498

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1204>
2021-06-21 08:02:31 +00:00
François Laignel
973f0bf552 Check mandatory ClockTime arguments
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1205>
2021-06-16 14:52:38 +00:00
Scott Moreau
885c1c605b gl/wayland: Use consistent wl_display when creating work queue for proxy wrapper
Without this, glimagesink since wayland 727c7903 fails with
gst-launch-1.0: ../src/wayland-client.c:2181: wl_proxy_set_queue:
Assertion 'proxy->display == queue->display' failed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1200>
2021-06-11 09:31:58 -06:00
Haihua Hu
58f4217468 gl/viv-fb: fix gl plugin hang when run with viv-fb backend
below commit change the window resize thread and cause viv-fb backend
hang, need move resize code after window->open is called. Otherwise,
the resize message will send to a thread that not start running and
window resize call will waiting forever.

Commit:        b887db1efe
glwindow: fix racy resize updates

Take locks around resize handling and marshall all resizes to the
windowing thread by default.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1195>
2021-06-11 04:52:40 +00:00
Nicolas Dufresne
025a14e7fe eglimage: Add AV12 DMABuf import support
The per plane format mapping for AV12 was missing, which would force
raw upload.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1199>
2021-06-10 12:41:31 -04:00
Nicolas Dufresne
0661b15957 eglimage: Fix wrong stride when importing DMABuf
When the code was ported to use component index instead of plane
index, the call to GST_VIDEO_INFO_PLANE_STRIDE() was accidently ported
to use component index, but this macro takes a plane index.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1199>
2021-06-10 12:39:34 -04:00
Sebastian Dröge
1565b9635b appsrc: When dropping buffers before handling the initial segment use the latest input segment
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1198>
2021-06-08 17:31:02 +03:00
Sebastian Dröge
0b9976ac46 appsrc: Correctly check if this is the first buffer that was queued
By checking the queue length this would also count events and caps. We
already keep track of the number of buffers separately so just use that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1197>
2021-06-08 13:05:46 +03:00
Mathieu Duponchelle
d1fa109083 appsrc: signal enough-data even when leaking
this is convenient for application that wish to monitor whether
the appsrc is leaking.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1193>
2021-06-05 16:55:44 +02:00
Marijn Suijten
ed6c970d9c rtp/header: Add missing array length annotation to read/write methods
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1190>
2021-06-03 21:14:42 +02:00
Sebastian Dröge
c18dd84f79 video: Sort video formats correctly
AV12 should be right after A420 because it is the same format with just
one plane less, instead of being next to I420/NV12 which don't have an
alpha channel.

RGBP should be before GBR because it's the same format except for the
more canonical component order.

See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/790
which actually checks on the CI if the algorithm defined in
video-format.h is implemented correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1189>
2021-06-03 14:00:54 +03:00
Matthew Waters
33c60bdbf9 gl/display: remove choosing egl fallback from GST_GL_PLATFORM
If GST_GL_WINDOW is unset but GST_GL_PLATFORM=egl, then we were choosing
to create an GstGLDisplayEGL directly instead of going through the any
more specific windowing system implementation (X11, Wayland).

The 'create an GstGLDisplayEGL when GST_GL_PLATFORM=egl' was a fallback
as we did not have entries for all EGL-using window systems previously.
Now that we do, the fallback can be removed.  An EGLDisplay can still
be created by setting GST_GL_WINDOW=egl or as one option.

Fixup of https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1154

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1169>
2021-06-03 02:58:10 +00:00
Tim-Philipp Müller
577dabf7b1 Use g_memdup2() where available and add fallback for older GLib versions
g_memdup() is deprecated since GLib 2.68 and we want to avoid
deprecation warnings with recent versions of GLib.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1171>
2021-06-02 14:21:02 +00:00
Nicolas Dufresne
cd31689ced glcontext: Ask for an alpha channel and fallback
While this was already possible through the GLContext machinary, this simply
request an alpha channel by default and fallback if this is not possible. This
obsolete some RPi Dispmanx hack, since this is near equivalent will allow see
through when playgin WebM Alpha or other transparent files.

Application are still free to pass their own EGLContext attribute, this is
specially for the case the application let GStreamer chose (e.g. gst-launch).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1176>
2021-05-31 13:17:37 +00:00
Olivier Crête
fd73fd05ca audioaggregator: Don't overwrite already written samples
On re-sync, don't forget what has already been written. Instead, just
drop any samples that overlap with parts that were already filled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1180>
2021-05-27 16:33:00 -04:00
Seungha Yang
5ad59ce725 audiobasesrc: Fix divide by zero assertion
GstAudioRingBufferSpec can be cleared from other thread, then
rate value will be zero

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1179>
2021-05-27 07:51:48 +00:00
Marijn Suijten
9a502c15c6 audio,video-format: Make generate_raw_formats idempotent for assertions
When compiling without assertions `g_assert` and its contents disappear
resulting in no list being deserialized at all and the
`gst_{audio,video}_formats_raw` functions to return an empty collection.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1177>
2021-05-26 23:35:16 +02:00
Nicolas Dufresne
0df31ae9d4 video: Update video-orc-dist
This adds the new symbols needed for AV12 support.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1152>
2021-05-21 21:16:24 -04:00
Daniel Almeida
3a3385f35c gl: add support for AV12
AV12 is an internally conceived format that is actually the
combination of NV12 and an alpha plane.

This format is to add to gstreamer's webM transparency support for
vp8 and vp9. To this end, two I420 streams are independently decoded
simultaneously for the actual content and the alpha plane respectively
and these are then combined into A420.

This patch adds GL conversion support so that it is possible to convert
from AV12 to RGBA for the purposes of rendering it on a display.

The reverse conversion is also supplied.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1152>
2021-05-21 21:16:24 -04:00
Daniel Almeida
6760c7fd76 video: add support for AV12
AV12 is an internally conceived format that is actually
the combination of NV12 and an alpha plane.

This format is to add to gstreamer's webM
transparency support for vp8 and vp9. To this end, two
I420 streams are independently decoded simultaneously for
the actual content and the alpha plane respectively
and these are then combined into A420.

Since most hardware decoders output NV12, this patch adds
NV12+A to make the same workflow possible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1152>
2021-05-21 21:16:24 -04:00
Daniel Almeida
038ba1bffe video: video-orc: remove trailing spaces
Remove unnecessary trailing spaces at the end of some orc functions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1152>
2021-05-21 21:16:24 -04:00
Thibault Saunier
d77d5669d4 meson: Fix the name of the sdp_deps variable
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1167>
2021-05-21 18:54:22 +00:00
Matthew Waters
512160a1c8 gl/context/wgl: implement a better get_proc_address()
Look in opengl32.dll first, then wglGetProcAddress(), and only then
possibly from any linked in libraries.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1165>
2021-05-21 14:12:11 +10:00
Matthew Waters
f8510ae3c8 gl/context: add opengl32.dll as a library to dlopen() on windows
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1165>
2021-05-21 14:12:11 +10:00
Daniel Almeida
195981767c gl: add support for A420 conversion
A420 is a four planar format similar to I420 but with an extra buffer
for alpha values.

A common use of the gl stack is for GPU format conversions using
shaders, in which case one can use glupload, glcolorconvert and
gldownload elements to upload their buffer to the GPU context, perform
the conversion on the GPU itself and then retrieve the data to CPU
context.

A420 was not supported. This patch adds said support mainly by adding
the corresponding shader to perform the conversion and updating the
supported caps.

Both A420->RGBA and RGBA->A420 conversions are supported.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1153>
2021-05-20 15:06:26 +00:00
Nicolas Dufresne
3897b24f69 video: Pass component index not plane index
While so far it worked, we are about to introduce a format that break this
assuming. We have a format which consist of NV12 with alpha, and this format
does not have a direct mapping of the component against their plane indexes.

Fix this by using gst_video_format_info_component() introduced in 1.18 for
this purpose.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1151>
2021-05-19 15:17:56 +00:00
Matthew Waters
42512c92de gl/context: move egl creation lower in priority on _new()
e.g. if running a dual wgl/egl built library, then egl will always
succeed in creating the GstGLContext because almost anything could
support egl, as long as eglGetDisplay() works.

wgl, however has a check for the correct display type so should move
earlier in the tried list.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1154>
2021-05-19 10:15:56 +00:00