Commit graph

8730 commits

Author SHA1 Message Date
Tim-Philipp Müller a2cbf75523 Remove unused valgrind detection
Having this just to log a debug message in case we're
running inside valgrind doesn't seem very useful, and
the code that used to use this no longer exists it seems.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/595>
2020-10-11 22:39:51 +00:00
Seungha Yang 271af223b7 info: Fix build on Windows ARM64 device
gstinfo.c(3086): error C2094: label 'done' was undefined

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/662>
2020-10-09 06:52:12 +00:00
Xavier Claessens 0ed165bf67 gst_init: Call gst_init_static_plugins() when available
When doing a static build, gstreamer-full-1.0 defines that symbol to
register static plugins. Cerbero's Android build will be updated to
implement that symbol too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/641>
2020-10-05 16:09:10 -04:00
Mathieu Duponchelle acdb4ce03d gstvalue: expose gst_value_deserialize_with_pspec()
Typing hints can only be passed to gst_value_deserialize()
through the type of the passed-in value. This means deserialization
can only target the desired type for the top-level elements,
making it for example impossible to deserialize an array of
flags to the expected type.

This commit exposes a new function, gst_value_deserialize_full(),
that takes an optional pspec as the extra parameter, and updates
the deserialization code to pass around that pspec, or the
element_spec when recursively parsing the elements of a list-type
value.

This allows for example passing arrays of flags through the
command line or gst_util_set_object_arg, eg:

foo="<bar,bar+baz>"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/629>
2020-10-03 01:02:55 +02:00
Seungha Yang 220ce9c3fd info: Load DbgHelp.dll using g_module_open()
... and update meson file so that enable it only using required headers.

"dependency(...)" is unlikely successful for Windows SDK libraries
since it doesn't ship pkg-config file. So it needs to be changed
to "find_library()" to link corresponding .lib file. That would
result to most MSVC build system will link dbghelp.dll. However,
one drawback of the change is that gstreamer-1.0.dll will mandate
dbghelp.dll although it should be optional. So g_module_open() way
can be the most safe way in this case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/626>
2020-09-30 18:51:40 +00:00
Matthew Waters 19fb999e09 padtemplate: mark documentation caps as may be leaked
The template itself is already marked as such and the caps, the
documentation caps are a logical extension of those two.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/650>
2020-09-30 11:59:04 +10:00
Víctor Manuel Jáquez Leal a854a1feda padtemplate: add missing annotation
Adds missing "transfer full" annotation for caps parameter in
gst_pad_template_set_documentation_caps()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/648>
2020-09-28 11:43:19 +00:00
Víctor Manuel Jáquez Leal b81808de0e memory: fix documentation to display in html
Commit e9c99c05 added a deprecation message, but this message is not
displayed in the html page since the format was not correct.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/648>
2020-09-28 11:43:19 +00:00
Mathieu Duponchelle bbca6b1ddf meta: expose API to register and create custom meta
Custom meta is backed by a GstStructure, and does not require
that users of the API expose their GstMeta implementation as
public API for other components to make use of it.

In addition, it provides a simpler interface by ignoring the
impl vs. api distinction that the regular API exposes.

This new API is meant to be the meta counterpart to custom events
and messages, and to be more convenient than the lower-level API
when the absolute best performance isn't a requirement.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/609>
2020-09-27 11:08:03 +00:00
Olivier Crête e9c99c05ae memory: Deprecate GST_MEMORY_FLAG_NO_SHARE
This flag always causes problems as it prevents subbuffering,
instead one should create a custom GstAllocator to pool the GstMemory objects
and not rely on the lifetime of the GstBuffer object they were originally
attached to.

https://bugzilla.gnome.org/show_bug.cgi?id=757254

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/614>
2020-09-18 22:37:28 +00:00
Mathieu Duponchelle 3393b456e4 gstmeta: intern registered impl string
Subsequent lookups in the hashtable are probably better done
on memory we're confident is allocated to us :)

It was easy to trigger invalid reads by calling gst_meta_register
with dynamically allocated memory, freeing that memory, then
calling gst_meta_get_info()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/628>
2020-09-18 17:31:22 +00:00
Olivier Crête f26a9ebafb deviceprovider: Returns non-floating devices from gst_device_provider_probe
This should make the API usage more consistent. Also document that the subclasses
should just return the devices as floating.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/558>
2020-09-18 14:52:12 +00:00
Sebastian Dröge 8d0055e185 event: Add optional flags to the GAP event
This allows to signal the reason for the gap, for example missing data
like packet loss.

