Commit graph

60 commits

Author SHA1 Message Date
Doug Nazar
b16e96dd87 Use g_memdup2() where available and add fallback for older GLib versions
glib 2.68 deprecates g_memdup(). Replace with g_memdup2() and
add fallback if compiling against older versions, since we
want to avoid deprecation warnings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/803>
2021-06-08 07:59:05 +00: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
Edward Hervey
973986f40b gstregistry: Directly get list of plugin features
Previously this was:
* iterating and referencing all plugin features in a GList
* *then* filtering out the ones we want
* Was doing that filtering by name (i.e. `strcmp`) instead of direct pointer
comparision

Instead, just create a private direct function to get the list of plugin
features

Uses 4 times less instructions ...

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/462>
2020-05-05 10:50:05 +02:00
Sebastian Dröge
ed1022fa81 Use gst_object_unref() / gst_object_clear() instead of the GObject ones
To allow the refcounting tracer to work better. In childproxy/iterator
these might be plain GObjects but gst_object_unref() also works on them.
In other places where it is never GstObject, g_object_unref() is kept.
2020-04-20 16:28:52 +00:00
Edward Hervey
ab8674d503 gstregistrychunks: Directly set name on features 2020-04-17 09:26:45 +02:00
Edward Hervey
99901ffab4 registrychunks: Use strnlen if available
When this `_strnlen` internal method was added, strnlen (in glibc)
was not available yet (appeared in 2.10 it was released that same
year).

If available, use the much more optimized strnlen
2020-03-22 10:40:21 +00:00
luz.paz
4a402c1c7d Fix typos in comments and docs
Found via `codespell`

https://bugzilla.gnome.org/show_bug.cgi?id=795610
2018-05-01 11:18:03 +01:00
Edward Hervey
40c5396c24 registrychunks: Make sure we use aligned memory
This is in the same vein as for all other features. Some systems
might not allow unaligned read.
2017-11-20 17:01:04 +01:00
Heekyoung Seo
d32afe3f71 registrychunk: Fix leak in failed case of reading plugin dependency string
https://bugzilla.gnome.org/show_bug.cgi?id=783978
2017-06-20 10:55:49 +03:00
Tim-Philipp Müller
519d64881f Don't use deprecated g_object_newv()
Use g_object_new() instead which nowadays has a shortcut for the
no-properties check. It still does an extra GType check in the
function guard, but there's a pending patch to remove that
and it's hardly going to be a performance issue in practice,
even less so on a system that's compiled without run-time checks.

Alternative would be to move to the new g_object_new_properties()
with a fallback define for older glib versions, but it makes the
code look more unwieldy and doesn't seem worth it.

Fixes deprecation warnings when building against newer GLib versions.

https://bugzilla.gnome.org/show_bug.cgi?id=780903
2017-04-08 09:49:59 +01:00
Jan Schmidt
e1dc60524e dynamic types: Implement dynamic types in the registry
Implement GstDynamicTypeFactory as a new registry feature.

GstDynamicTypeFactory provides a way of registering a GType
into the registry, such that it will be registered as a dynamic
type when the registry is loaded, and then automatically loaded
if the type is needed during caps parsing.

This allows using non-core types in pad templates, by loading a
registry feature to create the GType on the fly.

https://bugzilla.gnome.org/show_bug.cgi?id=750079
2016-11-02 11:21:37 +11:00
Thiago Santos
6f4bb8850b registrychunks: remove unused macro
macro was added in 2011 and isn't used anymore
2016-02-16 17:53:10 -03:00
Stefan Sauer
46ea9729df tracer: split into tracer and tracerutils
Keep tracer base class in tracer and move core support into the utils module.
Add a unstable-api guard to the tracer.h so that external modules would need to
acknowledge the status by setting GST_USE_UNSTABLE_API.
2015-10-05 20:59:39 +02:00
Stefan Sauer
4e5d586c7d tracer: initial prototype for the tracing subsystem 2015-10-05 20:59:39 +02:00
Olivier Crête
7992174a1a DeviceProvider: Rename from DeviceMonitor 2014-06-26 14:45:30 -04:00
Olivier Crête
e4e85fc88a devicemonitor: Add GstDeviceMonitor and related
Also add GstDevice and GstDeviceMonitorFactory
And add code to the registry to save them

