Commit graph

3039 commits

Author SHA1 Message Date
Havard Graff
1335110409 tests: fix tests when compiling with glib_checks=disabled
We won't be able to do ASSERT_CRITICAL, but the main body of the tests
are still valid, and given we ship GStreamer with this configuration, it
is important to be able to run some tests against it.
2018-11-10 15:37:36 +00:00
Tim-Philipp Müller
b92e34ebfd Fix distcheck
Follow-up to !18 and #320.
2018-11-08 14:09:32 +00:00
Michael Olbrich
bc621cc335 gst: add some gdb python macros
This adds gdb pretty printer for some GStreamer types.
For GstObject pointers the type and name is added, e.g.
"0x5555557e4110 [GstDecodeBin|decodebin0]".
For GstMiniObject pointers the object type is added, e.g.
"0x7fffe001fc50 [GstBuffer]".
For GstClockTime and GstClockTimeDiff the time is also printed in human
readable form, e.g. "150116219955 [+0:02:30.116219955]".

Fixes #320
2018-11-08 12:36:23 +00:00
Havard Graff
fa34768729 harness: improve _wait_for_clock_id_waits performance
By moving the functionality down to the testclock, the implementation
no longer needs to poll the waits, but rather wait properly for
them to be added.

The performance-hit here would be that by polling the test-clock
regularly, you would create contention on the testclock-lock, making code
using the testclock (gst_clock_id_wait) fighting for the lock.
2018-11-06 11:46:06 +01:00
Thomas Bluemel
36ab067905 clock: Keep weak reference to underlying clock
Fixes potential segmentation fault when using a GstClockID that
is referencing an already freed GstClock

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/187
2018-11-03 19:00:22 +02:00
Sebastian Dröge
c3214e8deb harness: Add API for proposing meta APIs from the allocation query
https://bugzilla.gnome.org/show_bug.cgi?id=797350
2018-10-28 17:05:27 +00:00
Sebastian Dröge
fc3602aec8 queuearray: Only clear dropped item if it is not returned 2018-10-15 18:47:16 +03:00
Sebastian Dröge
2481e542c7 queuearray: Clear items when dropping them and a clear function was defined 2018-10-15 15:28:35 +03:00
Jan Schmidt
04176bede1 ptp clock: Wait for ANNOUNCE before selecting a master
Previously, with opportunistic sync we'd track a master
clock as soon as we see a SYNC message, and hence sync up
faster, but then we'd announce we're synched before seeing
the ANNOUNCE, leaving the clock details like grandmaster-clock
empty.

A better way is to start tracking the clock opportunistically,
but not announce we're synched until we've also seen the ANNOUNCE.
2018-10-11 22:11:51 +11:00
Jan Schmidt
d37fcea225 ptp clock: improve debug
Log message arrival times. Fix a typo in one debug string
2018-10-11 22:11:51 +11:00
Jan Schmidt
6a653437ac ptp clock: Increase tolerance for late follow-up and delay-resp
The follow-up and delay-resp messages carry precise
timestamps for the arrival at the clock master, but
the local return time is unimportant, so we should be very
lenient in accepting them late. Some PTP masters don't
prioritise sending those packets, and we reject all the
responses and never sync - or take forever to do so.

Increase the tolerance to 20x the mean path delay.

Also fix a typo in one debug output that would print
the absolute time of the delay-resp message, not the offset
from the delay-req that it's actually being compared against.
2018-10-11 22:11:51 +11:00
Jan Schmidt
6fcd3c135a ptpclock: Add TRACE level debug output
Add some debugging to be able to tell what is happening
inside the PTP clock protocol handling.
2018-10-11 22:11:51 +11:00
Tim-Philipp Müller
135932872e aggregator: document new "min-upstream-latency" property is in nanosecs
https://bugzilla.gnome.org/show_bug.cgi?id=797213
2018-10-04 00:30:52 +01:00
Vivia Nikolaidou
22d0f40716 queuearray: Add set_clear_func and clear functions
gst_queue_array_clear will clear the GstQueueArray,
gst_queue_array_set_clear_func will set a clear function for each
element to be called on _clear and on _free.

https://bugzilla.gnome.org/show_bug.cgi?id=797218
2018-09-27 19:32:54 +03:00
Mathieu Duponchelle
62d7eaf3aa aggregator: add gtk-doc blurb for new min-upstream-latency prop 2018-09-27 13:20:10 +02:00
Mathieu Duponchelle
97e2e7a63d aggregator: add min-upstream-latency property.
This is exposed as a solution to the use case of plugging in
sources with a higher latency after the aggregator has started
playing with an initial set of sources, allowing to avoid resyncing.

https://bugzilla.gnome.org/show_bug.cgi?id=797213
2018-09-27 12:56:47 +02:00
Tim-Philipp Müller
50c32da91f meson: use library() for libgstcheck instead of always building a shared lib
Otherwise we try to build a shared lib when we build the rest
of GStreamer statically, which won't work because we pass
-DGST_STATIC_COMPILATION when building statically, which means
we won't dllimport public symbols from our libs which means
that on Windows the unit tests will fail to link to libgstcheck.

