Commit graph

8614 commits

Author SHA1 Message Date
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
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
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
Niels De Graef
9e69c90869 object: 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-08-25 21:32:44 +02:00
Seungha Yang
e6c43380bb info: Take lock around all prinf on Windows
On Windows, concurrent colored gstreamr debug output and usual
stdout/stderr string will cause broken output on terminal.
Since it's OS specific behavior, that's hard to completely avoid it
but we can protect it at least among our printing interfaces side.
2019-08-24 12:15:56 +00:00
Mathieu Duponchelle
7e87a05e5a docstrings: port ulinks to markdown links 2019-08-23 18:17:41 +02:00
Johan Sternerup
a4d5c95638 utils: Avoid memory merge in gst_util_dump_buffer()
For buffers with multiple memory chunks, gst_buffer_map() has the side
effect of merging the memory chunks into one contiguous
chunk. Since gst_util_dump_mem() used gst_buffer_map() the internals
of the buffer could actually change as a result of printing it.

For the case of a buffer containing several memory chunks,
gst_memory_map() is now used to obtain the memory address and each
memory chunk is dumped separately preceded by a header line. The
behaviour for a buffer containing a single memory chunk is left unchanged.
2019-08-21 08:37:50 +02:00
Jan Alexander Steffens (heftig)
1d5a1e8235 element: Added gst_element_get_current_clock_time and gst_element_get_current_running_time
Helper functions for getting the element clock's time, and the clock
time minus base time, respectively.
2019-08-12 12:59:27 +03:00
Sebastian Dröge
533fbf766e registry: Use plugin directory from the build system for relocateable Windows builds
Instead of guessing something based on preprocessor defines and magic.
2019-08-09 07:22:38 +00:00
Thibault Saunier
d6c14e70a1 device-monitor: list hidden providers before listing devices
The way it was implemented could make the list updated after the
list of device was filled with supposdely hidden devices
2019-08-07 15:20:39 -04:00
Tim-Philipp Müller
8841c3a22f message: fix up enum value for GST_MESSAGE_DEVICE_CHANGED
This was added in 1.16 and accidentally duplicated the value of
the existing GST_MESSAGE_REDIRECT.

As the only known user of this message is GStreamer core itself,
and it is quite an obscure message, it seems best to just fix up
the enum value even if that technically breaks API.

Fixes #418
2019-08-06 08:02:09 +00:00
Doug Nazar
7b596ba6c6 info: Fix deadlock in gst_ring_buffer_logger_log
gst_ring_buffer_logger_log calls several functions while formatting
the message which may in turn log a message while we already hold
the mutex. Do all formatting first before acquiring the mutex to
avoid this and reduce the time we hold the mutex.
2019-08-05 15:24:03 +00:00
Sebastian Dröge
55e79c3772 info: Free some more memory on gst_deinit() 2019-07-15 11:35:07 +03:00
Sebastian Dröge
04a7334140 info: Deprecate gst_debug_category_free()
And change it to do nothing at all.

As debug categories don't use reference counting and they can be
retrieved from anywhere at any time by name, it is fundamentally unsafe
to free them at any point in time except for right before the end of the
process.

No code apart from a unit test seems to be currently using the function,
so deprecate it and also change it to do nothing at all.
2019-07-15 11:35:07 +03:00
Jan Schmidt
318a6169f7 gsttracerutils: Fix build with disabled tracer hooks.
Add a stub gst_tracing_get_active_tracers() call when building
with tracer hooks disabled.
2019-07-07 20:42:56 +10:00
Nirbheek Chauhan
e5a3f12ff2 gstinfo: Fix typo in debug log message 2019-07-02 15:13:26 +05:30
Nirbheek Chauhan
1685f38bb2 gsttracer: Add new API to fetch the list of active tracers
This will be useful in the next commit where we add action-signals on
the leaks tracer to get information about leaks and to manipulate
checkpoints as a replacement for the SIGUSR1 and SIGUSR2 signals for
doing the same.
2019-07-02 15:13:26 +05:30
Nicolas Dufresne
8a9b20a18b bufferpool: Fix the buffer size reset code
The offset in gst_buffer_resize() is additive. So to move back the
offset to zero, we need to pass the opposite of the current offset. This
was raised through the related unit test failingon 32bit as on 64bit
the alignment padding was enough to hide the issue. The test was
modified to also fail on 64bit. This patch will remove spurious
assertions like:

  assertion 'bufmax >= bufoffs + offset + size' failed

