Commit graph

117 commits

Author SHA1 Message Date
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
Sebastian Dröge a42aaf87d5 gst: Fix various Since markers 2019-04-23 15:08:18 +03:00
Tim-Philipp Müller 8983cce9f6 gst: GST_EXPORT -> GST_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 00:45:35 +00:00
Mathieu Duponchelle 6cddce7663 plugin: API: GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_RELATIVE_TO_EXE
When a plugin declares a dependency using this flag, all the
relative paths are considered to be relative to the path of
the main executable.

We try to determine the path of the executable portably,
with implementations provided for Linux, Windows and Mac.

If retrieval of the path fails, we will not detect changes.

In order for the main executable path to be the same when
scanning a plugin in a child process, a new variable is
exposed in gst_private.h, _gst_executable_path

https://bugzilla.gnome.org/show_bug.cgi?id=788152
2017-09-26 13:12:00 +02:00
Tim-Philipp Müller 92d3246f76 gst: mark symbols explicitly for export with GST_EXPORT
One omission: gst_allocator_sysmem_get_type() was
exported but never in any public header file.
2017-05-15 23:14:12 +01:00
Nicolas Dufresne e7ede5a487 plugin: Unify static and dynamic plugin interface
This patch changes the entry point of each plugin in order to unify the
interface for static and dynamic plugin. What we do is replace the
current static plugin interface and extend the dymamic one. The plugin
entry was a C structure, name "gst_plugin_desc". With this patch, the
interface is now:

  GstPpluginDesc *gst_plugin_<name>_get_desc(void);

The reason we change the C structure into function, is that it is
potentially more common to have function pointers, avoiding possible
binding language limitation. Additionally to that. This change prevents
the symbols from clashing between plugins, allowing to build once the
plugin (assuming you have -fPIC).

On the plugin loader side, we symply derive the shared object basename
to extract the plugin name. If this symbol is not found, we fallback to
gst_plugin_desc for backward compatibility.

This has one side effect, which is that the shared objects now need to
be named after their plugin name. This is generally the case with few
exceptions. The benifit of this limitation is that you can control the
gst_plugin_<name>_desc clash at file level.

https://bugzilla.gnome.org/show_bug.cgi?id=779344
2017-05-09 08:48:19 -04:00
Xavier Claessens 46f83f5fcd core: Add g_autoptr() support to all types
https://bugzilla.gnome.org/show_bug.cgi?id=754464
2015-12-14 12:06:55 -05:00
Nicolas Dufresne c47e1383ca plugin: Add prefix support to dependencies
This adds a new flags, GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_PREFIX,
which allow using the names as prefix for plugin depencies.

https://bugzilla.gnome.org/show_bug.cgi?id=758083
2015-11-25 14:26:11 -05:00
Nicolas Dufresne 781865e0da doc: Cannot reference GST_PACKAGE_RELEASE_DATETIME
So simply remove the % sign.
2015-06-13 21:02:20 -04:00
Evan Nemerson 4088363aea introspection: add some missing allow-none annotations to in params
https://bugzilla.gnome.org/show_bug.cgi?id=730957
2014-06-26 19:00:58 +02:00
Evan Nemerson e10266e3f3 docs: convert NULL, TRUE, and FALSE to %NULL, %TRUE, and %FALSE
This should help improve documentation generated for
languages other than C.

https://bugzilla.gnome.org/show_bug.cgi?id=730961
2014-05-30 00:20:27 +01:00
Sebastian Rasmussen 53ae1b2c9c docs: Fix typos in function/object descriptions
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=720029
2013-12-07 17:11:12 +00:00
Tim-Philipp Müller 9f669e5ea5 docs: cosmetic since marker fixes 2013-11-16 16:09:40 +00:00
Sebastian Dröge 18a7a1d062 gst: Add better support for static plugins
API: GST_PLUGIN_STATIC_DECLARE()
API: GST_PLUGIN_STATIC_REGISTER()

Based on a patch by Håvard Graff <havard.graff@tandberg.com>.

This now allows GST_PLUGIN_DEFINE() to create a static plugin if
GST_PLUGIN_BUILD_STATIC is defined. The resulting plugin can be
statically linked or dynamically linked during compilation but
can't be dynamically loaded during runtime.

Also adds GST_PLUGIN_STATIC_DECLARE() and GST_PLUGIN_STATIC_REGISTER(),
which allows to register a static linked plugin easily.
It is still required to manually register every single statically linked
plugin from inside the application as this can't be automated in a portable
way.

A new configure parameter --enable-static-plugins was added that allows
to build all plugins we build here as static plugins.

