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>
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>
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>
Mathieu Duponchelle [Thu, 4 Jun 2020 01:24:50 +0000 (03:24 +0200)]
doc: document fundamental types
Thibault Saunier [Wed, 3 Jun 2020 22:33:51 +0000 (18:33 -0400)]
doc: Require hotdoc >= 0.11.0
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.
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.
Sebastian Dröge [Mon, 25 May 2020 13:21:12 +0000 (16:21 +0300)]
docs: Update gst_plugins_cache.json
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
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.
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
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.
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
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
Sebastian Dröge [Tue, 19 May 2020 19:24:39 +0000 (22:24 +0300)]
docs: Add boolean field for readability of properties
Some properties are write-only.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/496>
Thor Andreassen [Tue, 19 May 2020 08:34:01 +0000 (10:34 +0200)]
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>
Thibault Saunier [Tue, 19 May 2020 18:16:49 +0000 (14:16 -0400)]
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>
Thibault Saunier [Mon, 4 May 2020 21:05:07 +0000 (17:05 -0400)]
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>
Stéphane Cerveau [Tue, 19 May 2020 09:30:50 +0000 (09:30 +0000)]
docs: update moving-plugins to use gitlab and meson
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/493>
Edward Hervey [Mon, 18 May 2020 08:46:04 +0000 (10:46 +0200)]
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>
Thibault Saunier [Fri, 15 May 2020 11:48:07 +0000 (11:48 +0000)]
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>
Thibault Saunier [Thu, 14 May 2020 21:13:05 +0000 (17:13 -0400)]
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>
Sebastian Dröge [Fri, 15 May 2020 07:38:30 +0000 (10:38 +0300)]
docs: Add list of interfaces implemented by elements to the docs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/486>
Thibault Saunier [Wed, 13 May 2020 21:35:01 +0000 (17:35 -0400)]
gdb: Print event seqnums, object pointers and structures
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/482>
Thibault Saunier [Wed, 13 May 2020 21:34:12 +0000 (17:34 -0400)]
gdb: Add support for queries and buffers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/482>
Thibault Saunier [Wed, 13 May 2020 21:07:43 +0000 (17:07 -0400)]
inputselector: Never reset active pad set from the user
This was leading to interesting races in a GES test.
Related to: https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/108
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/481>
Edward Hervey [Thu, 14 May 2020 10:13:07 +0000 (12:13 +0200)]
basetransform: Minor refactoring
Move checks related to peerfilter in one place. No impact except for logic.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/484>
Edward Hervey [Thu, 14 May 2020 09:32:39 +0000 (11:32 +0200)]
gstvalue: Minor list intersection optimization
When matching against the 2nd list, increment the starting position of the inner
list iteration.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/484>
Xu Guangxin [Thu, 7 May 2020 13:06:18 +0000 (21:06 +0800)]
bufferpool: unblock acquire thread when we discard buffer
else the acquire thread will wait infinitely.
The deadlock showed in prevous unit test commit. This will fix it
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/470>
Xu Guangxin [Mon, 11 May 2020 10:21:48 +0000 (18:21 +0800)]
tests: bufferpool: add dead lock test for buffer discard
you will see a deadlock after you apply this patch, and run following commandline:
GST_STATE_IGNORE_ELEMENTS=1 tests/check/gst_gstbufferpool
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/470>
Thibault Saunier [Tue, 12 May 2020 02:27:14 +0000 (22:27 -0400)]
output-selector: Drop duplicated seek events
When we get a seek event on several source pads, we should drop
the duplicated ones as any element that has several srcpads (like
demuxers).
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/478>
Nirbheek Chauhan [Tue, 12 May 2020 00:28:38 +0000 (05:58 +0530)]
meson: Pass native: false to add_languages()
This is needed for cross-compiling without a build machine compiler
available. The option was added in 0.54, but we only need this in
Cerbero and it doesn't affect older versions so it should be ok.
Will just cause a spurious warning.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/477>
Thibault Saunier [Tue, 12 May 2020 20:42:42 +0000 (16:42 -0400)]
gdb: Fix iterating GstStructure fields
This broke with
1b568fa01fa16885c3a7368551034c206493a41a where we inlined the array
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/479>
Sebastian Dröge [Sun, 10 May 2020 08:37:45 +0000 (11:37 +0300)]
docs: Update gst_plugins_cache.json
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/474>
Sebastian Dröge [Sun, 10 May 2020 08:35:53 +0000 (11:35 +0300)]
docs: Output JSON files with UTF-8 encoding
Otherwise non-ASCII characters are encoded as \uXXXX.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/474>
Edward Hervey [Fri, 8 May 2020 15:21:20 +0000 (17:21 +0200)]
gstvalue: Fix segment (de)serialization
By using the proper quarks (stored in the indirection table) and not the *enums*
of those entry in the quark table.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/473>
Edward Hervey [Fri, 8 May 2020 06:03:54 +0000 (08:03 +0200)]
check: uri: Check return value
CID #1455381
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/472>
Edward Hervey [Fri, 8 May 2020 06:02:12 +0000 (08:02 +0200)]
check: gstvalue: Check return value
As is done everywhere else
CID #1455540
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/472>
Edward Hervey [Fri, 8 May 2020 05:43:02 +0000 (07:43 +0200)]
check: testclock: Check return values
As done everywhere else.
CID #1455383
CID #1455524
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/472>
Edward Hervey [Fri, 8 May 2020 05:03:49 +0000 (07:03 +0200)]
check: gst_promise_reply() takes ownership
Copy the structure temporarily to check it further down.
CID #1455392
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/472>
Edward Hervey [Fri, 8 May 2020 04:49:45 +0000 (06:49 +0200)]
check: Don't leak test string
Turns out the length returned by `__gst_vasprintf()` doesn't include the final
`\0`.
CID #1455430
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/472>
Matej Knopp [Thu, 7 May 2020 21:00:13 +0000 (23:00 +0200)]
taglist: Fix crash when comparing two lists of the same length but with different items
Fixes #549
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/469>
Jan Schmidt [Wed, 6 May 2020 17:28:59 +0000 (03:28 +1000)]
tests/input selector: Fix a shutdown crash
Hold a ref to the pad we're planning on sending EOS too, so that
it doesn't disappear if things shut down before the thread gets
to actually send the EOS event.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/467>
Thibault Saunier [Wed, 29 Apr 2020 02:21:13 +0000 (22:21 -0400)]
identity: Handle seeking with single_segment=True
Identity was ignoring seek and flush events even when using
a single segment. In the end it means that we couldn't compute
buffers running-time and stream time after seeks.
This commits adds support for flushing seeks only as I have no idea
what to do for non flushing ones.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/450>
Thibault Saunier [Tue, 28 Apr 2020 17:28:32 +0000 (13:28 -0400)]
identity,clocksync: Fix timestamping inside single segment in reverse playback
In reverse playback, buffers are played back from buffer.stop
(buffer.pts + buffer.duration) to buffer.pts running times which
mean that we need to use the buffer end running time as a buffer
timestsamp, not the buffer pts when using a single segment in reverse
playback.
This is now being tested in
`validate.test.identity.reverse_single_segment`
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/450>
Thibault Saunier [Thu, 23 Apr 2020 20:24:15 +0000 (16:24 -0400)]
basesink: Fix clock synchronization running time in reverse playback
In reverse playback, buffers have to be displayed at buffer.stop running
time, otherwise a same set of buffer can't be displayed in the exact opposite
order to forward playback.
For example, seeking a video stream at 1fps with start=0, stop=5s, rate=1.0
will display the following buffers:
b0.pts = 0s, b0.duration = 1s - at running time = 0s
b1.pts = 1s, b1.duration = 1s - at running time = 1s
b2.pts = 2s, b2.duration = 1s - at running time = 2s
b3.pts = 3s, b3.duration = 1s - at running time = 3s
b4.pts = 4s, b4.duration = 1s - at running time = 4s
<wait at EOS for 1second>
Now, playing that reverse with start=0, stop=5s, rate=1.0 has to display
the following buffers:
b0.pts = 4s, b0.duration = 1s - at running time = 0s
b1.pts = 3s, b1.duration = 1s - at running time = 1s
b2.pts = 2s, b2.duration = 1s - at running time = 2s
b3.pts = 1s, b3.duration = 1s - at running time = 3s
b4.pts = 0s, b4.duration = 1s - at running time = 4s
<wait at EOS for 1second>
With the previous code, it reproduced the following:
b0.pts = 4s, b0.duration = 1s - at running time = 1s
b1.pts = 3s, b1.duration = 1s - at running time = 2s
b2.pts = 2s, b2.duration = 1s - at running time = 3s
b3.pts = 1s, b3.duration = 1s - at running time = 4s
b4.pts = 0s, b4.duration = 1s - at running time = 5s
<NO WAIT AT EOS AND POST EOS RIGHT AWAY>
This is being tested with the `validate.launch_pipeline.sink.reverse_playback_clock_waits.*`
set of tests
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/450>
Thibault Saunier [Thu, 23 Apr 2020 20:10:24 +0000 (16:10 -0400)]
basesrc: Fix the way position is computed in reverse playback
In reverse playback, buffers are played back from buffer.stop
(buffer.pts + buffer.duration) to buffer.pts, which means that the
position after the buffer is consumed is buffer.pts, not buffer.pts -
buffer.duration.
Without that change, and when `automatic_eos` feature is on,
we were dropping the last buffers as marking the stream EOS one buffer
too soon.
This is now being tested extensively by GstValidate in the
`validate.test.clock_sync.*` set of tests.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/450>
Tim-Philipp Müller [Sat, 2 May 2020 11:01:49 +0000 (12:01 +0100)]
pkgconfig: add pluginscannerdir variable
So we can get this in a unified way from installed
and uninstalled GStreamer when using pkg-config to
set up test environments in other modules.
See https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/582
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/456>
Edward Hervey [Wed, 6 May 2020 09:59:15 +0000 (11:59 +0200)]
taglist: Make equality check more uniform
Previously this was iterating over taglists with ... string names.
Instead use the same technique as `gst_structure_is_equal()` with the additional
double check.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/466>
Sebastian Dröge [Wed, 6 May 2020 07:07:30 +0000 (10:07 +0300)]
registrybinary: Also call fclose() if fflush()/fsync() failed
Otherwise we would be leaking the file in error cases.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/465>
Sebastian Dröge [Wed, 6 May 2020 06:59:47 +0000 (09:59 +0300)]
registrybinary: Don't call fclose() more than once
We must not retry fclose() on EINTR as POSIX states:
After the call to fclose(), any use of stream results in undefined
behavior.
We ensure above with fflush() and fsync() that everything is written out
so chances of running into EINTR are very low. Nonetheless assume that
the file can't be safely renamed, we'll just try again on the next
opportunity.
CID #1462697
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/465>
Edward Hervey [Wed, 6 May 2020 06:04:28 +0000 (08:04 +0200)]
queue2: Use explicit limit checking
When we know we'll only be checking the real limits, use a clearer/simpler
macro.
CID #1037148
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/464>
Thibault Saunier [Wed, 15 Apr 2020 21:49:37 +0000 (17:49 -0400)]
segment: Enhance the GstSegment structure documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/435>
Thibault Saunier [Tue, 5 May 2020 17:20:10 +0000 (13:20 -0400)]
doc: Add signal flags information in the plugin cache
Updating the plugin cache file
Same behavior as g-ir as the signal flags don't have a GType associated.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/463>
Richard Kreckel [Sun, 3 May 2020 16:50:26 +0000 (18:50 +0200)]
registrybinary: Use a FILE* in BinaryRegistryCache...
...instead of a file descriptor so buffered I/O is used when writing
the binary cache. This boosts performance at startup, particularly on
network filesystems where writes may be quite slow.
Fixes gstreamer#545.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/458>
Edward Hervey [Thu, 23 Apr 2020 12:57:59 +0000 (14:57 +0200)]
gstvalue: Use quark-based structure usage for segment (de)serialization
Instead of string-based one. Smaller and faster code
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
Edward Hervey [Fri, 17 Apr 2020 15:14:36 +0000 (17:14 +0200)]
value: Handle runtime checks as such
The various `g_strdup_printf()` returns values are runtime checks
which could be disabled if one wants and therefore should be
handled as such with g_return_val_if_fail()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
Edward Hervey [Fri, 1 May 2020 13:15:46 +0000 (15:15 +0200)]
gstvalue: Remove useless checks
The calling function already checks that the values exists and it's
a valid list
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
Edward Hervey [Fri, 1 May 2020 12:50:52 +0000 (14:50 +0200)]
gstvalue: Use previous assumption
The types were already checked for equality just before, not need to
check for that again
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
Edward Hervey [Fri, 1 May 2020 12:48:37 +0000 (14:48 +0200)]
gstvalue: Use comparision functions directly
We know the types of values, just use the comparision function directly
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
Edward Hervey [Fri, 1 May 2020 12:45:28 +0000 (14:45 +0200)]
gstvalue: Minor optimization for checks
For value types that aren't subclassable, just check the type directly.
For flags, compare against the fundamental type directly instead of going through
the more expensive recursive check of `G_TYPE_CHECK_VALUE_TYPE()`
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
Edward Hervey [Mon, 23 Mar 2020 16:03:51 +0000 (17:03 +0100)]
gstvalue: Optimize list subset some more
Avoid going through the double subtract function when comparing
anything to a list.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
Edward Hervey [Mon, 23 Mar 2020 16:01:20 +0000 (17:01 +0100)]
gstvalue: Optimize gst_value_compare_list
The compare function only needs to be retrieved once and used
directly
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
Edward Hervey [Sat, 21 Mar 2020 12:05:33 +0000 (13:05 +0100)]
gstvalue: Avoid temporary allocation
The problem is that:
* g_value_init will end up allocating an internal list/array
* g_value_copy *clears* the existing value by calling the free func
and then the copy function (creating it again)
To avoid that alloc/free/alloc cycle, directly call the appropriate
function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
Edward Hervey [Mon, 23 Mar 2020 07:20:58 +0000 (08:20 +0100)]
gstcaps: Move assignment outside loop
s1 and f1 stay the same within the inner loop
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
Edward Hervey [Mon, 23 Mar 2020 07:10:53 +0000 (08:10 +0100)]
gststructure: inline gst_structure_is_subset()
Having direct access to the iteration allows tighter code and
also being able to stop earlier.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
Edward Hervey [Mon, 23 Mar 2020 07:06:26 +0000 (08:06 +0100)]
gststructure: Inline gst_structure_intersect()
Having direct access to the iteration allows tighter code and
also being able to stop earlier.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
Edward Hervey [Tue, 5 May 2020 08:47:07 +0000 (10:47 +0200)]
gstregistry: Directly get list of plugin features
Previously this was:
* iterating and referencing all plugin features in a GList
* *then* filtering out the ones we want
* Was doing that filtering by name (i.e. `strcmp`) instead of direct pointer
comparision
Instead, just create a private direct function to get the list of plugin
features
Uses 4 times less instructions ...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/462>
Rubén Gonzalez [Mon, 4 May 2020 16:51:19 +0000 (16:51 +0000)]
plugin: Fix typo with GStremaer version:
```
has incompatible version (plugin: 1.15, gst: 1,12)
```
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/460>
Edward Hervey [Fri, 1 May 2020 13:03:55 +0000 (15:03 +0200)]
gstvalue: No longer store same-type intersection functions in table
The intersection function table is a legacy of 2005, when one could
register random intersection functions. This is no longer the case.
The only place where that table was used was:
* `gst_value_can_intersect()`, where it was already only used for identical
GType
* `gst_value_intersect()`, where the table iteration was insanely expensive
Instead this patch:
* Only stored intersection functions for *different* types (of which there are
only 4)
* Make gst_value_intersect directly call the same-type intersection functions
and only use the table if ever it doesn't match.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/454>
Edward Hervey [Fri, 1 May 2020 15:27:07 +0000 (17:27 +0200)]
gstpad: Simplify task name creation
This was going through a few locks and doing temporarily allocations for every
single task creation.. just to get a name.
We don't need to take locks since:
* The parent exists (we have a reference to it)
* The pad exists (the task belongs to it)
* Changing names of pad/elements when activating is a big no-no
Instead use the existing direct GST_DEBUG_PAD_NAME macro
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/455>
Edward Hervey [Fri, 1 May 2020 15:30:20 +0000 (17:30 +0200)]
gstevent: Add function for checking event name by GQuark
Avoids doing string<=>quark conversions in the sticky event handling path.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/455>
Edward Hervey [Fri, 17 Apr 2020 15:12:10 +0000 (17:12 +0200)]
caps: Unify common checks for intersections
Regardless of the intersect method chosen, migrate the same checks
up into the calling function. Same result, just less code.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/455>
Edward Hervey [Wed, 15 Apr 2020 07:09:22 +0000 (09:09 +0200)]
gstregistry: Remove unneeded call
_priv_gst_preload_plugins is only filled if option parsing is active.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/455>
Edward Hervey [Fri, 1 May 2020 08:19:08 +0000 (10:19 +0200)]
basesrc: Don't get flow name if not needed
Put it in the debug call so it's only called when/if needed
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/455>
Sebastian Dröge [Wed, 22 Apr 2020 07:26:45 +0000 (10:26 +0300)]
clocksync: Remove handoff signals
They're not really useful on this element and were just a leftover from
identity.
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/540
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/443>
Sebastian Dröge [Sun, 3 May 2020 13:11:39 +0000 (16:11 +0300)]
aggregator: Mark segment parameter as const in gst_aggregator_update_segment()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/457>
Tim-Philipp Müller [Mon, 24 Feb 2020 11:24:16 +0000 (11:24 +0000)]
tools: gst-stats: parse thread-id in windows debug logs properly
They don't seem to have the "0x" prefix.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/376>
Sebastian Dröge [Fri, 1 May 2020 07:07:09 +0000 (10:07 +0300)]
Add missing colons to Since markers in the docs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/452>
Mathieu Duponchelle [Mon, 27 Apr 2020 22:33:22 +0000 (00:33 +0200)]
multiqueue: fix link-like syntax in doc
Matthew Waters [Fri, 24 Apr 2020 02:47:52 +0000 (12:47 +1000)]
harness: also forward context queries between harnesses
Fixes multiple OpenGL contexts being created with a setup like:
h = gst_harness_new ("glcolorconvert");
gst_harness_add_src (h, "gltestsrc", FALSE);
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/448>
Nicolas Dufresne [Wed, 22 Apr 2020 16:58:35 +0000 (12:58 -0400)]
baseparse: Always clear drain flag before pulling
In pull mode, each pull is unique. A following pull can be well inside the
range even if the previous one wasn't. Fix this my moving the drain flag
right before the pull.
This avoids passing a bad drain flag to parsers, which may endup truncate
buffers causing data corruption.
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1275
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/446>
Matthew Waters [Thu, 23 Apr 2020 05:46:48 +0000 (15:46 +1000)]
build: libcheck may require linking against rt
In static linking scenarios, this is required to avoid this error
building tests:
/work/prefix/lib/libgstcheck-1.0.a(check_run.c.o): In function `tcase_run_tfun_fork':
/work/gstreamer/_builddir/../../../src/gstreamer/libs/gst/check/libcheck/check_run.c:476: undefined reference to `timer_create'
/work/gstreamer/_builddir/../../../src/gstreamer/libs/gst/check/libcheck/check_run.c:483: undefined reference to `timer_settime'
/work/gstreamer/_builddir/../../../src/gstreamer/libs/gst/check/libcheck/check_run.c:493: undefined reference to `timer_delete'
/work/prefix/lib/libgstcheck-1.0.a(check.c.o): In function `check_get_clockid':
/work/gstreamer/_builddir/../../../src/gstreamer/libs/gst/check/libcheck/check.c:628: undefined reference to `timer_create'
/work/gstreamer/_builddir/../../../src/gstreamer/libs/gst/check/libcheck/check.c:629: undefined reference to `timer_delete'
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/447>
Juan Navarro [Wed, 22 Apr 2020 16:59:54 +0000 (18:59 +0200)]
gstcaps: fix out of bounds checks
These two checks could end up allowing out of bounds array access, when
the index equals the array size.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/445>