Commit graph

18199 commits

Author SHA1 Message Date
Edward Hervey
31383e4413 gstpad: Avoid stream-dead-lock on deactivation
The following case can happen when two thread try to activate and
deactivate a pad at the same time:
T1: starts to deactivate, calls pre_activate(), sets in_activation
    to TRUE and carries on
T2: starts to activate, calls pre_activate(), in_activation is TRUE
    so it waits on the GCond
T1: calls post_activate(), tries to acquire the streaming lock ..
    but can't because T2 is currently holding it

With this patch, the deadlock will no longer happen but does not
solve the problem that:
T2: will resume activation of the pad, set the pad mode to the target
   one (PUSH or PULL) and eventually the streaming lock gets released.
T1: is able to finish calling post_activate() ... but ... the pad
   wasn't deactivated (T2 was the last one to "activate" the pad.

https://bugzilla.gnome.org/show_bug.cgi?id=792341
2018-01-16 10:29:18 +01:00
Edward Hervey
6cd783b9fc gstpad: Release pending g_cond_wait() when stopping/pausing task
Otherwise we would deadlock waiting forever for the streaming lock
to be released

https://bugzilla.gnome.org/show_bug.cgi?id=792341
2018-01-15 18:19:48 +01:00
Jun Xie
33e7269c37 typefindhelper: fix confusing debug log message
In case of a short buffer, the debug log is quite confusing.
Distinguish the two types of failure cases to make it clearer.

https://bugzilla.gnome.org/show_bug.cgi?id=792486
2018-01-15 16:31:44 +00:00
Tim-Philipp Müller
968dd651c2 docs: explicit refer to GObject docs for floating refs
https://bugzilla.gnome.org/show_bug.cgi?id=788477
2018-01-12 18:47:17 +00:00
Tim-Philipp Müller
c33e1224a7 tests: fakesink: make notify stress test work better on Windows
Set up all ten pipelines and preroll them first, and only set
them to playing to run wild after they're all set up. If we set
them to PLAYING directly and let those threads run wild, then
it might take ages (many seconds) for the other pipelines to
even get up and running, especially on machines with only one
or two cores, and operating systems that suck at scheduling.

Now the fakesink test takes 19 secs instead of 71 secs on a
single-cpu windows machine.
2018-01-11 19:57:13 +00:00
Tim-Philipp Müller
a69dc71f79 tests: filesrc: more Windows fixes
Fix typo in newly-added windows uri test.
2018-01-11 19:32:08 +00:00
Tim-Philipp Müller
d7a9b08268 utils: use g_get_monotonic_time() as fallback in gst_utils_get_timestamp()
This is a better fit given that the function docs say this
should (only) be used for interval measurements, but also
this seems to give much better granularity on Windows
systems, where before this change there would often be
10-20 lines of debug log with the same timestamp up front.
2018-01-11 18:44:50 +00:00
Tim-Philipp Müller
db0c54c5c8 tests: systemclock: scale stress test threads according to number of cpus
Scale the number of threads used in the stress tests according to
the number of cores/cpus. We want some contention, but we also
don't want too much contention, as some operating systems are
better at handling 100 threads running wild on a single core
than others.
2018-01-11 18:39:50 +00:00
Tim-Philipp Müller
5feff26624 plugin: plugin_load() must return a ref even if it was loaded already
Fix refcounting issue when plugin was loaded already.
gst_plugin_load() is supposed to return a ref, so it
must always return a ref.

This also fixes the gstplugin unit test on windows where
fork is not available and where test_load_coreelements()
would unref a plugin ref it didn't get and then mess up
the internal registry plugin list state for the next test,
in case where the test registry does not exist yet.
2018-01-11 17:10:45 +00:00
Tim-Philipp Müller
4a5aa8dba0 tests: filesrc: fix for windows
Location paths have backslashes on windows when converted from URI.
2018-01-11 14:56:42 +00:00
Tim-Philipp Müller
88dfd9ee48 libs: check: print stacktrace on unexpected criticals 2018-01-11 12:27:18 +00:00
Tim-Philipp Müller
c5e1dc4ee6 tests: abi: fix abi test on 64-bit Windows
Add header with structure sizes for 64-bit windows as well.
They're almost the same as on Linux, but it looks like things
like padding unions get aligned slightly differently so there
are a handful of differences:

 sizeof(GstGhostPad) is 528, expected 536
 sizeof(GstPad) is 512, expected 520
 sizeof(GstPadProbeInfo) is 64, expected 72
 sizeof(GstProxyPad) is 520, expected 528
