Commit graph

18201 commits

Author SHA1 Message Date
Matthew Waters
3991afe68b element: NULL the lists of contexts in dispose()
If dispose() is called more than once, we may double unref the list of
GstContext's.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/878>
2021-08-28 12:25:49 +01:00
Tim-Philipp Müller
f5beb2da84 Release 1.14.5 2019-05-29 17:32:41 +01:00
Tim-Philipp Müller
f57c83076f Update docs 2019-05-29 17:32:39 +01:00
Haihao Xiang
77d7d86b0f Clone the code from gitlab
This fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/326
2019-05-02 17:20:41 +01:00
Sebastian Dröge
91e74fa9f6 aggregator: Mark all public structs as Since: 1.14 2019-05-02 08:31:25 +01:00
Olivier Crête
91084561df basesrc: Downgrade EOS warning
In the case of pushfilesrc, this is the expected behaviour, so let's
downgrade the warning to a debug message to avoid confusing users.
2019-05-02 08:31:25 +01:00
Sebastian Dröge
10e2cb84f8 controlbinding: Check if the weak pointer was cleared before explicitly removing it
Otherwise we'll get an assertion if the object behind the weak pointer
was already destroyed in the meantime as we would pass NULL as first
argument to g_object_remove_weak_pointer().
2019-05-02 08:31:25 +01:00
Antonio Ospite
1f9b375f96 gst-inspect: fix printing the first field of a GstStructure
When printing a GstStructure property (e.g. the "stats" property in
rtpsession) the first field is printed on the same line of the type
description, and this is both inconsistent compared to  how Enum values
are printed and confusing as the reader might miss the first field.

To fix this, add a newline before printing GstStructure fields in
properties.

NOTE: this does not change the existing inconsistent behavior of an
extra newline *after* a GstStructure property, but the latter is not as
annoying and it would take more effort to fix because GstStructure
fields are printed in CAPS descriptions too.
2019-05-02 08:31:25 +01:00
Matthew Waters
26bd067ff4 aggregator: don't leak gap buffer when out of segment 2019-05-02 08:31:25 +01:00
Matthew Waters
0396bc2e64 aggregator: take the pad lock around queue gap event removal
As is done for every other queue interaction
2019-05-02 08:31:25 +01:00
Matthew Waters
abc875b3c7 baseparse: don't reset the disable-passthrough property value
Resetting as a result of _reset() on PAUSED->READY is unexpected.
2019-05-02 08:31:25 +01:00
Santiago Carot-Nemesio
c6a33f7641 gsttaskpool: Do not block tasks while cleaning up the taskpool
There is a deadlock if any thread from the pool tries to push
a new task while other thread is waiting for the pool of threads
to finish. With this patch the thread will get an error when it
tries to add a new task while the taskpool is being cleaned up.
2019-05-02 08:31:25 +01:00
Marco Trevisan (Treviño)
949598d987 gsturi: Fix annotation on get_path to return a nullable
Use proper syntax or the (nullable): part will be part of the description
2019-05-02 08:31:25 +01:00
Marco Trevisan (Treviño)
88aecda3de gstmessage: Fix annotations on details
Details argument should be nullable, but the docstring uses a wrong syntax.
2019-05-02 08:31:25 +01:00
Santiago Carot-Nemesio
d7a26ed55e taskpool: Set error in case something goes wrong in the default handlers 2019-05-02 08:31:25 +01:00
Sebastian Dröge
3555b3ebe0 bus: Make removing of signal/bus watches thread-safe
Between getting the GSource with the mutex and destroying it, something
else might've destroyed it already and we would have a dangling pointer.

Keep an additional reference just in case.
2019-05-02 08:31:25 +01:00
Sebastian Dröge
90e0311324 bus: Don't allow removing signal watches with gst_bus_remove_watch()
Signal watches are reference counted and gst_bus_remove_watch() would
immediately remove it, breaking the reference counting. Only
gst_bus_remove_signal_watch() should be used for removing signal
watches.
2019-05-02 08:31:25 +01:00
Sebastian Dröge
fd06d56d48 padtemplate: Constructors are all nullable as they check the template name 2019-05-02 08:31:25 +01:00
Daniel Drake
70599dc3d8 deviceprovider: fix counting number of times started
GstDeviceProvider has a started_count private variable counter,
and the gst_device_provider_start() documentation emphasizes the
importance of balancing the start and stop calls.

However, when starting a provider that is already started, the
current code will never increment the counter more than once.

So you start it twice, but it will have start_count 1, which is the
maximum value it will ever see.

