Commit graph

17719 commits

Author SHA1 Message Date
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
fengalin
6617b01af9 flowcombiner: Fix version for ref and unref functions
The functions were introduced in version 1.12.1, GstFlowCombiner was
introduced in 1.4.

https://bugzilla.gnome.org/show_bug.cgi?id=788778
2017-10-10 18:39:26 +03:00
Tim-Philipp Müller
2841b8f0b2 basesink: use new gst_buffer_list_calculate_size() utility function 2017-10-05 13:35:14 +01:00
Ashish Kumar
0ca70247fc device-provider: gst_device_provider_unhide_provider() always fails
https://bugzilla.gnome.org/show_bug.cgi?id=788520
2017-10-05 09:42:39 +01:00
Havard Graff
fee176d253 meson: remove vs_module_defs
The GST_EXPORT should handle it.
2017-10-05 09:35:41 +01:00
Reynaldo H. Verdejo Pinochet
402159fb88 Use proper GtkDoc notation for NULL/FALSE/TRUE 2017-10-03 13:54:25 -07:00
Edward Hervey
ebad8c0094 bin: iterate_sorted: Ensure sources are always returned last
For linked elements, the resulting gst_bin_iterate_sorted() will
properly return elements from sink to sources.

If we have some elements that are not linked, we *still* want to
ensure that we return:
* In priority any sinks
* Last of all any sources
* And in between any element which is neither source nor sink

For this to work, when looking for the next candidate element,
not only check the degree order, but if there are two candidates
with the same degree order, prefer the non-source one.

Amongst other things, this fixes the case where we activating a
bin containing unlinked sources and other elements. Without this
we could end up activating sources (which might start adding pads
to be linked) before other (to which those new source element pads
might be linked) are not activated

https://bugzilla.gnome.org/show_bug.cgi?id=788434
2017-10-03 07:56:39 +02:00
Nicolas Dufresne
beab4c8e50 tee-test: Test a real use case
The real use case is when downstream didn't set a pool or
allocation params, in which case we expect the tee to not
create a pool or param from thin air. Dowstream setting
an pool with size=0 was in fact testing a downstream element
bug. The fact we handle that is accidental.
2017-10-02 14:11:19 -04:00
Stefan Sauer
21c3f0ff22 tee: don't create a pool if none is needed
If the aggregated size is 0 and we create a pool, the pool would provide
buffers with no memory assigned. Handle that case and skip the pool.
This was the behaviour before cf803ea9f4.

Add a test for this scenario.

https://bugzilla.gnome.org/show_bug.cgi?id=730758
2017-10-02 13:58:04 -04:00
Nicolas Dufresne
944758aeda tee: Re-enabled alloc query + allow-not-linked test
In the unit test refactoring, the unlinked pad required to test
the different behaviour induced by "allow-not-linked" property
was removed.

  Commit e364d7944e

Move all the code for this test in the proper function, and re-add
the missing unlinked pad. This makes the test useful again.
2017-10-02 13:35:52 -04:00
Stefan Sauer
e364d7944e tee: split the allocation query test
Split the large allocation_query test into seperate tests. Add a setup helper
to reduce code duplication. Fix the original test that used fail_unless instead
of ck_assert_int_eq and had it accidentially working.
2017-10-02 16:36:54 +02:00
Stefan Sauer
eb329eec1c structure: add a todo comment
Printing NULL is confusing when the type is e.g. a GArray that is not empty.
2017-10-02 16:23:31 +02:00
Stefan Sauer
e584886d06 query: doc consistency
Mention that it is the 'buffer size', like we do elsewhere.
2017-10-02 13:14:21 +02:00
Edward Hervey
90238a8958 win32: update exports file 2017-09-28 10:17:53 +02:00
Mathieu Duponchelle
2138acabe5 gst: Modify behaviour of gst_get_main_executable_path
To actually return the path of the executable, not its
directory.

https://bugzilla.gnome.org/show_bug.cgi?id=788256
2017-09-27 20:59:54 +02:00
Mathieu Duponchelle
895bb7bcd6 gst: API: gst_get_main_executable_path()
This is useful for plugins that need to inspect the
folder of the main executable in order to determine the
set of features they will expose, for example:

https://github.com/centricular/gstreamer-vst3

https://bugzilla.gnome.org/show_bug.cgi?id=788214
2017-09-27 20:59:54 +02:00
Mathieu Duponchelle
49e230ad1a gst: Do not try to determine executable path on iOS.
The method used relies on "libproc.h", which is only available
on OSX.

https://bugzilla.gnome.org/show_bug.cgi?id=788234
2017-09-27 13:56:15 +02:00
Mathieu Duponchelle
c9815957d3 gst: Fix typo in windows function name.
GetModuleFilename -> GetModuleFileName

https://bugzilla.gnome.org/show_bug.cgi?id=788234
2017-09-27 13:56:15 +02:00
Edward Hervey
81b1258fbb win32: Update export file 2017-09-27 10:06:12 +02:00
Mathieu Duponchelle
a5e168071c plugin dependencies: fix 6cddce7663
There were a few errors:

* The plugin scanner now accepts executable path as an argument.
  In case it is NULL, argc == 2

* We find the executable path in init_pre instead of gst_init,
  allowing this to work when gst is initialized through the
  option group (eg gst-inspect)

* There was a semi-colon missing in the __APPLE__ #ifdef
2017-09-26 15:15:27 +02:00
Mathieu Duponchelle
6cddce7663 plugin: API: GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_RELATIVE_TO_EXE
When a plugin declares a dependency using this flag, all the
relative paths are considered to be relative to the path of
the main executable.

We try to determine the path of the executable portably,
with implementations provided for Linux, Windows and Mac.

If retrieval of the path fails, we will not detect changes.

In order for the main executable path to be the same when
scanning a plugin in a child process, a new variable is
exposed in gst_private.h, _gst_executable_path

https://bugzilla.gnome.org/show_bug.cgi?id=788152
2017-09-26 13:12:00 +02:00
Vivia Nikolaidou
0c614a0bd3 git-update: Also build $EXTRA_MODULES
Doing a git pull but not autogen.sh / make is not consistent behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=787981
2017-09-22 14:17:08 +03:00
Mathieu Duponchelle
7da98a2278 gst-inspect: Print GstValueArray properties nicely
https://bugzilla.gnome.org/show_bug.cgi?id=787924
2017-09-22 00:53:12 +02:00
Mathieu Duponchelle
053f1523ad Multiqueue: don't allow dropping SEGMENT_DONE events
https://bugzilla.gnome.org/show_bug.cgi?id=780795
2017-09-18 14:12:06 +02:00
Sebastian Dröge
f649f0a44f info: GstStackTraceFlags were added in 1.12 2017-09-17 18:55:43 +03:00
Tim-Philipp Müller
c2917b1ae2 plugins: use new gst_buffer_list_calculate_size() 2017-09-17 12:36:03 +01:00
Tim-Philipp Müller
8f26af8b02 bufferlist: add gst_buffer_list_calculate_size()
Returns size in bytes.
2017-09-17 12:35:25 +01:00