https://bugzilla.gnome.org/show_bug.cgi?id=797185
2018-09-24 08:39:39 +01:00
Tim-Philipp Müller
57c8e0146f libs: figure out right export define in configure
Add new GST_API_EXPORT in config.h and use that for GST_*_API
decorators instead of GST_EXPORT.

The right export define depends on the toolchain and whether
we're using -fvisibility=hidden or not, so it's better to set it
to the right thing directly than hard-coding a compiler whitelist
in the public header.

We put the export define into config.h instead of passing it via the
command line to the compiler because it might contain spaces and brackets
and in the autotools scenario we'd have to pass that through multiple
layers of plumbing and Makefile/shell escaping and we're just not going
to be *that* lucky.

The export define is only used if we're compiling our lib, not by external
users of the lib headers, so it's not a problem to put it into config.h

Also, this means all .c files of libs need to include config.h
to get the export marker defined, so fix up a few that didn't
include config.h.

This commit depends on a common submodule commit that makes gst-glib-gen.mak
add an #include "config.h" to generated enum/marshal .c files for the
autotools build.

https://bugzilla.gnome.org/show_bug.cgi?id=797185
2018-09-24 08:39:37 +01:00
Tim-Philipp Müller
46ed0f0489 libs: fix 'inconsistent DLL linkage' warnings on Windows
For each lib we build export its own API in headers when we're
building it, otherwise import the API from the headers.

This fixes linker warnings on Windows when building with MSVC.

The problem was that we had defined all GST_*_API decorators
unconditionally to GST_EXPORT. This was intentional and only
supposed to be temporary, but caused linker warnings because
we tell the linker that we want to export all symbols even
those from externall DLLs, and when the linker notices that
they were in external DLLS and not present locally it warns.

What we need to do when building each library is: export
the library's own symbols and import all other symbols. To
this end we define e.g. BUILDING_GST_FOO and then we define
the GST_FOO_API decorator either to export or to import
symbols depending on whether BUILDING_GST_FOO is set or not.
That way external users of each library API automatically
get the import.

https://bugzilla.gnome.org/show_bug.cgi?id=797185
2018-09-23 23:23:01 +01:00
Mathieu Duponchelle
17798bca6d aggregator: define autoptr cleanup functions 2018-09-20 16:22:17 +02:00
Nirbheek Chauhan
cbd02b9584 meson: Always use a dependency object for dependencies
Fixes a configure error with gst-build:

subprojects/gst-plugins-base/meson.build:235:2: ERROR:  Fetched variable 'gst_check_dep' in the subproject 'gstreamer' is not a dependency object.
2018-09-05 16:33:43 +05:30
Philippe Normand
d7c87910c2 baseparse: avg_bitrate calculation critical warning fix
The avg_bitrate is an unsigned int, so the gst_util_uin64_scale() function can't
be used for it, as it expects signed integers for the fraction parts arguments.

https://bugzilla.gnome.org/show_bug.cgi?id=797054
2018-08-31 15:35:35 +01:00
Nirbheek Chauhan
c389c59b22 meson: Maintain macOS ABI through dylib versioning
Requires Meson 0.48, but the feature will be ignored on older versions
so it's safe to add it without bumping the requirement.

Documentation:
https://github.com/mesonbuild/meson/blob/master/docs/markdown/Reference-manual.md#shared_library
2018-08-31 14:40:14 +05:30
Tim-Philipp Müller
04deaac7a4 check: testclock: fix deprecation guards
Make our own deprecation marker for libgstcheck,
since the function declaration must contain the
right API export decorator (GST_CHECK_API) and
not the one for GStreamer core.
2018-08-26 11:45:58 +02:00
Tim-Philipp Müller
f7b5151b58 bitwriter: fix compiler warning
Don't return a value from a function that doesn't
return a value using the returned value from a
function that also doesn't return a value.

gstbitwriter.h(265): warning C4098: 'gst_bit_writer_align_bytes_unchecked': 'void' function returning a value
2018-08-26 11:45:58 +02:00
Nirbheek Chauhan
0a84fae16c meson: host_system is 'ios' when building for iOS
The cross file sets this value, and we use 'ios' in Cerbero.
2018-08-17 02:55:43 +05:30
Sebastian Dröge
49d212e908 aggregator: Fixup for previous commit to prevent infinite loop if no events are pending 2018-08-14 12:30:19 +03:00
Sebastian Dröge
08bd835f09 aggregator: Return an error directly if negotiation of a sink pad failed
And don't give buffers to subclasses in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=796951
2018-08-14 10:23:23 +03:00
Tim-Philipp Müller
de8fe283d6 autotools: stop controlling symbol visibility with -export-symbols-regex
Instead, use -fvisibility=hidden and explicit exports via GST_EXPORT.
This should result in consistent behaviour for the autotools and
Meson builds where this is done already, and will allow us to drop
the win32 .def files.
2018-08-12 23:26:25 +01:00
Tim-Philipp Müller
88bd7c61a7 bitwriter: fix g-i scanner warning
gstbitwriter.h:45: Warning: GstBase: "@bit_capacity" parameter unexpected at this location:
 * @bit_capacity: Capacity of the allocated @data