Then when you stop it twice, on the 2nd stop, after decrementing the
counter in gst_device_provider_stop():

  else if (provider->priv->started_count < 1) {
    g_critical
        ("Trying to stop a GstDeviceProvider %s which is already stopped",
        GST_OBJECT_NAME (provider));

and the program is killed.

Fix this by incrementing the counter when starting a device provider that
was already started.
2019-05-02 08:31:25 +01:00
Tim-Philipp Müller
f37190e6d1 basesrc: ensure submitted buffer list is writable
Fixes flaky appsrc unit test where depending on scheduling
the submitted list might not be writable if submitted via
an action signal from the application thread.

Fixes gst-plugins-base#522
2019-05-02 08:31:25 +01:00
Dardo D Kleiner
4c87b6ee84 buffer: Fix memory corruption in gst_buffer_foreach_meta() when removing metas
Fix corruption of meta list head when removing metas at the beginning
during iteration. Linked list handling in gst_buffer_foreach_meta
failed to track the previous entry and update the correct next pointer
when removing items from beyond the head of the list, resulting in
arbitrary list pointer corruption.

Closes #332
2019-05-01 15:11:08 +01:00
Edward Hervey
39de78c996 docs: Update gst core doc 2018-11-09 11:16:27 +02:00
Sebastian Dröge
4cd1bca969 typefind: Always forward RECONFIGURE events upstream
Based on a patch by Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/67
2018-11-07 23:11:57 +02:00
Nicolas Dufresne
008c1366b3 tracers: log: Fix post query trace
The post tracer hooks have a GstQuery argument which was truncated from
the trace. As the post hook is the one that contains the useful data,
this bug was hiding the important information from that trace.
2018-11-07 23:10:58 +02:00
Havard Graff
e4093f05f3 systemclock: pre-calculate the ratio for multiplying the perf-count on win
Saves a lot of computations.
2018-11-07 23:10:52 +02:00
Havard Graff
d819f6913c gstpad: use hook_id instead of hook in called_probes list
A pointer to a hook in this list can easily not be unique, given both
the slice-allocator reusing memory, and the OS re-using freed blocks
in malloc.

By doing many repeated add and remove of probes, this becomes very easily
reproduced.

Instead use hook_id, which *is* unique for a added GHook.
2018-11-07 23:10:42 +02:00
Jan Schmidt
6b2bbd6036 segment: Allow stop == -1 in gst_segment_to_running_time() and rate < 0
If a segment has stop == -1, then gst_segment_to_running_time()
would refuse to calculate a running time for negative rates,
but gst_segment_do_seek() allows this scenario and uses a
valid duration for calculations.

Make the 2 functions consistent by using any configured duration
to calculate a running time too in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=796559
2018-11-07 23:10:12 +02:00
Edward Hervey
36d19e7e10 multiqueue: Don't clamp running times for position calculation
Since we use full signed running times, we no longer need to clamp
the buffer time.

This avoids having the position of single queues not advancing for
buffers that are out of segment and never waking up non-linked
streams (resulting in an apparent "deadlock").
2018-11-07 23:09:50 +02:00
Jan Schmidt
8e328f571e ptp clock: Increase tolerance for late follow-up and delay-resp
The follow-up and delay-resp messages carry precise
timestamps for the arrival at the clock master, but
the local return time is unimportant, so we should be very
lenient in accepting them late. Some PTP masters don't
prioritise sending those packets, and we reject all the
responses and never sync - or take forever to do so.

Increase the tolerance to 20x the mean path delay.

Also fix a typo in one debug output that would print
the absolute time of the delay-resp message, not the offset
from the delay-req that it's actually being compared against.
2018-11-07 23:09:44 +02:00
Jan Schmidt
9dafa0cb03 ptp clock: Wait for ANNOUNCE before selecting a master
Previously, with opportunistic sync we'd track a master
clock as soon as we see a SYNC message, and hence sync up
faster, but then we'd announce we're synched before seeing
the ANNOUNCE, leaving the clock details like grandmaster-clock
empty.

A better way is to start tracking the clock opportunistically,
but not announce we're synched until we've also seen the ANNOUNCE.
2018-11-07 23:09:38 +02:00
Sebastian Dröge
57ae8a5569 typefind: Lower debug level of some output related to the URI query
It's not a warning if an URI doesn't have an extension, and it's also
not mandatory that sources have an URI or even answer the URI query.
2018-11-05 20:16:02 +02:00
Edward Hervey
e486a9244b queue2: Reset result flow when retrying
If we ever get a GST_FLOW_EOS from downstream, we might retry
pushing new data. But if pushing that data doesn't return a
GstFlowReturn (such as pushing events), we would end up returning
the previous GstFlowReturn (i.e. EOS).

Not properly resetting it would cause cases where queue2 would
stop pushing on the first GstEvent stored (even if there is more
data contained within).
2018-10-22 14:00:50 +02:00
Tim-Philipp Müller
3c586dec93 Release 1.14.4 2018-10-02 22:53:02 +01:00
Tim-Philipp Müller
91b88d3b70 Update docs 2018-10-02 22:53:00 +01:00
Jan Schmidt
0a479c3cdc tests: Use a different rate in a segment test.
Using a rate of 1.1 in the test is causing the test to
fail on 32-bit because ceil(1.1 * 10) can round to 12.

Instead use a rate 2.0 that can be expressed as floating
point number and doesn't trigger the problem.

https://bugzilla.gnome.org/show_bug.cgi?id=797154
2018-09-17 22:22:48 +10:00
Tim-Philipp Müller
86a48030a2 Release 1.14.3 2018-09-16 16:13:02 +01:00
Tim-Philipp Müller
028b40b33e Update docs 2018-09-16 16:13:00 +01:00
Jan Schmidt
769ceac199 gstsegment: Add check for gst_segment_offset_running_time()
Add a check for gst_segment_offset_running_time() that values
are taken directly from the segment base if possible.
2018-09-11 22:21:09 +10:00
Jan Schmidt
5978e3b958 gstsegment: Handle positions before the segment properly
Fixes for gst_segment_position_from_running_time_full() when
converting running_times that precede the segment start (or
stop in a negative rate segment)

The return value was incorrectly negated in those cases.

Add some more unit test checks for those cases, and especially
for segments with offsets.
2018-09-11 22:21:02 +10:00
Philippe Normand
208282e0b7 bin: Fix use-after-free issue in gst_bin_add()
gst_element_post_message() takes ownership of the message so we need to increase
its refcount until we no longer require access to its data (context_type).

https://bugzilla.gnome.org/show_bug.cgi?id=797099
2018-09-08 19:27:48 +01:00
Philippe Normand
3cf1bac0b7 utils: Set default values for position and duration query results
https://bugzilla.gnome.org/show_bug.cgi?id=797066
2018-09-03 13:27:11 +01:00
Philippe Normand
e35adf5b6a baseparse: avg_bitrate calculation critical warning fix
The avg_bitrate is an unsigned int, so the gst_util_uin64_scale() function can't
be used for it, as it expects signed integers for the fraction parts arguments.

https://bugzilla.gnome.org/show_bug.cgi?id=797054
2018-08-31 15:51:47 +01:00
Sebastian Dröge
f6739d8e1f input-selector: Bring latency handling in sync with GstPad code 2018-08-31 12:17:08 +03:00
Sebastian Dröge
235241a00d Revert "pad: Don't drop LATENCY queries with default implementation"
This reverts commit 794944f779.

Accumulating non-live latency values generally makes no sense and often
gives invalid results with min>max
2018-08-31 12:17:07 +03:00
Sebastian Dröge
9477e15e96 Revert "pad: Accumulate live/non-live latency values separately"
This reverts commit f5783e1cac.
2018-08-31 12:17:07 +03:00
Sebastian Dröge
016531d0f3 input-selector: Apply GstPad default latency handler fixes here too 2018-08-31 11:47:44 +03:00
Sebastian Dröge
5182b18912 pad: Accumulate live/non-live latency values separately
And only ever use the non-live values if all pads are non-live,
otherwise only use the results of all live pads.

It's unclear what one would use the values for in the non-live case, but
by this we at least pass them through correctly then.

This is a follow-up for 794944f779, which
causes wrong latency calculations if the first pad is non-live but a
later pad is actually live. In that case the live values would be
accumulated together with the values of the non-live first pad,
generally causing wrong min/max latencies to be calculated.
2018-08-31 11:41:47 +03:00
Sebastian Dröge
a42ab58588 typefindhelper: Mark gst_type_find_helper_get_range_full() as Since 1.14.3 2018-08-02 10:55:40 +03:00
Sebastian Dröge
aeeefe399a pad: Ensure that the pad is blocked for IDLE probes if they are called from the streaming thread too
IDLE probes that are directly called when being added will increase /
decrease the "number of IDLE probes running" counter around the call,
but when running from the streaming thread this won't happen.

This has the effect that when running from a streaming thread it is
possible to push serialized events or data out of the pad without
problems, but otherwise it would deadlock because serialized data would
wait for the IDLE probe to finish first (it is blocking after all!).

With this change it will now always consistently deadlock instead of
just every once in a while, which should make it obvious why this
happens and prevent racy deadlocks in application code.

https://bugzilla.gnome.org/show_bug.cgi?id=796895
2018-08-02 10:55:01 +03:00
Sebastian Dröge
bb3fbfbe7f typefind: Add new gst_type_find_helper_get_range_full() that returns flow return
And make use of it in the typefind element. It's useful to distinguish
between the different errors why typefinding can fail, and especially to
not consider GST_FLOW_FLUSHING as an actual error.

https://bugzilla.gnome.org/show_bug.cgi?id=796894
2018-08-02 10:54:35 +03:00