platform/upstream/gstreamer.git
3 years agomeson: add a plugin summary
Stéphane Cerveau [Thu, 9 Jul 2020 07:46:07 +0000 (09:46 +0200)]
meson: add a plugin summary

This summary displays a list of plugins which
have been enabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/560>

3 years agogst-inspect: fix memory leak
Eero Nurkkala [Wed, 22 Jul 2020 07:51:54 +0000 (10:51 +0300)]
gst-inspect: fix memory leak

With meson configure option: -Db_sanitize=address, the following
issue is seen while running the test "tools_gstinspect":

Running suite(s): gst-inspect

=================================================================
==20880==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 51 byte(s) in 9 object(s) allocated from:
    #0 0x7ffb4dbb0b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7ffb4cdf1ab8 in g_malloc (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x51ab8)

SUMMARY: AddressSanitizer: 51 byte(s) leaked in 9 allocation(s).
0%: Checks: 1, Failures: 0, Errors: 1

GOptionEntry man page states that: "Please note that parsed arguments need to be freed separately (see GOptionEntry)."
Thus, free the 'min_version' string that has been allocated but never freed.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/572>

3 years agogst/bufferpool: only resize in reset when maxsize is larger
Matthew Waters [Mon, 20 Jul 2020 07:08:32 +0000 (17:08 +1000)]
gst/bufferpool: only resize in reset when maxsize is larger

Only resize the buffer if the maxsize is larger then the configued pool
size.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/570>

3 years agobuild/coretracers: add dep on threads
Matthew Waters [Thu, 16 Jul 2020 13:03:35 +0000 (23:03 +1000)]
build/coretracers: add dep on threads

Fixes the following build error and missing '-pthread' argument when
linking:

subprojects/gstreamer/plugins/tracers/libgstcoretracers.so.p/gstleaks.c.o: In function `gst_leaks_tracer_setup_signals':
/work/build32/../subprojects/gstreamer/plugins/tracers/gstleaks.c:919: undefined reference to `pthread_atfork'

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/571>

3 years agodirectcontrolbinding: Properly initialize default `last_value`
Thibault Saunier [Tue, 14 Jul 2020 04:03:18 +0000 (00:03 -0400)]
directcontrolbinding: Properly initialize default `last_value`

It was zero and in some condition it means that the control binding
values where ignored (as shown in the test). Setting it to MAXDOUBLE
so that the first time we sync the values from a a timestamp in the
right range the proper value is computed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/564>

3 years agoinfo: Fix possible broken debug output on Windows
Seungha Yang [Thu, 16 Jul 2020 09:55:22 +0000 (18:55 +0900)]
info: Fix possible broken debug output on Windows

Depending on Windows codepage setting, some characters could
be broken when printing on terminal. Fortunatly g_print* family will
take care Windows codepage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/566>

3 years agopad: More explicitly explain how to post errors on GST_FLOW_ERROR
Olivier Crête [Thu, 16 Jul 2020 20:34:05 +0000 (16:34 -0400)]
pad: More explicitly explain how to post errors on GST_FLOW_ERROR

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/568>

3 years agolatency tracer: Fix leaks in the reported latency trace
Nicolas Dufresne [Wed, 15 Jul 2020 20:12:02 +0000 (16:12 -0400)]
latency tracer: Fix leaks in the reported latency trace

The stack item was not freed as it was supposed, causing leaks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/269>

3 years agolatency tracer: Fix unsafe and NULL pointer accesses
Jan Schmidt [Fri, 30 Aug 2019 13:59:42 +0000 (23:59 +1000)]
latency tracer: Fix unsafe and NULL pointer accesses

Use thread-safe accesses to pad peers and parent objects. This
fixes some crashers and all the non-safe access patterns I could
spot. There's still some weirdness when using the latency
tracer on pipeline chains that aren't yet linked, but this
at least stops it segfaulting.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/269>

3 years agoRevert "gstinfo: Check threshold for category from macro"
Edward Hervey [Mon, 13 Jul 2020 06:00:15 +0000 (08:00 +0200)]
Revert "gstinfo: Check threshold for category from macro"

This reverts commit dcece2a878b88335fd1990dbeeb88bdeacba0f06.

This increased the code size and number of branches for all debug statements.

Fixes #564

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/563>

3 years agoaggregator: expose gst_aggregator_finish_buffer_list API
Mathieu Duponchelle [Fri, 10 Jul 2020 15:11:08 +0000 (17:11 +0200)]
aggregator: expose gst_aggregator_finish_buffer_list API

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1276

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/562>

