plugin: remove deprecated methods

Remove more deprecated methods and fix unit test.
This commit is contained in:
Wim Taymans 2010-12-07 15:31:27 +01:00
parent a1500eeeb2
commit a0ed044de8
2 changed files with 0 additions and 124 deletions

View file

@ -272,53 +272,6 @@ GST_PLUGIN_EXPORT GstPluginDesc gst_plugin_desc = { \
}; \
G_END_DECLS
/**
* GST_PLUGIN_DEFINE_STATIC:
* @major: major version number of the gstreamer-core that plugin was compiled for
* @minor: minor version number of the gstreamer-core that plugin was compiled for
* @name: short, but unique name of the plugin
* @description: information about the purpose of the plugin
* @init: function pointer to the plugin_init method with the signature of <code>static gboolean plugin_init (GstPlugin * plugin)</code>.
* @version: full version string (e.g. VERSION from config.h)
* @license: under which licence the package has been released, e.g. GPL, LGPL.
* @package: the package-name (e.g. PACKAGE_NAME from config.h)
* @origin: a description from where the package comes from (e.g. the homepage URL)
*
* This macro needs to be used to define the entry point and meta data of a
* local plugin. One would use this macro to define a local plugin that can only
* be used by the own application.
*
* The macro uses a define named PACKAGE for the #GstPluginDesc.source field.
*
* Deprecated: Use gst_plugin_register_static() instead. This macro was
* deprecated because it uses constructors, which is a compiler feature not
* available on all compilers.
*
*/
/* We don't have deprecation guards here on purpose, it's enough to have
* deprecation guards around _gst_plugin_register_static(), and will result in
* much better error messages when compiling with -DGST_DISABLE_DEPRECATED */
#define GST_PLUGIN_DEFINE_STATIC(major,minor,name,description,init,version,license,package,origin) \
static void GST_GNUC_CONSTRUCTOR \
_gst_plugin_static_init__ ##init (void) \
{ \
static GstPluginDesc plugin_desc_ = { \
major, \
minor, \
name, \
(gchar *) description, \
init, \
version, \
license, \
PACKAGE, \
package, \
origin, \
NULL, \
GST_PADDING_INIT \
}; \
_gst_plugin_register_static (&plugin_desc_); \
}
/**
* GST_LICENSE_UNKNOWN:
*

View file

@ -25,67 +25,6 @@
#include <gst/check/gstcheck.h>
#ifdef GST_DISABLE_DEPRECATED
void _gst_plugin_register_static (GstPluginDesc * desc);
#endif
/* keep in sync with GST_GNUC_CONSTRUCTOR in gstmacros.h (ideally we'd just
* do it there, but I don't want to touch that now, and also we really want
* to deprecate this macro in the long run, I think) */
#if defined (__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4))
#define GST_GNUC_CONSTRUCTOR_DEFINED
#else
#undef GST_GNUC_CONSTRUCTOR_DEFINED
#endif
#ifdef GST_GNUC_CONSTRUCTOR_DEFINED
/* ------------------------------------------------------------------------- */
/* To make sure the old and deprecated GST_PLUGIN_DEFINE_STATIC still works */
static guint plugin_init_counter; /* 0 */
static gboolean
plugin1_init (GstPlugin * plugin)
{
++plugin_init_counter;
return TRUE;
}
static gboolean
plugin2_init (GstPlugin * plugin)
{
++plugin_init_counter;
return TRUE;
}
static gboolean
plugin3_init (GstPlugin * plugin)
{
++plugin_init_counter;
return TRUE;
}
GST_PLUGIN_DEFINE_STATIC (GST_VERSION_MAJOR, GST_VERSION_MINOR, "plugin-1",
"some static elements 1", plugin1_init, VERSION, GST_LICENSE, PACKAGE,
GST_PACKAGE_ORIGIN);
GST_PLUGIN_DEFINE_STATIC (GST_VERSION_MAJOR, GST_VERSION_MINOR, "plugin-2",
"some static elements 2", plugin2_init, VERSION, GST_LICENSE, PACKAGE,
GST_PACKAGE_ORIGIN);
GST_PLUGIN_DEFINE_STATIC (GST_VERSION_MAJOR, GST_VERSION_MINOR, "plugin-3",
"some static elements 3", plugin3_init, VERSION, GST_LICENSE, PACKAGE,
GST_PACKAGE_ORIGIN);
GST_START_TEST (test_old_register_static)
{
fail_unless (plugin_init_counter == 3);
}
GST_END_TEST;
#endif /* GST_GNUC_CONSTRUCTOR_DEFINED */
static gboolean
register_check_elements (GstPlugin * plugin)
@ -93,26 +32,10 @@ register_check_elements (GstPlugin * plugin)
return TRUE;
}
static GstPluginDesc plugin_desc = {
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"check elements",
"check elements",
register_check_elements,
VERSION,
GST_LICENSE,
PACKAGE,
GST_PACKAGE_NAME,
GST_PACKAGE_ORIGIN,
NULL,
GST_PADDING_INIT
};
GST_START_TEST (test_register_static)
{
GstPlugin *plugin;
_gst_plugin_register_static (&plugin_desc);
fail_unless (gst_plugin_register_static (GST_VERSION_MAJOR,
GST_VERSION_MINOR, "more-elements", "more-elements",
register_check_elements, VERSION, GST_LICENSE, PACKAGE,