Fixes #316
2019-07-01 16:49:04 -04:00
Nirbheek Chauhan
aae5f58dd1 tracerrecord: Be stricter while parsing record templates
It's not really possible for us to recover when someone uses the
gst_tracer_record_new() API incorrectly. Also, document a piece of
somewhat-obscure code.
2019-07-01 13:33:13 +00:00
Nirbheek Chauhan
f336fdd088 gstsystemclock: Mark the clock as MAY_BE_LEAKED
It is freed in gst_deinit(), but otherwise it is leaked.
2019-07-01 11:51:46 +00:00
Nirbheek Chauhan
4ba6898f24 gstinfo: Rework stack trace detection a bit
Ensure that the code paths for HAVE_UNWIND and HAVE_DBGHELP are never
taken at the same time, even if the build file code changes.

Prefer DbgHelp over libunwind on Windows in case both are somehow
available because DbgHelp is only available when building with the
MSVC toolchain, and libunwind won't give us debug symbols from objects
built with the MSVC toolchain.

Also, print slightly more useful messages for the level of stack trace
support enabled, and document what each if conditional does.
2019-07-01 10:36:09 +00:00
Nirbheek Chauhan
145f8546c4 gstinfo: Add an explicit enum for GST_STACK_TRACE_SHOW_NONE
The code implicitly uses this value when the stack trace is not FULL.
Mostly useful for documenting the behaviour when each flag is passed
and for translating to/from strings.
2019-07-01 10:36:09 +00:00
Nirbheek Chauhan
5f89225bc2 gstplugin: Don't stat plugins when building for UWP
When using GStreamer with Universal Windows Platform apps, dynamic
plugins can only be loaded by filename (without a path) using
gst_plugin_load_file() which will call into g_module_open().

On Windows, GModule calls LoadLibrary() on the filename, but with
UWP we need to use LoadPackagedLibrary() which is basically the same
as LoadLibrary(), except it looks only for DLLs (by name) that have
been packaged as assets with the app.

These assets are not files and cannot be accessed using normal file
APIs such as open() or stat().

The upstream glib merge request for adding LoadPackagedLibrary support
is: https://gitlab.gnome.org/GNOME/glib/merge_requests/951

