Commit graph

18576 commits

Author SHA1 Message Date
Jan Schmidt
177d0fa1c2 baseparse: Fix upstream read caching
When running in pull mode (for e.g. mp3 reading),
baseparse currently reads 64KB from upstream, then mp3parse
consumes typically around 417/418 bytes of it. Then
on the next loop, it will read a full fresh 64KB again,
which is a big waste.

Fix the read loop to use the available cache buffer first
before going for more data, until the cache drops to < 1KB.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/518
2020-06-07 00:47:41 +01:00
Jan Schmidt
0f91868ef0 baseparse: Fix typo 2020-06-07 00:47:41 +01:00
Ondřej Hruška
7b0e6f3e62 gstdatetime: Add missing NULL check to gst_date_time_new_local_time
Also add a unit test for this.

Fixes #524
2020-06-04 22:59:10 +00:00
Miguel Paris
687c0f0ce7 bufferlist: foreach: always remove as parent if buffer is changed
In case the buffer is not writable, the parent (the BufferList) is not
removed before calling func. So if it is changed, the parent (the BufferList)
of the previous buffer should be removed after calling func.
2020-06-04 21:49:02 +00:00
Stéphane Cerveau
e3afb0ea8e identity: Fix a minor leak using meta_str 2020-03-14 00:21:01 +00:00
Matthew Waters
d1c887bc77 basetransform: allow not passthrough if generate_output is implemented
This allows an element to not require implementing transform or
transform_ip.
2020-03-13 14:37:58 +00:00
Seungha Yang
c2a7875aa1 gst-launch: Follow up to missing s/g_print/gst_print/g
Required to avoid broken log string on Windows but missed
in the commit of 493a3261a9
2020-03-13 12:37:36 +00:00
Seungha Yang
87f70650be gst-inspect: Add define guard for g_log_writer_supports_color()
g_log_writer_supports_color() was introduced since GLib 2.50.0
which is slightly higher version than our minimum required GLib version.
2020-02-26 15:27:46 +00:00
Matus Gajdos
ba43993f24 baseparse: fix memory leak
A buffer to be skipped wasn't unref'd in gst_base_parse_chain().

Fixes #406
2020-02-15 19:16:42 +00:00
Zebediah Figura
b52c8fc2b2 baseparse: Set the private duration before posting a duration-changed message
Otherwise an application cannot rely on a subsequent call to e.g. gst_pad_query_duration() succeeding.
2020-02-15 00:14:10 +00:00
Sebastian Dröge
a1c0ca3ac0 bus: Make setting/replacing/clearing the sync handler thread-safe
Previously we would use the object lock only for storing the sync
handler and its user_data in a local variable, then unlock it and only
then call the sync handler. Between unlocking and calling the sync
handler it might be unset and the user_data be freed, causing it to be
called with a freed pointer.

To prevent this add a refcounting wrapper struct around the sync
handler, hold the object lock while retrieving it and increasing the
reference count and only actually free it once the reference count
reaches zero.

As a side-effect we can now also allow to actually replace the sync
handler. Previously it was only allowed to clear it after initially
setting it according to the docs, but the code still allowed to clear it
and then set a different one.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/506
2020-02-14 18:51:35 +00:00
Thibault Saunier
cdf7d802db device-monitor: list hidden providers before listing devices
The way it was implemented could make the list updated after the
list of device was filled with supposdely hidden devices
2020-02-05 09:08:31 +00:00
Jan Alexander Steffens (heftig)
63f0b31dbf bin: Fix deep-element-removed log message
child and bin were switched.

https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/354
2020-01-09 20:20:47 +00:00
Mathieu Duponchelle
5c47fe6118 Revert "element: Enforce that elements created by gst_element_factory_create/make() are floating"
See https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/333

The reference we receive when calling g_object_new should be
floating, but we can't force it at our level.

This reverts commit ce43de8690.
2019-12-05 10:45:49 +01:00
Mathieu Duponchelle
3c21d6a29f Revert "device: Enforce that elements created by gst_device_create_element() are floating"
See https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/333

The reference we receive when calling g_object_new should be
floating, but we can't force it at our level.

This reverts commit cc6342d853.
2019-12-05 10:45:10 +01:00
Tim-Philipp Müller
1294936877 Release 1.16.2 2019-12-03 10:57:31 +00:00
Tim-Philipp Müller
326dbc56a1 Update docs 2019-12-03 10:57:30 +00:00
Tim-Philipp Müller
41c82ae9be Update translations 2019-12-03 10:57:29 +00:00
Tim-Philipp Müller
7105428470 Revert "gst/parse: define pure-parser depending on bison version"
This reverts commit 77141834bb.