Fixes bug #667305.
2013-04-15 15:52:18 +02:00
Gwenole Beauchesne f43b756f39 plugin: fix name expansion for GST_PLUGIN_DEFINE macro
Make GST_PLUGIN_DEFINE use G_STRINGIFY() to convert the name argument
into a meaningful string. The advantage of this is that `name' can be
expanded from other macros defined in the plug-in element.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=697872
2013-04-13 11:40:26 +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
Edward Hervey d3ffa82639 Remove 0.10-related documentation and "Since" markers 2012-07-10 12:03:27 +02:00
Tim-Philipp Müller e75f68ea57 docs: remove reference to removed API in plugin docs 2012-04-29 20:06:58 +01:00
Tim-Philipp Müller 4889fd6b6f plugin: remove gst_plugin_name_filter
It's only used internally, most other users will likely
want to use gst_registry_find_plugin() directly instead
(and if not, they can easily walk the list and doing the
strcmp themselves).
2012-04-29 18:35:11 +01:00
Tim-Philipp Müller c7eca5ca15 plugin: use GstObject flags for plugin flags 2012-04-29 17:46:32 +01:00
Tim-Philipp Müller 19d4c0ba73 plugin: make GstPlugin object structure opaque for now
There's no reason anyone would want to derive from this, so
just make opaque until we manage to make all the private bits
private properly (which I'm not doing right now because it's
more invasive and I have registry modifications locally which
touch all that code as well).
2012-04-29 17:03:32 +01:00
Tim-Philipp Müller 3954fdcb0d plugin: remove gst_plugin_get_module()
This is an implementation detail really, and it's not
clear what anyone would do with this. It's unused as
far as I'm aware, so just remove it for now.
2012-04-29 16:46:55 +01:00
Tim-Philipp Müller fb158cb994 plugin: add accessor for release date time string in plugin description
API: gst_plugin_get_release_date_string()
2012-04-29 16:20:50 +01:00
Sebastian Dröge aca083c56d gst: Change name parameter of GST_PLUGIN_DEFINE() to not take a string anymore
This will be needed when we later add support for static linking
of plugins without introducing new API or changing existing API.
2012-04-05 14:17:16 +02:00
Wim Taymans 4a7c3b929a .h: fix header files
Ensure correct indentation and :retab.
Make sure all structures have padding
Fix up some old ABI additions.
2011-11-11 17:30:03 +01:00
Wim Taymans 2d28891528 Merge branch 'master' into 0.11
Conflicts:
	gst/gstelementfactory.c
	gst/gstelementfactory.h
	gst/gstpad.h
	gst/gstpluginfeature.c
	gst/gstpluginfeature.h
2011-06-10 12:09:49 +02:00
Javier Jardón 5d25e4a204 Use "const" instead G_CONST_RETURN
G_CONST_RETURN will be deprecated soon.

https://bugzilla.gnome.org/show_bug.cgi?id=652211
2011-06-09 17:54:27 +01:00
Stefan Kost 01d8d7d718 deprecation-guards: fixup for commit 9ff4ec3104
Remove the deprecation guards for GST_PLUGIN_DEFINE_STATIC again (even though it
is deprecated) as we use it in the tests. Remove "_" for intlinkfunc.
2011-05-20 15:50:30 +03:00
Stefan Kost 9ff4ec3104 docs: add deprecation guards
Move GstPadIntLinkFunction to private header to avoid a dozen #ifdefs. Use a
gpointer in public header instead.
2011-05-18 09:55:57 +03:00
Wim Taymans 5dd9ab1cab cleanups
Fix padding, remove deprecated symbols.
2011-02-22 16:04:12 +01:00
Wim Taymans a0ed044de8 plugin: remove deprecated methods
Remove more deprecated methods and fix unit test.
2010-12-07 15:31:27 +01:00
Wim Taymans 993eda5004 remove deprecated symbols and methods 2010-12-06 19:18:31 +01:00
Tim-Philipp Müller 8c72758ec2 plugin: add release datetime field to GstPluginDesc and set it if GST_PACKAGE_RELEASE_DATETIME is defined
This is a string describing a date and/or date/time in a simple subset of
the ISO-8601 format, namely either "YYYY-MM-DD" or "YYYY-MM-DDTHH:MMZ" (with
'T' the date/time separator and the 'Z' indicating UTC).

The main purpose of this field is to keep track of plugin and element versions
on an absolute timeline, so it's possible to determine which one is newer when
comparing two date time numbers. This will allow us to express 'replaces'-type
relationships betweeen plugins and element factories in future, even across
different modules and plugin merges or splits (source module version numbers
aren't particularly useful here, since they can only meaningfully be compared
within the same module). It also allows applications and libraries to reliably
check that a plugin is recent enough without making assumptions about modules
or module versions.

We use a string here to keep things simple and clear, esp. on the build system
side of things.

https://bugzilla.gnome.org/show_bug.cgi?id=623040
2010-07-23 17:00:56 +01:00
Benjamin Otte 7c1d33a8a3 Add some 0.11 FIXMEs for GstPluginInitFunc
See 8fe63000de for why having a TRUE/FALSE
return value is a bad idea.
I've scanned a few plugins and they generally get it wrong and aren't
unloadable when they return FALSE.
2010-03-13 11:05:33 +01:00
Benjamin Otte a9d1a493a7 Fixes for -Wwrite-strings
This changes some APIs in compatible ways:
- Some functions now take "const char *" arguments, not "char *"
- Some structs now have "conts char *" members, not "char *"
The changes may cause warnings when compiling with the right warning
flags. You've been warned.

Also adds -Wwrite-strings as a warning flag in configure.ac.

https://bugzilla.gnome.org/show_bug.cgi?id=611692
2010-03-10 20:50:10 +01:00
Stefan Kost 85d85f9d36 docs: add missing parameter docs 2009-11-27 14:18:39 +02:00
Stefan Kost 1b5391fb47 docs: add docs for GstPluginFlags
This also makes links to them work.
2009-11-27 14:18:38 +02:00
Stefan Kost 23da3639f0 docs: fix xrefs in docs
Fix typos in xrefs, links to non existing functions and rework plural forms.
2009-11-25 16:59:50 +02:00
David Schleef 7537505ed0 gstplugin: Add C++ escape for gst_plugin_desc define
In order to properly export the gst_plugin_desc symbol
from DLLs in MSVC, it needs to be extern "C".
2009-11-19 18:04:56 +01:00
Jan Schmidt ef32c11e6e Add restarting of the plugin loader and blacklisting of broken files 2009-10-06 19:51:42 +01:00
Stefan Kost ed88db818b registry: allow plugins to cache extra data in registry. Fixes #570233
Add a GstStructure to GstPlugin. Plugins can retieve it in plugin_init and
access the cached info or build the cache and store it there.
2009-06-07 23:48:59 +03:00
José Alburquerque 7ff2f9233f API: Add gst_plugin_register_static_full()
This is mainly useful for bindings that need to provide
some additional user data to the registration function.

Fixes bug #545787.
2009-05-12 09:02:45 +02:00
Stefan Kost f963f7f14d Document that GST_PLUGIN_DEFINE macros use PACKAGE define. Fixes #559722.
PACKAGE is defined by autofoo. If people use something different, they might want to define it themself.
2009-01-25 22:11:32 +02:00
Tim-Philipp Müller 2ae03ba72f Add API for making a GStreamer plugin 'dependent' on external files, directories or environment variables, so that GS...
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt::
* gst/gst_private.h: (GstPluginDep), (_GstPluginPrivate):
* gst/gstplugin.c: (gst_plugin_init), (gst_plugin_finalize),
(gst_plugin_class_init), (gst_plugin_list_free),
(gst_plugin_ext_dep_get_env_vars_hash),
(_priv_plugin_deps_env_vars_changed),
(gst_plugin_ext_dep_extract_env_vars_paths),
(gst_plugin_ext_dep_get_hash_from_stat_entry),
(gst_plugin_ext_dep_direntry_matches),
(gst_plugin_ext_dep_scan_dir_and_match_names),
(gst_plugin_ext_dep_scan_path_with_filenames),
(gst_plugin_ext_dep_get_stat_hash),
(_priv_plugin_deps_files_changed), (gst_plugin_ext_dep_free),
(gst_plugin_ext_dep_strv_equal), (gst_plugin_ext_dep_equals),
(gst_plugin_add_dependency), (gst_plugin_add_dependency_simple):
* gst/gstplugin.h: (GstPluginPrivate), (GstPluginFlags),
(GST_PLUGIN_DEPENDENCY_FLAG_NONE),
(GST_PLUGIN_DEPENDENCY_FLAG_RECURSE),
(GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_DEFAULT_ONLY),
(GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX),
(GstPluginDependencyFlags), (GstPluginFilter):
* gst/gstregistry.c: (gst_registry_scan_path_level):
* gst/gstregistrybinary.c: (gst_registry_binary_save_feature),
(gst_registry_binary_save_plugin_dep),
(gst_registry_binary_save_plugin),
(gst_registry_binary_load_feature),
(gst_registry_binary_load_plugin_dep_strv),
(gst_registry_binary_load_plugin_dep),
(gst_registry_binary_load_plugin):
* gst/gstregistrybinary.h: (GST_MAGIC_BINARY_VERSION_STR),
(GstBinaryPluginElement), (_GstBinaryDep), (GstBinaryDep):
* gst/gstregistryxml.c: (gst_registry_xml_save_plugin):
Add API for making a GStreamer plugin 'dependent' on external files,
directories or environment variables, so that GStreamer knows when
it needs to re-load GStreamer plugins that wrap other plugin systems.
Fixes bug #350477.
API: add gst_plugin_add_dependency()
API: add gst_plugin_add_dependency_simple()
2009-01-06 17:58:59 +00:00
Tim-Philipp Müller f1850d1fee gst/gstplugin.h: Remove deprecation guards around GST_PLUGIN_DEFINE_STATIC.
Original commit message from CVS:
* gst/gstplugin.h: (GST_PLUGIN_DEFINE_STATIC):
Remove deprecation guards around GST_PLUGIN_DEFINE_STATIC.
This makes gtk-doc complain, but results in slightly better
compiler errors. The old _gst_plugin_register_static() is
still guarded, so there'll be a compiler warning about that
instead. Fixes #510187 too.
2008-01-17 22:22:58 +00:00
Tim-Philipp Müller 33cd142292 gst/: Change API of gst_plugin_register_static() to not take a GstPluginDesc, but rather just take all the arguments ...
Original commit message from CVS:
* gst/gst.c: (init_post):
* gst/gstplugin.c: (_gst_plugin_register_static),
(gst_plugin_register_static), (_gst_plugin_initialize):
* gst/gstplugin.h: (GstPluginFilter):
Change API of gst_plugin_register_static() to not take
a GstPluginDesc, but rather just take all the arguments
in a GstPluginDesc directly. This is more intuitive and
avoids certain mistakes when porting code from
GST_PLUGIN_DEFINE_STATIC to gst_plugin_register_static().
Fixes #510187.
* tests/check/gst/gstplugin.c:
Fix up for changed API.
2008-01-17 22:17:15 +00:00
Tim-Philipp Müller 4a3f163052 API: add gst_plugin_register_static() and deprecate
Original commit message from CVS:
* docs/gst/gstreamer-sections.txt:
* gst/gst.c: (init_post):
* gst/gstplugin.c: (_gst_plugin_register_static),
(gst_plugin_register_static), (_gst_plugin_initialize),
(gst_plugin_register_func):
* gst/gstplugin.h: (GST_PLUGIN_DEFINE_STATIC):
API: add gst_plugin_register_static() and deprecate
GST_PLUGIN_DEFINE_STATIC, since it's not portable
(#498924).
Also, in _gst_plugin_register_static(), make sure to call
g_thread_init() before calling GLib functions such as
g_list_append() if we're not initialised yet, since that
may lead to random crashes with older GSlice/GLib versions.
* tests/check/gst/gstplugin.c:
Adapt unit test to above changes.
2008-01-09 18:23:39 +00:00
Tim-Philipp Müller 4e121ae147 gst/: Move declaration of private _gst_foo_initialize() functions into our private header file where they should have...
Original commit message from CVS:
* gst/gst_private.h:
* gst/gstbuffer.h:
* gst/gstevent.h:
* gst/gstformat.h:
* gst/gstmessage.h:
* gst/gstplugin.h:
* gst/gstquery.h:
* gst/gsttaglist.h:
* gst/gstvalue.h:
Move declaration of private _gst_foo_initialize() functions into
our private header file where they should have been all along.
2007-11-02 18:35:37 +00:00
Tim-Philipp Müller 46283255e4 gst/gstplugin.h: Cast description string constants in GST_PLUGIN_DEFINE macros to a (gchar*) to make C++ code using t...
Original commit message from CVS:
* gst/gstplugin.h:
Cast description string constants in GST_PLUGIN_DEFINE macros
to a (gchar*) to make C++ code using these macros compile
without warning with g++-4.2 (see #462737).  Even if slightly
ugly, this seems preferable to putting the description strings
into the GLib quark table or making the structure member a
const gchar * and doing casts in core code that allocs and
frees these strings, or requiring a cast in the C++ code.
2007-10-10 10:53:39 +00:00
Tim-Philipp Müller a90dc9f01a gst/: Put more strings into the GLib quark table. No need to keep a hundred-something copies of identical version str...
Original commit message from CVS:
* gst/gstplugin.c:
* gst/gstplugin.h:
* gst/gstregistrybinary.c:
* gst/gstregistryxml.c:
Put more strings into the GLib quark table. No need to keep
a hundred-something copies of identical version strings,
license strings, package name strings and package origin
strings around.
2007-10-09 14:18:39 +00:00