Commit graph

18900 commits

Author SHA1 Message Date
Edward Hervey e3d2eb1f16 GstBuffer: Inline fast-path for merged memory 2019-11-27 14:25:19 +00:00
Tim-Philipp Müller 6c2dfe5ebe docs: mention gst_parse_bin_from_description() in gst_parse_launch() docs 2019-11-27 09:41:36 +00:00
Linus Svensson 47c50b086e datetime: Add constructor for timestamps in microseconds 2019-11-25 13:31:11 +01:00
Vivia Nikolaidou fa8312472f baseparse: Make sure PTS >= DTS
If, for example, we are accumulating rounding errors from the buffer
duration when calculating the PTS/DTS, it can happen that the buffer
thinks it should be presented before it's decoded. In that case we just
clamp the DTS.
2019-11-18 14:09:22 +02:00
Stéphane Cerveau 8a20d66b10 gstbuffer: update documentation
remove unclear documentation about GST_BUFFER_FLAG_MARKER
2019-11-18 00:15:31 +00:00
Seungha Yang c05cb9504d gst-launch: Disable printing current position by default when stdout is not a tty
... and add new option to force-enable printing position even if stdout
is not a tty.
2019-11-14 12:15:20 +00:00
Havard Graff 7b38def8e0 structure: add gst_structure_take
(╯°□°)╯︵ ┻━┻
2019-11-14 10:08:38 +00:00
Tulio Beloqui a11f53e131 harness: fixed race condition on forward pad while forwarding sticky events to sink harness
Co-authored-by: Camilo Celis <camilo@pexip.com>
Co-authored-by: Havard Graff <hgr@pexip.com>
2019-11-13 20:33:51 +00:00
Thibault Saunier 06e54399ba hotdoc: Add missing json escaping
Fixes https://gitlab.freedesktop.org/gstreamer/gst-docs/issues/50
2019-11-13 11:37:22 +00:00
Wonchul Lee 5c6314d68b event: Fix gir warning
It fixes below gir warnings.
../subprojects/gstreamer/gst/gstevent.c:2246: Warning: Gst:
gst_event_new_instant_rate_sync_time: unknown parameter
'rate_multiplier' in documentation comment, should be 'rate'
../subprojects/gstreamer/gst/gstevent.c:2296: Warning: Gst:
gst_event_parse_instant_rate_sync_time: unknown parameter
'rate_multiplier' in documentation comment, should be 'rate'
2019-11-12 15:19:28 +09:00
Víctor Manuel Jáquez Leal 78041a7748 gst/parse: define pure-parser depending on bison version
After release bison 2.5 the declaration %pure-parser was deprecated
in favor of %define api.pure

Nonetheless, until bison 3.4, the declaration was treated as backward
compatibility, but now bison shows a warning:

  warning: deprecated directive, use ‘%define api.pure’

The patch's approach is to handle both directives according with the
used bison's version, by string replacement at source configuration
stage.
2019-11-05 12:55:08 +01:00
Nayana Topolsky e8c782d119 pad: clear sticky event tag upon stream-start
When playing gapless there were situations when some sticky events
like tags were stuck at some pad and then revived much later.
Therefore it is better to clear them upon stream-start.