2018-08-12 20:07:02 +01:00
Tim-Philipp Müller
fffc312893 meson: add options to disable gobject cast checks and glib asserts
And match what we do for autotools here currently.
2018-08-11 18:17:29 +01:00
Tim-Philipp Müller
6d34f57cb6 meson: add option to disable build of GStreamer unit test library 2018-08-10 01:23:35 +01:00
Sebastian Dröge
c31ef7fa51 typefindhelper: Mark gst_type_find_helper_get_range_full() as Since 1.14.3 2018-08-02 10:57:28 +03:00
Sebastian Dröge
41f1a40704 typefind: Add new gst_type_find_helper_get_range_full() that returns flow return
And make use of it in the typefind element. It's useful to distinguish
between the different errors why typefinding can fail, and especially to
not consider GST_FLOW_FLUSHING as an actual error.

https://bugzilla.gnome.org/show_bug.cgi?id=796894
2018-08-01 14:23:04 +03:00
Mathieu Duponchelle
27f53141e2 aggregator: annotate GstAggregatorClass::update_src_caps 2018-07-27 23:22:59 +02:00
Sebastian Dröge
a569347789 aggregator: Don't leak peer pad of inactive pads when (not) forwarding QoS events to them 2018-07-26 02:32:57 +03:00
Nirbheek Chauhan
c80a1fd64c meson: host_machine.system() is darwin even on iOS
Also use host_system everywhere.
2018-07-25 16:02:06 +05:30
Nirbheek Chauhan
38ec95460f meson: Don't add static printf library to executables
They should only need to link to libgstreamer.
2018-07-25 16:02:06 +05:30
Sebastian Dröge
7bee79426d typefindhelper: Mark extension in gst_type_find_helper_get_range() as allow-none
It always allowed NULL and even said so in the documentation.
2018-07-25 01:12:49 +03:00
Sebastian Dröge
d196b0b904 typefind: Add _with_extension() variants for typefinding data or a buffer
And make use of that in the typefind element to also be able to make use
of the extension in push mode. It previously only did that in pull mode
and this potentially speeds up typefinding and might also prevent false
positives.

https://bugzilla.gnome.org/show_bug.cgi?id=796865
2018-07-25 01:12:11 +03:00
Thibault Saunier
1f3ef7aa01 basetransform: Do not check if NULL is an emtpy caps
gst_base_transform_transform_caps can return NULL in various conditions
thus we should not treat its result as valid caps.

In all other places NULL is properly handled.
2018-07-18 21:18:56 -04:00
Olivier Crête
4f3aea316a sink: Only add processing latency if upstream is live
Only add it if upstream is live, otherwise leave the latency at 0.

https://bugzilla.gnome.org/show_bug.cgi?id=640610
2018-07-16 13:04:44 -04:00
Thibault Saunier
b4d93abb24 basesink: Minor GI warning fix. 2018-07-13 08:52:55 -04:00
Thibault Saunier
8f76257ac0 check: Add a fail_unless_equals_clocktime macro for convenience 2018-07-08 20:56:16 -04:00
Olivier Crête
a7f9c80220 basesink: Add processing deadline
The processing deadline is the acceptable amount of time to process the media
in a live pipeline before it reaches the sink. This is on top of the algorithmic
latency that is normally reported by the latency query. This should make
pipelines such as "v4lsrc ! xvimagesink" not claim that all frames are late
in the QoS events. Ideally, this should replace max_lateness for most applications.

https://bugzilla.gnome.org/show_bug.cgi?id=640610
2018-07-07 09:05:26 -04:00
Bastian Köcher
cd3e55c38e gstreamer: fix install dir for configure files
Nixos installs into a non-standard includedir.

https://bugzilla.gnome.org/show_bug.cgi?id=794856
2018-07-07 12:42:17 +02:00
Tim-Philipp Müller
2db8e3705f Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-24 12:49:14 +02:00
Edward Hervey
d34f046029 baseparse: Ensure seqnum consistency
We need all relevant events of a segment to have consistent seqnum:
* GST_EVENT_SEGMENT
* GST_EVENT_EOS

If we are push-based and create a new segment, use the same seqnum
as the upstream event.

If we are pull-based, use the seqnum of that newly created segment
event everywhere
2018-06-05 17:02:18 +02:00
Mike Wey
51b97d7403 dataqueue: add some missing introspection annotations
https://bugzilla.gnome.org/show_bug.cgi?id=796488
2018-06-03 19:42:17 +01:00
Edward Hervey
dfe5467209 baseparse: Documentation improvements
* Remove references to old functions and methods
* Use proper #ClassName.vmethod() decorator for vmethod
2018-05-30 14:06:06 +02:00