2018-01-11 12:04:31 +00:00
Tim-Philipp Müller
361fbc3fdd tests: info: fix post init cat reg test on windows and with CK_FORK=no
The test checks that categories not covered by the pattern in the
GST_DEBUG string have debug level GST_LEVEL_DEFAULT set, but previous
tests mess with the default threshold, which made this test fail on
Windows or when run with CK_FORK=no. Fix this by resetting everything
at the beginning, and then also do a sanity check afterwards.
2018-01-11 11:38:53 +00:00
Tim-Philipp Müller
3aa5ff37cd info: reset default threshold to LEVEL_DEFAULT not 0
in set_threshold_from_string().
2018-01-11 11:36:53 +00:00
Håvard Graff
fbbe6c646e meson: make check and tests build on Windows with msvc 2018-01-11 09:50:24 +00:00
Edward Hervey
9d335a80d0 gstharness: Remove double free 2018-01-02 10:02:45 +01:00
Sebastian Dröge
e32d89d6c9 streams: GstStreamType/GstStream are available since 1.10
Annotate them as such.
2017-12-26 18:10:25 +01:00
Tim-Philipp Müller
d51ff55af1 meson: skip translations if gettext is not available 2017-12-26 13:46:20 +01:00
Stefan Sauer
ce00ec8bce aggregator: remove DEBUG_FUNCPTR
The new gst_element_do_foreach_pad() does not print the functions anymore.
2017-12-26 12:53:25 +01:00
Stefan Sauer
ffc85bf7f6 inspect: add comment for how to improve tracer support 2017-12-26 12:17:53 +01:00
Stefan Sauer
c96901d4d9 segment: add a FIXME-2.0 for the format parameters
Capture the somewhat not ordinary use of the extra format parameter in a
comment.
See https://bugzilla.gnome.org/show_bug.cgi?id=788979
2017-12-26 11:29:39 +01:00
Tim-Philipp Müller
252ce5a093 Skip gst_deinit() if gstreamer was not initialized properly
Can happen if an error occurs during option parsing, for example.

https://bugzilla.gnome.org/show_bug.cgi?id=781914
2017-12-24 16:21:38 +01:00
Jan Alexander Steffens (heftig)
1b02b76137 tests: multiqueue: Replace large test macro with function
Just a bit of cleanup.

https://bugzilla.gnome.org/show_bug.cgi?id=756867
2017-12-24 11:51:13 +01:00
Jan Alexander Steffens (heftig)
67a9ec6878 tests: multiqueue: Check we get CREATE+ENTER stream-statuses when adding pads
https://bugzilla.gnome.org/show_bug.cgi?id=756867
2017-12-24 11:51:06 +01:00
Jan Alexander Steffens (heftig)
b17d03cb0a multiqueue: Don't start new pads until parented
Start task on new source pads added at runtime after they
have been added to the element, not during activation.

This ensures the pads can post their CREATE stream-status
messages and the application can set thread priorities.

https://bugzilla.gnome.org/show_bug.cgi?id=756867
2017-12-24 11:51:06 +01:00
Jan Alexander Steffens (heftig)
10c3a7bd55 multiqueue: Split task handling from gst_single_queue_flush
https://bugzilla.gnome.org/show_bug.cgi?id=756867
2017-12-24 11:51:06 +01:00
Jan Alexander Steffens (heftig)
4636477d81 aggregator: Avoid a maybe-uninitialized warning
Arch Linux x86_64, gcc 7.2.1-2, -Og -g3
2017-12-24 11:39:14 +01:00
Sebastian Dröge
d431ef7190 downloadbuffer: Don't hold the mutex while posint the download-complete message
Something might handle it from a sync message handler and call back into
downloadbuffer, causing a deadlock.
2017-12-21 13:47:52 +02:00
Sebastian Dröge
70104857b0 systemclock: set_default() clock parameter can be NULL 2017-12-20 18:56:23 +02:00
Sebastian Dröge
1a5a5709ad element: Annotate set_clock() clock parameter with allow-none 2017-12-20 18:11:48 +02:00
Sebastian Dröge
e16e55ed04 element: Annotate set_bus() bus parameter as allow-none
It's possible to replace the bus with NULL/None
2017-12-20 18:09:28 +02:00
Tim-Philipp Müller
07d3f58fcd gst-uninstalled: update for gl lib move from bad to base 2017-12-19 12:02:47 +00:00
Nicolas Dufresne
443221c661 basetransform: Allow going passthrough inside decide_allocation
Sub-class may want to decide to go passthrough/in-place by inspecting
the support meta APIs. This patch duplicates the check for this mode,
so we still don't do uneeded allocation query while we allow sub-classes
to switch the behaviour during it's own decide_allocation call.