3 years agotests/elements/leaks.c: check get_tracer_by_name return value
Mathieu Duponchelle [Mon, 6 Jul 2020 09:55:38 +0000 (11:55 +0200)]
tests/elements/leaks.c: check get_tracer_by_name return value

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/557>

3 years agobasesrc: Deprecate gst_base_src_new_seamless_segment()
Seungha Yang [Mon, 18 May 2020 10:45:35 +0000 (19:45 +0900)]
basesrc: Deprecate gst_base_src_new_seamless_segment()

It can be replaced by gst_base_src_new_segment()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/490>

3 years agobasesrc: Add new API for handling GstSegment update by subclass
Seungha Yang [Sat, 16 May 2020 15:08:56 +0000 (00:08 +0900)]
basesrc: Add new API for handling GstSegment update by subclass

Add API gst_base_src_new_segment() for subclass to be able to
signalling new GstSegment which should be applied to following
buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/490>

3 years agotaglist: Stop inlining gst_tag_list_copy
Thibault Saunier [Thu, 9 Jul 2020 11:57:01 +0000 (07:57 -0400)]
taglist: Stop inlining gst_tag_list_copy

This way it gets exposed to bindings through GObject Introspection.

Same logic as with d1b2d3429c66d80b8d38f9afc6a8dfca49f3a71a

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/561>

3 years agocheck: Use g_thread_yield instead of g_usleep(1)
Seungha Yang [Tue, 7 Jul 2020 20:15:28 +0000 (05:15 +0900)]
check: Use g_thread_yield instead of g_usleep(1)

Since the commit
https://gitlab.gnome.org/GNOME/glib/-/commit/01c02ac08b682de622930b1278c9c14d0ffe6c49,
g_usleep(1) will be translated to Sleep(1) on Windows which means
sleep in 1 millisecond. But GLib provides g_thread_yield() API
which is exactly what we required here for thread context switching.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/559>

3 years agodeviceprovider: Do static probe on start as fallback
Olivier Crête [Thu, 9 Jan 2020 00:38:45 +0000 (19:38 -0500)]
deviceprovider: Do static probe on start as fallback

For providers that don't support dynamic probing, just fall back to doing
a static one on start() to make the UI developers life easier.

This also means that the monitor doesn't need to call _can_monitor() before
calling start.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/353>

3 years agogstelementfactory: Fix missing features in case a feature moves to another filename
Christoph Reiter [Wed, 2 May 2018 11:05:21 +0000 (13:05 +0200)]
gstelementfactory: Fix missing features in case a feature moves to another filename

In case a plugin filename was renamed with the plugin being in the registry cache
the features were not loaded after the rename:

1) Cache of old/gone filename was loaded, features added
2) New filename was loaded, features where not added because
   they were already found in the registry.
3) In the end stale cache entries for files which are no longer there
   are removed, including the wanted features.
4) The cache gets updated without the features.

Fix this by also checking at (2) that the found feature is from the loaded plugin
and not from some stale cache entry.

This affected directsoundsink where libgstdirectsoundsink.dll was renamed
to libgstdirectsound.dll, losing the directsoundsink element in the process.

Fixes #290

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/102>

3 years agomeson: set release date from .doap file for releases
Tim-Philipp Müller [Sat, 4 Jul 2020 15:59:23 +0000 (16:59 +0100)]
meson: set release date from .doap file for releases

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/555>

3 years agopo: update POTFILES
Tim-Philipp Müller [Sun, 5 Jul 2020 17:17:48 +0000 (18:17 +0100)]
po: update POTFILES

xgettext: error while opening "gst/parse/grammar.y" for reading: No such file or directory

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/586

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/556>

3 years agoptp: Add GNU Hurd to the list of supported platforms and fix the Solaris name
Sebastian Dröge [Fri, 3 Jul 2020 08:45:36 +0000 (11:45 +0300)]
ptp: Add GNU Hurd to the list of supported platforms and fix the Solaris name

https://mesonbuild.com/Reference-tables.html#operating-system-names has
the table of all supported names right now.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/583

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/554>

3 years agoelement: When removing a ghost pad also unset its target
Sebastian Dröge [Thu, 2 Jul 2020 08:21:27 +0000 (11:21 +0300)]
element: When removing a ghost pad also unset its target

Otherwise the proxy pad of the ghost pad still stays linked to some
element inside the bin, which is not allowed anymore according to the
topology.

In 2.0 this should be fixed more generically from inside GstGhostPad but
currently there is no way to get notified that the ghost pad is
unparented.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/553>

3 years agoBack to development
Tim-Philipp Müller [Fri, 3 Jul 2020 01:03:15 +0000 (02:03 +0100)]
Back to development

3 years agoRelease 1.17.2
Tim-Philipp Müller [Thu, 2 Jul 2020 23:22:34 +0000 (00:22 +0100)]
Release 1.17.2