This breaks the autotools build and it seems too much effort to
fix that up just to fix a bison warning.
2019-12-03 10:40:44 +00:00
Edward Hervey
ebd0d664d4 tracers: Don't leak temporary GstStructure
CID: 1455462
2019-11-28 10:53:00 +00:00
Víctor Manuel Jáquez Leal
77141834bb gst/parse: define pure-parser depending on bison version
After release bison 2.5 the declaration %pure-parser was deprecated
in favor of %define api.pure

Nonetheless, until bison 3.4, the declaration was treated as backward
compatibility, but now bison shows a warning:

  warning: deprecated directive, use ‘%define api.pure’

The patch's approach is to handle both directives according with the
used bison's version, by string replacement at source configuration
stage.
2019-11-05 15:25:23 +00:00
Sebastian Dröge
44623cacd6 tee: First deactivate the pad and then remove it when releasing pads
This reverts a96002bb28, which is not
necessary anymore. If we release the pad after removing it then none of
the deactivation code will actually be called because the pad has no
parent anymore, and we require a parent on the pad for deactivation to
happen.

This can then, among other things, cause a streaming thread to be still
stuck in a pad probe because the pad was never flushed, and waiting
there forever because now the pad will actually never be flushed anymore.
2019-10-26 20:56:19 +01:00
Sebastian Dröge
dac5966da6 tee: Check for the removed pad flag also in the slow pushing path
If a pad is currently being released we don't want to forward the
FLUSHING flow return but instead consider it as NOT_LINKED. FLUSHING
would also cause upstream to be FLUSHING.

This part was missed in a3c4a3201a and
resulted in a different (and wrong) workaround in
a96002bb28.
2019-10-26 20:56:19 +01:00
Sebastian Dröge
94c765a173 tee: Lock mutex before reading the removed flag of the pads
Otherwise we're not guaranteed to read the very latest value that
another thread might've written in there when the pad was released, and
could instead work with an old value.
2019-10-26 20:56:19 +01:00
Sebastian Dröge
e6f55805b4 bin: Drop need-context messages without source instead of crashing 2019-10-24 12:58:54 +01:00
Sebastian Dröge
0c6f5b3e4c gst: Don't pass miniobjects to GST_DEBUG_OBJECT() and similar macros
The argument must be at least a GObject according to the GstLogFunction
definition, and while the default C log function handles miniobjects
just fine this is crashing bindings and user-supplied log functions that
(rightfully) don't expect anything but GObjects.
2019-10-01 13:45:31 +00:00
Seungha Yang
3ffd1e4f1d gst-launch: Use gst_print* instead of g_print* to fix broken stdout on Windows
Concurrent Windows' colored debug message and g_print will print
string hard to read. Instead, use gst_print* which serialize
debug output and the APIs call.
2019-10-01 12:40:32 +01:00
Seungha Yang
32b7108d54 info: Take lock around all prinf on Windows
On Windows, concurrent colored gstreamr debug output and usual
stdout/stderr string will cause broken output on terminal.
Since it's OS specific behavior, that's hard to completely avoid it
but we can protect it at least among our printing interfaces side.
2019-10-01 12:40:32 +01:00
Tim-Philipp Müller
de0a7c4bc8 Release 1.16.1 2019-09-23 11:01:52 +01:00
Tim-Philipp Müller
60ce375e9c Update docs 2019-09-23 11:01:50 +01:00
Tim-Philipp Müller
e77fa2581d Update translations 2019-09-23 11:01:47 +01:00
Sebastian Dröge
ce43de8690 element: Enforce that elements created by gst_element_factory_create/make() are floating
Bindings might have a hard time making sure that the reference is indeed
still floating after returning here.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/444
2019-09-15 00:26:54 +01:00
Sebastian Dröge
cc6342d853 device: Enforce that elements created by gst_device_create_element() are floating
Bindings might have a hard time making sure that the reference is indeed
still floating after returning here.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/444
2019-09-15 00:26:54 +01:00
Sebastian Dröge
937a6ca6d3 device: gst_device_create_element() is transfer floating, not transfer full
Fixing the annotation fixes leaking of the created element in all
bindings using GObject-Introspection.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/444
2019-09-15 00:26:54 +01:00
Jim Mason
abeb5e677f consolidated IOV_MAX/UIO_MAXIOV handling per GLib + legacy behaviour for osx/ios 2019-09-08 20:57:25 +00:00
Jim Mason
c2d10bd6c4 gst_writev: respect IOV_MAX for the writev iovec array #439 2019-09-08 20:57:25 +00:00
David Svensson Fors
e6bd5b4193 miniobject: free qdata array when the last qdata is removed
In cases with many long-lived buffers that have qdata only very
briefly, the memory overhead of keeping an array of 16 GstQData
structs for each buffer can be significant. We free the array when
the last qdata is removed, like it was done in 1.14.