Fixes #360
2019-11-04 12:01:47 +00:00
Seungha Yang d8b8a13285 taglist: Fix broken empty set character in code
Previous one was not a valid ASCII empty set character.
'tig' and 'git log -p' couldn't represent it as expected.
2019-11-03 19:06:58 +00:00
Seungha Yang 0505bd76a1 gst-launch: Add support printing current position of pipeline
By default, gst-launch will print the current position of pipeline (with duration if available).
To disable it, use "--no-position" option.
2019-11-03 09:12:26 +00:00
Seungha Yang 15423723fe gst-launch: Port to the direct use of GMainLoop
... instead of custom event loop.
This can make it easy to use GMainLoop related APIs in code.
2019-11-03 09:12:26 +00:00
Seungha Yang 966d013bf0 gst-launch: Remove meaningless global variable 2019-11-03 09:12:26 +00:00
Jan Schmidt acf66273f5 pipeline: Instant rate change handling
Implement aggregation of INSTANT_RATE_REQUEST messages and sending of
INSTANT_RATE_SYNC_TIME events.
2019-11-03 19:47:40 +11:00
Sebastian Dröge f72c89b159 basesink: Add support for instant-rate-change events
Post instant-rate-request message when receiving an instant-rate-change
event, and handle the incoming instant-rate-sync-time events from the
pipeline.
2019-11-03 19:47:40 +11:00
Sebastian Dröge 74412496cf event/message: Add new instant-rate-sync-time event and instant-rate-request message 2019-11-03 19:47:40 +11:00
Sebastian Dröge be3c4d00cf event: Add new GST_EVENT_INSTANT_RATE_CHANGE and GST_SEEK_FLAGS_INSTANT_RATE_CHANGE
A seek with that flag set must be non-flushing, not change the playback
direction and start/stop position. A seek handler will then send the new
GST_EVENT_INSTANT_RATE_CHANGE event downstream for downstream elements
to immediately apply the new playback rate before the new in-band segment
event arrives.
2019-11-03 19:47:40 +11:00
Víctor Manuel Jáquez Leal 9707db909d elementfactory: add GST_ELEMENT_FACTORY_TYPE_HARDWARE
This new symbol matches with the elements within "Hardware" class.
2019-11-02 15:11:12 +01:00
Niels De Graef 0ca0a9d982 queue2: Use g_object_notify_by_pspec
`g_object_notify()` actually takes a global lock to look up the
`GParamSpec` that corresponds to the given property name. It's not a
huge performance hit, but it's easily avoidable by using the
`_by_pspec()` variant.
2019-10-31 11:06:48 +01:00
Sebastian Dröge d25a88e3a1 tee: First deactivate the pad and then remove it when releasing pads
This reverts a96002bb28, which is not
necessary anymore. If we release the pad after removing it then none of
the deactivation code will actually be called because the pad has no
parent anymore, and we require a parent on the pad for deactivation to
happen.

This can then, among other things, cause a streaming thread to be still
stuck in a pad probe because the pad was never flushed, and waiting
there forever because now the pad will actually never be flushed anymore.
2019-10-24 22:49:41 +00:00
Sebastian Dröge 7f7da6a0d0 tee: Check for the removed pad flag also in the slow pushing path
If a pad is currently being released we don't want to forward the
FLUSHING flow return but instead consider it as NOT_LINKED. FLUSHING
would also cause upstream to be FLUSHING.

This part was missed in a3c4a3201a and
resulted in a different (and wrong) workaround in
a96002bb28.
2019-10-24 22:49:41 +00:00
Sebastian Dröge aa29864317 tee: Lock mutex before reading the removed flag of the pads
Otherwise we're not guaranteed to read the very latest value that
another thread might've written in there when the pad was released, and
could instead work with an old value.
2019-10-24 22:49:41 +00:00
Sebastian Dröge 487a3f9a30 bin: Drop need-context messages without source instead of crashing 2019-10-22 09:46:19 +03:00
Tim-Philipp Müller 35db4a2433 meson: build gir even when cross-compiling if introspection was enabled explicitly
This can be made to work in certain circumstances when
cross-compiling, so default to not building g-i stuff
when cross-compiling, but allow it if introspection was
enabled explicitly via -Dintrospection=enabled.

