Commit graph

17745 commits

Author SHA1 Message Date
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
Stefan Sauer 38dd43df29 Revert "segment: also intialize the duration"
This reverts commit f1baaae175.
2017-10-20 16:11:44 +02:00
Stefan Sauer f1baaae175 segment: also intialize the duration
If start and stop are set, calculate the duration and set it too.
2017-10-20 14:30:42 +02:00
Stefan Sauer 875903be3f gst-inspect: print more details for typefind and tracer features
Print full details for typefind features. Print some of the available features
for tracers and add some todos for the ones we'd like to see.
2017-10-20 13:13:52 +02:00
Stefan Sauer ef660a21d6 gst-inspect: reduce casting back and forth
Refactor the print_element_info() to take a GstPluginFeature. Reduces the need
to cast to and from GstElementFactory.
2017-10-20 11:16:46 +02:00
Stefan Sauer 2354c5b152 gst-inspect: simplify the code for printing feature info
Rename print_element_features() to print_feature_info() and move the code that
handles the ElementFactory there. This simplifies the calling code and improves
readability.

Also don't leak the features for other factories.
2017-10-20 11:11:37 +02:00
Robert Rosengren 4c8058272e netclientclock: Add possibility to set QoS DSCP value
https://bugzilla.gnome.org/show_bug.cgi?id=784737
2017-10-19 16:14:17 +02:00
Robert Rosengren a3e1fca7ee nettimeprovider: Add possibility to set QoS DSCP value
https://bugzilla.gnome.org/show_bug.cgi?id=784737
2017-10-19 16:14:17 +02:00
Jan Schmidt 6adb6b478f seqnum: Never return a seqnum of 0, reset GST_SEQNUM_INVALID
Various plugins use the value of '0' as an invalid seqnum value
(qtdemux for matching duplicated seek events, for example). Make
that behaviour explicit, create a GST_SEQNUM_INVALID value,
and ensure gst_util_seqnum_next never returns it.
2017-10-18 02:31:12 +11:00
Ashish Kumar 250d3e7284 queuearray: Fix for possible crashes due to null pointer dereferencing
https://bugzilla.gnome.org/show_bug.cgi?id=788838
2017-10-16 14:04:58 +03:00
Stefan Sauer 7eea54d6a1 collectpads: mention the query function in the docs as well 2017-10-15 15:59:11 +02:00
Mathieu Duponchelle e838007d09 gstbuffer: fix meta removal in gst_buffer_foreach_meta
When updating the linked list, prev->next = next is correct
if prev is actually updated after being set to the head
of the list at the start.

https://bugzilla.gnome.org/show_bug.cgi?id=788617
2017-10-11 19:57:04 +02:00