https://bugzilla.gnome.org/show_bug.cgi?id=678402
2014-03-16 14:38:07 +00:00
Stefan Sauer
a6f60fcf2e registry: small cleanups and use object log variants more 2013-10-25 21:29:01 +02:00
Stefan Sauer
ecbe3d4f2e registry: use g_slice_free for slice memory
Avoid memory list corruption, but g_free'ing slice memory.
2013-10-25 20:05:03 +02:00
Sebastian Dröge
3360299ef4 registrychunks: Use correct print format specifiers to fix compiler warnings 2013-03-03 11:28:32 +01:00
Tim-Philipp Müller
666c8c11c6 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-03 20:44:48 +00:00
Tim-Philipp Müller
c7eca5ca15 plugin: use GstObject flags for plugin flags 2012-04-29 17:46:32 +01:00
Wim Taymans
8a76c3269a caps: _do_simplify() -> _simplify()
Rename _do_simplify() to _simplify(). The name was introduced as a replacement
method for a deprecated method but we can now rename it again.
Fix some docs.
2012-03-12 11:38:37 +01:00
Wim Taymans
9cdbffea94 caps: improve _do_simplify
Make gst_caps_do_simplify() take ownership of the input caps and produce a
simplified output caps. This removes the requirement of having writable input
caps and the method can make the caps writable only when needed.
2012-03-12 10:42:23 +01:00
Wim Taymans
6426145fc9 registry: avoid copy when caps are fixed
Avoid doing a useless copy when the caps are fixed and simplify will not do
anything.
2012-03-10 09:15:43 +01:00
Sebastian Dröge
5d1d7d95b2 caps: Store a pointer to GstCaps in GstStaticCaps
...instead of using hackish subclass of GstCaps, which also
had some thread-safety problems.
2012-01-26 14:37:02 +01:00
Tim-Philipp Müller
be04f3945c index: remove GstIndex and GstIndexFactory for now
There are many good use cases for GstIndex and we want
to add it back again in some form, but possibly not with
the current API, which is very powerful (maybe too powerful),
but also a bit confusing. At the very least we'd need to
make the API bindings-friendly.
2011-12-30 18:32:57 +00:00
Wim Taymans
5cf8e68944 Merge branch 'master' into 0.11
Conflicts:
	gst/gstmessage.c
	gst/gstquery.c
	gst/gstregistrychunks.c
	gst/gstsegment.c
	libs/gst/base/gstbasetransform.c
	libs/gst/base/gstbasetransform.h
	libs/gst/base/gsttypefindhelper.c
	plugins/elements/gsttypefindelement.c
2011-08-26 14:37:54 +02:00
Josep Torra
9f8fe424c7 registrychunks: explicitly cast to the enum types
Fixes warning #188: enumerated type mixed with another type reported by ICC.
2011-08-26 14:11:14 +02:00
Edward Hervey
bdc1710be5 Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	gst/gstdebugutils.c
	gst/gstelementdetails.h
	gst/gstregistrychunks.c
	tools/gst-run.c
2011-08-10 17:07:54 +02:00
Stefan Kost
20618b4c28 registry: move utf-8 validation to registry saving time
Instead of checking for valid utf-8 element-details every time we create
elements (from plugin-init or registry), do it before we save the registry.
Fixes #656193.
2011-08-10 13:45:49 +02:00
Wim Taymans
2c221a5729 feature: use object name
Remove the name property from the plugin feature and port code to use the object
name instead.
2011-05-24 18:17:24 +02:00
Wim Taymans
e39182a085 Merge branch 'master' into 0.11
Conflicts:
	gst/gstminiobject.c
	gst/gstpad.c
	gst/gstpad.h
	gst/gstplugin.h
	libs/gst/base/gstbaseparse.c