Based on a patch by Mikhail Fludkov <misha@pexip.com>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/551>
2020-09-10 16:01:19 +00:00
Jordan Petridis c12c7afd06 fix clang 10 warnings
the typesystem checks in g_atomic_pointer_compare_and_exchange
seem to trigger some false positives with clang 10

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/584>
2020-08-04 10:44:16 +00:00
Nirbheek Chauhan 5195ad9126 gsturi: Add new API for storing unmodified userinfo / fragment
New API: gst_uri_from_string_escaped()

Identical to gst_uri_from_string() except that the userinfo and
fragment components of the URI will not be unescaped while parsing.

This is needed for correctly parsing usernames or passwords with `:`
in them such as reported at:
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/831

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/583>
2020-08-03 16:07:45 +00:00
Hosang Lee 411d255154 gsturi: unescape '=' in http query
Don't use percent-encoding for '=' in http queries.
'=' in the following kind of http query should be maintained.
example:
?token=exp=123~acl=/QualityLevels(*~hmac=0cb ...

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/580>
2020-07-29 09:06:12 +00:00
Tim-Philipp Müller 31ed9cf284 utils: silence g-ir-scanner warnings about float conversion macros
663: Warning: Gst: symbol='GFLOAT_TO_LE': Unknown namespace for symbol 'GFLOAT_TO_LE'
664: Warning: Gst: symbol='GFLOAT_TO_BE': Unknown namespace for symbol 'GFLOAT_TO_BE'
665: Warning: Gst: symbol='GDOUBLE_TO_LE': Unknown namespace for symbol 'GDOUBLE_TO_LE'
666: Warning: Gst: symbol='GDOUBLE_TO_BE': Unknown namespace for symbol 'GDOUBLE_TO_BE'
669: Warning: Gst: symbol='GFLOAT_TO_LE': Unknown namespace for symbol 'GFLOAT_TO_LE'
670: Warning: Gst: symbol='GFLOAT_TO_BE': Unknown namespace for symbol 'GFLOAT_TO_BE'
671: Warning: Gst: symbol='GDOUBLE_TO_LE': Unknown namespace for symbol 'GDOUBLE_TO_LE'
672: Warning: Gst: symbol='GDOUBLE_TO_BE': Unknown namespace for symbol 'GDOUBLE_TO_BE'
678: Warning: Gst: symbol='GFLOAT_FROM_LE': Unknown namespace for symbol 'GFLOAT_FROM_LE'
679: Warning: Gst: symbol='GFLOAT_FROM_BE': Unknown namespace for symbol 'GFLOAT_FROM_BE'
680: Warning: Gst: symbol='GDOUBLE_FROM_LE': Unknown namespace for symbol 'GDOUBLE_FROM_LE'
681: Warning: Gst: symbol='GDOUBLE_FROM_BE': Unknown namespace for symbol 'GDOUBLE_FROM_BE'

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/579>
2020-07-26 15:34:54 +01:00
Tim-Philipp Müller 6e7f4491ce math-compat.h: silence g-ir-scanner warnings
Easier to just make g-ir-scanner skip this header via #ifndef __GI_SCANNER__
than maintain different sets of headers in the meson.build file.

Warning: Gst: symbol="rint": Unknown namespace for symbol "rint"
Warning: Gst: symbol="rintf": Unknown namespace for symbol "rintf"
Warning: Gst: symbol="isnan": Unknown namespace for symbol "isnan"
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/579>
2020-07-26 15:34:54 +01:00
Tim-Philipp Müller 36715f407c event, query: fix g-ir-scanner warnings
gstevent.h:72: Warning: Gst: symbol='FLAG': Unknown namespace for symbol 'FLAG'
gstquery.h:76: Warning: Gst: symbol='FLAG': Unknown namespace for symbol 'FLAG'

Use _FLAG(xyz) instead of FLAG(xyz) to silence g-ir-scanner
warnings about this internal helper define.

It's also slightly more hygienic.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/579>
2020-07-26 15:34:54 +01:00
Tim-Philipp Müller e4f7cdb0df tracer: declare GstTracer API stable
It's been around for more than 4 years and people have built
lots of stuff on top of it, doesn't really make sense to keep
it marked as unstable. We're unlikely to change it now, and
we can always deprecate it and make a new one if needed.

This stabilises the following API:
- gst_tracer_register()
- gst_tracing_get_active_tracers()
- gst_tracing_register_hook()
- gst_tracer_record_new()
- gst_tracer_record_log()

Might also help a bit with #424

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/576>
2020-07-24 13:33:50 +01:00
Tim-Philipp Müller cb5d31a2fb buffer: improve seqnum fallback warning message
Print target CPU we're building for.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/565>
2020-07-22 12:19:59 +00:00
Tim-Philipp Müller 5bd81abdb1 buffer: fix meta sequence number fallback on rpi
The global seqnum variable wasn't actually increased in
the fallback code path, leading to all buffers getting
a seqnum of 0. Which also made the unit test fail.

This affects platforms/toolchains that don't have
64-bit atomic ops such as when compiling for armv7 rpi.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/565>
2020-07-22 12:19:59 +00:00
Matthew Waters a1b41b2b24 gst/bufferpool: only resize in reset when maxsize is larger
Only resize the buffer if the maxsize is larger then the configued pool
size.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/570>
2020-07-21 23:31:17 +10:00
Seungha Yang 30dfa177be info: Fix possible broken debug output on Windows
Depending on Windows codepage setting, some characters could
be broken when printing on terminal. Fortunatly g_print* family will
take care Windows codepage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/566>
2020-07-17 22:59:21 +09:00
Olivier Crête 90530bdb28 pad: More explicitly explain how to post errors on GST_FLOW_ERROR
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/568>
2020-07-16 16:34:05 -04:00
Edward Hervey cecb291263 Revert "gstinfo: Check threshold for category from macro"
This reverts commit dcece2a878.

This increased the code size and number of branches for all debug statements.

Fixes #564

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/563>
2020-07-13 08:02:26 +02:00
Thibault Saunier 1627222aa5 taglist: Stop inlining gst_tag_list_copy
This way it gets exposed to bindings through GObject Introspection.

Same logic as with d1b2d3429c

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/561>
2020-07-09 07:57:01 -04:00
Olivier Crête 44ef5a7c8c deviceprovider: Do static probe on start as fallback
For providers that don't support dynamic probing, just fall back to doing
a static one on start() to make the UI developers life easier.

This also means that the monitor doesn't need to call _can_monitor() before
calling start.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/353>
2020-07-06 15:08:27 -04:00
Christoph Reiter 3cfda6d6eb gstelementfactory: Fix missing features in case a feature moves to another filename
In case a plugin filename was renamed with the plugin being in the registry cache
the features were not loaded after the rename:

1) Cache of old/gone filename was loaded, features added
2) New filename was loaded, features where not added because
   they were already found in the registry.
