Commit graph

17756 commits

Author SHA1 Message Date
Thibault Saunier
28d142e6da preset: Do not save deprecated properties
It will g_warn upon desarialization and we should not use
those anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=789871
2017-11-26 12:53:54 -03:00
Tim-Philipp Müller
e04c6694f1 tracers: log: no need to link to our internal printf implementation
The call to __gst_vasprintf() was removed in commit 1a3e218b8.
2017-11-26 11:14:01 +00:00
Tim-Philipp Müller
ec6d2304bd tools: gst-inspect: don't print element flags whch are always 'none'
We print the interesting flags like clocking capabilities separately
later, this function just always prints 'none', so remove it.
2017-11-26 00:20:13 +00:00
Tim-Philipp Müller
8cc7c3f6aa tools: gst-inspect: print pad properties where we know the subclass type 2017-11-26 00:17:27 +00:00
Tim-Philipp Müller
b60d869b22 tools: gst-inspect: refactor way indentation is done during printing 2017-11-25 23:41:49 +00:00
Edward Hervey
a066522ad9 gstinfo: Use free instead of g_free
Because
2017-11-25 13:07:12 +01:00
Edward Hervey
4ac09c73f6 gstinfo: Don't leak array of strings
The array provided by backtrace_symbols needs to be freed.
2017-11-25 12:44:11 +01:00
Edward Hervey
5429dcdf2e check/buffer: Remove usless memcmp with empty size
1) checking nothing against nothing is pointless
2) memcmp needs to be provided non-NULL arguments
2017-11-24 15:40:14 +01:00
Edward Hervey
741ff6a371 gstutils: Fix linear regression comparision
The check for dropping precision was wrong when sxx and syy were negative.

if they are negative then "G_MAXINT64 - val" would always overflow

The check was meant to use G_MININT64 (like in the loop contained just
after).
2017-11-24 15:40:14 +01:00
Matthew Waters
3afc575062 check: add missing harness function to symbol export list
Fixes in user code:

undefined reference to `gst_harness_add_element_sink_pad'

Also reorder harness function list to be strictly in alphabetical order and
double check the list with:

awk '{ if ($1 !~ /#define/) if ($2 ~ /gst_harness_/) { print $2 }; if ($3 ~ /gst_harness_/) { print $3} }' libs/gst/check/gstharness.h | sort
2017-11-25 00:57:54 +11:00
Tim-Philipp Müller
3b54dace2d tests: include config.h and don't include unix headers
In many cases the unistd.h includes weren't actually needed.

Preparation for making tests work on Windows with MSVC.
2017-11-24 13:41:20 +01:00
Tim-Philipp Müller
d038d681ad tests: add missing license header to test_transform.c 2017-11-24 13:40:34 +01:00
Mikhail Fludkov
6577f5e91e gsttraceutils: actually disable tracing system hooks if configured
`./configure --disable-gst-tracer-hooks` didn't do anything, hooks were
always enabled regardless of the option. It works correctly in the
Meson build though.
2017-11-24 13:40:34 +01:00
Havard Graff
eb9ac74362 utils: add gst_utils_dump_buffer()
Useful for debugging.
2017-11-24 13:40:33 +01:00
Håvard Graff
c44edd95e7 meson.build: use join_paths() on prefix
So that "/" are correct on Windows and the paths in
the .pc files are like C:/some/where and not
C:\some\where.
2017-11-24 13:40:33 +01:00
Tim-Philipp Müller
db3ea93439 libs: fix indentation 2017-11-24 13:40:33 +01:00
Stian Selnes
512cec3dea pad: gst_pad_activate_mode() always succeed if same mode
Checking that the pad is in the correct mode before the parent is
checked makes the call always succeed if the mode is ok.

This fixes a race with ghostpad where gst_pad_activate_mode() could
trigger a g_critical() if the ghostpad is unparented while the
proxypad is deactivating, for instance if the ghostpad is released.
More specifically, gst_ghost_pad_internal_activate_push_default()'s
call to gst_pad_activate_mode() would fail if ghostpad doesn't have a
parent. With this patch it will return true of mode is already
correct.
2017-11-24 13:40:31 +01:00
Havard Graff
df27ec3e67 gstbasetranform: replace GST_BASE_TRANSFORM with GST_BASE_TRANSFORM_CAST
To avoid a global type-lock on chain etc.
2017-11-24 13:39:39 +01:00
Tim-Philipp Müller
b63ed9e066 ghostpad: return TRUE if target pad was already set
The state is as it should be, so no reason to return
FALSE really, everything's good.
2017-11-24 13:39:39 +01:00
Tim-Philipp Müller
3203a10821 ghostpad: access internal pad with lock held 2017-11-24 13:39:39 +01:00
Havard Graff
e515aa06fe ghostpad: fix race-condition while tearing down
An upstream query will take a ref on the internal proxypad, and can
hence end up owning the last reference to that pad, causing a crash.
2017-11-24 13:39:36 +01:00
Haakon Sporsheim
77502acabc check: Add test suite time elapsed output 2017-11-24 09:50:52 +01:00
Edward Hervey
922e048379 queue: Only calculate level if we have valid levels
Doing calculations with GST_CLOCK_STIME_NONE would result in
completely bogus levels
2017-11-23 15:28:39 +01:00
Tim-Philipp Müller
7ea4152323 gstvalue: allocate slightly larger than needed tables at startup
If we pre-allocate only *exactly* as many nodes as we need for the
core types, we are practically guaranteed a re-alloc when external
code like GstVideoTimeCode or GstEncodingProfile register their
own GstValue things. So allocate a bit more than strictly needed.
2017-11-23 13:56:51 +01:00
Mathieu Duponchelle
c01949a99e pad templates: Allow specifying GType
See https://bugzilla.gnome.org/show_bug.cgi?id=731301

https://bugzilla.gnome.org/show_bug.cgi?id=789986
2017-11-22 16:44:08 +01:00
Tim-Philipp Müller
02d678a2f8 win32: update for latest promise api changes 2017-11-22 15:59:39 +01:00
Matthew Waters
86abf49c23 gst: add a promise object
An object that can be waited on and asked for asynchronous values.
In much the same way as promise/futures in js/java/etc

A callback can be installed for when the promise changes state.

Original idea by
Jan Schmidt <jan@centricular.com>

With contributions from
Nirbheek Chauhan <nirbheek@centricular.com>
Mathieu Duponchelle <mathieu@centricular.com>

https://bugzilla.gnome.org/show_bug.cgi?id=789843
2017-11-23 00:48:30 +11:00
Edward Hervey
40c5396c24 registrychunks: Make sure we use aligned memory
This is in the same vein as for all other features. Some systems
might not allow unaligned read.
2017-11-20 17:01:04 +01:00
Tim-Philipp Müller
b8b03f69b0 tools: gst-inspect: stop printing element state_change function
This is really not interesting at all, not sure why we print this.
2017-11-17 00:15:17 +00:00
Tim-Philipp Müller
465094f071 tools: gst-inspect: fix double empty line after pad templates 2017-11-17 00:14:35 +00:00
Edward Hervey
d915dd4b20 gstpad: Make pad (de)activation atomic
The following could happen previously:
* T1: calls gst_pad_set_active()
* T2: currently (de)activating it
* T1: gst_pad_set_active() returns, caller assumes that the pad has
  completed the requested (de)activation ... whereas it is not
  the case since the actual (de)activation in T2 might still be
  going on.

To ensure atomicity of pad (de)activation, we use a internal
variable (and cond) to ensure only one thread at a time goes through
the actual (de)activation block

https://bugzilla.gnome.org/show_bug.cgi?id=790431
2017-11-16 10:55:36 +01:00
Edward Hervey
80262013ca gstpad: Make calls to GstPadActivateFunction MT-safe
checking whether we already were in the target GstPadMode was being
done too early and there was the risk that we *would* end up
(de)activating a pad more than once.

Instead, re-do the check for pad mode when entering the final pad
(de)activation block.

https://bugzilla.gnome.org/show_bug.cgi?id=790431
2017-11-16 08:29:22 +01:00
Nicolas Dufresne
7595c38a73 paramspec: Move condition check inside the g_return
It's mostly a debug check and crash avoidance, it's better to
keep all the condition inside the macro.
2017-11-10 12:09:41 -05:00
Nicolas Dufresne
98f4ff8331 paramspec: Add missing since for _spec_array() 2017-11-10 12:09:41 -05:00
Edward Hervey
f03443f90c concat: Handle single-pad use-cases
When EOS reaches concat, it will switch to the next candidate as its
activate pad.

The problem arises when there is only one sinkpad, the "active" pad
becomes NULL. This results in concat becoming unusable after it receives
a *single* EOS on its single sinkpad.

If we detect there is a single sinkpad and there is no current active pad:
* If we are waiting (from selected sink event/buffer), become the current
  active pad.
* If there is a seek request, send it upstream. We don't switch the
  active_sinkpad property at that point in time, since the seek could
  fail. If the seek succeeds, the following SEGMENT (or STREAM_START)
  will cause the pad_wait() to elect that pad as the new active one.
* Flush events get forwarded

https://bugzilla.gnome.org/show_bug.cgi?id=790167
2017-11-10 14:15:46 +01:00
Edward Hervey
08ad748ced concat: Make QoS forward MT-safe
In the same way it's done for other event forwarding.
2017-11-09 17:41:51 +01:00
Guillaume Desmottes
4670036691 latency tracer: add timestamp to tracer records
Include the timestamp of the recorded log as in the 'stats' tracer.
This can be useful, for example, to plot a graph showing the latency
over time.

https://bugzilla.gnome.org/show_bug.cgi?id=781315
2017-11-04 13:51:00 -04:00
Edward Hervey
40187f9247 typefindhelper: Fix overflow some more
Nothing guaranteed that off+size wouldn't exceed a 2**64 value.

Instead we reverse the operation and use a subtraction.
2017-11-04 11:48:40 +01:00
Edward Hervey
4ccdad084b typefindhelper: Fix signed integer overflow
Make sure the whole calculation is done with 64bit unsigned values

(To be ready for people want to typefind exabyte files).
2017-11-04 10:34:10 +01:00
Tim-Philipp Müller
d106390adc element: add gst_element_foreach_*pad()
Add convenience API that iterates over all pads, sink pads or
source pads and makes sure that the foreach function is called
exactly once for each pad.

This is a KISS implementation. It doesn't use GstIterator and
doesn't try to do clever things like resync if pads are added
or removed while the function is executing. We can still do that
in future if we think it's needed, but in practice it will
likely make absolutely no difference whatsoever, since these
things will have to be handled properly elsewhere by the element
anyway if they're important.

After all, it's always possible that a pad is added or removed
just after the iterator finishes iterating, but before the
function returns.

This is also a replacement for gst_aggregator_iterate_sink_pads().

https://bugzilla.gnome.org/show_bug.cgi?id=785679
2017-11-02 15:59:22 +00:00
Mathieu Duponchelle
f911fe4314 gstleaks.c: always log leaks listing
https://bugzilla.gnome.org/show_bug.cgi?id=789556
2017-11-02 14:53:48 +01:00
Sebastian Dröge
4c795924db net: Add new file to the meson.build 2017-11-01 12:27:31 +02:00
Sebastian Dröge
ab7efda48d examples/netclock-replay: Fix build 2017-11-01 11:31:52 +02:00
Robert Rosengren
5d885b9dc7 netutils: Add util for setting socket DSCP
Util function for setting QoS DSCP added, to remove duplicated code in
netclientclock and nettimeprovider. Fix build error if missing IP_TOS.

https://bugzilla.gnome.org/show_bug.cgi?id=784737
2017-11-01 11:00:47 +02:00
Edward Hervey
fb56ad6bee gstvalue: Cast GST_MAKE_FOURCC arguments
To make it explicit that we are dealing with uint32 targets

Avoids erroneous  runtime error: left shift of negative value -1

https://bugzilla.gnome.org/show_bug.cgi?id=789700
2017-10-31 12:02:18 +01:00
Nicolas Dufresne
41e35c334b latency-tracer: Exclude synchronization time
The goal of this tracer is to measure the processing latency between a
src and a sink. In push mode, the time was read after the chain function
have returned. As the amount of time we wait to get synched is reverse
to the amount of latency the source introduced, the result was quite
surprising.

This patch moves the latency calculation in the pre-push hook. When
there is no processing in a a pipeline (e.g. fakesrc ! fakesink), the
latency will now be 0 as it's supposed to. For pull mode, the code was
already correct. When GstBaseSink operate in pull mode, the processing
time is done durring the pull, so pull-post is the right hook. The
synchronization will happen after the pull has ended. Note that
GstBaseSink rarely operate in pull mode.

https://bugzilla.gnome.org/show_bug.cgi?id=788431
2017-10-30 15:33:15 -04:00
Edward Hervey
c0c9a531ef event: Don't allow invalid SELECT_STREAMS event creation
Asking to select no streams makes no sense and can create various
issues.

If one doesn't one any stream it should deactivate (or not use) the
element in question.
2017-10-27 09:53:06 +02:00
Edward Hervey
4844adf193 gst: Fix build with option parsing disabled 2017-10-25 17:10:15 +02:00
Stefan Sauer
9f2d7d2378 segment: update the tests
Boy scout rule. Make is a little less painful to debug the tests by using
fail_unless_equals_{uint64,int64,float} where appropriate. Ideally the large
tests would be splitted to avoid guessing data dependencies.
2017-10-20 17:28:11 +02:00
Stefan Sauer
05ce354d3e segment: clarify the segment docs for the duration 2017-10-20 16:15:01 +02:00