3 years agostream: Don't use GST_FIXME_OBJECT() when generating a random stream id if the caller...
Sebastian Dröge [Wed, 1 Jul 2020 17:20:16 +0000 (20:20 +0300)]
stream: Don't use GST_FIXME_OBJECT() when generating a random stream id if the caller didn't provide one

That would call into gst_info_describe_stream(), which takes the same
mutex a second time and then deadlocks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/552>

3 years agogstutils: fix link in parse_bin_from_description_full doc
Mathieu Duponchelle [Mon, 11 May 2020 15:44:43 +0000 (17:44 +0200)]
gstutils: fix link in parse_bin_from_description_full doc

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/475>

3 years agogstbin: Fix docs typo
Jan Schmidt [Thu, 25 Jun 2020 14:50:44 +0000 (00:50 +1000)]
gstbin: Fix docs typo

element-added-deep -> deep-element-added in the GstBin doc header

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/547>

3 years agodocs: Specify UTF-8 encoding everywhere
Seungha Yang [Wed, 24 Jun 2020 17:14:56 +0000 (02:14 +0900)]
docs: Specify UTF-8 encoding everywhere

Otherwise some non-English character might be broken depending on
OS and/or locale.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/545>

3 years agohooks: add opt-in cache update hook
Mathieu Duponchelle [Wed, 24 Jun 2020 23:37:43 +0000 (01:37 +0200)]
hooks: add opt-in cache update hook

CI now checks that plugin caches are up to date, for example
when adding a new property to an element.

This is something pretty easy to forget, and it can be checked
in a pre-commit hook provided the cache generator generates no
unnecessart diff on the developer's machine. This is now the
case for me in core, -base and -good, and eventually all the
repositories should behave appropriately, at least on my
development machine.

The new check in the pre-commit hook is only performed when
the user is in the development environment (it checks
$MESON_BUILD_ROOT to determine that), and when the developer
has opted-in by setting `GST_CACHE_HOOK=enabled`. That is
because the hook will actually rebuild the cache with ninja,
and modify it in the source directory, that's not a behaviour
we want to enable by default.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/546>

3 years agogst-inspect: Use gst_info_strdup_vprintf to print string
Seungha Yang [Wed, 24 Jun 2020 13:51:48 +0000 (22:51 +0900)]
gst-inspect: Use gst_info_strdup_vprintf to print string

g_vprintf() will write a string binary to stdout directly using fwrite().
So, depending on character in the string, fwrite to stdout can
print broken one but printf family might not cause the issue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/544>

3 years agobus: clear bus->priv->signal_watch immediately when the source is removed
Michael Olbrich [Wed, 24 Jun 2020 05:54:42 +0000 (07:54 +0200)]
bus: clear bus->priv->signal_watch immediately when the source is removed

There is a race-condition that can trigger the assertion in
gst_bus_add_signal_watch_full():

If gst_bus_add_signal_watch_full() is called immediately after
gst_bus_remove_signal_watch() then bus->priv->signal_watch may still be set
because gst_bus_source_dispose() or gst_bus_source_finalize() was not yet
called.
This happens if the corresponding GMainContext has the source queued for
dispatch. In this case, the following dispatch will only unref and delete
the signal_watch because it was already destroyed. Any pending messages
will remain until a new watch is installed.

So bus->priv->signal_watch can be cleared immediately when the watch is
removed. This avoid the race condition.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/543>

3 years agogst-hotdoc-plugins-scanner: serialize interfaces
Mathieu Duponchelle [Mon, 22 Jun 2020 23:54:15 +0000 (01:54 +0200)]
gst-hotdoc-plugins-scanner: serialize interfaces

3 years agogst-hotdoc-plugins-scanner: don't instantiate base classes
Mathieu Duponchelle [Mon, 22 Jun 2020 21:41:06 +0000 (23:41 +0200)]
gst-hotdoc-plugins-scanner: don't instantiate base classes

3 years agogst-hotdoc-plugins-scanner: serialize parents in hierarchy when needed
Mathieu Duponchelle [Sun, 21 Jun 2020 00:00:54 +0000 (02:00 +0200)]
gst-hotdoc-plugins-scanner: serialize parents in hierarchy when needed

3 years agodocs: Document signals and properties only for current type
Thibault Saunier [Mon, 22 Jun 2020 13:11:07 +0000 (09:11 -0400)]
docs: Document signals and properties only for current type

3 years agodoc: Stop documenting properties from parents
Thibault Saunier [Sat, 20 Jun 2020 02:52:01 +0000 (22:52 -0400)]
doc: Stop documenting properties from parents