3) In the end stale cache entries for files which are no longer there
   are removed, including the wanted features.
4) The cache gets updated without the features.

Fix this by also checking at (2) that the found feature is from the loaded plugin
and not from some stale cache entry.

This affected directsoundsink where libgstdirectsoundsink.dll was renamed
to libgstdirectsound.dll, losing the directsoundsink element in the process.

Fixes #290

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/102>
2020-07-06 14:31:48 +00:00
Sebastian Dröge d22813ef97 element: When removing a ghost pad also unset its target
Otherwise the proxy pad of the ghost pad still stays linked to some
element inside the bin, which is not allowed anymore according to the
topology.

In 2.0 this should be fixed more generically from inside GstGhostPad but
currently there is no way to get notified that the ghost pad is
unparented.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/553>
2020-07-03 06:55:37 +00:00
Sebastian Dröge f341619a4d stream: Don't use GST_FIXME_OBJECT() when generating a random stream id if the caller didn't provide one
That would call into gst_info_describe_stream(), which takes the same
mutex a second time and then deadlocks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/552>
2020-07-01 19:50:20 +00:00
Mathieu Duponchelle 1816f74339 gstutils: fix link in parse_bin_from_description_full doc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/475>
2020-07-01 18:56:47 +01:00
Jan Schmidt 53b193414d gstbin: Fix docs typo
element-added-deep -> deep-element-added in the GstBin doc header

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/547>
2020-07-01 02:22:43 +10:00
Michael Olbrich 1206a60bac bus: clear bus->priv->signal_watch immediately when the source is removed
There is a race-condition that can trigger the assertion in
gst_bus_add_signal_watch_full():

If gst_bus_add_signal_watch_full() is called immediately after
gst_bus_remove_signal_watch() then bus->priv->signal_watch may still be set
because gst_bus_source_dispose() or gst_bus_source_finalize() was not yet
called.
This happens if the corresponding GMainContext has the source queued for
dispatch. In this case, the following dispatch will only unref and delete
the signal_watch because it was already destroyed. Any pending messages
will remain until a new watch is installed.

So bus->priv->signal_watch can be cleared immediately when the watch is
removed. This avoid the race condition.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/543>
2020-06-24 15:08:59 +02:00
Nirbheek Chauhan 488acce730 registry: Print the pointer when printing features
This is what we do everywhere else too, useful for debugging.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/542>
2020-06-23 12:16:49 +01:00
Nirbheek Chauhan 43174bfe1d registry: Use a toolchain-specific registry file on Windows
If we load a plugin registry for MinGW plugins when running with MSVC,
we will have to write out the whole cache again, and vice-versa. Just
use separate cache files so that the cache is actually useful.