Fixes #454 and #381.
2019-10-17 19:54:21 +01:00
Tim-Philipp Müller 10d9e18f02 Remove autotools build system 2019-10-13 16:10:42 +01:00
Edward Hervey 6babf1f086 core: Avoid usage of deprecated API
GTimeval and related functions are now deprecated in glib.
Replacement APIs have been present since 2.26
2019-10-10 15:53:16 +02:00
Xavier Claessens e17bde51b3 Check buffer size before checking buffer data
If the expected size is bigger than the actual buffer size, it would
memcmp random memory which could lead to crashes instead of proper error
reporting.
2019-10-07 17:47:47 +00:00
Xavier Claessens d109dd2752 dataurisrc: Do not include trailing \0 into buffer 2019-10-07 17:47:47 +00:00
Xavier Claessens fe9e49da87 harness: Add gst_harness_pull_until_eos() 2019-10-07 17:47:47 +00:00
Aaron Boxer 509f6201e1 documentation: fix a number of typos 2019-10-06 11:12:11 -04:00
Jordan Petridis e2a70cb90f
gstdirectcontrolbinding: Fix integer comparison
i is declared as gint but then compared against `n_values` guint
in the for loop below.
2019-10-04 20:06:49 +03:00
Sebastian Dröge 9fb84ea7f4 gst: Don't pass miniobjects to GST_DEBUG_OBJECT() and similar macros
The argument must be at least a GObject according to the GstLogFunction
definition, and while the default C log function handles miniobjects
just fine this is crashing bindings and user-supplied log functions that
(rightfully) don't expect anything but GObjects.
2019-09-30 11:52:03 +03:00
Mathieu Duponchelle 0dafe6e639 gstvalue: use value_nick for serialization
not value_name . This was causing incorrect launch lines to be
displayed by gst-device-monitor, and the deserialization code
below works with nicks.
2019-09-17 01:09:05 +00:00
Mathieu Duponchelle a9e2776074 deviceprovider: set the bus to non-flushing before calling klass->start
Not posting DEVICE_ADDED messages while a device provider is being
started makes things awkward for applications, as they have to call
get_devices() after starting the monitor.

This requires redundant code on the application side, and as far as
I understand also could cause race conditions, when a device gets
added between the calls to gst_device_monitor_start() and
gst_device_monitor_get_devices(), causing the application to "see"
the same device twice.
2019-09-16 23:56:44 +00:00
Sebastian Dröge 9cf764b2ec element: Enforce that elements created by gst_element_factory_create/make() are floating
Bindings might have a hard time making sure that the reference is indeed
still floating after returning here.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/444
2019-09-12 09:50:17 +00:00
Sebastian Dröge 341ee45155 device: Enforce that elements created by gst_device_create_element() are floating
Bindings might have a hard time making sure that the reference is indeed
still floating after returning here.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/444
2019-09-12 09:50:17 +00:00
Sebastian Dröge 1edcf747ee device: gst_device_create_element() is transfer floating, not transfer full
Fixing the annotation fixes leaking of the created element in all
bindings using GObject-Introspection.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/444
2019-09-12 09:50:17 +00:00
Sebastiano Barrera 89dfda56e3 base: GstBaseSrc/GstBaseSink::get_caps: add (nullable) to filter
The virtual method named `get_caps` in both `GstBaseSrc` and
`GstBaseSink` has a `filter` parameter which can be `NULL` (the
default implementation in GstBaseSrc already considers the case).
Before this commit, there was no gtk-doc annotation representing this
fact, which caused the corresponding entry in the GIR file to also
miss this fact.

This caused bugs in other places, such inducing the Vala compiler to
introduce a wrongly assert on `(filter != NULL)` in every
implementation of the `get_caps` method implemented in Vala.
2019-09-11 11:13:38 +02:00
Niels De Graef 4812c4087f Don't pass default GLib marshallers for signals
By passing NULL to `g_signal_new` instead of a marshaller, GLib will
actually internally optimize the signal (if the marshaller is available
in GLib itself) by also setting the valist marshaller. This makes the
signal emission a bit more performant than the regular marshalling,
which still needs to box into `GValue` and call libffi in case of a
generic marshaller.

Note that for custom marshallers, one would use
`g_signal_set_va_marshaller()` with the valist marshaller instead.
2019-09-09 12:16:24 +00:00
Jim Mason a4aa2256d1 consolidated IOV_MAX/UIO_MAXIOV handling per GLib + legacy behaviour for osx/ios 2019-09-07 12:32:40 +01:00
Jim Mason dc5250e751 gst_writev: respect IOV_MAX for the writev iovec array #439 2019-09-06 19:23:01 +01:00
Vivia Nikolaidou 7774aae713 pad: Added gst_pad_get_single_internal_link
gst_pad_iterate_internal_links is usually used to find a single internal
link that a pad has, e.g. to find the corresponding pad of a multiqueue.
Added a helper function that will return either a single internal link,
if there's no other, or NULL.
2019-09-05 11:49:18 +03:00
David Svensson Fors f8d70b475c miniobject: free qdata array when the last qdata is removed
In cases with many long-lived buffers that have qdata only very
briefly, the memory overhead of keeping an array of 16 GstQData
structs for each buffer can be significant. We free the array when
the last qdata is removed, like it was done in 1.14.