3 years agoregistry: Print the pointer when printing features
Nirbheek Chauhan [Mon, 22 Jun 2020 23:48:11 +0000 (05:18 +0530)]
registry: Print the pointer when printing features

This is what we do everywhere else too, useful for debugging.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/542>

3 years agoregistry: Use a toolchain-specific registry file on Windows
Nirbheek Chauhan [Mon, 22 Jun 2020 22:13:53 +0000 (03:43 +0530)]
registry: Use a toolchain-specific registry file on Windows

If we load a plugin registry for MinGW plugins when running with MSVC,
we will have to write out the whole cache again, and vice-versa. Just
use separate cache files so that the cache is actually useful.

Closes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/427

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/542>

3 years agoghostpad: Deprecate gst_ghost_pad_construct()
Sebastian Dröge [Mon, 22 Jun 2020 09:26:46 +0000 (12:26 +0300)]
ghostpad: Deprecate gst_ghost_pad_construct()

Instead do everything it did as part of GObject::constructed() and
change the function to always return TRUE.

gst_ghost_pad_construct() was meant to be called by subclasses right
after construction of the object to finish construction as it can fail
in theory. In practice it's impossible for it to fail, even more so if
called directly from GObject::constructed(): The only failure condition
is if the newly created proxy pad already has a parent, which is
impossible at this point as nothing else can have a reference to it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/540>

3 years agotools: gst-inspect, add option '--color' with short option '-C'
Thor Andreassen [Tue, 19 May 2020 20:54:20 +0000 (22:54 +0200)]
tools: gst-inspect, add option '--color' with short option '-C'

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/498>

3 years agoinfo: Add a printf extension for ClockTime/ClockTimeDiff pointers
Thibault Saunier [Thu, 18 Jun 2020 17:46:29 +0000 (13:46 -0400)]
info: Add a printf extension for ClockTime/ClockTimeDiff pointers

Using both GST_TIME_FORMAT+GST_TIME_ARGS and friend is cumbersome, this
makes it sensibly more user friendly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/535>

3 years agoBack to development
Tim-Philipp Müller [Fri, 19 Jun 2020 23:27:57 +0000 (00:27 +0100)]
Back to development

3 years agoRelease 1.17.1
Tim-Philipp Müller [Fri, 19 Jun 2020 18:13:36 +0000 (19:13 +0100)]
Release 1.17.1

3 years agodoc: Stop recording if building from source/release in plugin cache
Thibault Saunier [Fri, 19 Jun 2020 15:19:43 +0000 (11:19 -0400)]
doc: Stop recording if building from source/release in plugin cache

Closes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/537

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/537>

3 years agoFix up and add various "Since" markers and other related docs fixes
Sebastian Dröge [Fri, 19 Jun 2020 09:01:49 +0000 (12:01 +0300)]
Fix up and add various "Since" markers and other related docs fixes

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/536>

3 years agosystemclock: Fix clock time conversion on Windows/xbox
Roman Shpuntov [Thu, 18 Jun 2020 08:52:40 +0000 (15:52 +0700)]
systemclock: Fix clock time conversion on Windows/xbox

The returned ratio can be bigger than GST_SECOND, in which case we would
forever return 0 for the system clock time. Even in other cases if it's
close to GST_SECOND it would result in accuracy loss.

Instead of doing the division by GST_CLOCK_TIME_NONE during
initialization once, do it every time the clock time is requested.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/575

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/534>

3 years agogst: Delay creation of threadpools
Edward Hervey [Fri, 12 Jun 2020 13:07:42 +0000 (15:07 +0200)]
gst: Delay creation of threadpools

Since glib 2.64, gthreadpool will start waiting on a GCond immediately upon
creation. This can cause issues if we fork *before* actually using the
threadpool since we will then be signalling that GCond ... from another process
and that will never work.

Instead, delay creationg of thread pools until the very first time we need
them. This introduces a minor (un-noticeable) delay when needing a new thread
but fixes the issues for all users of GSTreamer that will call gst_init, then
fork and actually start pipelines.

See https://gitlab.gnome.org/GNOME/glib/-/issues/2131 for more context.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/531>

3 years agoinputselector: Push event on selected pad only when one is selected
Thibault Saunier [Sun, 7 Jun 2020 16:05:07 +0000 (12:05 -0400)]
inputselector: Push event on selected pad only when one is selected

Calling `gst_input_selector_get_active_sinkpad` triggers sinkpad
selection but won't notify about it, leading  to breaking code that
relying on it. This new code added as part of
63ccf45395ce734a2044a58193939a3eda50eb0c was thought to be triggered only
when a pad was already selected and not change the behavior otherwise
so this commit makes sure it is actually the case.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/766

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/522>