NOTE: Whitespcae removal is to make gst-indent happy
2019-06-28 13:44:49 +05:30
Nirbheek Chauhan
9b7eaa3ed5 gstconfig.h.in: Windows ARM64 does not allow unaligned access 2019-06-28 13:01:14 +05:30
Mathieu Duponchelle
c34fe82b5b devicemonitor: add debug category 2019-06-21 13:38:58 +00:00
Michael Bunk
4bc68bb3fe Fixing various typos 2019-06-20 15:20:27 +00:00
Havard Graff
0257c7813b gstmeta: Optimize get_tags() by using private quark table 2019-06-17 09:50:32 +02:00
Havard Graff
ce7e6a9406 pad: increase debug-level to warning for fatal outcomes 2019-06-13 16:30:14 +00:00
Niels De Graef
09141c6e1f Use G_DEFINE_AUTOPTR_CLEANUP_FUNC unconditionally
Since we started depending on GLib 2.44, we can be sure this macro is
defined (it will be a no-op on compilers that don't support it). For
plugins we should just start using `G_DECLARE_FINAL_TYPE` which means
we no longer need the macro there, but for most types in core we don't
want to break ABI, which means it's better to just keep it like it is
(and use the `#ifdef` instead).
2019-06-04 08:50:59 +02:00
Mathieu Duponchelle
bcb4be455e gstelement: fix links to the gsterror page 2019-05-31 01:56:08 +02:00
Mathieu Duponchelle
cce397cc50 gsttaglist: do not link to symbols from gst-plugins-base in doc 2019-05-31 01:45:41 +02:00
Mathieu Duponchelle
ca17a6c791 doc: remove xml from comments 2019-05-29 21:33:42 +02:00
Thibault Saunier
e31f06f7f9 registry: Avoid discovering plugins in hotdoc private directories 2019-05-16 18:22:20 +00:00
Edward Hervey
7aee718394 gstpad: Probes that return HANDLED can reset the data info field
Before GST_PAD_PROBE_HANDLED was introduced, we had to handle the case
where some probes would reset the probe info data field to NULL. This would
be considered an invalid use-case.

But with GST_PAD_PROBE_HANDLED it is totally fine to reset that, since
the probe has "handled" it.
2019-05-16 15:13:48 +02:00
Thibault Saunier
949fba4b1f doc: Fix hotdoc warnings
* Making sure that `static inline` function are in the GIR (by first
  defining them, and make sure to mark as skiped)
* Do not try to link to unexisting symbols
* Also generate GIR information about gst_tracers
2019-05-13 16:34:09 -04:00
Thibault Saunier
a0c65067e0 Port to hotdoc 2019-05-13 16:34:09 -04:00
Thibault Saunier
3d5dbfb457 gst: Add a GParamSpecFlag to force gst-inspect to use pspec default value
Instead of the object value, this should be used every time a random
value will be returned by g_object_get This is also useful to make the
values returned by inspecting element stable accross runs.
2019-05-13 11:33:49 -04:00
Thibault Saunier
4e29b4aa34 doc: Add some missing docstrings 2019-05-13 11:33:49 -04:00
Thibault Saunier
5b2da0835e doc: Fix and add some missing docstrings 2019-05-13 11:33:49 -04:00
Thibault Saunier
4d259e8af3 structure: Mark _from_string as constructor 2019-05-13 11:33:49 -04:00
Nirbheek Chauhan
ebd918c0f6 meson: Pass -DGST_STATIC_COMPILATION for static builds
This is only needed on Windows when building with MSVC, but it is safe
to pass it everywhere.

Closes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/398
2019-05-13 14:42:28 +05:30
Nirbheek Chauhan
b19de413b9 meson: Link to objects instea of static helper library
Otherwise the objects from that static helper library are not included
in the gstreamer-1.0 static library. This was supposed to be fixed in
Meson, but the pull request hasn't been merged yet:
https://github.com/mesonbuild/meson/pull/3939

Closes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/398
2019-05-13 13:24:42 +05:30
Niels De Graef
8d180557eb uri: Add gst_clear_uri()
Basically, you can use this instead of using `gst_uri_unref()` (which
needs to be preceded by a NULL-check).

See https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/275
and https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/3
2019-05-10 14:59:23 +02:00
Niels De Graef
cfca53ce67 gst: Add support for g_autoptr(GstPromise) 2019-05-08 12:11:50 +02:00
Niklas Hambüchen
f5ccb2215a Make get_flex_version.py script executable
Like all other scripts in the same dir.

It has a hashbang, so it should be executable.
2019-05-01 15:46:56 +02:00
Mathieu Duponchelle
21a02e7672 gstsegment: Add GST_SEEK_FLAG_TRICKMODE_FORWARD_PREDICTED
This is generally useful, and mandated by the ONVIF streaming
spec, section 6.5.3

<https://www.onvif.org/specs/stream/ONVIF-Streaming-Spec.pdf>
2019-04-24 15:30:22 +00:00
Sebastian Dröge
a42aaf87d5 gst: Fix various Since markers 2019-04-23 15:08:18 +03:00
Sebastian Dröge
26aa7a6d36 caps: Add Since: 1.16 marker to gst_caps_copy() 2019-04-23 14:53:11 +03:00
Mathieu Duponchelle
dc5a62f702 gstinfo: clean up function pointer names hashtable
And add strduped function pointer names to the global quark
table, so that they don't get reported as lost by valgrind.

This allows us to use GST_DEBUG when running tests under
valgrind.
2019-04-17 23:03:56 +02:00
Philipp Zabel
b99bca2790 event: fix seek event creation
Creating seek events segfaults on 32-bit ARM since commit 2fa15d5371
('event: add new seek parameter, "trickmode-interval"'), which missed
casting the trickmode-interval initializer in the variable argument list
to guint64.
2019-04-12 18:30:12 +02:00
Sebastian Dröge
e0c9d4f879 controlbinding: Check if the weak pointer was cleared before explicitly removing it
Otherwise we'll get an assertion if the object behind the weak pointer
was already destroyed in the meantime as we would pass NULL as first
argument to g_object_remove_weak_pointer().
2019-04-10 10:18:54 +03:00
Mathieu Duponchelle
2fa15d5371 event: add new seek parameter, "trickmode-interval"
When performing a key unit trickmode seek, it may be useful to
specify a minimum interval between the output frames, either
in very high rate cases, or as a protection against streams
that may contain an overly large amount of key frames.

One use case is ONVIF Section 6.5.3:

<https://www.onvif.org/specs/stream/ONVIF-Streaming-Spec.pdf>
2019-04-01 17:13:32 +00:00
Stephane Cerveau
a01c4965de gst_element_get_factory: update documentation
Inform about a potential NULL result.
2019-03-14 13:12:52 +01:00
Stephane Cerveau
b5af526c9c gst_element_factory_get_metadata: protect from null factory 2019-03-13 18:46:14 +01:00
Santiago Carot-Nemesio
706e10ad05 gsttaskpool: Do not block tasks while cleaning up the taskpool
There is a deadlock if any thread from the pool tries to push
a new task while other thread is waiting for the pool of threads
to finish. With this patch the thread will get an error when it
tries to add a new task while the taskpool is being cleaned up.
2019-03-08 17:27:30 +01:00
Marco Trevisan (Treviño)
b5286f0560 gsturi: Fix annotation on get_path to return a nullable
Use proper syntax or the (nullable): part will be part of the description
2019-03-06 19:46:46 +01:00
Marco Trevisan (Treviño)
951dc50d34 gstmessage: Fix annotations on details
Details argument should be nullable, but the docstring uses a wrong syntax.
2019-03-06 19:34:12 +01:00
Mathieu Duponchelle
5dc149f4f2 gstbuffer: store meta in add order
The previous implementation of add was implemented as a prepend,
switch to append as that seems like the expected order.
2019-03-04 12:57:02 +00:00
Santiago Carot-Nemesio
e322250fb1 taskpool: Set error in case something goes wrong in the default handlers 2019-02-28 17:02:30 +01:00
Tim-Philipp Müller
8d3ca40e9d meson: dist get_flex_version.py 2019-02-26 13:24:28 +00:00
Philipp Zabel
b611c4e0af plugin: add 0BSD as valid license
Add the zero-clause BSD license, which is an alteration of the ISC
license, to the list of valid licenses.
2019-02-25 14:58:22 +01:00
Philipp Zabel
bef07f73a2 plugin: fix link to 3-clause BSD license
The current link points to the 2-clause BSD license,
explicitly link to the 3-clause version of the license.
2019-02-25 14:51:18 +01:00
Nirbheek Chauhan
a1447b036c gstmacros.h: Fix restrict definition on MSVC
Turns out it's exposed as `__restrict`, not as `restrict`.

https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/95#note_120782
2019-02-20 17:51:40 +05:30
Nirbheek Chauhan
ea4b086142 gstmacros.h: Fix check for 'restrict' keyword
MSVC also defines it as a keyword. Fixes build errors in projects that
include MSVC's xkeycheck.h which ensures that keywords aren't overriden
with a define.
2019-02-20 01:25:11 +05:30
Seungha Yang
790f193d63 buffer: Don't miss return value on Windows build
... and use InterlockedExchangeAdd64 for the 64bit value.
InterlockedExchangeAdd is 32bit version.
2019-02-18 10:21:18 +09:00
Sebastian Dröge
2108c6228a bus: Make removing of signal/bus watches thread-safe
Between getting the GSource with the mutex and destroying it, something
else might've destroyed it already and we would have a dangling pointer.

Keep an additional reference just in case.
2019-02-15 13:23:37 +02:00
Sebastian Dröge
8de3344ecc bus: Don't allow removing signal watches with gst_bus_remove_watch()
Signal watches are reference counted and gst_bus_remove_watch() would
immediately remove it, breaking the reference counting. Only
gst_bus_remove_signal_watch() should be used for removing signal
watches.
2019-02-15 13:21:35 +02:00
Lawrence Troup
2276336621 pad: Document that pad unlink function is called with pad lock held
Fixes #353
2019-02-13 11:56:15 +00:00
Tim-Philipp Müller
f62ee97592 buffer: store sequence number for metas
For metas where order might be significant if multiple metas are
attached to the same buffer, so store a sequence number with the
meta when adding it to the buffer. This allows users of the meta
to make sure metas are processed in the right order.

We need a 64-bit integer for the sequence number here in the API,
a 32-bit one might overflow too easily with high packet/buffer
rates. We could do it rtp-seqnum style of course, but that's a
bit of a pain.

We could also make it so that gst_buffer_add_meta() just keeps metas in
order or rely on the order we add the metas in, but that seems too
fragile overall, when buffers (incl. metas) get merged or split.

Also add a compare function for easier sorting.

We store the seqnum in the MetaItem struct here and not in the
GstMeta struct since there's no padding in the GstMeta struct.
We could add a private struct to GstMeta before the start of
GstMeta, but that's what MetaItem effectively is implementation-
wise. We can still change this later if we want, since it's all
private.

Fixes #262
2019-02-12 17:53:08 +00:00
Sebastian Dröge
335826a3eb deviceprovider: It's (transfer none) not (transfer-none) 2019-02-09 11:35:59 +02:00
Thibault Saunier
97aa82387f device-provider: Allow notifying application of device changes
Thi introduces new APIs to post a `DEVICE_CHANGED` message on the
bus so the application is notifies when a device is modified. For
example, if the "defaultness" of a device was changed or any property
that can be changed at any time. Atomically changing the device
object notifying that way allow us to abtract away the internal threads.

New APIS:
  - gst_message_new_device_changed
  - gst_message_parse_device_changed
  - gst_device_provider_device_changed
2019-02-08 13:44:02 -03:00
Nirbheek Chauhan
c164b88ac1 meson: Extract flex version using a regex inside a script
Different builds of Flex on different platforms output different strings
in --version. For example:

macOS:
flex 2.5.35 Apple(flex-31)

Windows:
win_flex.exe 2.6.4
C:\Program Files (x86)\GnuWin32\bin\flex.EXE version 2.5.4

We need to look for a string that looks like a version, which means
a regex till https://github.com/mesonbuild/meson/issues/1609 is fixed.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/356
2019-02-08 16:54:10 +05:30
Sebastian Dröge
d3a2ed10fe datetime: new() and new_local_time() constructors are not nullable 2019-01-29 14:49:28 +00:00
Sebastian Dröge
f6816d5412 pad: Constructors are all not nullable
They can't possibly return NULL except in case of assertions.
2019-01-29 14:49:28 +00:00
Sebastian Dröge
92b38d2a00 padtemplate: Constructors are all nullable as they check the template name 2019-01-29 14:49:28 +00:00
Mathieu Duponchelle
57cefb5932 gstinfo: add Windows stacktraces support
This uses the DbgHelp library if available
2019-01-28 14:29:23 +00:00
Nicolas Dufresne
c816ec4f0e pad: Remove unneeded 64bit upcast in debug trace
The hook->hook_id is a gulong for which there are no portability issues
when tracing in printf format with %lu. So use %lu and remove the upcast
to 64 bit. This makes the code more consistent with everything else
tracing that hook_id and other gulong id.
2019-01-26 01:42:22 +00:00
Sebastian Dröge
5688773b91 taglist: Remove (scope call) annotation from gst_tag_register()
This was added in 7fdb15d6a2 but it is wrong. (scope call) is for
closures that only have to stay valid for the scope of the call, but the
tag merge function has to stay valid for the whole lifetime of the
application instead.

There's no appropriate scope annotation for that so we have to skip
these functions for now.
2019-01-24 07:52:34 +00:00
Mathieu Duponchelle
59c31d8d0f meson: improve flex version parsing
the output of flex --version can contain more than one space
2019-01-23 21:15:09 +01:00
Sebastian Dröge
a143d9cb0c pad: Fix printf format when printing hook id
It's a gulong so we have to cast it to a guint64 when using it with
G_GUINT64_FORMAT.

Spotted by Vincent Penvern.
2019-01-15 16:07:04 +00:00
Daniel Drake
e0c9b04538 deviceprovider: fix counting number of times started
GstDeviceProvider has a started_count private variable counter,
and the gst_device_provider_start() documentation emphasizes the
importance of balancing the start and stop calls.

However, when starting a provider that is already started, the
current code will never increment the counter more than once.

So you start it twice, but it will have start_count 1, which is the
maximum value it will ever see.

Then when you stop it twice, on the 2nd stop, after decrementing the
counter in gst_device_provider_stop():

  else if (provider->priv->started_count < 1) {
    g_critical
        ("Trying to stop a GstDeviceProvider %s which is already stopped",
        GST_OBJECT_NAME (provider));

and the program is killed.

Fix this by incrementing the counter when starting a device provider that
was already started.
2019-01-14 16:26:44 +08:00
Sebastian Dröge
37edc474e3 Revert "bin: Hold the state lock while removing elements from a bin"
This reverts commit 7f70d7a945
2019-01-10 12:05:34 +00:00
Jan Alexander Steffens (heftig)
c5eddea72a structure: Support stepped ranges when fixating
The step restriction was completely ignored until now.
2019-01-09 23:03:08 +00:00
Jan Alexander Steffens (heftig)
b77f7b6820 structure: Use GLib's CLAMP macro for fixating ranges
Just a bit of refactoring.
2019-01-09 23:03:08 +00:00
Sebastian Dröge
cacc834d8f element: Add note about racyness to gst_element_set_locked_state()
This is racy if the state lock of the parent bin is not taken. The
parent bin might've just checked the flag in another thread and as the
next step proceed to change the child element's state.
2019-01-09 16:12:26 +02:00
Sebastian Dröge
7f70d7a945 bin: Hold the state lock while removing elements from a bin
We need to take the state lock here to ensure that we're
not currently just before setting the state of this child
element. Otherwise it can happen that we removed the element
here and e.g. set it to NULL state, and shortly afterwards
have another thread set it to a higher state again as part of
a state change for the whole bin.

When adding an element to the bin this is not needed as we
require callers to always ensure after adding to the bin that
the new element is set to the correct state.
2019-01-07 14:08:00 +02:00
Edward Hervey
7c1d700384 parse: Move variable to block where it's used
There was a dead assignment used outside of the bin/pipeline creation
which was confusing (and unused). Just move that variable to
where it is actually used.

(Note that that variable was not needed outside of that block since
the refactoring done in 2b33d33185 )
2018-12-15 11:46:26 +01:00
Sebastian Dröge
4af3b3f159 pad: Print some debug information about pad probe hooks we remove 2018-12-14 18:37:53 +02:00
Guillaume Desmottes
e03f086fae gstcaps: add gst_caps_set_features_simple()
Convenient helper setting a caps feature on all the structures of a
caps.
2018-12-11 16:39:30 +01:00
Dardo D Kleiner
6318e7c675 buffer: Fix memory corruption in gst_buffer_foreach_meta() when removing metas
Fix corruption of meta list head when removing metas at the beginning
during iteration. Linked list handling in gst_buffer_foreach_meta
failed to track the previous entry and update the correct next pointer
when removing items from beyond the head of the list, resulting in
arbitrary list pointer corruption.

Closes #332
2018-12-05 20:50:45 +00:00
Jordan Petridis
84512152c1
Run gst-indent through the files
This is required before we enabled an indent test in the CI.

https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/33
2018-11-28 05:58:53 +02:00
Seungha Yang
3332e39baa gst: Fix string leak when G_VALUE_COLLECT_INIT() was failed
Returned string should be freed

Fixes #319
2018-11-12 20:12:41 +09:00
Sebastian Dröge
5f469abbed debugutils: Make sure that GST_DEBUG_GRAPH_SHOW_VERBOSE gets the correct value in introspection
Currently in Python it would become a signed 64 bit value but should
actually be an unsigned 32 bit value with all bits set.

This is the same problem as with GST_MESSAGE_TYPE_ANY.

See https://bugzilla.gnome.org/show_bug.cgi?id=732633
2018-11-10 19:08:52 +00:00
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
Sebastian Dröge
1fda8c3bcf clock: Move clock GWeakRef to a private GstClockEntry struct
There's no need for it to be in the public struct and we can keep the
padding for things to be added in the future.
2018-11-08 09:07:07 +00:00
Matthew Waters
4fc4ad87d5 query: add a new bitrate query
Allows determining from downstream what the expected bitrate of a stream
may be which is useful in queue2 for setting time based limits when
upstream does not provide timing information.

Implement bitrate query handling in queue2

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/60
2018-11-07 15:04:14 +00:00
Havard Graff
c6e5f59b2c systemclock: pre-calculate the ratio for multiplying the perf-count on win
Saves a lot of computations.
2018-11-06 10:39:05 +01:00