Notice that such sub-class need to reset the class to non-passthrough in
set_caps() in order for decide_allocation to be called again. This is
needed otherwise we'd be doing an allocation query in element in which
it make no sense (notably capsfilter).

https://bugzilla.gnome.org/show_bug.cgi?id=791453
2017-12-17 15:39:51 -05:00
Sebastian Dröge
f85e93d004 plugin: Annotate add_dependency() arguments as NULL-terminated arrays 2017-12-17 14:19:14 +02:00
Umang Jain
52d2891fe3 docs: GstBus: Provide more information for ref/unref during bus watch.
https://bugzilla.gnome.org/show_bug.cgi?id=791588
2017-12-14 09:34:59 +00:00
Matthew Waters
9169a2522b update win32 defs for tracer API addition 2017-12-14 16:06:16 +11:00
Matthew Waters
538d0ce8a0 Automatic update of common submodule
From e8c7a71 to 3fa2c9e
2017-12-14 14:48:47 +11:00
Matthew Waters
a0400a0d28 docs: include tracers in the documentation
Requires exposing the tracer GType from the GstTracerFactory in order
to link the plugin with the tracer in the documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=791253
2017-12-14 14:46:46 +11:00
Matthew Waters
fa302587dd check/harness: fix transfer annotations on buffer passing functions 2017-12-13 11:23:03 +11:00
Tim-Philipp Müller
18fe36a286 basesrc: add buffer list support
Add a gst_base_src_submit_buffer_list() function that allows subclasses
to produce a bufferlist containing multiple buffers in the ::create()
function. The buffers in the buffer list will then also be pushed out
in one go as a GstBufferList. This can reduce push overhead
significantly for sources with packetised inputs (such as udpsrc)
in high-throughput scenarios.

The _submit_buffer_list() approach was chosen because it is fairly
straight-forward, backwards-compatible, bindings-friendly (as opposed
to e.g. making the create function return a mini object instead),
and it allows the subclass maximum control: the subclass can decide
dynamically at runtime whether to return a list or a single buffer
(which would be messier if we added a create_list virtual method).

https://bugzilla.gnome.org/show_bug.cgi?id=750241
2017-12-07 12:17:09 +00:00
Tim-Philipp Müller
880c573e8d basesrc: minor code readability improvement 2017-12-07 12:17:09 +00:00
Tim-Philipp Müller
f05bd2a016 docs: Fix a few gtk-doc warnings
Broken links mostly.
2017-12-07 12:16:57 +00:00
Tim-Philipp Müller
c26a802f5a tests: aggregator: fix caps leak in unit test 2017-12-06 20:58:42 +00:00
Edward Hervey
0afc114629 gstpad: Handle GST_PAD_PROBE_HANDLED on sticky event push
When actually pushing an event, if we get GST_FLOW_CUSTOM_SUCCESS_1
(which is the conversion of GST_PAD_PROBE_HANDLED return value),
don't consider the stick event push as ignored, but as handled
2017-12-06 17:23:05 +01:00
Sebastian Dröge
adf304d5af event/query/message: Annotate get_structure() return value as nullable 2017-12-06 13:40:46 +02:00
Sebastian Dröge
c813b1c276 query: Add an empty structure in writable_structure() if there is none yet
This is consistent with how it works for GstEvent already.
2017-12-06 13:36:30 +02:00
Edward Hervey
62ebee096b docs: Misc addition/fixes
And also add the "Since" API sections for 1.12 and 1.14
2017-12-05 18:48:56 +01:00
Edward Hervey
eb6ba249c4 docs: Add documentation for GST_SEQNUM_INVALID
And link to it
2017-12-05 18:20:34 +01:00
Edward Hervey
e5c15f6b96 utils: Never return a group_id of 0, add GST_GROUP_ID_INVALID
Various plugins use special values (0 or G_MAXUINT32) as an
invalid/unset group_id, but nothing guarantees a groupid won't have
that value.

Instead define a value which group_id will never have and make
gst_group_id_next() always return a value different from that.

API: GST_GROUP_ID_INVALID
2017-12-05 18:19:32 +01:00
Tim-Philipp Müller
16d9954dd5 harness: make bindings use the GBytes variant for _take_all_data() 2017-12-05 16:42:57 +00:00