4 years agocheck: Fix datetime unit test for builds without assert
Edward Hervey [Wed, 27 May 2020 13:35:41 +0000 (15:35 +0200)]
check: Fix datetime unit test for builds without assert

If built with assertions disabled, we need to ensure the variable is properly
reset before testing

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/530>

4 years agomessage: Add unit test for GST_MESSAGE_RATE_CHANGE
sohwan.park [Thu, 11 Jun 2020 01:56:10 +0000 (10:56 +0900)]
message: Add unit test for GST_MESSAGE_RATE_CHANGE

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/528>

4 years agoevent: Add unit test for INSTANT_RATE_CHANGE and INSTANT_RATE_SYNC_TIME
sohwan.park [Thu, 11 Jun 2020 01:54:54 +0000 (10:54 +0900)]
event: Add unit test for INSTANT_RATE_CHANGE and INSTANT_RATE_SYNC_TIME

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/528>

4 years agosegment: Add unit test for GST_SEEK_FLAG_INSTANT_RATE_CHANGE
sohwan.park [Thu, 11 Jun 2020 01:53:59 +0000 (10:53 +0900)]
segment: Add unit test for GST_SEEK_FLAG_INSTANT_RATE_CHANGE

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/528>

4 years agodocs: Update plugins cache
Thibault Saunier [Tue, 9 Jun 2020 19:06:52 +0000 (15:06 -0400)]
docs: Update plugins cache

4 years agodocs: Fix the way we mark properties mutability
Thibault Saunier [Tue, 9 Jun 2020 19:05:54 +0000 (15:05 -0400)]
docs: Fix the way we mark properties mutability

When nothing is specified, we should default to NULL, not PLAYING

4 years agoaggregator: Fix StartTimeSelection enum type registration
Sebastian Dröge [Wed, 10 Jun 2020 08:23:42 +0000 (11:23 +0300)]
aggregator: Fix StartTimeSelection enum type registration

Make it thread-safe and use the actual C identifiers for the "name"
field, as otherwise gobject-introspection will fall apart.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/527>

4 years agodocs: Update plugins cache
Thibault Saunier [Mon, 8 Jun 2020 14:51:57 +0000 (10:51 -0400)]
docs: Update plugins cache

4 years agotracers/leaks: fix reentrancy issues with the custom signal handlers
Matthew Waters [Thu, 1 Sep 2016 07:33:13 +0000 (17:33 +1000)]
tracers/leaks: fix reentrancy issues with the custom signal handlers

The signal handlers were performing mutex operations in the signal handlers
which is bad idea that may lead to deadlocks.

1. Implement a separate signal thread to handle the signals.
2. Use the glib provided signal GSource to avoid performing operations in
   the signal handler.

Fix #186

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/487>

4 years agogst_private.h: increse padding in struct _GstClockEntryImpl
Havard Graff [Mon, 8 Jun 2020 20:47:56 +0000 (22:47 +0200)]
gst_private.h: increse padding in struct _GstClockEntryImpl

When compiling for 32bit ios arm, the static assert that the
GstClockEntryImpl smaller or equal to the struct _GstClockEntryImpl
triggered. (they were 12bytes off).

To fix this, the padding is increased by 12 bytes (on 32bit).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/525>

4 years agoparamspecs: add 'Since: 1.18' markers for new param spec flags
Tim-Philipp Müller [Mon, 8 Jun 2020 15:04:51 +0000 (16:04 +0100)]
paramspecs: add 'Since: 1.18' markers for new param spec flags

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/524>

4 years agodoc: Add GstObject specific GParamFlags
Seungha Yang [Sun, 7 Jun 2020 11:56:49 +0000 (20:56 +0900)]
doc: Add GstObject specific GParamFlags

Document "controllable", "mutable-{ready, paused, playing}" and
"conditonally-available" GParamFlags

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/283>

4 years agoparamspecs: Add a GParamSpecFlag to indicate the property might not always exists
Seungha Yang [Wed, 11 Sep 2019 04:51:04 +0000 (13:51 +0900)]
paramspecs: Add a GParamSpecFlag to indicate the property might not always exists

Add new flag for users to notice that the property is not guaranteed
to exist depending on environment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/283>

4 years agocheck: Avoid race with leaks test
Edward Hervey [Sun, 7 Jun 2020 16:42:21 +0000 (18:42 +0200)]
check: Avoid race with leaks test

The problem is that the taskpool might not have completely drained by the time
we check for leaks.

Instead, ensure all tasks have stopped before testing for valid results.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/523>