Fixes #436
2019-09-08 19:42:59 +00:00
Nicolas Dufresne
94ba1cea88 bin: Fix minor race when adding to a bin
This patch simply add a null check around a case where a child may have
been unparented concurrently to the deep_add_remove operation. This was
found by accident in the form of an "IS_GST_OBJECT" assertion, but had
no other known side effect in that test.
2019-09-03 22:27:38 +01:00
Tim-Philipp Müller
090a928329 meson: fix warning about configure_file() install kwarg
The install kwarg on configure_file() was only added in
Meson 0.50 but we're targetting older versions as well,
which caused a warning. The install kwarg is not needed
here as we specify install_dir, so we can just drop it.

Fixes #379
2019-08-15 14:16:51 +01:00
Sebastian Dröge
549cc941eb aggregator: Actually handle NEED_DATA return from update_src_caps()
The documentation says that this allows the subclass to signal that it
needs more data before it can decide on caps, so let's actually
implement it that way.
2019-08-14 14:49:53 +01:00
Sebastian Dröge
5bf13cdd53 aggregator: Assert if the sink/src pad type that is to be used is not a GstAggregatorPad or subclass thereof 2019-08-14 13:35:31 +01:00
Sebastian Dröge
8f3fa68504 aggregator: Ensure that the source pad is created as a GstAggregatorPad if no type is given in the pad template
Otherwise we would create a GstPad and that causes invalid memory
accesses later.
2019-08-14 13:35:31 +01:00
Guillaume Desmottes
a9bc30b51c latency: fix custom event leaks
If the element before the sink needs $n buffers to produce one output
buffer, we were reffing $n events and unreffing only one.
Prevent this by using g_object_set_qdata_full() to handle the event
unreffing so we're sure no ref will be lost.
2019-08-14 08:51:06 +05:30
Guillaume Desmottes
de9ff83533 tracers: set MAY_BE_LEAKED on tracer records
The records are static and so appear as false positives when using those
tracers with the leaks tracer as well.
The leaks tracer was already setting this flag on its record so let's
set it on the other ones as well.
2019-08-14 08:51:02 +05:30
Guillaume Desmottes
3e04aa2afc latency: display event pointer in logs
This is quite useful for debugging when tracer is reporting the wrong
latency because of an element breaking the events/buffers ordering.
2019-08-14 08:50:42 +05:30
Alicia Boya García
5dbaaa1e51 downloadbuffer: Check for flush after seek
In gst_download_buffer_wait_for_data(), when a seek is made with
perform_seek_to_offset() the `qlock` is released temporarily. Therefore,
the flushing condition can be set during this period and should be
checked.

This was not being checked before, causing occasional deadlocks when
GST_DOWNLOAD_BUFFER_WAIT_ADD_CHECK() was called.

GST_DOWNLOAD_BUFFER_WAIT_ADD_CHECK() assumes that the caller has already
checked that we're not flushing before, since this is done when
acquiring the lock; so if we release it temporarily somewhere, we need
to check for flush again.

Without that check, the function would keep waiting for the condition
variable to be notified before checking for flushing condition again,
and that may very well never happen. This was reproduced when during pad
deactivation when running WebKit in gdb.
2019-08-11 12:37:45 +01:00
Sebastian Dröge
684796f45a registry: Use plugin directory from the build system for relocateable Windows builds
Instead of guessing something based on preprocessor defines and magic.
2019-08-09 12:29:37 +01:00
Tim-Philipp Müller
dc7b9cec1e message: fix up enum value for GST_MESSAGE_DEVICE_CHANGED
This was added in 1.16 and accidentally duplicated the value of
the existing GST_MESSAGE_REDIRECT.

As the only known user of this message is GStreamer core itself,
and it is quite an obscure message, it seems best to just fix up
the enum value even if that technically breaks API.

Fixes #418
2019-08-09 09:10:04 +01:00
Doug Nazar
815acd88ee info: Fix deadlock in gst_ring_buffer_logger_log
gst_ring_buffer_logger_log calls several functions while formatting
the message which may in turn log a message while we already hold
the mutex. Do all formatting first before acquiring the mutex to
avoid this and reduce the time we hold the mutex.
2019-08-09 00:27:04 +01:00
Nicolas Dufresne
819b316e03 identity: Non-live upstream have no max latency
sync=TRUE implementation changes the latency query of a non-live
upstream into live, though it wrongly set the upstream max latency to 0.
As non-live sources won't loose data if we wait longer, this should have
been reported as have no max latency limite (-1).
2019-08-08 23:27:10 +01:00