Closes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/427

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/542>
2020-06-23 12:16:45 +01:00
Sebastian Dröge 63c1945695 ghostpad: Deprecate gst_ghost_pad_construct()
Instead do everything it did as part of GObject::constructed() and
change the function to always return TRUE.

gst_ghost_pad_construct() was meant to be called by subclasses right
after construction of the object to finish construction as it can fail
in theory. In practice it's impossible for it to fail, even more so if
called directly from GObject::constructed(): The only failure condition
is if the newly created proxy pad already has a parent, which is
impossible at this point as nothing else can have a reference to it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/540>
2020-06-22 12:30:48 +03:00
Thibault Saunier 74d29ca771 info: Add a printf extension for ClockTime/ClockTimeDiff pointers
Using both GST_TIME_FORMAT+GST_TIME_ARGS and friend is cumbersome, this
makes it sensibly more user friendly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/535>
2020-06-20 00:42:31 +00:00
Sebastian Dröge f88b59f49a Fix up and add various "Since" markers and other related docs fixes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/536>
2020-06-19 13:10:53 +01:00
Roman Shpuntov fd280c0981 systemclock: Fix clock time conversion on Windows/xbox
The returned ratio can be bigger than GST_SECOND, in which case we would
forever return 0 for the system clock time. Even in other cases if it's
close to GST_SECOND it would result in accuracy loss.

Instead of doing the division by GST_CLOCK_TIME_NONE during
initialization once, do it every time the clock time is requested.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/575

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/534>
2020-06-18 17:41:25 +03:00
Edward Hervey 31e6d766ff gst: Delay creation of threadpools
Since glib 2.64, gthreadpool will start waiting on a GCond immediately upon
creation. This can cause issues if we fork *before* actually using the
threadpool since we will then be signalling that GCond ... from another process
and that will never work.

Instead, delay creationg of thread pools until the very first time we need
them. This introduces a minor (un-noticeable) delay when needing a new thread
but fixes the issues for all users of GSTreamer that will call gst_init, then
fork and actually start pipelines.

See https://gitlab.gnome.org/GNOME/glib/-/issues/2131 for more context.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/531>
2020-06-16 08:23:21 +02:00
Havard Graff 0b0a120a37 gst_private.h: increse padding in struct _GstClockEntryImpl
When compiling for 32bit ios arm, the static assert that the
GstClockEntryImpl smaller or equal to the struct _GstClockEntryImpl
triggered. (they were 12bytes off).

To fix this, the padding is increased by 12 bytes (on 32bit).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/525>
2020-06-08 22:48:55 +02:00
Tim-Philipp Müller d1cd07b72b paramspecs: add 'Since: 1.18' markers for new param spec flags
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/524>
2020-06-08 16:04:51 +01:00
Seungha Yang 1769187328 paramspecs: Add a GParamSpecFlag to indicate the property might not always exists
Add new flag for users to notice that the property is not guaranteed
to exist depending on environment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/283>
2020-06-08 14:18:09 +00:00
Edward Hervey 221cb03664 padtemplate: Directly unreference the documentation caps
The public-facing API has a (valid) protection against NULL caps. We can just
directly remove it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/515>
2020-06-06 08:25:16 +02:00
Mathieu Duponchelle ba0ffeb36c utils: fix markdown link to #GstPluginAPIFlags 2020-06-06 01:10:09 +02:00
Mathieu Duponchelle 169abc86e9 padtemplate: expose getters and setters "documentation caps"
This can be used in elements where the caps of pad templates
are dynamically generated and dependent on the environment.

An example is x265enc.
2020-06-06 00:38:29 +02:00
Mathieu Duponchelle 0c1ce6e8c4 utils: expose GstPluginAPIFlags
These can be passed to gst_type_mark_as_plugin_api, to inform
plugin cache generation.

For now a single flag is specified, "IGNORE_ENUM_MEMBERS", it
can be used for dynamically generated enums to avoid documenting
environment-specific enumeration members. An example is
GstX265EncTune.
2020-06-06 00:38:29 +02:00
Thibault Saunier 2cd23d67d3 structure: Quickly document serialization format
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/510>
2020-06-05 11:01:43 +00:00
Thibault Saunier bd0abb3857 structure: Reflow the SECTION comment
Removing trailing whitespaces and avoiding to exceed 80chars

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/510>
2020-06-05 11:01:43 +00:00