4 years agoqueue: protect against lost wakeups for iterm_del condition
Camilo Celis Guzman [Thu, 4 Jun 2020 15:50:01 +0000 (17:50 +0200)]
queue: protect against lost wakeups for iterm_del condition

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/513>

4 years agodocs: Prevent potential NULL pointer dereference when serializing plugin object types
Sebastian Dröge [Sat, 6 Jun 2020 07:19:57 +0000 (10:19 +0300)]
docs: Prevent potential NULL pointer dereference when serializing plugin object types

CID 1464007

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/516>

4 years agopadtemplate: Directly unreference the documentation caps
Edward Hervey [Sat, 6 Jun 2020 06:24:01 +0000 (08:24 +0200)]
padtemplate: Directly unreference the documentation caps

The public-facing API has a (valid) protection against NULL caps. We can just
directly remove it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/515>

4 years agoutils: fix markdown link to #GstPluginAPIFlags
Mathieu Duponchelle [Fri, 5 Jun 2020 23:10:09 +0000 (01:10 +0200)]
utils: fix markdown link to #GstPluginAPIFlags

4 years agopadtemplate: expose getters and setters "documentation caps"
Mathieu Duponchelle [Fri, 5 Jun 2020 21:28:38 +0000 (23:28 +0200)]
padtemplate: expose getters and setters "documentation caps"

This can be used in elements where the caps of pad templates
are dynamically generated and dependent on the environment.

An example is x265enc.

4 years agoutils: expose GstPluginAPIFlags
Mathieu Duponchelle [Fri, 5 Jun 2020 19:10:29 +0000 (21:10 +0200)]
utils: expose GstPluginAPIFlags

These can be passed to gst_type_mark_as_plugin_api, to inform
plugin cache generation.

For now a single flag is specified, "IGNORE_ENUM_MEMBERS", it
can be used for dynamically generated enums to avoid documenting
environment-specific enumeration members. An example is
GstX265EncTune.

4 years agoidentity, clocksync: implement provide_clock
Mathieu Duponchelle [Mon, 1 Jun 2020 14:18:50 +0000 (16:18 +0200)]
identity, clocksync: implement provide_clock

Since those are using the clock for sync, they need to also
provide a clock for good measure. The reason is that even if
downstream elements provide a clock, we don't want to have
that clock selected because it might not be running yet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/509>

4 years agostructure: Quickly document serialization format
Thibault Saunier [Wed, 3 Jun 2020 02:39:41 +0000 (22:39 -0400)]
structure: Quickly document serialization format

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/510>

4 years agostructure: Reflow the SECTION comment
Thibault Saunier [Wed, 3 Jun 2020 13:17:32 +0000 (09:17 -0400)]
structure: Reflow the SECTION comment

Removing trailing whitespaces and avoiding to exceed 80chars

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/510>

4 years agoqueue2: Defer downstream bitrate query to the streaming thread.
Jan Schmidt [Tue, 26 May 2020 17:41:37 +0000 (03:41 +1000)]
queue2: Defer downstream bitrate query to the streaming thread.

When we want to perform a downstream bitrate query, just
set the reconfigure flag on the srcpad and get the streaming
thread to do it. That avoids emitting a downstream query
when receiving the upstream RECONFIGURE event - which can
lead to deadlocks if downstream is sending the event from
within a lock - e.g. input-selector.

If querying the downstream bitrate changes the cached
value, then make sure to update our buffering state
and potentially post a BUFFERING message to the application.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/566
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/501>

4 years agoinputselector: Avoid deadlock when requesting pads
Edward Hervey [Wed, 3 Jun 2020 06:09:04 +0000 (08:09 +0200)]
inputselector: Avoid deadlock when requesting pads

The deadlock was the following:
* One thread requests a new pad, the internal lock is kept while adding the pad
* Another thread (or the same one) requests the internal links of a pad (could
be that pad)... which also requires that lock.

That internal lock is not required when adding the pad to the element (which is
the last action when requesting a new pad). The fact it will be actually used
will be *after* the request pad function is released.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/512>

4 years agodoc: document fundamental types
Mathieu Duponchelle [Thu, 4 Jun 2020 01:24:50 +0000 (03:24 +0200)]
doc: document fundamental types

4 years agodoc: Require hotdoc >= 0.11.0
Thibault Saunier [Wed, 3 Jun 2020 22:33:51 +0000 (18:33 -0400)]
doc: Require hotdoc >= 0.11.0

4 years agodocs: Don't include GObject and GstPipeline signals
Sebastian Dröge [Tue, 2 Jun 2020 19:25:24 +0000 (22:25 +0300)]
docs: Don't include GObject and GstPipeline signals

They're already documented from elsewhere.

