Commit graph

18923 commits

Author SHA1 Message Date
Seungha Yang
1769187328 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>
2020-06-08 14:18:09 +00:00
Edward Hervey
58859c8ee9 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>
2020-06-08 09:47:03 +02:00
Camilo Celis Guzman
3ac3a01298 queue: protect against lost wakeups for iterm_del condition
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/513>
2020-06-06 17:41:20 +00:00
Sebastian Dröge
5e8e847687 docs: Prevent potential NULL pointer dereference when serializing plugin object types
CID 1464007

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/516>
2020-06-06 08:14:39 +00:00
Edward Hervey
221cb03664 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>
2020-06-06 08:25:16 +02:00
Mathieu Duponchelle
ba0ffeb36c utils: fix markdown link to #GstPluginAPIFlags 2020-06-06 01:10:09 +02:00
Mathieu Duponchelle
169abc86e9 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.
2020-06-06 00:38:29 +02:00
Mathieu Duponchelle
0c1ce6e8c4 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.
2020-06-06 00:38:29 +02:00
Mathieu Duponchelle
d46e902273 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>
2020-06-05 11:28:12 +00:00
Thibault Saunier
2cd23d67d3 structure: Quickly document serialization format
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/510>
2020-06-05 11:01:43 +00:00
Thibault Saunier
bd0abb3857 structure: Reflow the SECTION comment
Removing trailing whitespaces and avoiding to exceed 80chars

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/510>
2020-06-05 11:01:43 +00:00
Jan Schmidt
8e670a23b0 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>
2020-06-05 10:29:19 +00:00
Edward Hervey
f2478618b5 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>
2020-06-05 09:59:15 +00:00
Mathieu Duponchelle
cc87357105 doc: document fundamental types 2020-06-04 15:49:25 -04:00
Thibault Saunier
31e68eb26a doc: Require hotdoc >= 0.11.0 2020-06-04 15:49:24 -04:00
Sebastian Dröge
6e50c6c6fb docs: Don't include GObject and GstPipeline signals
They're already documented from elsewhere.
2020-06-04 15:49:24 -04:00
Sebastian Dröge
ea32d1741c 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.
2020-06-04 15:49:24 -04:00
Sebastian Dröge
3e37b0ab82 docs: Update gst_plugins_cache.json 2020-06-04 15:49:24 -04:00
Sebastian Dröge
5bdbde32da plugins: Use gst_type_mark_as_plugin_api() for all non-element plugin types 2020-06-04 15:49:24 -04:00
Sebastian Dröge
65e266fe6e docs: Store all non-element types in a separate other-types array
And also make sure to not duplicate them.
2020-06-04 15:49:24 -04:00
Sebastian Dröge
994d74faf4 docs: Use gst_type_is_plugin_api() for deciding whether a type should be included in the docs 2020-06-04 15:49:24 -04:00
Sebastian Dröge
3de23c30e1 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.
2020-06-04 15:49:23 -04:00
Sebastian Dröge
b705ab4de6 docs: Don't try to print pad templates of non-GstElement types 2020-06-04 15:49:23 -04:00
Sebastian Dröge
8e28799303 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
2020-06-04 15:49:23 -04:00
Edward Hervey
08d2d3cfd7 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>
2020-06-04 11:24:39 +02:00
Thibault Saunier
c8cb342833 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>
2020-05-28 14:56:26 -04:00
Thibault Saunier
95b26d1f89 tester: Fix exit code on bailout/skipping
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/506>
2020-05-28 12:39:32 -04:00
Matthew Waters
0cccf63fa0 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>
2020-05-28 10:23:51 +00:00
Tim-Philipp Müller
e0bcf24d30 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>
2020-05-27 14:19:21 +00:00
Mathieu Duponchelle
07fcd4d1b5 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>
2020-05-27 13:07:03 +00:00
Carlos Rafael Giani
6d4ad80b82 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>
2020-05-27 13:07:03 +00:00
Sebastian Dröge
bf0672f00b 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>
2020-05-27 12:15:34 +00:00
Sebastian Dröge
d9bf0f1ec2 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>
2020-05-27 12:15:34 +00:00
Sebastian Dröge
c4a2d92718 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>
2020-05-27 12:15:34 +00:00
Sebastian Dröge
3e924f5df9 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>
2020-05-27 12:15:34 +00:00
dhilshad
319f81bc60 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>
2020-05-25 08:35:32 +00:00
Edward Hervey
79374b8d94 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
2020-05-25 08:29:21 +02:00
Mathieu Duponchelle
742291c799 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>
2020-05-20 14:10:14 +00:00
Mathieu Duponchelle
2812064734 fdsink: remove unused struct member bytes_written
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/476>
2020-05-20 14:10:14 +00:00
Mathieu Duponchelle
710ce84d0c filesink: port over unlock code from fdsink
See also: 5216322d39

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>
2020-05-20 14:10:14 +00:00
Sebastian Dröge
d0e430a690 docs: Add boolean field for readability of properties
Some properties are write-only.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/496>
2020-05-20 12:02:08 +00:00
Thor Andreassen
41d77e0327 tools: option '-u' occurs twice in gst-inspect-1.0.1
I have removed the erroneous one according to the source file.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/492>
2020-05-20 08:20:50 +00:00
Thibault Saunier
827c181447 tester: Stop using g_file_new_build_filename
It was introduced in GLib 2.56 only

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/495>
2020-05-19 14:17:34 -04:00
Thibault Saunier
34916e133d tests: Add a gst-tester utility
gst-tester is a tool to launch `.validatetest` files with
TAP[0] compatible output and supporting missing `gst-validate`
application which means that it can be cleanly integrated with meson
test harness.

It allows us to use `gst-validate` to write integration tests in any
GStreamer repository keeping them as close as possible to the code. It
can simplify a lot test writing and reading and not having to go into
another repository to implement or run tests makes it more convenient to
use.

This also implements a stupid simple test to show how that works

[0] https://testanything.org/

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/461>
2020-05-19 13:14:46 +00:00
Stéphane Cerveau
618c37fca4 docs: update moving-plugins to use gitlab and meson
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/493>
2020-05-19 10:21:28 +00:00
Edward Hervey
7f068512ec gstbin: Remove mentions of duration caching
This was effectively disabled in 1.0 with the intent of maybe re-enabling it.

The problem is that caching duration at a bin level doesn't make much sense
since there might be queueing/buffering taking place internally and therefore
the duration reported might have no correlation to what is actually being
outputted.

Remove commented code and fixmes, and update documentation

Fixes #4

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/489>
2020-05-18 15:37:20 +02:00
Thibault Saunier
24d789a9b5 input-selector: Ensure events are forwarded only once per pad
The code was prepared to do it but was missing to fill the pushed_pads
list.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/485>
2020-05-15 13:51:43 +00:00
Thibault Saunier
63ccf45395 inputselector: Ensure that events are pushed first on active pad
Making it less random and fixing a race in a GES test where we have
as pipeline:

```
videotestsrc ! output-selector name=s ! input-selector name=i s. ! timecodestamper ! i.
```

which we seek, leading to the seek reaching the video testsrc
without going through the timecodestamper and generating a buffer
even before timecodestamper gets the seek which means that its internal
state is wrong compared to the datastream it gets and attaches wrong
timecode metas.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/485>
2020-05-15 13:51:43 +00:00
Sebastian Dröge
a3562b0d2a docs: Add list of interfaces implemented by elements to the docs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/486>
2020-05-15 11:46:28 +00:00
Thibault Saunier
1c97dac2b1 gdb: Print event seqnums, object pointers and structures
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/482>
2020-05-15 06:33:22 +00:00