Fixes #436
2019-09-04 16:31:53 +02:00
Nicolas Dufresne 80a76a4b4d bin: Fix minor race when adding to a bin
This patch simply add a null check around a case where a child may have
been unparented concurrently to the deep_add_remove operation. This was
found by accident in the form of an "IS_GST_OBJECT" assertion, but had
no other known side effect in that test.
2019-09-03 15:42:17 -04:00
Matthew Waters 83e0da2061 libcheck: fix macos werror build
../libs/gst/check/libcheck/check.c:617:15: error: result of comparison of constant 4294967295 with expression of type 'clockid_t' is always false [-Werror,-Wtautological-constant-out-of-range-compare]
  if (clockid == -1) {
      ~~~~~~~ ^  ~~
2019-08-30 12:05:40 +10:00
Matthew Waters 43622119bb file/fdsrc: use struct stat64 on android to match stat64()
Fixes android werror failures:

../plugins/elements/gstfdsrc.c:244:25: error: incompatible pointer types passing 'struct stat *' to parameter of type 'struct stat64 *' [-Werror,-Wincompatible-pointer-types]
    if (fstat (src->fd, &stat_results) < 0)
                        ^~~~~~~~~~~~~
/home/matt/Projects/cerbero/build/android-ndk-18/sysroot/usr/include/sys/stat.h:159:38: note: passing argument to parameter '__buf' here
int fstat64(int __fd, struct stat64* __buf) __RENAME_STAT64(fstat, 3, 21);
                                     ^
../plugins/elements/gstfdsrc.c:560:23: error: incompatible pointer types passing 'struct stat *' to parameter of type 'struct stat64 *' [-Werror,-Wincompatible-pointer-types]
  if (fstat (src->fd, &stat_results) < 0)
                      ^~~~~~~~~~~~~
/home/matt/Projects/cerbero/build/android-ndk-18/sysroot/usr/include/sys/stat.h:159:38: note: passing argument to parameter '__buf' here
int fstat64(int __fd, struct stat64* __buf) __RENAME_STAT64(fstat, 3, 21);
                                     ^

  if (fstat (fd, &stat_results) < 0)
                 ^~~~~~~~~~~~~
/home/matt/Projects/cerbero/build/android-ndk-18/sysroot/usr/include/sys/stat.h:159:38: note: passing argument to parameter '__buf' here
int fstat64(int __fd, struct stat64* __buf) __RENAME_STAT64(fstat, 3, 21);
                                     ^

  if (fstat (src->fd, &stat_results) < 0)
                      ^~~~~~~~~~~~~
../../../../../android-ndk-18/sysroot/usr/include/sys/stat.h:159:38: note: passing argument to parameter '__buf' here
int fstat64(int __fd, struct stat64* __buf) __RENAME_STAT64(fstat, 3, 21);
                                     ^
../plugins/elements/gstfilesrc.c:477:23: error: incompatible pointer types passing 'struct stat *' to parameter of type 'struct stat64 *' [-Werror,-Wincompatible-pointer-types]
  if (fstat (src->fd, &stat_results) < 0)
                      ^~~~~~~~~~~~~
../../../../../android-ndk-18/sysroot/usr/include/sys/stat.h:159:38: note: passing argument to parameter '__buf' here
int fstat64(int __fd, struct stat64* __buf) __RENAME_STAT64(fstat, 3, 21);
                                     ^
2019-08-28 15:46:33 +10:00
Matthew Waters 5c3ae3893a check: fix werror build with clang
Silence -Wformat-nonliteral warnings from the internal copy of libcheck

../subprojects/gstreamer/libs/gst/check/libcheck/check.c:379:29: warning: format string is not a string literal [-Wformat-nonliteral]
    vsnprintf (buf, BUFSIZ, msg, ap);
                            ^~~
../subprojects/gstreamer/libs/gst/check/libcheck/check_error.c:48:21: warning: format string is not a string literal [-Wformat-nonliteral]
  vfprintf (stderr, fmt, args);
                    ^~~
../subprojects/gstreamer/libs/gst/check/libcheck/check_str.c:92:29: warning: format string is not a string literal [-Wformat-nonliteral]
    n = vsnprintf (p, size, fmt, ap);
                            ^~~
2019-08-26 12:42:37 +00:00