4 years agoaggregator: Export GstAggregatorStartTimeSelection in the header and document it
Sebastian Dröge [Tue, 2 Jun 2020 09:25:00 +0000 (12:25 +0300)]
aggregator: Export GstAggregatorStartTimeSelection in the header and document it

It is used by one of the aggregator properties and was private in the
source file before.

4 years agodocs: Update gst_plugins_cache.json
Sebastian Dröge [Mon, 25 May 2020 13:21:12 +0000 (16:21 +0300)]
docs: Update gst_plugins_cache.json

4 years agoplugins: Use gst_type_mark_as_plugin_api() for all non-element plugin types
Sebastian Dröge [Thu, 28 May 2020 18:51:22 +0000 (21:51 +0300)]
plugins: Use gst_type_mark_as_plugin_api() for all non-element plugin types

4 years agodocs: Store all non-element types in a separate other-types array
Sebastian Dröge [Thu, 28 May 2020 20:40:09 +0000 (23:40 +0300)]
docs: Store all non-element types in a separate other-types array

And also make sure to not duplicate them.

4 years agodocs: Use gst_type_is_plugin_api() for deciding whether a type should be included...
Sebastian Dröge [Thu, 28 May 2020 19:59:09 +0000 (22:59 +0300)]
docs: Use gst_type_is_plugin_api() for deciding whether a type should be included in the docs

4 years agoutils: Add helper function for marking types as plugin API
Sebastian Dröge [Thu, 28 May 2020 17:56:14 +0000 (20:56 +0300)]
utils: Add helper function for marking types as plugin API

This can be used to mark additional types exposed by plugins (i.e.
enums, flags and GObjects) via properties, signals or pad templates as
plugin API. They can then be picked up by the documentation for the
plugin.

Not all types exposed by plugins are documented automatically because
they might come from an external library and should be documented from
there instead.

4 years agodocs: Don't try to print pad templates of non-GstElement types
Sebastian Dröge [Tue, 26 May 2020 10:06:20 +0000 (13:06 +0300)]
docs: Don't try to print pad templates of non-GstElement types

4 years agodocs: Print object/flag/enum type information in a more structured way and in more...
Sebastian Dröge [Thu, 21 May 2020 14:33:36 +0000 (17:33 +0300)]
docs: Print object/flag/enum type information in a more structured way and in more places

Custom types are printed now for signal parameters/return value and properties, and more consistently.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-docs/-/issues/59

4 years agoqueue2: Avoid races when posting buffering messages
Edward Hervey [Thu, 4 Jun 2020 09:21:45 +0000 (11:21 +0200)]
queue2: Avoid races when posting buffering messages

When posting a buffering message succesfully:
* Remember the *actual* percentage value that was posted
* Make sure we only reset the percent_changed variable if the value we just
  posted is indeed different from the current value

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/511>

4 years agotests:validate: Whitelist validate plugins
Thibault Saunier [Thu, 28 May 2020 18:56:26 +0000 (14:56 -0400)]
tests:validate: Whitelist validate plugins

This is required so we can use validateflow for example

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/506>

4 years agotester: Fix exit code on bailout/skipping
Thibault Saunier [Thu, 28 May 2020 16:39:08 +0000 (12:39 -0400)]
tester: Fix exit code on bailout/skipping

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/506>

4 years agopromise: update documentation and annotations for NULL replies
Matthew Waters [Wed, 27 May 2020 10:22:49 +0000 (20:22 +1000)]
promise: update documentation and annotations for NULL replies

The implementation and tests already handle NULL replies.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1300
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/502>

4 years agotests: leak tracer: disable stack traces for faster test execution
Tim-Philipp Müller [Wed, 27 May 2020 11:26:01 +0000 (12:26 +0100)]
tests: leak tracer: disable stack traces for faster test execution

This test takes 39 seconds on my machine even though it just runs
a couple of fakesrc num-buffers=2 ! fakesink pipelines. Most of
the cpu seems to be spent in libz, related to stack trace management.

Use stack-traces-flags=none instead of stack-traces-flags=full
until a better solution can be found. Might warrant more
investigation in any case..

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/503>

4 years agoqueue2: don't post unnecessary buffering message, refine locking
Mathieu Duponchelle [Wed, 20 May 2020 15:32:48 +0000 (17:32 +0200)]
queue2: don't post unnecessary buffering message, refine locking

This is a follow up to review comments in !297

+ The posting of the buffering message in READY_TO_PAUSED isn't
  needed, removing it made the test fail, but the correct fix
  was simply to link elements together

+ Move code to relock the queue and set last_posted_buffering_percent
  and percent_changed inside the buffering_post_lock in create_write().
  This makes locking consistent with post_buffering()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/297>