2011-05-18 13:14:57 +02:00
Stefan Kost
bd302bb63d pluginfeature: avoid duplicating feature->name
The feature name is not supposed to change over time anyway. In order to enforce
this parentize features to the registry and make the feature->name pointing to
GstObject:name. In 0.11 we could consider of removing the feature->name variable
(FIXME comment added).

Fixes: #459466
2011-05-18 09:55:57 +03:00
Wim Taymans
070cdaab7c Merge branch 'master' into 0.11 2011-04-25 10:30:41 +02:00
Tim-Philipp Müller
4926ce31c7 pluginfeature: store pointer to plugin in addition to the plugin name
So we can reliably remove plugin features for a specific plugin later.

https://bugzilla.gnome.org/show_bug.cgi?id=604094
2011-04-24 11:27:19 +01:00
Wim Taymans
cdde34f0ee fix compilation 2011-02-23 10:35:36 +01:00
Wim Taymans
238b9a57cc Merge branch 'master' into 0.11
Conflicts:
	configure.ac
	gst/gstelement.c
	gst/gstelement.h
	gst/gstpad.c
	gst/gstutils.c
	libs/gst/base/Makefile.am
	libs/gst/check/Makefile.am
	libs/gst/controller/Makefile.am
	libs/gst/dataprotocol/Makefile.am
	libs/gst/net/Makefile.am
	win32/common/libgstreamer.def
2011-02-22 14:11:59 +01:00
Stefan Kost
4ef9bf1019 registry: maintain the typefind extension list order 2010-12-08 11:53:10 +02:00
Wim Taymans
920ef127ce element: rework GstElementDetails
Clean up the GstElement structure
Replace GstElementDetails with metadata
2010-12-07 15:33:04 +01:00
Stefan Kost
d370a2437a registry: also intern the static caps 2010-12-03 09:42:44 +02:00
Olivier Crête
c5888dc6cf registrychunks: Use the correct variable for debug message
Debug print was using a variable that was not initialized.
2010-09-06 14:11:27 +03:00
Stefan Kost
65356fbb7a element-details: allow for arbitrary element details
Add a GstStructure to GstElementClass and GstElementFactory. Add setters/getter.
Handle it in the registry code. Print items in gst-inspect.
Fixes #396774.

API: gst_element_class_set_meta_data(), gst_element_factory_get_meta_data_detail()
2010-09-06 12:31:04 +03:00
Mark Nauwelaerts
c485918405 registrychunks: intern all GstPluginDesc members when unpacking 2010-08-23 10:59:50 +02:00
Tim-Philipp Müller
042e056776 binaryregistry: save and load release date time in GstPluginDesc
https://bugzilla.gnome.org/show_bug.cgi?id=623040
2010-07-23 17:03:42 +01:00
Tim-Philipp Müller
3410d665d7 binaryregistry: ignore the plugin cache if the filter environment has changed
Make sure that we properly update the registry and the cache file whenever
the filter environment changes or there's no more filter set.
2010-06-23 17:56:51 +01:00
Sebastian Dröge
b5e875d201 registrychunks: Initialize typefind/element factory registry chunks with zeroes
This makes valgrind stop complaining about reading unitializated memory,
which is not initialized because it's just compiler-added struct padding...
2010-04-09 13:08:13 +02:00
Sebastian Dröge
fd68dbc08f gst: Use GSlice instead of normal g_malloc in more places 2010-03-28 19:48:45 +02:00
Tim-Philipp Müller
4da2c6b380 registry: avoid some more unnecessary malloc/frees 2010-01-12 21:35:18 +00:00
Tim-Philipp Müller
5e47d24e1b registry: avoid some unnecessary strdup/free when reading the binary registry
Strings in the binary registry are NUL-terminated, so we can just use them
directly if we only need them temporarily, and avoid unnecessary mallocs
and frees.
2010-01-12 21:35:17 +00:00
Tim-Philipp Müller
dfc792c904 registrychunks: fix compilation with debugging disabled
Add ugly ifdef to fix unused variable warning when compiling with
debug logging disabled.
2009-11-10 00:58:37 +00:00