4 years agoqueue2: Fix missing/dropped buffering messages at startup
Carlos Rafael Giani [Fri, 4 Oct 2019 14:57:29 +0000 (16:57 +0200)]
queue2: Fix missing/dropped buffering messages at startup

This fixes a bug that occurs when an attempt is made to post a buffering
message before the queue2 was assigned a bus. One common situation where
this happens is when the use-buffering property is set to TRUE before the
queue2 was added to a bin.

If the result of gst_element_post_message() is not checked, and the
aforementioned situation occurs, then last_posted_buffering_percent and
percent_changed will still be updated, as if posting the message succeeded.
Later attempts to post again will not do anything because the code then
assumes that a message with the same percentage was previously posted
successfully and posting again is redundant.

Updating these variables only if posting succeed and explicitely
posting a buffering message in the READY->PAUSED state change ensure that
a buffering message is posted as early as possible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/297>

4 years agosystemclock: Only try initializing entries if they were not initialized before
Sebastian Dröge [Mon, 25 May 2020 11:56:10 +0000 (14:56 +0300)]
systemclock: Only try initializing entries if they were not initialized before

And add assertions accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/500>

4 years agosystemclock: Clarify comment that described a previous version of the code
Sebastian Dröge [Mon, 25 May 2020 09:51:19 +0000 (12:51 +0300)]
systemclock: Clarify comment that described a previous version of the code

Nowadays we are only waking up the head entry waiting if either the head
entry is unscheduled (which is handled some lines above already), or
when the head entry specifically is woken up because a new entry became
the new head entry.

We're not waking up *all* entries anymore whenever any entry in the last
was unscheduled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/500>

4 years agosystemclock: Get rid of atomic access to clock entry status and use the mutex instead
Sebastian Dröge [Fri, 22 May 2020 16:28:54 +0000 (19:28 +0300)]
systemclock: Get rid of atomic access to clock entry status and use the mutex instead

We already have a mutex in each clock entry anyway and need to make use
of that mutex in most cases when the status changes. Removal of the
atomic operations and usage of the mutex instead simplifies the code
considerably.

The only downside is that unscheduling a clock entry might block for the
time it needs for the waiting thread to go from checking the status of
the entry to actually waiting, which is not a lot of code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/500>

4 years agosystemclock: Don't start waiting for a clock id if it was signalled before
Sebastian Dröge [Fri, 22 May 2020 15:12:55 +0000 (18:12 +0300)]
systemclock: Don't start waiting for a clock id if it was signalled before

Otherwise it can happen that unscheduling a clock id never takes place
and instead it is waiting until the normal timeout. This can happen if
the wait thread checks the status and sets it to busy, then the
unschedule thread sets it to unscheduled and signals the condition
variable, and then the waiting thread starts waiting. As condition
variables don't have a state (unlike Windows event objects), we have to
remember ourselves in a new boolean flag protected by the entry mutex
whether it is currently signalled, and reset this after waiting.

Previously this was not a problem because a file descriptor was written
to for waking up, and the token was left on the file descriptor until
the read from it for waiting.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/500>

4 years agosparsefile: fix possible crash when seeking
dhilshad [Sat, 15 Feb 2020 16:50:18 +0000 (22:20 +0530)]
sparsefile: fix possible crash when seeking

In gst_sparse_file_clear function we were closing a file and
reopening it using closed file descriptor.

Fix: Removed closing and reopening of file.

Fixes #512

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/372>

4 years agovalue: Fix comparison of int/int64 ranges
Edward Hervey [Sat, 4 Nov 2017 12:28:03 +0000 (13:28 +0100)]
value: Fix comparison of int/int64 ranges

ranges are only equal if:
* Their bounds are equal
* And their step value are equal *IF* they contain more than one value

https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/253

4 years agofdsink: do not supress legitimate errors when unlocking
Mathieu Duponchelle [Tue, 12 May 2020 00:05:25 +0000 (02:05 +0200)]
fdsink: do not supress legitimate errors when unlocking

Instead, only wait_preroll when writev_* returns FLUSHING

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/476>

4 years agofdsink: remove unused struct member `bytes_written`
Mathieu Duponchelle [Mon, 11 May 2020 22:57:36 +0000 (00:57 +0200)]
fdsink: remove unused struct member `bytes_written`

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/476>

4 years agofilesink: port over unlock code from fdsink
Mathieu Duponchelle [Mon, 11 May 2020 22:54:56 +0000 (00:54 +0200)]
filesink: port over unlock code from fdsink

See also: 5216322d39448ed61c86bb1b3dd9c8c5e6feccf3

The previous code was causing "random" flushing returns
in scenarios with intensive state changes such as within
a buffering pipeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/476>