update plugin initialization restructuring (see email for details

Original commit message from CVS:
update plugin initialization restructuring (see email for details
This commit is contained in:
Benjamin Otte 2003-10-31 19:32:47 +00:00
parent 37d3d6ec99
commit 907e3e97d9
129 changed files with 1921 additions and 1486 deletions

View file

@ -464,9 +464,31 @@ dnl ############################
dnl # Set up some more defines # dnl # Set up some more defines #
dnl ############################ dnl ############################
dnl Set location of registry dir. dnl set license and copyright notice
AC_DEFINE_UNQUOTED(GST_CACHE_DIR, "$GST_CACHE_DIR", [Define the registry directory]) AC_DEFINE(GST_LICENSE, "LGPL", [GStreamer license])
AC_SUBST(GST_CACHE_DIR) AC_DEFINE(GST_COPYRIGHT, "(c) 1999-2003 The GStreamer Team", [copyright message in plugins])
dnl package name in plugins
AC_ARG_WITH(package-name,
AC_HELP_STRING([--with-package-name],[specify package name to use in plugins]),
[case "${withval}" in
yes) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
*) GST_PACKAGE="${withval}" ;;
esac],
[GST_PACKAGE="Gstreamer"]) dnl Default value
AC_MSG_NOTICE(Using $GST_PACKAGE as package name)
AC_DEFINE_UNQUOTED(GST_PACKAGE, "$GST_PACKAGE", [package name in plugins])
dnl package origin URL
AC_ARG_WITH(package-origin,
AC_HELP_STRING([--with-package-origin],[specify package origin URL to use in plugins]),
[case "${withval}" in
yes) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
*) GST_ORIGIN="${withval}" ;;
esac],
[GST_ORIGIN="http://gstreamer.net"]) dnl Default value
AC_MSG_NOTICE(Using $GST_ORIGIN as package origin)
AC_DEFINE_UNQUOTED(GST_ORIGIN, "$GST_ORIGIN", [package origin])
dnl Set location of plugin directory dnl Set location of plugin directory
if test "x${prefix}" = "xNONE"; then if test "x${prefix}" = "xNONE"; then

View file

@ -23,18 +23,16 @@
#include <string.h> #include <string.h>
#include "example.h" #include "example.h"
/* The ElementDetails structure gives a human-readable description /* The ElementDetails structure gives a human-readable description of the
* of the plugin, as well as author and version data. * plugin, as well as author and version data. Use the GST_ELEMENT_DETAILS
* macro when defining it.
*/ */
static GstElementDetails example_details = { static GstElementDetails example_details = GST_ELEMENT_DETAILS (
"An example plugin", "An example plugin",
"Example/FirstExample", "Example/FirstExample",
"LGPL",
"Shows the basic structure of a plugin", "Shows the basic structure of a plugin",
"0.1", "your name <your.name@your.isp>"
"your name <your.name@your.isp>", );
"(C) 2001",
};
/* These are the signals that this element can fire. They are zero- /* These are the signals that this element can fire. They are zero-
* based because the numbers themselves are private to the object. * based because the numbers themselves are private to the object.
@ -186,6 +184,13 @@ gst_example_class_init (GstExampleClass *klass)
/* we also override the default state change handler with our own /* we also override the default state change handler with our own
* implementation */ * implementation */
gstelement_class->change_state = gst_example_change_state; gstelement_class->change_state = gst_example_change_state;
/* We can now provide the details for this element, that we defined earlier. */
gst_element_class_set_details (gstelement_class, &example_details);
/* The pad templates can be easily generated from the factories above,
* and then added to the list of padtemplates for the class.
*/
gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (sink_factory));
gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (src_factory));
} }
/* This function is responsible for initializing a specific instance of /* This function is responsible for initializing a specific instance of
@ -386,31 +391,20 @@ gst_example_change_state (GstElement *element)
* this function is called to register everything that the plugin provides. * this function is called to register everything that the plugin provides.
*/ */
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GstPlugin *plugin)
{ {
GstElementFactory *factory; /* We need to register each element we provide with the plugin. This consists
* of the name of the element, a rank that gives the importance of the element
/* We need to create an ElementFactory for each element we provide. * when compared to similar plugins and the GType identifier.
* This consists of the name of the element, the GType identifier,
* and a pointer to the details structure at the top of the file.
*/ */
factory = gst_element_factory_new("example", GST_TYPE_EXAMPLE, &example_details); if (!gst_element_register (plugin, "example", GST_RANK_MARGINAL, GST_TYPE_EXAMPLE))
g_return_val_if_fail(factory != NULL, FALSE); return FALSE;
/* The pad templates can be easily generated from the factories above,
* and then added to the list of padtemplates for the elementfactory.
*/
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (sink_factory));
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (src_factory));
/* The very last thing is to register the elementfactory with the plugin. */
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
/* Now we can return successfully. */ /* Now we can return successfully. */
return TRUE; return TRUE;
/* At this point, the GStreamer core registers the plugin, its /* At this point, the GStreamer core registers the plugin, its
* elementfactories, padtemplates, etc., for use in you application. * elementfactories, padtemplates, etc., for use in your application.
*/ */
} }
@ -421,12 +415,26 @@ plugin_init (GModule *module, GstPlugin *plugin)
* The symbol pointing to this structure is the only symbol looked up when * The symbol pointing to this structure is the only symbol looked up when
* loading the plugin. * loading the plugin.
*/ */
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, /* The major version of the core that this was built with */ GST_VERSION_MAJOR, /* The major version of the core that this was built with */
GST_VERSION_MINOR, /* The minor version of the core that this was built with */ GST_VERSION_MINOR, /* The minor version of the core that this was built with */
"example", /* The name of the plugin. This must be unique: plugins with "example", /* The name of the plugin. This must be unique: plugins with
* the same name will be assumed to be identical, and only * the same name will be assumed to be identical, and only
* one will be loaded. */ * one will be loaded. */
plugin_init /* Pointer to the initialisation function for the plugin. */ "an example plugin", /* a short description of the plugin in English */
}; plugin_init, /* Pointer to the initialisation function for the plugin. */
"0.1", /* The version number of the plugin */
"LGPL", /* ieffective license the plugin can be shipped with. Must be
* valid for all libraries it links to, too. */
"(c) 2003 E. Xamplewriter",
/* Copyright holder for this plugin. This does not include
* the libraries it links to, contrary to the license. This
* field should be considered informational and not legally
* binding */
"my nifty plugin package",
/* package this plugin belongs to. */
"http://www.mydomain.com"
/* originating URL for this plugin. This is the place to look
* for updates, information and so on. */
);

View file

@ -28,15 +28,12 @@
GST_DEBUG_CATEGORY_STATIC(debug_category); GST_DEBUG_CATEGORY_STATIC(debug_category);
#define GST_CAT_DEFAULT debug_category #define GST_CAT_DEFAULT debug_category
GstElementDetails gst_autoplugcache_details = { GstElementDetails gst_autoplugcache_details = GST_ELEMENT_DETAILS (
"AutoplugCache", "AutoplugCache",
"Generic", "Generic",
"LGPL",
"Data cache for the dynamic autoplugger", "Data cache for the dynamic autoplugger",
VERSION, "Erik Walthinsen <omega@temple-baptist.com>"
"Erik Walthinsen <omega@temple-baptist.com>", );
"(C) 2001 RidgeRun, Inc. (www.ridgerun.com)",
};
#define GST_TYPE_AUTOPLUGCACHE \ #define GST_TYPE_AUTOPLUGCACHE \
(gst_autoplugcache_get_type()) (gst_autoplugcache_get_type())
@ -162,6 +159,7 @@ gst_autoplugcache_class_init (GstAutoplugCacheClass *klass)
gobject_class->get_property = gst_autoplugcache_get_property; gobject_class->get_property = gst_autoplugcache_get_property;
gstelement_class->change_state = gst_autoplugcache_change_state; gstelement_class->change_state = gst_autoplugcache_change_state;
gst_element_class_set_details (gstelement_class, &gst_autoplugcache_details);
} }
static void static void
@ -345,24 +343,25 @@ gst_autoplugcache_get_property (GObject *object, guint prop_id, GValue *value, G
} }
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GstPlugin *plugin)
{ {
GstElementFactory *factory;
GST_DEBUG_CATEGORY_INIT (debug_category, "AUTOPLUGCACHE", 0, "autoplugcache element"); GST_DEBUG_CATEGORY_INIT (debug_category, "AUTOPLUGCACHE", 0, "autoplugcache element");
factory = gst_element_factory_new ("autoplugcache", GST_TYPE_AUTOPLUGCACHE, if (!gst_element_register (plugin, "autoplugcache", GST_RANK_NONE, GST_TYPE_AUTOPLUGCACHE))
&gst_autoplugcache_details); return FALSE;
g_return_val_if_fail (factory != NULL, FALSE);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
return TRUE; return TRUE;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"autoplugcache", "autoplugcache",
plugin_init "an autoplug cache",
}; plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)

View file

@ -25,15 +25,12 @@
#include <gst/gst.h> #include <gst/gst.h>
GstElementDetails gst_autoplugger_details = { GstElementDetails gst_autoplugger_details = GST_ELEMENT_DETAILS (
"Dynamic autoplugger", "Dynamic autoplugger",
"Generic", "Generic",
"LGPL",
"Magic element that converts from any type to any other", "Magic element that converts from any type to any other",
VERSION, "Erik Walthinsen <omega@temple-baptist.com>"
"Erik Walthinsen <omega@temple-baptist.com>", );
"(C) 2001 RidgeRun, Inc. (www.ridgerun.com)",
};
#define GST_TYPE_AUTOPLUGGER \ #define GST_TYPE_AUTOPLUGGER \
(gst_autoplugger_get_type()) (gst_autoplugger_get_type())
@ -164,6 +161,7 @@ gst_autoplugger_class_init (GstAutopluggerClass *klass)
gobject_class->get_property = gst_autoplugger_get_property; gobject_class->get_property = gst_autoplugger_get_property;
/* gstelement_class->change_state = gst_autoplugger_change_state; */ /* gstelement_class->change_state = gst_autoplugger_change_state; */
gst_element_class_set_details (gstelement_class, &gst_autoplugger_details);
} }
static void static void
@ -596,23 +594,24 @@ gst_autoplugger_get_property (GObject *object, guint prop_id, GValue *value, GPa
} }
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GstPlugin *plugin)
{ {
GstElementFactory *factory; if (!gst_element_register (plugin, "autoplugger", GST_RANK_NONE, GST_TYPE_AUTOPLUGGER))
return FALSE;
factory = gst_element_factory_new ("autoplugger", GST_TYPE_AUTOPLUGGER,
&gst_autoplugger_details);
g_return_val_if_fail (factory != NULL, FALSE);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
return TRUE; return TRUE;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"autoplugger", "autoplugger",
plugin_init "magic element that converts from any type tom any other",
}; plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)

View file

@ -352,17 +352,17 @@ gst_autoplug_sp (GstCaps *srccaps, GstCaps *sinkcaps, GList *factories)
GstAutoplugNode *node = g_new0 (GstAutoplugNode, 1); GstAutoplugNode *node = g_new0 (GstAutoplugNode, 1);
node->prev = NULL; node->prev = NULL;
node->fac = (GstElementFactory *) factories->data; node->fac = (GstElementFactory *) factories->data;
GST_DEBUG ("trying with %s", node->fac->details->longname); GST_DEBUG ("trying with %s", node->fac->details.longname);
node->templ = gst_autoplug_can_connect_src (node->fac, srccaps); node->templ = gst_autoplug_can_connect_src (node->fac, srccaps);
node->cost = (node->templ ? gst_autoplug_get_cost (node->fac) node->cost = (node->templ ? gst_autoplug_get_cost (node->fac)
: GST_AUTOPLUG_MAX_COST); : GST_AUTOPLUG_MAX_COST);
node->endpoint = gst_autoplug_can_connect_sink (node->fac, sinkcaps); node->endpoint = gst_autoplug_can_connect_sink (node->fac, sinkcaps);
if (node->templ && node->endpoint) if (node->templ && node->endpoint)
GST_DEBUG ("%s makes connection possible", GST_DEBUG ("%s makes connection possible",
node->fac->details->longname); node->fac->details.longname);
else else
GST_DEBUG ("direct connection with %s not possible", GST_DEBUG ("direct connection with %s not possible",
node->fac->details->longname); node->fac->details.longname);
if ((node->endpoint != NULL) && if ((node->endpoint != NULL) &&
((bestnode == NULL) || (node->cost < bestnode->cost))) ((bestnode == NULL) || (node->cost < bestnode->cost)))
{ {

View file

@ -153,6 +153,7 @@ gst_spider_class_init (GstSpiderClass *klass)
gobject_class->dispose = gst_spider_dispose; gobject_class->dispose = gst_spider_dispose;
gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (spider_src_factory)); gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (spider_src_factory));
gst_element_class_set_details (gstelement_class, &gst_spider_details);
gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR(gst_spider_request_new_pad); gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR(gst_spider_request_new_pad);
} }
@ -554,7 +555,8 @@ gst_spider_find_element_to_plug (GstElement *src, GstElementFactory *fac, GstPad
{ {
/* is the element the pad is linked to of the right type? */ /* is the element the pad is linked to of the right type? */
GstElement *element = GST_PAD_PARENT (pad); GstElement *element = GST_PAD_PARENT (pad);
if (GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS (element))->elementfactory == fac) {
if (G_TYPE_FROM_INSTANCE (element) == gst_element_factory_get_element_type (fac)) {
return element; return element;
} }
} }
@ -632,44 +634,35 @@ gst_spider_plug_from_srcpad (GstSpiderConnection *conn, GstPad *srcpad)
return result; return result;
} }
GstElementDetails gst_spider_details = { GstElementDetails gst_spider_details = GST_ELEMENT_DETAILS (
"Spider", "Spider",
"Generic", "Generic",
"LGPL",
"Automatically link sinks and sources", "Automatically link sinks and sources",
VERSION, "Benjamin Otte <in7y118@public.uni-hamburg.de>"
"Benjamin Otte <in7y118@public.uni-hamburg.de>", );
"(C) 2002",
};
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GstPlugin *plugin)
{ {
GstElementFactory *factory;
GST_DEBUG_CATEGORY_INIT (gst_spider_debug, "spider", 0, "spider autoplugging element"); GST_DEBUG_CATEGORY_INIT (gst_spider_debug, "spider", 0, "spider autoplugging element");
GST_DEBUG_CATEGORY_INIT (gst_spider_identity_debug, "spideridentity", 0, "spider autoplugging proxy element");
factory = gst_element_factory_new("spider", GST_TYPE_SPIDER, if (!gst_element_register (plugin, "spider", GST_RANK_SECONDARY, GST_TYPE_SPIDER))
&gst_spider_details); return FALSE;
gst_plugin_set_longname (plugin, "Spider autoplugging elements"); if (!gst_element_register (plugin, "spideridentity", GST_RANK_NONE, GST_TYPE_SPIDER_IDENTITY))
g_return_val_if_fail(factory != NULL, FALSE); return FALSE;
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (spider_src_factory));
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
/* add spideridentity */
factory = gst_element_factory_new ("spideridentity", GST_TYPE_SPIDER_IDENTITY,
&gst_spider_identity_details);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
return TRUE; return TRUE;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"gstspider", "gstspider",
plugin_init "a 1:n autoplugger",
}; plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)

View file

@ -27,18 +27,15 @@
#include "gstspideridentity.h" #include "gstspideridentity.h"
#include "gstspider.h" #include "gstspider.h"
GST_DEBUG_CATEGORY (gst_spider_identity_debug); GST_DEBUG_CATEGORY_STATIC (gst_spider_identity_debug);
#define GST_CAT_DEFAULT gst_spider_identity_debug #define GST_CAT_DEFAULT gst_spider_identity_debug
GstElementDetails gst_spider_identity_details = { static GstElementDetails gst_spider_identity_details = GST_ELEMENT_DETAILS (
"SpiderIdentity", "SpiderIdentity",
"Generic", "Generic",
"LGPL",
"Link between spider and outside elements", "Link between spider and outside elements",
VERSION, "Benjamin Otte <in7y118@public.uni-hamburg.de>"
"Benjamin Otte <in7y118@public.uni-hamburg.de>", );
"(C) 2002",
};
/* generic templates /* generic templates
@ -47,14 +44,14 @@ GstElementDetails gst_spider_identity_details = {
GST_PAD_TEMPLATE_FACTORY (spider_src_factory, GST_PAD_TEMPLATE_FACTORY (spider_src_factory,
"src", "src",
GST_PAD_SRC, GST_PAD_SRC,
GST_PAD_REQUEST, GST_PAD_ALWAYS,
NULL /* no caps */ NULL /* no caps */
); );
GST_PAD_TEMPLATE_FACTORY (spider_sink_factory, GST_PAD_TEMPLATE_FACTORY (spider_sink_factory,
"sink", "sink",
GST_PAD_SINK, GST_PAD_SINK,
GST_PAD_REQUEST, GST_PAD_ALWAYS,
NULL /* no caps */ NULL /* no caps */
); );
@ -108,7 +105,10 @@ gst_spider_identity_get_type (void)
0, 0,
(GInstanceInitFunc)gst_spider_identity_init, (GInstanceInitFunc)gst_spider_identity_init,
}; };
spider_identity_type = g_type_register_static (GST_TYPE_ELEMENT, "GstSpiderIdentity", &spider_identity_info, 0); spider_identity_type = g_type_register_static (GST_TYPE_ELEMENT, "GstSpiderIdentity",
&spider_identity_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_spider_identity_debug, "spideridentity",
0, "spider autoplugging proxy element");
} }
return spider_identity_type; return spider_identity_type;
} }
@ -123,6 +123,7 @@ gst_spider_identity_class_init (GstSpiderIdentityClass *klass)
/* add our two pad templates */ /* add our two pad templates */
gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (spider_src_factory)); gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (spider_src_factory));
gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (spider_sink_factory)); gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (spider_sink_factory));
gst_element_class_set_details (gstelement_class, &gst_spider_identity_details);
gstelement_class->change_state = GST_DEBUG_FUNCPTR(gst_spider_identity_change_state); gstelement_class->change_state = GST_DEBUG_FUNCPTR(gst_spider_identity_change_state);
gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR(gst_spider_identity_request_new_pad); gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR(gst_spider_identity_request_new_pad);
@ -156,7 +157,6 @@ gst_spider_identity_init (GstSpiderIdentity *ident)
/* variables */ /* variables */
ident->plugged = FALSE; ident->plugged = FALSE;
} }
static void static void

View file

@ -28,9 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_spider_identity_details;
GST_DEBUG_CATEGORY_EXTERN(gst_spider_identity_debug);
#define GST_TYPE_SPIDER_IDENTITY \ #define GST_TYPE_SPIDER_IDENTITY \
(gst_spider_identity_get_type()) (gst_spider_identity_get_type())
#define GST_SPIDER_IDENTITY(obj) \ #define GST_SPIDER_IDENTITY(obj) \

View file

@ -20,6 +20,10 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gststaticautoplug.h" #include "gststaticautoplug.h"
#include <gst/gst.h> #include <gst/gst.h>
@ -85,14 +89,12 @@ static void gst_static_autoplug_init(GstStaticAutoplug *autoplug) {
} }
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GstPlugin *plugin)
{ {
GstAutoplugFactory *factory; GstAutoplugFactory *factory;
GST_DEBUG_CATEGORY_INIT (debug_category, "STATIC_AUTOPLUG", 0, "static autoplugger element"); GST_DEBUG_CATEGORY_INIT (debug_category, "STATIC_AUTOPLUG", 0, "static autoplugger element");
gst_plugin_set_longname (plugin, "A static autoplugger");
factory = gst_autoplug_factory_new ("static", factory = gst_autoplug_factory_new ("static",
"A static autoplugger, it constructs the complete element before running it", "A static autoplugger, it constructs the complete element before running it",
gst_static_autoplug_get_type ()); gst_static_autoplug_get_type ());
@ -103,12 +105,18 @@ plugin_init (GModule *module, GstPlugin *plugin)
return TRUE; return TRUE;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"gststaticautoplug", "gststaticautoplug",
plugin_init "a static autoplugger",
}; plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
static gboolean static gboolean
gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest) gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest)

View file

@ -20,6 +20,10 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gststaticautoplugrender.h" #include "gststaticautoplugrender.h"
#include <gst/gst.h> #include <gst/gst.h>
@ -85,12 +89,10 @@ static void gst_static_autoplug_render_init(GstStaticAutoplugRender *autoplug) {
} }
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GstPlugin *plugin)
{ {
GstAutoplugFactory *factory; GstAutoplugFactory *factory;
gst_plugin_set_longname (plugin, "A static autoplugger");
GST_DEBUG_CATEGORY_INIT (debug_category, "STATIC_AUTOPLUG", 0, "static autoplug render element"); GST_DEBUG_CATEGORY_INIT (debug_category, "STATIC_AUTOPLUG", 0, "static autoplug render element");
factory = gst_autoplug_factory_new ("staticrender", factory = gst_autoplug_factory_new ("staticrender",
@ -106,12 +108,18 @@ plugin_init (GModule *module, GstPlugin *plugin)
return TRUE; return TRUE;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"gststaticautoplugrender", "gststaticautoplugrender",
plugin_init "a static autoplugger",
}; plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
static GstPadTemplate* static GstPadTemplate*
gst_autoplug_match_caps (GstElementFactory *factory, GstPadDirection direction, GstCaps *caps) gst_autoplug_match_caps (GstElementFactory *factory, GstPadDirection direction, GstCaps *caps)

View file

@ -26,18 +26,15 @@
#include "gstaggregator.h" #include "gstaggregator.h"
GST_DEBUG_CATEGORY (gst_aggregator_debug); GST_DEBUG_CATEGORY_STATIC (gst_aggregator_debug);
#define GST_CAT_DEFAULT gst_aggregator_debug #define GST_CAT_DEFAULT gst_aggregator_debug
GstElementDetails gst_aggregator_details = { GstElementDetails gst_aggregator_details = GST_ELEMENT_DETAILS (
"Aggregator pipe fitting", "Aggregator pipe fitting",
"Generic", "Generic",
"LGPL",
"N-to-1 pipe fitting", "N-to-1 pipe fitting",
VERSION, "Wim Taymans <wim.taymans@chello.be>"
"Wim Taymans <wim.taymans@chello.be>", );
"(C) 2001",
};
/* Aggregator signals and args */ /* Aggregator signals and args */
enum { enum {
@ -80,6 +77,7 @@ gst_aggregator_sched_get_type (void)
#define AGGREGATOR_IS_LOOP_BASED(ag) ((ag)->sched != AGGREGATOR_CHAIN) #define AGGREGATOR_IS_LOOP_BASED(ag) ((ag)->sched != AGGREGATOR_CHAIN)
static void gst_aggregator_base_init (gpointer g_class);
static void gst_aggregator_class_init (GstAggregatorClass *klass); static void gst_aggregator_class_init (GstAggregatorClass *klass);
static void gst_aggregator_init (GstAggregator *aggregator); static void gst_aggregator_init (GstAggregator *aggregator);
@ -106,7 +104,7 @@ gst_aggregator_get_type (void)
if (!aggregator_type) { if (!aggregator_type) {
static const GTypeInfo aggregator_info = { static const GTypeInfo aggregator_info = {
sizeof(GstAggregatorClass), sizeof(GstAggregatorClass),
NULL, gst_aggregator_base_init,
NULL, NULL,
(GClassInitFunc)gst_aggregator_class_init, (GClassInitFunc)gst_aggregator_class_init,
NULL, NULL,
@ -116,10 +114,19 @@ gst_aggregator_get_type (void)
(GInstanceInitFunc)gst_aggregator_init, (GInstanceInitFunc)gst_aggregator_init,
}; };
aggregator_type = g_type_register_static (GST_TYPE_ELEMENT, "GstAggregator", &aggregator_info, 0); aggregator_type = g_type_register_static (GST_TYPE_ELEMENT, "GstAggregator", &aggregator_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_aggregator_debug, "aggregator", 0, "aggregator element");
} }
return aggregator_type; return aggregator_type;
} }
static void
gst_aggregator_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (aggregator_src_factory));
gst_element_class_set_details (gstelement_class, &gst_aggregator_details);
}
static void static void
gst_aggregator_class_init (GstAggregatorClass *klass) gst_aggregator_class_init (GstAggregatorClass *klass)
{ {
@ -360,11 +367,4 @@ gst_aggregator_chain (GstPad *pad, GstData *_data)
gst_aggregator_push (aggregator, pad, buf, "chain"); gst_aggregator_push (aggregator, pad, buf, "chain");
} }
gboolean
gst_aggregator_factory_init (GstElementFactory *factory)
{
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (aggregator_src_factory));
return TRUE;
}

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_aggregator_details;
GST_DEBUG_CATEGORY_EXTERN(gst_aggregator_debug);
typedef enum { typedef enum {
AGGREGATOR_LOOP = 1, AGGREGATOR_LOOP = 1,

View file

@ -25,7 +25,7 @@
#include "gstbufferstore.h" #include "gstbufferstore.h"
#include <string.h> #include <string.h>
GST_DEBUG_CATEGORY (gst_buffer_store_debug); GST_DEBUG_CATEGORY_STATIC (gst_buffer_store_debug);
#define GST_CAT_DEFAULT gst_buffer_store_debug #define GST_CAT_DEFAULT gst_buffer_store_debug
enum { enum {

View file

@ -46,9 +46,8 @@
struct _elements_entry { struct _elements_entry {
gchar *name; gchar *name;
guint rank;
GType (*type) (void); GType (*type) (void);
GstElementDetails *details;
gboolean (*factoryinit) (GstElementFactory *factory);
}; };
@ -56,75 +55,48 @@ extern GType gst_filesrc_get_type(void);
extern GstElementDetails gst_filesrc_details; extern GstElementDetails gst_filesrc_details;
static struct _elements_entry _elements[] = { static struct _elements_entry _elements[] = {
{ "aggregator", gst_aggregator_get_type, &gst_aggregator_details, gst_aggregator_factory_init }, { "aggregator", GST_RANK_PRIMARY, gst_aggregator_get_type },
{ "fakesrc", gst_fakesrc_get_type, &gst_fakesrc_details, gst_fakesrc_factory_init }, { "fakesrc", GST_RANK_PRIMARY, gst_fakesrc_get_type },
{ "fakesink", gst_fakesink_get_type, &gst_fakesink_details, gst_fakesink_factory_init }, { "fakesink", GST_RANK_PRIMARY, gst_fakesink_get_type },
{ "fdsink", gst_fdsink_get_type, &gst_fdsink_details, NULL }, { "fdsink", GST_RANK_PRIMARY, gst_fdsink_get_type },
{ "fdsrc", gst_fdsrc_get_type, &gst_fdsrc_details, NULL }, { "fdsrc", GST_RANK_PRIMARY, gst_fdsrc_get_type },
{ "filesrc", gst_filesrc_get_type, &gst_filesrc_details, NULL }, { "filesrc", GST_RANK_PRIMARY, gst_filesrc_get_type },
{ "filesink", gst_filesink_get_type, &gst_filesink_details, NULL }, { "filesink", GST_RANK_PRIMARY, gst_filesink_get_type },
{ "identity", gst_identity_get_type, &gst_identity_details, NULL }, { "identity", GST_RANK_PRIMARY, gst_identity_get_type },
{ "md5sink", gst_md5sink_get_type, &gst_md5sink_details, gst_md5sink_factory_init }, { "md5sink", GST_RANK_PRIMARY, gst_md5sink_get_type },
{ "multidisksrc", gst_multidisksrc_get_type, &gst_multidisksrc_details, NULL }, { "multidisksrc", GST_RANK_PRIMARY, gst_multidisksrc_get_type },
{ "pipefilter", gst_pipefilter_get_type, &gst_pipefilter_details, NULL }, { "pipefilter", GST_RANK_PRIMARY, gst_pipefilter_get_type },
{ "shaper", gst_shaper_get_type, &gst_shaper_details, gst_shaper_factory_init }, { "shaper", GST_RANK_PRIMARY, gst_shaper_get_type },
{ "statistics", gst_statistics_get_type, &gst_statistics_details, NULL }, { "statistics", GST_RANK_PRIMARY, gst_statistics_get_type },
{ "tee", gst_tee_get_type, &gst_tee_details, gst_tee_factory_init }, { "tee", GST_RANK_PRIMARY, gst_tee_get_type },
{ "typefind", gst_type_find_element_get_type, &gst_type_find_element_details, NULL }, { "typefind", GST_RANK_PRIMARY, gst_type_find_element_get_type },
{ NULL, 0 }, { NULL, 0 },
}; };
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GstPlugin *plugin)
{ {
GstElementFactory *factory; struct _elements_entry *my_elements = _elements;
gint i = 0;
while ((*my_elements).name) {
gst_plugin_set_longname (plugin, "Standard GST Elements"); if (!gst_element_register (plugin, (*my_elements).name, (*my_elements).rank, ((*my_elements).type) ()))
return FALSE;
GST_DEBUG_CATEGORY_INIT (gst_aggregator_debug, "aggregator", 0, "aggregator element"); my_elements++;
GST_DEBUG_CATEGORY_INIT (gst_fakesink_debug, "fakesink", 0, "fakesink element");
GST_DEBUG_CATEGORY_INIT (gst_fakesrc_debug, "fakesrc", 0, "fakesrc element");
GST_DEBUG_CATEGORY_INIT (gst_fdsink_debug, "fdsink", 0, "fdsink element");
GST_DEBUG_CATEGORY_INIT (gst_fdsrc_debug, "fdsrc", 0, "fdsrc element");
GST_DEBUG_CATEGORY_INIT (gst_filesink_debug, "filesink", 0, "filesink element");
GST_DEBUG_CATEGORY_INIT (gst_filesrc_debug, "filesrc", 0, "filesrc element");
GST_DEBUG_CATEGORY_INIT (gst_identity_debug, "identity", 0, "identity element");
GST_DEBUG_CATEGORY_INIT (gst_md5sink_debug, "md5sink", 0, "md5sink element");
GST_DEBUG_CATEGORY_INIT (gst_multidisksrc_debug, "multidisksrc", 0, "multidisksrc element");
GST_DEBUG_CATEGORY_INIT (gst_pipefilter_debug, "pipefilter", 0, "pipefilter element");
GST_DEBUG_CATEGORY_INIT (gst_shaper_debug, "shaper", 0, "shaper element");
GST_DEBUG_CATEGORY_INIT (gst_statistics_debug, "statistics", 0, "statistics element");
GST_DEBUG_CATEGORY_INIT (gst_tee_debug, "tee", 0, "tee element");
GST_DEBUG_CATEGORY_INIT (gst_type_find_element_debug, "typefind", GST_DEBUG_BG_YELLOW | GST_DEBUG_FG_GREEN, "typefind element");
while (_elements[i].name) {
factory = gst_element_factory_new (_elements[i].name,
(_elements[i].type) (),
_elements[i].details);
if (!factory)
{
g_warning ("gst_element_factory_new failed for `%s'",
_elements[i].name);
continue;
}
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
if (_elements[i].factoryinit) {
_elements[i].factoryinit (factory);
}
/* g_print("added factory '%s'\n",_elements[i].name); */
i++;
} }
/* INFO (GST_INFO_PLUGIN_LOAD,"gstelements: loaded %d standard elements", i);*/
return TRUE; return TRUE;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"gstelements", "gstelements",
plugin_init "standard GStreamer elements",
}; plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)

View file

@ -27,18 +27,15 @@
#include "gstfakesink.h" #include "gstfakesink.h"
GST_DEBUG_CATEGORY (gst_fakesink_debug); GST_DEBUG_CATEGORY_STATIC (gst_fakesink_debug);
#define GST_CAT_DEFAULT gst_fakesink_debug #define GST_CAT_DEFAULT gst_fakesink_debug
GstElementDetails gst_fakesink_details = { GstElementDetails gst_fakesink_details = GST_ELEMENT_DETAILS (
"Fake Sink", "Fake Sink",
"Sink", "Sink",
"LGPL",
"Black hole for data", "Black hole for data",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>"
"Erik Walthinsen <omega@cse.ogi.edu>", );
"(C) 1999",
};
/* FakeSink signals and args */ /* FakeSink signals and args */
@ -87,6 +84,7 @@ gst_fakesink_state_error_get_type (void)
return fakesink_state_error_type; return fakesink_state_error_type;
} }
static void gst_fakesink_base_init (gpointer g_class);
static void gst_fakesink_class_init (GstFakeSinkClass *klass); static void gst_fakesink_class_init (GstFakeSinkClass *klass);
static void gst_fakesink_init (GstFakeSink *fakesink); static void gst_fakesink_init (GstFakeSink *fakesink);
@ -114,7 +112,8 @@ gst_fakesink_get_type (void)
if (!fakesink_type) { if (!fakesink_type) {
static const GTypeInfo fakesink_info = { static const GTypeInfo fakesink_info = {
sizeof(GstFakeSinkClass), NULL, sizeof(GstFakeSinkClass),
gst_fakesink_base_init,
NULL, NULL,
(GClassInitFunc)gst_fakesink_class_init, (GClassInitFunc)gst_fakesink_class_init,
NULL, NULL,
@ -124,10 +123,20 @@ gst_fakesink_get_type (void)
(GInstanceInitFunc)gst_fakesink_init, (GInstanceInitFunc)gst_fakesink_init,
}; };
fakesink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFakeSink", &fakesink_info, 0); fakesink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFakeSink", &fakesink_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_fakesink_debug, "fakesink", 0, "fakesink element");
} }
return fakesink_type; return fakesink_type;
} }
static void
gst_fakesink_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_fakesink_details);
gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (fakesink_sink_factory));
}
static void static void
gst_fakesink_class_init (GstFakeSinkClass *klass) gst_fakesink_class_init (GstFakeSinkClass *klass)
{ {
@ -411,10 +420,3 @@ error:
return GST_STATE_FAILURE; return GST_STATE_FAILURE;
} }
gboolean
gst_fakesink_factory_init (GstElementFactory *factory)
{
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (fakesink_sink_factory));
return TRUE;
}

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_fakesink_details;
GST_DEBUG_CATEGORY_EXTERN(gst_fakesink_debug);
#define GST_TYPE_FAKESINK \ #define GST_TYPE_FAKESINK \
(gst_fakesink_get_type()) (gst_fakesink_get_type())

View file

@ -34,19 +34,16 @@
#define DEFAULT_SIZEMAX 4096 #define DEFAULT_SIZEMAX 4096
#define DEFAULT_PARENTSIZE 4096*10 #define DEFAULT_PARENTSIZE 4096*10
GST_DEBUG_CATEGORY (gst_fakesrc_debug); GST_DEBUG_CATEGORY_STATIC (gst_fakesrc_debug);
#define GST_CAT_DEFAULT gst_fakesrc_debug #define GST_CAT_DEFAULT gst_fakesrc_debug
GstElementDetails gst_fakesrc_details = { GstElementDetails gst_fakesrc_details = GST_ELEMENT_DETAILS (
"Fake Source", "Fake Source",
"Source", "Source",
"LGPL",
"Push empty (no data) buffers around", "Push empty (no data) buffers around",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>, "
"Erik Walthinsen <omega@cse.ogi.edu>\n" "Wim Taymans <wim.taymans@chello.be>"
"Wim Taymans <wim.taymans@chello.be>", );
"(C) 1999",
};
/* FakeSrc signals and args */ /* FakeSrc signals and args */
@ -101,6 +98,8 @@ gst_fakesrc_output_get_type (void)
}; };
if (!fakesrc_output_type) { if (!fakesrc_output_type) {
fakesrc_output_type = g_enum_register_static ("GstFakeSrcOutput", fakesrc_output); fakesrc_output_type = g_enum_register_static ("GstFakeSrcOutput", fakesrc_output);
GST_DEBUG_CATEGORY_INIT (gst_fakesrc_debug, "fakesrc", 0, "fakesrc element");
} }
return fakesrc_output_type; return fakesrc_output_type;
} }
@ -158,6 +157,7 @@ gst_fakesrc_filltype_get_type (void)
return fakesrc_filltype_type; return fakesrc_filltype_type;
} }
static void gst_fakesrc_base_init (gpointer g_class);
static void gst_fakesrc_class_init (GstFakeSrcClass *klass); static void gst_fakesrc_class_init (GstFakeSrcClass *klass);
static void gst_fakesrc_init (GstFakeSrc *fakesrc); static void gst_fakesrc_init (GstFakeSrc *fakesrc);
@ -184,7 +184,7 @@ gst_fakesrc_get_type (void)
if (!fakesrc_type) { if (!fakesrc_type) {
static const GTypeInfo fakesrc_info = { static const GTypeInfo fakesrc_info = {
sizeof(GstFakeSrcClass), sizeof(GstFakeSrcClass),
NULL, gst_fakesrc_base_init,
NULL, NULL,
(GClassInitFunc)gst_fakesrc_class_init, (GClassInitFunc)gst_fakesrc_class_init,
NULL, NULL,
@ -198,6 +198,14 @@ gst_fakesrc_get_type (void)
return fakesrc_type; return fakesrc_type;
} }
static void
gst_fakesrc_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_fakesrc_details);
gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (fakesrc_src_factory));
}
static void static void
gst_fakesrc_class_init (GstFakeSrcClass *klass) gst_fakesrc_class_init (GstFakeSrcClass *klass)
{ {
@ -879,10 +887,3 @@ gst_fakesrc_change_state (GstElement *element)
return GST_STATE_SUCCESS; return GST_STATE_SUCCESS;
} }
gboolean
gst_fakesrc_factory_init (GstElementFactory *factory)
{
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (fakesrc_src_factory));
return TRUE;
}

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_fakesrc_details;
GST_DEBUG_CATEGORY_EXTERN(gst_fakesrc_debug);
typedef enum { typedef enum {
FAKESRC_FIRST_LAST_LOOP = 1, FAKESRC_FIRST_LAST_LOOP = 1,

View file

@ -27,18 +27,15 @@
#include "gstfdsink.h" #include "gstfdsink.h"
#include <unistd.h> #include <unistd.h>
GST_DEBUG_CATEGORY (gst_fdsink_debug); GST_DEBUG_CATEGORY_STATIC (gst_fdsink_debug);
#define GST_CAT_DEFAULT gst_fdsink_debug #define GST_CAT_DEFAULT gst_fdsink_debug
GstElementDetails gst_fdsink_details = { GstElementDetails gst_fdsink_details = GST_ELEMENT_DETAILS (
"Filedescriptor Sink", "Filedescriptor Sink",
"Sink/File", "Sink/File",
"LGPL",
"Write data to a file descriptor", "Write data to a file descriptor",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>"
"Erik Walthinsen <omega@cse.ogi.edu>", );
"(C) 1999",
};
/* FdSink signals and args */ /* FdSink signals and args */
@ -53,6 +50,7 @@ enum {
}; };
static void gst_fdsink_base_init (gpointer g_class);
static void gst_fdsink_class_init (GstFdSinkClass *klass); static void gst_fdsink_class_init (GstFdSinkClass *klass);
static void gst_fdsink_init (GstFdSink *fdsink); static void gst_fdsink_init (GstFdSink *fdsink);
@ -73,7 +71,8 @@ gst_fdsink_get_type (void)
if (!fdsink_type) { if (!fdsink_type) {
static const GTypeInfo fdsink_info = { static const GTypeInfo fdsink_info = {
sizeof(GstFdSinkClass), NULL, sizeof(GstFdSinkClass),
gst_fdsink_base_init,
NULL, NULL,
(GClassInitFunc)gst_fdsink_class_init, (GClassInitFunc)gst_fdsink_class_init,
NULL, NULL,
@ -83,16 +82,25 @@ gst_fdsink_get_type (void)
(GInstanceInitFunc)gst_fdsink_init, (GInstanceInitFunc)gst_fdsink_init,
}; };
fdsink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFdSink", &fdsink_info, 0); fdsink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFdSink", &fdsink_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_fdsink_debug, "fdsink", 0, "fdsink element");
} }
return fdsink_type; return fdsink_type;
} }
static void
gst_fdsink_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_fdsink_details);
}
static void static void
gst_fdsink_class_init (GstFdSinkClass *klass) gst_fdsink_class_init (GstFdSinkClass *klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
gobject_class = (GObjectClass*)klass; gobject_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT); parent_class = g_type_class_ref (GST_TYPE_ELEMENT);

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_fdsink_details;
GST_DEBUG_CATEGORY_EXTERN(gst_fdsink_debug);
#define GST_TYPE_FDSINK \ #define GST_TYPE_FDSINK \
(gst_fdsink_get_type()) (gst_fdsink_get_type())

View file

@ -35,19 +35,15 @@
#define DEFAULT_BLOCKSIZE 4096 #define DEFAULT_BLOCKSIZE 4096
GST_DEBUG_CATEGORY (gst_fdsrc_debug); GST_DEBUG_CATEGORY_STATIC (gst_fdsrc_debug);
#define GST_CAT_DEFAULT gst_fdsrc_debug #define GST_CAT_DEFAULT gst_fdsrc_debug
GstElementDetails gst_fdsrc_details = GstElementDetails gst_fdsrc_details = GST_ELEMENT_DETAILS (
{
"Disk Source", "Disk Source",
"Source/File", "Source/File",
"LGPL",
"Synchronous read from a file", "Synchronous read from a file",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>"
"Erik Walthinsen <omega@cse.ogi.edu>", );
"(C) 1999",
};
/* FdSrc signals and args */ /* FdSrc signals and args */
@ -62,7 +58,7 @@ enum {
ARG_BLOCKSIZE, ARG_BLOCKSIZE,
}; };
static void gst_fdsrc_base_init (gpointer g_class);
static void gst_fdsrc_class_init (GstFdSrcClass *klass); static void gst_fdsrc_class_init (GstFdSrcClass *klass);
static void gst_fdsrc_init (GstFdSrc *fdsrc); static void gst_fdsrc_init (GstFdSrc *fdsrc);
@ -85,7 +81,7 @@ gst_fdsrc_get_type (void)
if (!fdsrc_type) { if (!fdsrc_type) {
static const GTypeInfo fdsrc_info = { static const GTypeInfo fdsrc_info = {
sizeof(GstFdSrcClass), sizeof(GstFdSrcClass),
NULL, gst_fdsrc_base_init,
NULL, NULL,
(GClassInitFunc)gst_fdsrc_class_init, (GClassInitFunc)gst_fdsrc_class_init,
NULL, NULL,
@ -95,17 +91,26 @@ gst_fdsrc_get_type (void)
(GInstanceInitFunc)gst_fdsrc_init, (GInstanceInitFunc)gst_fdsrc_init,
}; };
fdsrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFdSrc", &fdsrc_info, 0); fdsrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFdSrc", &fdsrc_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_fdsrc_debug, "fdsrc", 0, "fdsrc element");
} }
return fdsrc_type; return fdsrc_type;
} }
static void
gst_fdsrc_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_fdsrc_details);
}
static void static void
gst_fdsrc_class_init (GstFdSrcClass *klass) gst_fdsrc_class_init (GstFdSrcClass *klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
gobject_class = (GObjectClass*)klass; gobject_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_ref(GST_TYPE_ELEMENT); parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD, g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD,

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_fdsrc_details;
GST_DEBUG_CATEGORY_EXTERN(gst_fdsrc_debug);
#define GST_TYPE_FDSRC \ #define GST_TYPE_FDSRC \
(gst_fdsrc_get_type()) (gst_fdsrc_get_type())

View file

@ -33,18 +33,15 @@
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
GST_DEBUG_CATEGORY (gst_filesink_debug); GST_DEBUG_CATEGORY_STATIC (gst_filesink_debug);
#define GST_CAT_DEFAULT gst_filesink_debug #define GST_CAT_DEFAULT gst_filesink_debug
GstElementDetails gst_filesink_details = { GstElementDetails gst_filesink_details = GST_ELEMENT_DETAILS (
"File Sink", "File Sink",
"Sink/File", "Sink/File",
"LGPL",
"Write stream to a file", "Write stream to a file",
VERSION, "Thomas <thomas@apestaart.org>"
"Thomas <thomas@apestaart.org>", );
"(C) 2001"
};
/* FileSink signals and args */ /* FileSink signals and args */
@ -69,6 +66,7 @@ GST_PAD_FORMATS_FUNCTION (gst_filesink_get_formats,
) )
static void gst_filesink_base_init (gpointer g_class);
static void gst_filesink_class_init (GstFileSinkClass *klass); static void gst_filesink_class_init (GstFileSinkClass *klass);
static void gst_filesink_init (GstFileSink *filesink); static void gst_filesink_init (GstFileSink *filesink);
@ -97,7 +95,8 @@ gst_filesink_get_type (void)
if (!filesink_type) { if (!filesink_type) {
static const GTypeInfo filesink_info = { static const GTypeInfo filesink_info = {
sizeof(GstFileSinkClass), NULL, sizeof(GstFileSinkClass),
gst_filesink_base_init,
NULL, NULL,
(GClassInitFunc)gst_filesink_class_init, (GClassInitFunc)gst_filesink_class_init,
NULL, NULL,
@ -107,20 +106,26 @@ gst_filesink_get_type (void)
(GInstanceInitFunc)gst_filesink_init, (GInstanceInitFunc)gst_filesink_init,
}; };
filesink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFileSink", &filesink_info, 0); filesink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFileSink", &filesink_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_filesink_debug, "filesink", 0, "filesink element");
} }
return filesink_type; return filesink_type;
} }
static void
gst_filesink_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gstelement_class->change_state = gst_filesink_change_state;
gst_element_class_set_details (gstelement_class, &gst_filesink_details);
}
static void static void
gst_filesink_class_init (GstFileSinkClass *klass) gst_filesink_class_init (GstFileSinkClass *klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *gstelement_class;
gobject_class = (GObjectClass*)klass; parent_class = g_type_class_peek_parent (klass);
gstelement_class = (GstElementClass*)klass;
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOCATION, g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOCATION,
g_param_spec_string ("location", "File Location", "Location of the file to write", g_param_spec_string ("location", "File Location", "Location of the file to write",
@ -133,8 +138,6 @@ gst_filesink_class_init (GstFileSinkClass *klass)
gobject_class->set_property = gst_filesink_set_property; gobject_class->set_property = gst_filesink_set_property;
gobject_class->get_property = gst_filesink_get_property; gobject_class->get_property = gst_filesink_get_property;
gstelement_class->change_state = gst_filesink_change_state;
} }
static void static void

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_filesink_details;
GST_DEBUG_CATEGORY_EXTERN(gst_filesink_debug);
#define GST_TYPE_FILESINK \ #define GST_TYPE_FILESINK \
(gst_filesink_get_type()) (gst_filesink_get_type())

View file

@ -72,18 +72,15 @@
*/ */
GST_DEBUG_CATEGORY (gst_filesrc_debug); GST_DEBUG_CATEGORY_STATIC (gst_filesrc_debug);
#define GST_CAT_DEFAULT gst_filesrc_debug #define GST_CAT_DEFAULT gst_filesrc_debug
GstElementDetails gst_filesrc_details = { GstElementDetails gst_filesrc_details = GST_ELEMENT_DETAILS (
"File Source", "File Source",
"Source/File", "Source/File",
"LGPL",
"Read from arbitrary point in a file", "Read from arbitrary point in a file",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>"
"Erik Walthinsen <omega@cse.ogi.edu>", );
"(C) 1999",
};
#define DEFAULT_BLOCKSIZE 4*1024 #define DEFAULT_BLOCKSIZE 4*1024
#define DEFAULT_MMAPSIZE 4*1024*1024 #define DEFAULT_MMAPSIZE 4*1024*1024
@ -121,6 +118,7 @@ GST_PAD_FORMATS_FUNCTION (gst_filesrc_get_formats,
GST_FORMAT_BYTES GST_FORMAT_BYTES
) )
static void gst_filesrc_base_init (gpointer g_class);
static void gst_filesrc_class_init (GstFileSrcClass *klass); static void gst_filesrc_class_init (GstFileSrcClass *klass);
static void gst_filesrc_init (GstFileSrc *filesrc); static void gst_filesrc_init (GstFileSrc *filesrc);
static void gst_filesrc_dispose (GObject *object); static void gst_filesrc_dispose (GObject *object);
@ -148,7 +146,8 @@ gst_filesrc_get_type(void)
if (!filesrc_type) { if (!filesrc_type) {
static const GTypeInfo filesrc_info = { static const GTypeInfo filesrc_info = {
sizeof(GstFileSrcClass), NULL, sizeof(GstFileSrcClass),
gst_filesrc_base_init,
NULL, NULL,
(GClassInitFunc)gst_filesrc_class_init, (GClassInitFunc)gst_filesrc_class_init,
NULL, NULL,
@ -158,20 +157,28 @@ gst_filesrc_get_type(void)
(GInstanceInitFunc)gst_filesrc_init, (GInstanceInitFunc)gst_filesrc_init,
}; };
filesrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFileSrc", &filesrc_info, 0); filesrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFileSrc", &filesrc_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_filesrc_debug, "filesrc", 0, "filesrc element");
} }
return filesrc_type; return filesrc_type;
} }
static void
gst_filesrc_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_filesrc_details);
}
static void static void
gst_filesrc_class_init (GstFileSrcClass *klass) gst_filesrc_class_init (GstFileSrcClass *klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *gstelement_class; GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
gobject_class = (GObjectClass*)klass; gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
parent_class = g_type_class_ref (GST_TYPE_ELEMENT); parent_class = g_type_class_peek_parent (klass);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD, g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD,
g_param_spec_int ("fd", "File-descriptor", "File-descriptor for the file being mmap()d", g_param_spec_int ("fd", "File-descriptor", "File-descriptor for the file being mmap()d",

View file

@ -30,8 +30,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_filesrc_details;
GST_DEBUG_CATEGORY_EXTERN(gst_filesrc_debug);
#define GST_TYPE_FILESRC \ #define GST_TYPE_FILESRC \
(gst_filesrc_get_type()) (gst_filesrc_get_type())

View file

@ -29,18 +29,15 @@
#include "gstidentity.h" #include "gstidentity.h"
GST_DEBUG_CATEGORY (gst_identity_debug); GST_DEBUG_CATEGORY_STATIC (gst_identity_debug);
#define GST_CAT_DEFAULT gst_identity_debug #define GST_CAT_DEFAULT gst_identity_debug
GstElementDetails gst_identity_details = { GstElementDetails gst_identity_details = GST_ELEMENT_DETAILS (
"Identity", "Identity",
"Generic", "Generic",
"LGPL",
"Pass data without modification", "Pass data without modification",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>"
"Erik Walthinsen <omega@cse.ogi.edu>", );
"(C) 1999",
};
/* Identity signals and args */ /* Identity signals and args */
@ -64,6 +61,7 @@ enum {
}; };
static void gst_identity_base_init (gpointer g_class);
static void gst_identity_class_init (GstIdentityClass *klass); static void gst_identity_class_init (GstIdentityClass *klass);
static void gst_identity_init (GstIdentity *identity); static void gst_identity_init (GstIdentity *identity);
@ -82,7 +80,8 @@ gst_identity_get_type (void)
if (!identity_type) { if (!identity_type) {
static const GTypeInfo identity_info = { static const GTypeInfo identity_info = {
sizeof(GstIdentityClass), NULL, sizeof(GstIdentityClass),
gst_identity_base_init,
NULL, NULL,
(GClassInitFunc)gst_identity_class_init, (GClassInitFunc)gst_identity_class_init,
NULL, NULL,
@ -92,18 +91,27 @@ gst_identity_get_type (void)
(GInstanceInitFunc)gst_identity_init, (GInstanceInitFunc)gst_identity_init,
}; };
identity_type = g_type_register_static (GST_TYPE_ELEMENT, "GstIdentity", &identity_info, 0); identity_type = g_type_register_static (GST_TYPE_ELEMENT, "GstIdentity", &identity_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_identity_debug, "identity", 0, "identity element");
} }
return identity_type; return identity_type;
} }
static void
gst_identity_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_identity_details);
}
static void static void
gst_identity_class_init (GstIdentityClass *klass) gst_identity_class_init (GstIdentityClass *klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
gobject_class = (GObjectClass*)klass; gobject_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT); parent_class = g_type_class_peek_parent (klass);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOOP_BASED, g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOOP_BASED,
g_param_spec_boolean ("loop-based", "Loop-based", g_param_spec_boolean ("loop-based", "Loop-based",

View file

@ -29,8 +29,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_identity_details;
GST_DEBUG_CATEGORY_EXTERN(gst_identity_debug);
#define GST_TYPE_IDENTITY \ #define GST_TYPE_IDENTITY \
(gst_identity_get_type()) (gst_identity_get_type())

View file

@ -32,9 +32,16 @@
#include <gst/gst.h> #include <gst/gst.h>
#include "gstmd5sink.h" #include "gstmd5sink.h"
GST_DEBUG_CATEGORY (gst_md5sink_debug); GST_DEBUG_CATEGORY_STATIC (gst_md5sink_debug);
#define GST_CAT_DEFAULT gst_md5sink_debug #define GST_CAT_DEFAULT gst_md5sink_debug
GstElementDetails gst_md5sink_details = GST_ELEMENT_DETAILS (
"MD5 Sink",
"Sink",
"compute MD5 for incoming data",
"Benjamin Otte <in7y118@public.uni-hamburg.de>"
);
/* MD5Sink signals and args */ /* MD5Sink signals and args */
enum { enum {
/* FILL ME */ /* FILL ME */
@ -55,6 +62,7 @@ GST_PAD_TEMPLATE_FACTORY (md5_sink_factory,
); );
/* GObject stuff */ /* GObject stuff */
static void gst_md5sink_base_init (gpointer g_class);
static void gst_md5sink_class_init (GstMD5SinkClass *klass); static void gst_md5sink_class_init (GstMD5SinkClass *klass);
static void gst_md5sink_init (GstMD5Sink *md5sink); static void gst_md5sink_init (GstMD5Sink *md5sink);
@ -381,7 +389,7 @@ gst_md5sink_get_type (void)
if (!md5sink_type) { if (!md5sink_type) {
static const GTypeInfo md5sink_info = { static const GTypeInfo md5sink_info = {
sizeof(GstMD5SinkClass), sizeof(GstMD5SinkClass),
NULL, gst_md5sink_base_init,
NULL, NULL,
(GClassInitFunc) gst_md5sink_class_init, (GClassInitFunc) gst_md5sink_class_init,
NULL, NULL,
@ -392,10 +400,20 @@ gst_md5sink_get_type (void)
}; };
md5sink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstMD5Sink", md5sink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstMD5Sink",
&md5sink_info, 0); &md5sink_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_md5sink_debug, "md5sink", 0, "md5sink element");
} }
return md5sink_type; return md5sink_type;
} }
static void
gst_md5sink_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_md5sink_details);
gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (md5_sink_factory));
}
static void static void
gst_md5sink_class_init (GstMD5SinkClass *klass) gst_md5sink_class_init (GstMD5SinkClass *klass)
{ {
@ -405,15 +423,15 @@ gst_md5sink_class_init (GstMD5SinkClass *klass)
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
parent_class = g_type_class_ref (GST_TYPE_ELEMENT); parent_class = g_type_class_peek_parent (klass);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_md5sink_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MD5, g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MD5,
g_param_spec_string ("md5", "md5", "current value of the md5 sum", g_param_spec_string ("md5", "md5", "current value of the md5 sum",
"", G_PARAM_READABLE)); "", G_PARAM_READABLE));
gstelement_class->change_state = GST_DEBUG_FUNCPTR(gst_md5sink_change_state); gstelement_class->change_state = GST_DEBUG_FUNCPTR(gst_md5sink_change_state);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_md5sink_get_property);
} }
static void static void
@ -508,20 +526,3 @@ gst_md5sink_chain (GstPad *pad, GstData *_data)
gst_buffer_unref (buf); gst_buffer_unref (buf);
} }
GstElementDetails gst_md5sink_details = {
"MD5 Sink",
"Sink",
"LGPL",
"compute MD5 for incoming data",
VERSION,
"Benjamin Otte <in7y118@public.uni-hamburg.de>",
"(C) 2002",
};
gboolean
gst_md5sink_factory_init (GstElementFactory *factory)
{
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (md5_sink_factory));
return TRUE;
}

View file

@ -29,8 +29,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_md5sink_details;
GST_DEBUG_CATEGORY_EXTERN(gst_md5sink_debug);
#define GST_TYPE_MD5SINK \ #define GST_TYPE_MD5SINK \
(gst_md5sink_get_type()) (gst_md5sink_get_type())

View file

@ -33,18 +33,15 @@
#include "gstmultidisksrc.h" #include "gstmultidisksrc.h"
GST_DEBUG_CATEGORY (gst_multidisksrc_debug); GST_DEBUG_CATEGORY_STATIC (gst_multidisksrc_debug);
#define GST_CAT_DEFAULT gst_multidisksrc_debug #define GST_CAT_DEFAULT gst_multidisksrc_debug
GstElementDetails gst_multidisksrc_details = { GstElementDetails gst_multidisksrc_details = GST_ELEMENT_DETAILS (
"Multi Disk Source", "Multi Disk Source",
"Source/File", "Source/File",
"LGPL",
"Read from multiple files in order", "Read from multiple files in order",
VERSION, "Dominic Ludlam <dom@openfx.org>"
"Dominic Ludlam <dom@openfx.org>", );
"(C) 2001",
};
/* DiskSrc signals and args */ /* DiskSrc signals and args */
enum { enum {
@ -57,6 +54,7 @@ enum {
ARG_LOCATIONS, ARG_LOCATIONS,
}; };
static void gst_multidiscsrc_base_init (gpointer g_class);
static void gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass); static void gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass);
static void gst_multidisksrc_init (GstMultiDiskSrc *disksrc); static void gst_multidisksrc_init (GstMultiDiskSrc *disksrc);
@ -81,7 +79,8 @@ gst_multidisksrc_get_type(void)
if (!multidisksrc_type) { if (!multidisksrc_type) {
static const GTypeInfo multidisksrc_info = { static const GTypeInfo multidisksrc_info = {
sizeof(GstMultiDiskSrcClass), NULL, sizeof(GstMultiDiskSrcClass),
gst_multidiscsrc_base_init,
NULL, NULL,
(GClassInitFunc)gst_multidisksrc_class_init, (GClassInitFunc)gst_multidisksrc_class_init,
NULL, NULL,
@ -91,10 +90,19 @@ gst_multidisksrc_get_type(void)
(GInstanceInitFunc)gst_multidisksrc_init, (GInstanceInitFunc)gst_multidisksrc_init,
}; };
multidisksrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstMultiDiskSrc", &multidisksrc_info, 0); multidisksrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstMultiDiskSrc", &multidisksrc_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_multidisksrc_debug, "multidisksrc", 0, "multidisksrc element");
} }
return multidisksrc_type; return multidisksrc_type;
} }
static void
gst_multidiscsrc_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_multidisksrc_details);
}
static void static void
gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass) gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass)
{ {

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_multidisksrc_details;
GST_DEBUG_CATEGORY_EXTERN(gst_multidisksrc_debug);
#define GST_TYPE_MULTIDISKSRC \ #define GST_TYPE_MULTIDISKSRC \
(gst_multidisksrc_get_type()) (gst_multidisksrc_get_type())

View file

@ -33,18 +33,15 @@
#include "gstmultidisksrc.h" #include "gstmultidisksrc.h"
GST_DEBUG_CATEGORY (gst_multidisksrc_debug); GST_DEBUG_CATEGORY_STATIC (gst_multidisksrc_debug);
#define GST_CAT_DEFAULT gst_multidisksrc_debug #define GST_CAT_DEFAULT gst_multidisksrc_debug
GstElementDetails gst_multidisksrc_details = { GstElementDetails gst_multidisksrc_details = GST_ELEMENT_DETAILS (
"Multi Disk Source", "Multi Disk Source",
"Source/File", "Source/File",
"LGPL",
"Read from multiple files in order", "Read from multiple files in order",
VERSION, "Dominic Ludlam <dom@openfx.org>"
"Dominic Ludlam <dom@openfx.org>", );
"(C) 2001",
};
/* DiskSrc signals and args */ /* DiskSrc signals and args */
enum { enum {
@ -57,6 +54,7 @@ enum {
ARG_LOCATIONS, ARG_LOCATIONS,
}; };
static void gst_multidiscsrc_base_init (gpointer g_class);
static void gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass); static void gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass);
static void gst_multidisksrc_init (GstMultiDiskSrc *disksrc); static void gst_multidisksrc_init (GstMultiDiskSrc *disksrc);
@ -81,7 +79,8 @@ gst_multidisksrc_get_type(void)
if (!multidisksrc_type) { if (!multidisksrc_type) {
static const GTypeInfo multidisksrc_info = { static const GTypeInfo multidisksrc_info = {
sizeof(GstMultiDiskSrcClass), NULL, sizeof(GstMultiDiskSrcClass),
gst_multidiscsrc_base_init,
NULL, NULL,
(GClassInitFunc)gst_multidisksrc_class_init, (GClassInitFunc)gst_multidisksrc_class_init,
NULL, NULL,
@ -91,10 +90,19 @@ gst_multidisksrc_get_type(void)
(GInstanceInitFunc)gst_multidisksrc_init, (GInstanceInitFunc)gst_multidisksrc_init,
}; };
multidisksrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstMultiDiskSrc", &multidisksrc_info, 0); multidisksrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstMultiDiskSrc", &multidisksrc_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_multidisksrc_debug, "multidisksrc", 0, "multidisksrc element");
} }
return multidisksrc_type; return multidisksrc_type;
} }
static void
gst_multidiscsrc_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_multidisksrc_details);
}
static void static void
gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass) gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass)
{ {

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_multidisksrc_details;
GST_DEBUG_CATEGORY_EXTERN(gst_multidisksrc_debug);
#define GST_TYPE_MULTIDISKSRC \ #define GST_TYPE_MULTIDISKSRC \
(gst_multidisksrc_get_type()) (gst_multidisksrc_get_type())

View file

@ -35,19 +35,16 @@
#include "gstpipefilter.h" #include "gstpipefilter.h"
GST_DEBUG_CATEGORY (gst_pipefilter_debug); GST_DEBUG_CATEGORY_STATIC (gst_pipefilter_debug);
#define GST_CAT_DEFAULT gst_pipefilter_debug #define GST_CAT_DEFAULT gst_pipefilter_debug
GstElementDetails gst_pipefilter_details = { GstElementDetails gst_pipefilter_details = GST_ELEMENT_DETAILS (
"Pipefilter", "Pipefilter",
"Filter", "Filter",
"LGPL",
"Interoperate with an external program using stdin and stdout", "Interoperate with an external program using stdin and stdout",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>, "
"Erik Walthinsen <omega@cse.ogi.edu>\n" "Wim Taymans <wim.taymans@chello.be>"
"Wim Taymans <wim.taymans@chello.be>", );
"(C) 1999",
};
/* Pipefilter signals and args */ /* Pipefilter signals and args */
@ -62,13 +59,14 @@ enum {
}; };
static void gst_pipefilter_base_init (gpointer g_class);
static void gst_pipefilter_class_init (GstPipefilterClass *klass); static void gst_pipefilter_class_init (GstPipefilterClass *klass);
static void gst_pipefilter_init (GstPipefilter *pipefilter); static void gst_pipefilter_init (GstPipefilter *pipefilter);
static void gst_pipefilter_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void gst_pipefilter_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_pipefilter_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void gst_pipefilter_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstData* gst_pipefilter_get (GstPad *pad); static GstData* gst_pipefilter_get (GstPad *pad);
static void gst_pipefilter_chain (GstPad *pad, GstData *_data); static void gst_pipefilter_chain (GstPad *pad, GstData *_data);
static gboolean gst_pipefilter_handle_event (GstPad *pad, GstEvent *event); static gboolean gst_pipefilter_handle_event (GstPad *pad, GstEvent *event);
@ -84,7 +82,8 @@ gst_pipefilter_get_type (void)
if (!pipefilter_type) { if (!pipefilter_type) {
static const GTypeInfo pipefilter_info = { static const GTypeInfo pipefilter_info = {
sizeof(GstPipefilterClass), NULL, sizeof(GstPipefilterClass),
gst_pipefilter_base_init,
NULL, NULL,
(GClassInitFunc)gst_pipefilter_class_init, (GClassInitFunc)gst_pipefilter_class_init,
NULL, NULL,
@ -94,10 +93,19 @@ gst_pipefilter_get_type (void)
(GInstanceInitFunc)gst_pipefilter_init, (GInstanceInitFunc)gst_pipefilter_init,
}; };
pipefilter_type = g_type_register_static(GST_TYPE_ELEMENT, "GstPipefilter", &pipefilter_info, 0); pipefilter_type = g_type_register_static(GST_TYPE_ELEMENT, "GstPipefilter", &pipefilter_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_pipefilter_debug, "pipefilter", 0, "pipefilter element");
} }
return pipefilter_type; return pipefilter_type;
} }
static void
gst_pipefilter_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_pipefilter_details);
}
static void static void
gst_pipefilter_class_init (GstPipefilterClass *klass) gst_pipefilter_class_init (GstPipefilterClass *klass)
{ {
@ -109,14 +117,14 @@ gst_pipefilter_class_init (GstPipefilterClass *klass)
parent_class = g_type_class_ref(GST_TYPE_ELEMENT); parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
gstelement_class->change_state = gst_pipefilter_change_state; gobject_class->set_property = gst_pipefilter_set_property;
gobject_class->get_property = gst_pipefilter_get_property;
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_COMMAND, g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_COMMAND,
g_param_spec_string("command","command","command", g_param_spec_string("command","command","command",
NULL, G_PARAM_READWRITE)); /* CHECKME */ NULL, G_PARAM_READWRITE)); /* CHECKME */
gobject_class->set_property = gst_pipefilter_set_property; gstelement_class->change_state = gst_pipefilter_change_state;
gobject_class->get_property = gst_pipefilter_get_property;
} }
static void static void

View file

@ -29,8 +29,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_pipefilter_details;
GST_DEBUG_CATEGORY_EXTERN(gst_pipefilter_debug);
#define GST_TYPE_PIPEFILTER \ #define GST_TYPE_PIPEFILTER \
(gst_pipefilter_get_type()) (gst_pipefilter_get_type())

View file

@ -29,18 +29,15 @@
#include "gstshaper.h" #include "gstshaper.h"
GST_DEBUG_CATEGORY (gst_shaper_debug); GST_DEBUG_CATEGORY_STATIC (gst_shaper_debug);
#define GST_CAT_DEFAULT gst_shaper_debug #define GST_CAT_DEFAULT gst_shaper_debug
GstElementDetails gst_shaper_details = { GstElementDetails gst_shaper_details = GST_ELEMENT_DETAILS (
"Shaper", "Shaper",
"Generic", "Generic",
"LGPL",
"Synchronizes streams on different pads", "Synchronizes streams on different pads",
VERSION, "Wim Taymans <wim.taymans@chello.be>"
"Wim Taymans <wim.taymans@chello.be>", );
"(C) 2003",
};
/* Shaper signals and args */ /* Shaper signals and args */
@ -93,6 +90,7 @@ gst_shaper_policy_get_type (void)
return shaper_policy_type; return shaper_policy_type;
} }
static void gst_shaper_base_init (gpointer g_class);
static void gst_shaper_class_init (GstShaperClass *klass); static void gst_shaper_class_init (GstShaperClass *klass);
static void gst_shaper_init (GstShaper *shaper); static void gst_shaper_init (GstShaper *shaper);
@ -116,7 +114,8 @@ gst_shaper_get_type (void)
if (!shaper_type) { if (!shaper_type) {
static const GTypeInfo shaper_info = { static const GTypeInfo shaper_info = {
sizeof(GstShaperClass), NULL, sizeof(GstShaperClass),
gst_shaper_base_init,
NULL, NULL,
(GClassInitFunc)gst_shaper_class_init, (GClassInitFunc)gst_shaper_class_init,
NULL, NULL,
@ -126,10 +125,21 @@ gst_shaper_get_type (void)
(GInstanceInitFunc)gst_shaper_init, (GInstanceInitFunc)gst_shaper_init,
}; };
shaper_type = g_type_register_static (GST_TYPE_ELEMENT, "GstShaper", &shaper_info, 0); shaper_type = g_type_register_static (GST_TYPE_ELEMENT, "GstShaper", &shaper_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_shaper_debug, "shaper", 0, "shaper element");
} }
return shaper_type; return shaper_type;
} }
static void
gst_shaper_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_shaper_details);
gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (shaper_src_factory));
gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (shaper_sink_factory));
}
static void static void
gst_shaper_class_init (GstShaperClass *klass) gst_shaper_class_init (GstShaperClass *klass)
{ {
@ -380,11 +390,3 @@ static void gst_shaper_get_property(GObject *object, guint prop_id, GValue *valu
} }
} }
gboolean
gst_shaper_factory_init (GstElementFactory *factory)
{
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (shaper_src_factory));
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (shaper_sink_factory));
return TRUE;
}

View file

@ -29,8 +29,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_shaper_details;
GST_DEBUG_CATEGORY_EXTERN(gst_shaper_debug);
#define GST_TYPE_SHAPER \ #define GST_TYPE_SHAPER \
(gst_shaper_get_type()) (gst_shaper_get_type())

View file

@ -27,18 +27,15 @@
#include "gststatistics.h" #include "gststatistics.h"
GST_DEBUG_CATEGORY (gst_statistics_debug); GST_DEBUG_CATEGORY_STATIC (gst_statistics_debug);
#define GST_CAT_DEFAULT gst_statistics_debug #define GST_CAT_DEFAULT gst_statistics_debug
GstElementDetails gst_statistics_details = { GstElementDetails gst_statistics_details = GST_ELEMENT_DETAILS (
"Statistics", "Statistics",
"Generic", "Generic",
"LGPL",
"Statistics on buffers/bytes/events", "Statistics on buffers/bytes/events",
VERSION, "David I. Lehn <dlehn@users.sourceforge.net>"
"David I. Lehn <dlehn@users.sourceforge.net>", );
"(C) 2001",
};
/* Statistics signals and args */ /* Statistics signals and args */
@ -61,6 +58,7 @@ enum {
}; };
static void gst_statistics_base_init (gpointer g_class);
static void gst_statistics_class_init (GstStatisticsClass *klass); static void gst_statistics_class_init (GstStatisticsClass *klass);
static void gst_statistics_init (GstStatistics *statistics); static void gst_statistics_init (GstStatistics *statistics);
@ -83,7 +81,8 @@ gst_statistics_get_type (void)
if (!statistics_type) { if (!statistics_type) {
static const GTypeInfo statistics_info = { static const GTypeInfo statistics_info = {
sizeof(GstStatisticsClass), NULL, sizeof(GstStatisticsClass),
gst_statistics_base_init,
NULL, NULL,
(GClassInitFunc)gst_statistics_class_init, (GClassInitFunc)gst_statistics_class_init,
NULL, NULL,
@ -93,18 +92,27 @@ gst_statistics_get_type (void)
(GInstanceInitFunc)gst_statistics_init, (GInstanceInitFunc)gst_statistics_init,
}; };
statistics_type = g_type_register_static (GST_TYPE_ELEMENT, "GstStatistics", &statistics_info, 0); statistics_type = g_type_register_static (GST_TYPE_ELEMENT, "GstStatistics", &statistics_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_statistics_debug, "statistics", 0, "statistics element");
} }
return statistics_type; return statistics_type;
} }
static void
gst_statistics_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_statistics_details);
}
static void static void
gst_statistics_class_init (GstStatisticsClass *klass) gst_statistics_class_init (GstStatisticsClass *klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (klass);
gobject_class = (GObjectClass*)klass; parent_class = g_type_class_peek_parent (klass);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BUFFERS, g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BUFFERS,
g_param_spec_int64 ("buffers", "buffers", "total buffers count", g_param_spec_int64 ("buffers", "buffers", "total buffers count",

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_statistics_details;
GST_DEBUG_CATEGORY_EXTERN(gst_statistics_debug);
#define GST_TYPE_STATISTICS \ #define GST_TYPE_STATISTICS \
(gst_statistics_get_type()) (gst_statistics_get_type())

View file

@ -26,19 +26,16 @@
#include "gsttee.h" #include "gsttee.h"
GST_DEBUG_CATEGORY (gst_tee_debug); GST_DEBUG_CATEGORY_STATIC (gst_tee_debug);
#define GST_CAT_DEFAULT gst_tee_debug #define GST_CAT_DEFAULT gst_tee_debug
GstElementDetails gst_tee_details = { GstElementDetails gst_tee_details = GST_ELEMENT_DETAILS (
"Tee pipe fitting", "Tee pipe fitting",
"Generic", "Generic",
"LGPL",
"1-to-N pipe fitting", "1-to-N pipe fitting",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>, "
"Erik Walthinsen <omega@cse.ogi.edu>\n" "Wim Taymans <wim.taymans@chello.be>"
"Wim Taymans <wim.taymans@chello.be>", );
"(C) 1999, 2000",
};
/* Tee signals and args */ /* Tee signals and args */
enum { enum {
@ -61,6 +58,7 @@ GST_PAD_TEMPLATE_FACTORY (tee_src_factory,
GST_CAPS_ANY GST_CAPS_ANY
); );
static void gst_tee_base_init (gpointer g_class);
static void gst_tee_class_init (GstTeeClass *klass); static void gst_tee_class_init (GstTeeClass *klass);
static void gst_tee_init (GstTee *tee); static void gst_tee_init (GstTee *tee);
@ -83,7 +81,8 @@ gst_tee_get_type(void) {
if (!tee_type) { if (!tee_type) {
static const GTypeInfo tee_info = { static const GTypeInfo tee_info = {
sizeof(GstTeeClass), NULL, sizeof(GstTeeClass),
gst_tee_base_init,
NULL, NULL,
(GClassInitFunc)gst_tee_class_init, (GClassInitFunc)gst_tee_class_init,
NULL, NULL,
@ -93,10 +92,20 @@ gst_tee_get_type(void) {
(GInstanceInitFunc)gst_tee_init, (GInstanceInitFunc)gst_tee_init,
}; };
tee_type = g_type_register_static (GST_TYPE_ELEMENT, "GstTee", &tee_info, 0); tee_type = g_type_register_static (GST_TYPE_ELEMENT, "GstTee", &tee_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_tee_debug, "tee", 0, "tee element");
} }
return tee_type; return tee_type;
} }
static void
gst_tee_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_tee_details);
gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (tee_src_factory));
}
static void static void
gst_tee_class_init (GstTeeClass *klass) gst_tee_class_init (GstTeeClass *klass)
{ {
@ -380,10 +389,3 @@ gst_tee_chain (GstPad *pad, GstData *_data)
} }
} }
gboolean
gst_tee_factory_init (GstElementFactory *factory)
{
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (tee_src_factory));
return TRUE;
}

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_tee_details;
GST_DEBUG_CATEGORY_EXTERN(gst_tee_debug);
#define GST_TYPE_TEE \ #define GST_TYPE_TEE \
(gst_tee_get_type()) (gst_tee_get_type())

View file

@ -43,18 +43,15 @@
#include <gst/gsttypefind.h> #include <gst/gsttypefind.h>
GST_DEBUG_CATEGORY (gst_type_find_element_debug); GST_DEBUG_CATEGORY_STATIC (gst_type_find_element_debug);
#define GST_CAT_DEFAULT gst_type_find_element_debug #define GST_CAT_DEFAULT gst_type_find_element_debug
GstElementDetails gst_type_find_element_details = { GstElementDetails gst_type_find_element_details = GST_ELEMENT_DETAILS (
"TypeFind", "TypeFind",
"Generic", "Generic",
"LGPL",
"Finds the media type of a stream", "Finds the media type of a stream",
VERSION, "Benjamin Otte <in7y118@public.uni-hamburg.de>"
"Benjamin Otte <in7y118@public.uni-hamburg.de>", );
"(C) 2003",
};
/* generic templates */ /* generic templates */
GST_PAD_TEMPLATE_FACTORY (type_find_element_sink_factory, GST_PAD_TEMPLATE_FACTORY (type_find_element_sink_factory,
@ -87,6 +84,7 @@ enum {
}; };
static void gst_type_find_element_base_init (gpointer g_class);
static void gst_type_find_element_class_init (gpointer g_class, static void gst_type_find_element_class_init (gpointer g_class,
gpointer class_data); gpointer class_data);
static void gst_type_find_element_init (GTypeInstance *instance, static void gst_type_find_element_init (GTypeInstance *instance,
@ -122,7 +120,7 @@ gst_type_find_element_get_type (void)
if (!typefind_type) { if (!typefind_type) {
static const GTypeInfo typefind_info = { static const GTypeInfo typefind_info = {
sizeof (GstTypeFindElementClass), sizeof (GstTypeFindElementClass),
NULL, gst_type_find_element_base_init,
NULL, NULL,
gst_type_find_element_class_init, gst_type_find_element_class_init,
NULL, NULL,
@ -135,6 +133,9 @@ gst_type_find_element_get_type (void)
typefind_type = g_type_register_static (GST_TYPE_ELEMENT, typefind_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstTypeFindElement", "GstTypeFindElement",
&typefind_info, 0); &typefind_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_type_find_element_debug, "typefind",
GST_DEBUG_BG_YELLOW | GST_DEBUG_FG_GREEN, "typefind element");
} }
return typefind_type; return typefind_type;
} }
@ -155,6 +156,13 @@ gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability
} }
} }
static void static void
gst_type_find_element_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_type_find_element_details);
}
static void
gst_type_find_element_class_init (gpointer g_class, gpointer class_data) gst_type_find_element_class_init (gpointer g_class, gpointer class_data)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;

View file

@ -30,9 +30,7 @@
G_BEGIN_DECLS G_BEGIN_DECLS
GST_DEBUG_CATEGORY_EXTERN(gst_type_find_element_debug);
extern GstElementDetails gst_type_find_element_details;
#define GST_TYPE_TYPE_FIND_ELEMENT (gst_type_find_element_get_type ()) #define GST_TYPE_TYPE_FIND_ELEMENT (gst_type_find_element_get_type ())
#define GST_TYPE_FIND_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TYPE_FIND_ELEMENT, GstTypeFindElement)) #define GST_TYPE_FIND_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TYPE_FIND_ELEMENT, GstTypeFindElement))

View file

@ -43,18 +43,15 @@
#include <gst/gsttypefind.h> #include <gst/gsttypefind.h>
GST_DEBUG_CATEGORY (gst_type_find_element_debug); GST_DEBUG_CATEGORY_STATIC (gst_type_find_element_debug);
#define GST_CAT_DEFAULT gst_type_find_element_debug #define GST_CAT_DEFAULT gst_type_find_element_debug
GstElementDetails gst_type_find_element_details = { GstElementDetails gst_type_find_element_details = GST_ELEMENT_DETAILS (
"TypeFind", "TypeFind",
"Generic", "Generic",
"LGPL",
"Finds the media type of a stream", "Finds the media type of a stream",
VERSION, "Benjamin Otte <in7y118@public.uni-hamburg.de>"
"Benjamin Otte <in7y118@public.uni-hamburg.de>", );
"(C) 2003",
};
/* generic templates */ /* generic templates */
GST_PAD_TEMPLATE_FACTORY (type_find_element_sink_factory, GST_PAD_TEMPLATE_FACTORY (type_find_element_sink_factory,
@ -87,6 +84,7 @@ enum {
}; };
static void gst_type_find_element_base_init (gpointer g_class);
static void gst_type_find_element_class_init (gpointer g_class, static void gst_type_find_element_class_init (gpointer g_class,
gpointer class_data); gpointer class_data);
static void gst_type_find_element_init (GTypeInstance *instance, static void gst_type_find_element_init (GTypeInstance *instance,
@ -122,7 +120,7 @@ gst_type_find_element_get_type (void)
if (!typefind_type) { if (!typefind_type) {
static const GTypeInfo typefind_info = { static const GTypeInfo typefind_info = {
sizeof (GstTypeFindElementClass), sizeof (GstTypeFindElementClass),
NULL, gst_type_find_element_base_init,
NULL, NULL,
gst_type_find_element_class_init, gst_type_find_element_class_init,
NULL, NULL,
@ -135,6 +133,9 @@ gst_type_find_element_get_type (void)
typefind_type = g_type_register_static (GST_TYPE_ELEMENT, typefind_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstTypeFindElement", "GstTypeFindElement",
&typefind_info, 0); &typefind_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_type_find_element_debug, "typefind",
GST_DEBUG_BG_YELLOW | GST_DEBUG_FG_GREEN, "typefind element");
} }
return typefind_type; return typefind_type;
} }
@ -155,6 +156,13 @@ gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability
} }
} }
static void static void
gst_type_find_element_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_type_find_element_details);
}
static void
gst_type_find_element_class_init (gpointer g_class, gpointer class_data) gst_type_find_element_class_init (gpointer g_class, gpointer class_data)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;

View file

@ -30,9 +30,7 @@
G_BEGIN_DECLS G_BEGIN_DECLS
GST_DEBUG_CATEGORY_EXTERN(gst_type_find_element_debug);
extern GstElementDetails gst_type_find_element_details;
#define GST_TYPE_TYPE_FIND_ELEMENT (gst_type_find_element_get_type ()) #define GST_TYPE_TYPE_FIND_ELEMENT (gst_type_find_element_get_type ())
#define GST_TYPE_FIND_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TYPE_FIND_ELEMENT, GstTypeFindElement)) #define GST_TYPE_FIND_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TYPE_FIND_ELEMENT, GstTypeFindElement))

View file

@ -330,16 +330,14 @@ parse_debug_list (const gchar *list)
static void static void
load_plugin_func (gpointer data, gpointer user_data) load_plugin_func (gpointer data, gpointer user_data)
{ {
gboolean ret;
GstPlugin *plugin; GstPlugin *plugin;
const gchar *filename; const gchar *filename;
filename = (const gchar *) data; filename = (const gchar *) data;
plugin = gst_plugin_new (filename); plugin = gst_plugin_load_file (filename, NULL);
ret = gst_plugin_load_plugin (plugin, NULL);
if (ret) { if (plugin) {
GST_INFO ("Loaded plugin: \"%s\"", filename); GST_INFO ("Loaded plugin: \"%s\"", filename);
gst_registry_pool_add_plugin (plugin); gst_registry_pool_add_plugin (plugin);
@ -445,19 +443,13 @@ init_pre (void)
} }
static gboolean static gboolean
gst_register_core_elements (GModule *module, GstPlugin *plugin) gst_register_core_elements (GstPlugin *plugin)
{ {
GstElementFactory *factory;
/* register some standard builtin types */ /* register some standard builtin types */
factory = gst_element_factory_new ("bin", gst_bin_get_type (), &gst_bin_details); g_assert (gst_element_register (plugin, "bin", GST_RANK_PRIMARY, GST_TYPE_BIN));
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); g_assert (gst_element_register (plugin, "pipeline", GST_RANK_PRIMARY, GST_TYPE_PIPELINE));
factory = gst_element_factory_new ("pipeline", gst_pipeline_get_type (), &gst_pipeline_details); g_assert (gst_element_register (plugin, "thread", GST_RANK_PRIMARY, GST_TYPE_THREAD));
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); g_assert (gst_element_register (plugin, "queue", GST_RANK_PRIMARY, GST_TYPE_QUEUE));
factory = gst_element_factory_new ("thread", gst_thread_get_type (), &gst_thread_details);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
factory = gst_element_factory_new ("queue", gst_queue_get_type (), &gst_queue_details);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
return TRUE; return TRUE;
} }
@ -465,8 +457,17 @@ gst_register_core_elements (GModule *module, GstPlugin *plugin)
static GstPluginDesc plugin_desc = { static GstPluginDesc plugin_desc = {
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"gst_core_plugins", "gst_core_elements",
gst_register_core_elements "core elements of the GStreamer library",
gst_register_core_elements,
NULL,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN,
GST_STRUCT_PADDING_INIT
}; };
/* /*

View file

@ -71,7 +71,6 @@ extern GstDebugCategory *GST_CAT_BUFFER;
extern GstDebugCategory *GST_CAT_CAPS; extern GstDebugCategory *GST_CAT_CAPS;
extern GstDebugCategory *GST_CAT_CLOCK; extern GstDebugCategory *GST_CAT_CLOCK;
extern GstDebugCategory *GST_CAT_ELEMENT_PADS; extern GstDebugCategory *GST_CAT_ELEMENT_PADS;
extern GstDebugCategory *GST_CAT_ELEMENT_FACTORY;
extern GstDebugCategory *GST_CAT_PADS; extern GstDebugCategory *GST_CAT_PADS;
extern GstDebugCategory *GST_CAT_PIPELINE; extern GstDebugCategory *GST_CAT_PIPELINE;
extern GstDebugCategory *GST_CAT_PLUGIN_LOADING; extern GstDebugCategory *GST_CAT_PLUGIN_LOADING;

View file

@ -31,15 +31,12 @@
#include "gstscheduler.h" #include "gstscheduler.h"
#include "gstindex.h" #include "gstindex.h"
GstElementDetails gst_bin_details = { static GstElementDetails gst_bin_details = GST_ELEMENT_DETAILS (
"Generic bin", "Generic bin",
"Generic/Bin", "Generic/Bin",
"LGPL",
"Simple container object", "Simple container object",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>"
"Erik Walthinsen <omega@cse.ogi.edu>", );
"(C) 1999",
};
GType _gst_bin_type = 0; GType _gst_bin_type = 0;
@ -85,6 +82,7 @@ enum
/* FILL ME */ /* FILL ME */
}; };
static void gst_bin_base_init (gpointer g_class);
static void gst_bin_class_init (GstBinClass * klass); static void gst_bin_class_init (GstBinClass * klass);
static void gst_bin_init (GstBin * bin); static void gst_bin_init (GstBin * bin);
@ -97,7 +95,7 @@ gst_bin_get_type (void)
if (!_gst_bin_type) { if (!_gst_bin_type) {
static const GTypeInfo bin_info = { static const GTypeInfo bin_info = {
sizeof (GstBinClass), sizeof (GstBinClass),
NULL, gst_bin_base_init,
NULL, NULL,
(GClassInitFunc) gst_bin_class_init, (GClassInitFunc) gst_bin_class_init,
NULL, NULL,
@ -113,6 +111,14 @@ gst_bin_get_type (void)
return _gst_bin_type; return _gst_bin_type;
} }
static void
gst_bin_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_bin_details);
}
static void static void
gst_bin_class_init (GstBinClass * klass) gst_bin_class_init (GstBinClass * klass)
{ {

View file

@ -28,7 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_bin_details;
extern GType _gst_bin_type; extern GType _gst_bin_type;
#define GST_TYPE_BIN (_gst_bin_type) #define GST_TYPE_BIN (_gst_bin_type)

View file

@ -47,9 +47,14 @@ enum {
/* FILL ME */ /* FILL ME */
}; };
extern void __gst_element_details_clear (GstElementDetails *dp);
extern void __gst_element_details_set (GstElementDetails *dest,
const GstElementDetails *src);
static void gst_element_class_init (GstElementClass *klass); static void gst_element_class_init (GstElementClass *klass);
static void gst_element_init (GstElement *element); static void gst_element_init (GstElement *element);
static void gst_element_base_class_init (GstElementClass *klass); static void gst_element_base_class_init (gpointer g_class);
static void gst_element_base_class_finalize (gpointer g_class);
static void gst_element_real_set_property (GObject *object, guint prop_id, static void gst_element_real_set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec); const GValue *value, GParamSpec *pspec);
@ -76,8 +81,8 @@ GType gst_element_get_type (void)
if (!_gst_element_type) { if (!_gst_element_type) {
static const GTypeInfo element_info = { static const GTypeInfo element_info = {
sizeof(GstElementClass), sizeof(GstElementClass),
(GBaseInitFunc)gst_element_base_class_init, gst_element_base_class_init,
NULL, gst_element_base_class_finalize,
(GClassInitFunc)gst_element_class_init, (GClassInitFunc)gst_element_class_init,
NULL, NULL,
NULL, NULL,
@ -140,14 +145,14 @@ gst_element_class_init (GstElementClass *klass)
klass->change_state = GST_DEBUG_FUNCPTR (gst_element_change_state); klass->change_state = GST_DEBUG_FUNCPTR (gst_element_change_state);
klass->error = GST_DEBUG_FUNCPTR (gst_element_error_func); klass->error = GST_DEBUG_FUNCPTR (gst_element_error_func);
klass->elementfactory = NULL;
klass->padtemplates = NULL; klass->padtemplates = NULL;
klass->numpadtemplates = 0; klass->numpadtemplates = 0;
} }
static void static void
gst_element_base_class_init (GstElementClass *klass) gst_element_base_class_init (gpointer g_class)
{ {
GstElementClass *klass = GST_ELEMENT_CLASS (klass);
GObjectClass *gobject_class; GObjectClass *gobject_class;
gobject_class = (GObjectClass*) klass; gobject_class = (GObjectClass*) klass;
@ -156,6 +161,16 @@ gst_element_base_class_init (GstElementClass *klass)
gobject_class->get_property = GST_DEBUG_FUNCPTR(gst_element_real_get_property); gobject_class->get_property = GST_DEBUG_FUNCPTR(gst_element_real_get_property);
} }
static void
gst_element_base_class_finalize (gpointer g_class)
{
GstElementClass *klass = GST_ELEMENT_CLASS (klass);
g_list_foreach (klass->padtemplates, (GFunc) g_object_unref, NULL);
g_list_free (klass->padtemplates);
__gst_element_details_clear (&klass->details);
}
static void static void
gst_element_init (GstElement *element) gst_element_init (GstElement *element)
{ {
@ -1157,10 +1172,8 @@ gst_element_get_pad_list (GstElement *element)
* @klass: the #GstElementClass to add the pad template to. * @klass: the #GstElementClass to add the pad template to.
* @templ: a #GstPadTemplate to add to the element class. * @templ: a #GstPadTemplate to add to the element class.
* *
* Adds a padtemplate to an element class. * Adds a padtemplate to an element class. This is mainly used in the _base_init
* This is useful if you have derived a custom bin and wish to provide * functions of classes.
* an on-request pad at runtime. Plug-in writers should use
* gst_element_factory_add_pad_template instead.
*/ */
void void
gst_element_class_add_pad_template (GstElementClass *klass, gst_element_class_add_pad_template (GstElementClass *klass,
@ -1175,6 +1188,23 @@ gst_element_class_add_pad_template (GstElementClass *klass,
klass->numpadtemplates++; klass->numpadtemplates++;
} }
/**
* gst_element_class_set_details:
* @klass: class to set details for
* @details: details to set
*
* Sets the detailed information for a #GstElementClass.
* <note>This function is for use in _base_init functions only.</note>
*/
void
gst_element_class_set_details (GstElementClass *klass, GstElementDetails *details)
{
g_return_if_fail (GST_IS_ELEMENT_CLASS (klass));
g_return_if_fail (GST_IS_ELEMENT_DETAILS (details));
__gst_element_details_set (&klass->details, details);
}
/** /**
* gst_element_get_pad_template_list: * gst_element_get_pad_template_list:
* @element: a #GstElement to get pad templates of. * @element: a #GstElement to get pad templates of.
@ -2522,22 +2552,6 @@ failure:
return GST_STATE_FAILURE; return GST_STATE_FAILURE;
} }
/**
* gst_element_get_factory:
* @element: a #GstElement to request the element factory of.
*
* Retrieves the factory that was used to create this element.
*
* Returns: the #GstElementFactory used for creating this element.
*/
GstElementFactory*
gst_element_get_factory (GstElement *element)
{
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
return GST_ELEMENT_GET_CLASS (element)->elementfactory;
}
static void static void
gst_element_dispose (GObject *object) gst_element_dispose (GObject *object)
{ {
@ -2617,13 +2631,6 @@ gst_element_save_thyself (GstObject *object,
xmlNewChild(parent, NULL, "name", GST_ELEMENT_NAME(element)); xmlNewChild(parent, NULL, "name", GST_ELEMENT_NAME(element));
if (oclass->elementfactory != NULL) {
GstElementFactory *factory = (GstElementFactory *)oclass->elementfactory;
xmlNewChild (parent, NULL, "type", GST_OBJECT_NAME (factory));
xmlNewChild (parent, NULL, "version", factory->details->version);
}
/* FIXME: what is this? */ /* FIXME: what is this? */
/* if (element->manager) */ /* if (element->manager) */
/* xmlNewChild(parent, NULL, "manager", GST_ELEMENT_NAME(element->manager)); */ /* xmlNewChild(parent, NULL, "manager", GST_ELEMENT_NAME(element->manager)); */

View file

@ -29,11 +29,29 @@
#include <gst/gstobject.h> #include <gst/gstobject.h>
#include <gst/gstpad.h> #include <gst/gstpad.h>
#include <gst/gstclock.h> #include <gst/gstclock.h>
#include <gst/gstplugin.h>
#include <gst/gstpluginfeature.h> #include <gst/gstpluginfeature.h>
#include <gst/gstindex.h> #include <gst/gstindex.h>
G_BEGIN_DECLS G_BEGIN_DECLS
typedef struct _GstElementDetails GstElementDetails;
/* FIXME: need translatable stuff in here (how handle in registry)? */
struct _GstElementDetails {
gchar *longname; /* long, english name */
gchar *klass; /* type of element, as hierarchy */
gchar *description; /* insights of one form or another */
gchar *author; /* who wrote this thing? */
GST_STRUCT_PADDING
};
#define GST_ELEMENT_DETAILS(longname,klass,description,author) \
{ longname, klass, description, author, GST_STRUCT_PADDING_INIT }
#define GST_IS_ELEMENT_DETAILS(details) ( \
(details) && ((details)->longname != NULL) && ((details)->klass != NULL) \
&& ((details)->description != NULL) && ((details)->author != NULL))
#define GST_NUM_STATES 4 #define GST_NUM_STATES 4
/* NOTE: this probably should be done with an #ifdef to decide /* NOTE: this probably should be done with an #ifdef to decide
@ -172,8 +190,8 @@ struct _GstElement {
struct _GstElementClass { struct _GstElementClass {
GstObjectClass parent_class; GstObjectClass parent_class;
/* the elementfactory that created us */ /* the element details */
GstElementFactory *elementfactory; GstElementDetails details;
/* templates for our pads */ /* templates for our pads */
GList *padtemplates; GList *padtemplates;
gint numpadtemplates; gint numpadtemplates;
@ -224,6 +242,8 @@ struct _GstElementClass {
void gst_element_class_add_pad_template (GstElementClass *klass, GstPadTemplate *templ); void gst_element_class_add_pad_template (GstElementClass *klass, GstPadTemplate *templ);
void gst_element_class_install_std_props (GstElementClass *klass, void gst_element_class_install_std_props (GstElementClass *klass,
const gchar *first_name, ...); const gchar *first_name, ...);
void gst_element_class_set_details (GstElementClass *klass,
GstElementDetails *details);
#define gst_element_default_deep_notify gst_object_default_deep_notify #define gst_element_default_deep_notify gst_object_default_deep_notify
@ -349,19 +369,6 @@ GstBin* gst_element_get_managing_bin (GstElement *element);
* factories stuff * factories stuff
* *
**/ **/
typedef struct _GstElementDetails GstElementDetails;
struct _GstElementDetails {
gchar *longname; /* long, english name */
gchar *klass; /* type of element, as hierarchy */
gchar *license; /* license element is under */
gchar *description; /* insights of one form or another */
gchar *version; /* version of the element */
gchar *author; /* who wrote this thing? */
gchar *copyright; /* copyright details (year, etc.) */
GST_STRUCT_PADDING
};
#define GST_TYPE_ELEMENT_FACTORY (gst_element_factory_get_type()) #define GST_TYPE_ELEMENT_FACTORY (gst_element_factory_get_type())
#define GST_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ELEMENT_FACTORY,\ #define GST_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ELEMENT_FACTORY,\
@ -371,22 +378,15 @@ struct _GstElementDetails {
#define GST_IS_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ELEMENT_FACTORY)) #define GST_IS_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ELEMENT_FACTORY))
#define GST_IS_ELEMENT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT_FACTORY)) #define GST_IS_ELEMENT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT_FACTORY))
#define GST_ELEMENT_RANK_PRIMARY 256
#define GST_ELEMENT_RANK_SECONDARY 128
#define GST_ELEMENT_RANK_MARGINAL 64
#define GST_ELEMENT_RANK_NONE 0
struct _GstElementFactory { struct _GstElementFactory {
GstPluginFeature feature; GstPluginFeature parent;
GType type; /* unique GType of element */ GType type; /* unique GType of element or 0 if not loaded */
guint details_dynamic : 1; GstElementDetails details;
GstElementDetails *details; /* pointer to details struct */ GList * padtemplates;
guint numpadtemplates;
GList *padtemplates;
guint16 numpadtemplates;
GST_OBJECT_PADDING GST_OBJECT_PADDING
}; };
@ -399,25 +399,33 @@ struct _GstElementFactoryClass {
GType gst_element_factory_get_type (void); GType gst_element_factory_get_type (void);
GstElementFactory* gst_element_factory_new (const gchar *name, GType type, gboolean gst_element_register (GstPlugin *plugin,
GstElementDetails *details); const gchar *elementname,
GstElementFactory* gst_element_factory_find (const gchar *name); guint rank,
GType type);
void gst_element_factory_add_pad_template (GstElementFactory *elementfactory, GstElementFactory* gst_element_factory_find (const gchar *name);
GstPadTemplate *templ); GType gst_element_factory_get_element_type (GstElementFactory *factory);
G_CONST_RETURN gchar * gst_element_factory_get_longname (GstElementFactory *factory);
G_CONST_RETURN gchar * gst_element_factory_get_klass (GstElementFactory *factory);
G_CONST_RETURN gchar * gst_element_factory_get_description (GstElementFactory *factory);
G_CONST_RETURN gchar * gst_element_factory_get_version (GstElementFactory *factory);
G_CONST_RETURN gchar * gst_element_factory_get_author (GstElementFactory *factory);
guint gst_element_factory_get_num_padtemplates (GstElementFactory *factory);
G_CONST_RETURN GList * gst_element_factory_get_padtemplates (GstElementFactory *factory);
GstElement* gst_element_factory_create (GstElementFactory *factory,
const gchar *name);
GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
gboolean gst_element_factory_can_src_caps (GstElementFactory *factory, gboolean gst_element_factory_can_src_caps (GstElementFactory *factory,
GstCaps *caps); GstCaps *caps);
gboolean gst_element_factory_can_sink_caps (GstElementFactory *factory, gboolean gst_element_factory_can_sink_caps (GstElementFactory *factory,
GstCaps *caps); GstCaps *caps);
GstElement* gst_element_factory_create (GstElementFactory *factory, void __gst_element_factory_add_pad_template (GstElementFactory *elementfactory,
const gchar *name); GstPadTemplate *templ);
GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
GstElement* gst_element_factory_make_or_warn (const gchar *factoryname, const gchar *name);
#define gst_element_factory_set_rank(factory, rank) \
gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory), rank)
G_END_DECLS G_END_DECLS

View file

@ -1,6 +1,7 @@
/* GStreamer /* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu> * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be> * 2000 Wim Taymans <wtay@chello.be>
* 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
* *
* gstelementfactory.c: GstElementFactory object, support routines * gstelementfactory.c: GstElementFactory object, support routines
* *
@ -26,7 +27,8 @@
#include "gstregistrypool.h" #include "gstregistrypool.h"
#include "gstinfo.h" #include "gstinfo.h"
#define GST_CAT_DEFAULT GST_CAT_ELEMENT_FACTORY GST_DEBUG_CATEGORY_STATIC (element_factory_debug);
#define GST_CAT_DEFAULT element_factory_debug
static void gst_element_factory_class_init (GstElementFactoryClass *klass); static void gst_element_factory_class_init (GstElementFactoryClass *klass);
static void gst_element_factory_init (GstElementFactory *factory); static void gst_element_factory_init (GstElementFactory *factory);
@ -56,10 +58,12 @@ gst_element_factory_get_type (void)
}; };
elementfactory_type = g_type_register_static (GST_TYPE_PLUGIN_FEATURE, elementfactory_type = g_type_register_static (GST_TYPE_PLUGIN_FEATURE,
"GstElementFactory", &elementfactory_info, 0); "GstElementFactory", &elementfactory_info, 0);
GST_DEBUG_CATEGORY_INIT (element_factory_debug, "GST_ELEMENT_FACTORY",
GST_DEBUG_BOLD | GST_DEBUG_FG_WHITE | GST_DEBUG_BG_RED,
"element factories keep information about installed elements");
} }
return elementfactory_type; return elementfactory_type;
} }
static void static void
gst_element_factory_class_init (GstElementFactoryClass *klass) gst_element_factory_class_init (GstElementFactoryClass *klass)
{ {
@ -71,19 +75,16 @@ gst_element_factory_class_init (GstElementFactoryClass *klass)
gstobject_class = (GstObjectClass*)klass; gstobject_class = (GstObjectClass*)klass;
gstpluginfeature_class = (GstPluginFeatureClass*) klass; gstpluginfeature_class = (GstPluginFeatureClass*) klass;
parent_class = g_type_class_ref (GST_TYPE_PLUGIN_FEATURE); parent_class = g_type_class_peek_parent (klass);
gstpluginfeature_class->unload_thyself = GST_DEBUG_FUNCPTR (gst_element_factory_unload_thyself); gstpluginfeature_class->unload_thyself = GST_DEBUG_FUNCPTR (gst_element_factory_unload_thyself);
} }
static void static void
gst_element_factory_init (GstElementFactory *factory) gst_element_factory_init (GstElementFactory *factory)
{ {
factory->padtemplates = NULL; factory->padtemplates = NULL;
factory->numpadtemplates = 0; factory->numpadtemplates = 0;
} }
/** /**
* gst_element_factory_find: * gst_element_factory_find:
* @name: name of factory to find * @name: name of factory to find
@ -107,96 +108,93 @@ gst_element_factory_find (const gchar *name)
GST_DEBUG ("no such elementfactory \"%s\"", name); GST_DEBUG ("no such elementfactory \"%s\"", name);
return NULL; return NULL;
} }
void
static void __gst_element_details_clear (GstElementDetails *dp)
gst_element_details_free (GstElementDetails *dp)
{ {
g_free (dp->longname); g_free (dp->longname);
dp->longname = NULL;
g_free (dp->klass); g_free (dp->klass);
g_free (dp->license); dp->klass = NULL;
g_free (dp->description); g_free (dp->description);
g_free (dp->version); dp->description = NULL;
g_free (dp->author); g_free (dp->author);
g_free (dp->copyright); dp->author = NULL;
g_free (dp); }
void
__gst_element_details_set (GstElementDetails *dest, const GstElementDetails *src)
{
dest->longname = g_strdup (src->longname);
dest->klass = g_strdup (src->klass);
dest->description = g_strdup (src->description);
dest->author = g_strdup (src->author);
}
void
__gst_element_details_copy (GstElementDetails *dest, const GstElementDetails *src)
{
__gst_element_details_clear (dest);
__gst_element_details_set (dest, src);
} }
static void static void
gst_element_factory_cleanup (GstElementFactory *factory) gst_element_factory_cleanup (GstElementFactory *factory)
{ {
GList *padtemplates; __gst_element_details_clear (&factory->details);
if (factory->type) {
if (factory->details_dynamic) { g_type_class_unref (g_type_class_peek (factory->type));
gst_element_details_free (factory->details); factory->type = 0;
factory->details_dynamic = FALSE;
} }
padtemplates = factory->padtemplates; g_list_foreach (factory->padtemplates, (GFunc) g_object_unref, NULL);
while (padtemplates) {
GstPadTemplate *oldtempl = GST_PAD_TEMPLATE (padtemplates->data);
gst_object_unref (GST_OBJECT (oldtempl));
padtemplates = g_list_next (padtemplates);
}
g_list_free (factory->padtemplates); g_list_free (factory->padtemplates);
factory->padtemplates = NULL; factory->padtemplates = NULL;
factory->numpadtemplates = 0; factory->numpadtemplates = 0;
g_free (GST_PLUGIN_FEATURE (factory)->name);
} }
/** /**
* gst_element_factory_new: * gst_element_register:
* @name: name of new elementfactory * @plugin:
* @type: GType of new element * @name: name of elements of this type
* @details: #GstElementDetails structure with element details * @rank: rank of element (higher rank means more importance when autoplugging)
* @type: GType of element to register
* *
* Create a new elementfactory capable of insantiating objects of the * Create a new elementfactory capable of insantiating objects of the
* given type. * given type.
* *
* Returns: new elementfactory * Returns: TRUE, if the registering succeeded, FALSE on error
*/ */
GstElementFactory* gboolean
gst_element_factory_new (const gchar *name, GType type, gst_element_register (GstPlugin *plugin, const gchar *name, guint rank, GType type)
GstElementDetails *details)
{ {
GstElementFactory *factory; GstElementFactory *factory;
GstElementClass *klass;
g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (name != NULL, FALSE);
g_return_val_if_fail (type, NULL); g_return_val_if_fail (g_type_is_a (type, GST_TYPE_ELEMENT), FALSE);
g_return_val_if_fail (details, NULL);
g_return_val_if_fail (details->longname, NULL);
g_return_val_if_fail (details->klass, NULL);
g_return_val_if_fail (details->license, NULL);
g_return_val_if_fail (details->description, NULL);
g_return_val_if_fail (details->version, NULL);
g_return_val_if_fail (details->author, NULL);
g_return_val_if_fail (details->copyright, NULL);
factory = gst_element_factory_find (name); factory = gst_element_factory_find (name);
if (!factory) if (!factory) {
klass = GST_ELEMENT_CLASS (g_type_class_ref (type));
factory = GST_ELEMENT_FACTORY (g_object_new (GST_TYPE_ELEMENT_FACTORY, NULL)); factory = GST_ELEMENT_FACTORY (g_object_new (GST_TYPE_ELEMENT_FACTORY, NULL));
else { gst_plugin_feature_set_name (GST_PLUGIN_FEATURE (factory), name);
GST_LOG_OBJECT (factory, "Created new elementfactory for type %s", g_type_name (type));
} else {
g_return_val_if_fail (factory->type == 0, FALSE);
klass = GST_ELEMENT_CLASS (g_type_class_ref (type));
gst_element_factory_cleanup (factory); gst_element_factory_cleanup (factory);
GST_LOG_OBJECT (factory, "Reuse existing elementfactory for type %s", g_type_name (type));
} }
factory->details = details; factory->type = type;
factory->details_dynamic = FALSE; __gst_element_details_copy (&factory->details, &klass->details);
factory->padtemplates = g_list_copy (klass->padtemplates);
g_list_foreach (factory->padtemplates, (GFunc) g_object_ref, NULL);
factory->numpadtemplates = klass->numpadtemplates;
if (!factory->type) gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory), rank);
factory->type = type;
else if (factory->type != type)
g_critical ("`%s' requested type change (!)", name);
GST_PLUGIN_FEATURE (factory)->name = g_strdup (name); gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
return factory; return TRUE;
} }
/** /**
* gst_element_factory_create: * gst_element_factory_create:
* @factory: factory to instantiate * @factory: factory to instantiate
@ -206,14 +204,13 @@ gst_element_factory_new (const gchar *name, GType type,
* It will be given the name supplied, since all elements require a name as * It will be given the name supplied, since all elements require a name as
* their first argument. * their first argument.
* *
* Returns: new #GstElement * Returns: new #GstElement or NULL if the element couldn't be created
*/ */
GstElement* GstElement*
gst_element_factory_create (GstElementFactory *factory, gst_element_factory_create (GstElementFactory *factory,
const gchar *name) const gchar *name)
{ {
GstElement *element; GstElement *element;
GstElementClass *oclass;
g_return_val_if_fail (factory != NULL, NULL); g_return_val_if_fail (factory != NULL, NULL);
@ -222,8 +219,8 @@ gst_element_factory_create (GstElementFactory *factory,
return NULL; return NULL;
} }
GST_LOG ("creating element from factory \"%s\" (name \"%s\", type %d)", GST_LOG_OBJECT (factory, "creating element (name \"%s\", type %d)",
GST_PLUGIN_FEATURE_NAME (factory), GST_STR_NULL (name), (gint) factory->type); GST_STR_NULL (name), (gint) factory->type);
if (factory->type == 0) { if (factory->type == 0) {
g_critical ("Factory for `%s' has no type", g_critical ("Factory for `%s' has no type",
@ -231,30 +228,14 @@ gst_element_factory_create (GstElementFactory *factory,
return NULL; return NULL;
} }
/* attempt to set the elementfactory class pointer if necessary */
oclass = GST_ELEMENT_CLASS (g_type_class_ref (factory->type));
if (oclass->elementfactory == NULL) {
GST_DEBUG ("class %s", GST_PLUGIN_FEATURE_NAME (factory));
oclass->elementfactory = factory;
/* copy pad template pointers to the element class,
* allow for custom padtemplates */
oclass->padtemplates = g_list_concat (oclass->padtemplates,
g_list_copy (factory->padtemplates));
oclass->numpadtemplates += factory->numpadtemplates;
}
/* create an instance of the element */ /* create an instance of the element */
element = GST_ELEMENT (g_object_new (factory->type, NULL)); element = GST_ELEMENT (g_object_new (factory->type, NULL));
g_assert (element != NULL); g_assert (element != NULL);
g_type_class_unref (oclass);
gst_object_set_name (GST_OBJECT (element), name); gst_object_set_name (GST_OBJECT (element), name);
return element; return element;
} }
/** /**
* gst_element_factory_make: * gst_element_factory_make:
* @factoryname: a named factory to instantiate * @factoryname: a named factory to instantiate
@ -265,7 +246,7 @@ gst_element_factory_create (GstElementFactory *factory,
* consisting of the element factory name and a number. * consisting of the element factory name and a number.
* If name is given, it will be given the name supplied. * If name is given, it will be given the name supplied.
* *
* Returns: new #GstElement (or NULL if unable to create element) * Returns: new #GstElement or NULL if unable to create element
*/ */
GstElement* GstElement*
gst_element_factory_make (const gchar *factoryname, const gchar *name) gst_element_factory_make (const gchar *factoryname, const gchar *name)
@ -287,48 +268,15 @@ gst_element_factory_make (const gchar *factoryname, const gchar *name)
} }
element = gst_element_factory_create (factory, name); element = gst_element_factory_create (factory, name);
if (element == NULL) { if (element == NULL) {
GST_INFO ("couldn't create instance of element factory \"%s\"!", GST_INFO_OBJECT (factory, "couldn't create instance!");
factoryname);
return NULL; return NULL;
} }
return element; return element;
} }
/**
* gst_element_factory_make_or_warn:
* @factoryname: a named factory to instantiate
* @name: name of new element
*
* Create a new element of the type defined by the given element factory
* using #gst_element_factory_make.
* Will use g_warning if the element could not be created.
*
* Returns: new #GstElement (or NULL if unable to create element)
*/
GstElement*
gst_element_factory_make_or_warn (const gchar *factoryname, const gchar *name)
{
GstElement *element;
element = gst_element_factory_make (factoryname, name);
if (element == NULL)
g_warning ("Could not create element from factory %s !\n", factoryname);
return element;
}
/**
* gst_element_factory_add_pad_template :
* @elementfactory: factory to add the src id to
* @templ: the padtemplate to add
*
* Add the given padtemplate to this elementfactory.
*/
void void
gst_element_factory_add_pad_template (GstElementFactory *factory, __gst_element_factory_add_pad_template (GstElementFactory *factory,
GstPadTemplate *templ) GstPadTemplate *templ)
{ {
g_return_if_fail (factory != NULL); g_return_if_fail (factory != NULL);
g_return_if_fail (templ != NULL); g_return_if_fail (templ != NULL);
@ -339,7 +287,111 @@ gst_element_factory_add_pad_template (GstElementFactory *factory,
factory->padtemplates = g_list_append (factory->padtemplates, templ); factory->padtemplates = g_list_append (factory->padtemplates, templ);
factory->numpadtemplates++; factory->numpadtemplates++;
} }
/**
* gst_element_factory_get_element_type:
* @factory: factory to get managed #GType from
*
* Get the #GType for elements managed by this factory
*
* Returns: the #GType for elements managed by this factory
*/
GType
gst_element_factory_get_element_type (GstElementFactory *factory)
{
g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), 0);
return factory->type;
}
/**
* gst_element_factory_get_longname:
* @factory: a #GstElementFactory
*
* Gets the longname for this factory
*
* Returns: the longname
*/
G_CONST_RETURN gchar *
gst_element_factory_get_longname (GstElementFactory *factory)
{
g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL);
return factory->details.longname;
}
/**
* gst_element_factory_get_class:
* @factory: a #GstElementFactory
*
* Gets the class for this factory.
*
* Returns: the class
*/
G_CONST_RETURN gchar *
gst_element_factory_get_class (GstElementFactory *factory)
{
g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL);
return factory->details.klass;
}
/**
* gst_element_factory_get_description:
* @factory: a #GstElementFactory
*
* Gets the description for this factory.
*
* Returns: the description
*/
G_CONST_RETURN gchar *
gst_element_factory_get_description (GstElementFactory *factory)
{
g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL);
return factory->details.description;
}
/**
* gst_element_factory_get_author:
* @factory: a #GstElementFactory
*
* Gets the author for this factory.
*
* Returns: the author
*/
G_CONST_RETURN gchar *
gst_element_factory_get_author (GstElementFactory *factory)
{
g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL);
return factory->details.author;
}
/**
* gst_element_factory_get_num_padtemplates:
* @factory: a #GstElementFactory
*
* Gets the number of padtemplates in this factory.
*
* Returns: the number of padtemplates
*/
guint
gst_element_factory_get_num_padtemplates (GstElementFactory *factory)
{
g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), 0);
return factory->numpadtemplates;
}
/**
* gst_element_factory_get_padtemplates:
* @factory: a #GstElementFactory
*
* Gets the #Glist of padtemplates for this factory.
*
* Returns: the padtemplates
*/
G_CONST_RETURN GList *
gst_element_factory_get_padtemplates (GstElementFactory *factory)
{
g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL);
return factory->padtemplates;
}
/** /**
* gst_element_factory_can_src_caps : * gst_element_factory_can_src_caps :
* @factory: factory to query * @factory: factory to query
@ -372,7 +424,6 @@ gst_element_factory_can_src_caps (GstElementFactory *factory,
return FALSE; return FALSE;
} }
/** /**
* gst_element_factory_can_sink_caps : * gst_element_factory_can_sink_caps :
* @factory: factory to query * @factory: factory to query
@ -405,7 +456,6 @@ gst_element_factory_can_sink_caps (GstElementFactory *factory,
return FALSE; return FALSE;
} }
static void static void
gst_element_factory_unload_thyself (GstPluginFeature *feature) gst_element_factory_unload_thyself (GstPluginFeature *feature)
{ {
@ -413,5 +463,8 @@ gst_element_factory_unload_thyself (GstPluginFeature *feature)
factory = GST_ELEMENT_FACTORY (feature); factory = GST_ELEMENT_FACTORY (feature);
factory->type = 0; if (factory->type) {
g_type_class_unref (g_type_class_peek (factory->type));
factory->type = 0;
}
} }

View file

@ -112,7 +112,6 @@ GstDebugCategory *GST_CAT_BUFFER = NULL;
GstDebugCategory *GST_CAT_CAPS = NULL; GstDebugCategory *GST_CAT_CAPS = NULL;
GstDebugCategory *GST_CAT_CLOCK = NULL; GstDebugCategory *GST_CAT_CLOCK = NULL;
GstDebugCategory *GST_CAT_ELEMENT_PADS = NULL; GstDebugCategory *GST_CAT_ELEMENT_PADS = NULL;
GstDebugCategory *GST_CAT_ELEMENT_FACTORY = NULL;
GstDebugCategory *GST_CAT_PADS = NULL; GstDebugCategory *GST_CAT_PADS = NULL;
GstDebugCategory *GST_CAT_PIPELINE = NULL; GstDebugCategory *GST_CAT_PIPELINE = NULL;
GstDebugCategory *GST_CAT_PLUGIN_LOADING = NULL; GstDebugCategory *GST_CAT_PLUGIN_LOADING = NULL;
@ -192,9 +191,6 @@ void _gst_debug_init (void)
GST_CAT_ELEMENT_PADS = _gst_debug_category_new ("GST_ELEMENT_PADS", GST_CAT_ELEMENT_PADS = _gst_debug_category_new ("GST_ELEMENT_PADS",
GST_DEBUG_BOLD | GST_DEBUG_FG_WHITE | GST_DEBUG_BG_RED, GST_DEBUG_BOLD | GST_DEBUG_FG_WHITE | GST_DEBUG_BG_RED,
NULL); NULL);
GST_CAT_ELEMENT_FACTORY = _gst_debug_category_new ("GST_ELEMENT_FACTORY",
GST_DEBUG_BOLD | GST_DEBUG_FG_WHITE | GST_DEBUG_BG_RED,
NULL);
GST_CAT_PADS = _gst_debug_category_new ("GST_PADS", GST_CAT_PADS = _gst_debug_category_new ("GST_PADS",
GST_DEBUG_BOLD | GST_DEBUG_FG_WHITE | GST_DEBUG_BG_RED, GST_DEBUG_BOLD | GST_DEBUG_FG_WHITE | GST_DEBUG_BG_RED,
NULL); NULL);

View file

@ -26,15 +26,12 @@
#include "gstinfo.h" #include "gstinfo.h"
#include "gstscheduler.h" #include "gstscheduler.h"
GstElementDetails gst_pipeline_details = { static GstElementDetails gst_pipeline_details = GST_ELEMENT_DETAILS (
"Pipeline object", "Pipeline object",
"Generic/Bin", "Generic/Bin",
"LGPL",
"Complete pipeline object", "Complete pipeline object",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>"
"Erik Walthinsen <omega@cse.ogi.edu>", );
"(C) 1999",
};
/* Pipeline signals and args */ /* Pipeline signals and args */
enum { enum {
@ -48,12 +45,15 @@ enum {
}; };
static void gst_pipeline_class_init (GstPipelineClass *klass); static void gst_pipeline_base_init (gpointer g_class);
static void gst_pipeline_init (GstPipeline *pipeline); static void gst_pipeline_class_init (gpointer g_class,
gpointer class_data);
static void gst_pipeline_init (GTypeInstance *instance,
gpointer g_class);
static void gst_pipeline_dispose (GObject *object); static void gst_pipeline_dispose (GObject * object);
static GstElementStateReturn gst_pipeline_change_state (GstElement *element); static GstElementStateReturn gst_pipeline_change_state (GstElement * element);
static GstBinClass *parent_class = NULL; static GstBinClass *parent_class = NULL;
/* static guint gst_pipeline_signals[LAST_SIGNAL] = { 0 }; */ /* static guint gst_pipeline_signals[LAST_SIGNAL] = { 0 }; */
@ -65,14 +65,14 @@ gst_pipeline_get_type (void) {
if (!pipeline_type) { if (!pipeline_type) {
static const GTypeInfo pipeline_info = { static const GTypeInfo pipeline_info = {
sizeof(GstPipelineClass), sizeof(GstPipelineClass),
NULL, gst_pipeline_base_init,
NULL, NULL,
(GClassInitFunc)gst_pipeline_class_init, (GClassInitFunc)gst_pipeline_class_init,
NULL, NULL,
NULL, NULL,
sizeof(GstPipeline), sizeof(GstPipeline),
0, 0,
(GInstanceInitFunc)gst_pipeline_init, gst_pipeline_init,
NULL NULL
}; };
pipeline_type = g_type_register_static (GST_TYPE_BIN, "GstPipeline", &pipeline_info, 0); pipeline_type = g_type_register_static (GST_TYPE_BIN, "GstPipeline", &pipeline_info, 0);
@ -81,15 +81,21 @@ gst_pipeline_get_type (void) {
} }
static void static void
gst_pipeline_class_init (GstPipelineClass *klass) gst_pipeline_base_init (gpointer g_class)
{ {
GObjectClass *gobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
gst_element_class_set_details (gstelement_class, &gst_pipeline_details);
}
gobject_class = (GObjectClass *)klass; static void
gstelement_class = (GstElementClass*)klass; gst_pipeline_class_init (gpointer g_class, gpointer class_data)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (g_class);
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
GstPipelineClass *klass = GST_PIPELINE_CLASS (g_class);
parent_class = g_type_class_ref (gst_bin_get_type ()); parent_class = g_type_class_peek_parent (klass);
gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_pipeline_dispose); gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_pipeline_dispose);
@ -97,10 +103,11 @@ gst_pipeline_class_init (GstPipelineClass *klass)
} }
static void static void
gst_pipeline_init (GstPipeline *pipeline) gst_pipeline_init (GTypeInstance *instance, gpointer g_class)
{ {
GstScheduler *scheduler; GstScheduler *scheduler;
GstPipeline *pipeline = GST_PIPELINE (instance);
/* pipelines are managing bins */ /* pipelines are managing bins */
GST_FLAG_SET (pipeline, GST_BIN_FLAG_MANAGER); GST_FLAG_SET (pipeline, GST_BIN_FLAG_MANAGER);

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_pipeline_details;
#define GST_TYPE_PIPELINE (gst_pipeline_get_type ()) #define GST_TYPE_PIPELINE (gst_pipeline_get_type ())
#define GST_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PIPELINE, GstPipeline)) #define GST_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PIPELINE, GstPipeline))
#define GST_IS_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PIPELINE)) #define GST_IS_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PIPELINE))

View file

@ -34,11 +34,28 @@
#include "config.h" #include "config.h"
#include "gstfilter.h" #include "gstfilter.h"
#define GST_CAT_DEFAULT GST_CAT_PLUGIN_LOADING
static GModule *main_module = NULL; static GModule *main_module = NULL;
static GList *_gst_plugin_static = NULL; static GList *_gst_plugin_static = NULL;
static GstPlugin* gst_plugin_register_func (GstPluginDesc *desc, GstPlugin *plugin, /* list of valid licenses.
GModule *module); * One of these must be specified or the plugin won't be loaded
* Contact gstreamer-devel@lists.sourceforge.net if your license should be
* added. */
static gchar *valid_licenses[] = {
"LGPL", /* GNU Lesser General Public License */
"GPL", /* GNU General Public License */
GST_LICENSE_UNKNOWN, /* some other license */
NULL
};
static void gst_plugin_desc_copy (GstPluginDesc *dest,
const GstPluginDesc *src);
static GstPlugin * gst_plugin_register_func (GstPlugin *plugin,
GModule *module,
GstPluginDesc *desc);
GQuark GQuark
gst_plugin_error_quark (void) gst_plugin_error_quark (void)
{ {
@ -58,18 +75,16 @@ void
_gst_plugin_register_static (GstPluginDesc *desc) _gst_plugin_register_static (GstPluginDesc *desc)
{ {
if (main_module == NULL) { if (main_module == NULL) {
GST_LOG ("queueing static plugin \"%s\" for loading later on", desc->name);
_gst_plugin_static = g_list_prepend (_gst_plugin_static, desc); _gst_plugin_static = g_list_prepend (_gst_plugin_static, desc);
} }
else { else {
GstPlugin *plugin; GstPlugin *plugin;
GST_LOG ("attempting to load static plugin \"%s\" now...", desc->name);
plugin = g_new0 (GstPlugin, 1); plugin = g_new0 (GstPlugin, 1);
plugin->filename = NULL; if (gst_plugin_register_func (plugin, main_module, desc)) {
plugin->module = NULL; GST_INFO ("loaded static plugin \"%s\"", desc->name);
plugin = gst_plugin_register_func (desc, plugin, main_module);
if (plugin) {
plugin->module = main_module;
gst_registry_pool_add_plugin (plugin); gst_registry_pool_add_plugin (plugin);
} }
} }
@ -84,6 +99,25 @@ _gst_plugin_initialize (void)
g_list_foreach (_gst_plugin_static, (GFunc) _gst_plugin_register_static, NULL); g_list_foreach (_gst_plugin_static, (GFunc) _gst_plugin_register_static, NULL);
} }
/* this function could be extended to check if the plugin license matches the
* applications license (would require the app to register its license somehow).
* We'll wait for someone who's interested in it to code it :)
*/
static gboolean
gst_plugin_check_license (const gchar *license)
{
gchar **check_license = valid_licenses;
g_assert (check_license);
while (*check_license) {
if (strcmp (license, *check_license) == 0)
return TRUE;
check_license++;
}
return FALSE;
}
static gboolean static gboolean
gst_plugin_check_version (gint major, gint minor) gst_plugin_check_version (gint major, gint minor)
{ {
@ -96,67 +130,61 @@ gst_plugin_check_version (gint major, gint minor)
} }
static GstPlugin* static GstPlugin*
gst_plugin_register_func (GstPluginDesc *desc, GstPlugin *plugin, GModule *module) gst_plugin_register_func (GstPlugin *plugin, GModule *module, GstPluginDesc *desc)
{ {
g_assert (plugin->module == NULL);
if (!gst_plugin_check_version (desc->major_version, desc->minor_version)) { if (!gst_plugin_check_version (desc->major_version, desc->minor_version)) {
GST_CAT_INFO (GST_CAT_PLUGIN_LOADING,"plugin \"%s\" has incompatible version, not loading", GST_INFO ("plugin \"%s\" has incompatible version, not loading",
plugin->filename); plugin->filename);
return NULL; return FALSE;
} }
g_free (plugin->name); if (!desc->license || !desc->description || !desc->package ||
plugin->name = g_strdup(desc->name); !desc->copyright || !desc->origin) {
GST_INFO ("plugin \"%s\" has incorrect GstPluginDesc, not loading",
if (!((desc->plugin_init) (module, plugin))) {
GST_CAT_INFO (GST_CAT_PLUGIN_LOADING,"plugin \"%s\" failed to initialise",
plugin->filename); plugin->filename);
return NULL; return FALSE;
} }
GST_CAT_INFO (GST_CAT_PLUGIN_LOADING,"plugin \"%s\" initialised", GST_STR_NULL (plugin->filename));
if (!gst_plugin_check_license (desc->license)) {
GST_INFO ("plugin \"%s\" has invalid license \"%s\", not loading",
plugin->filename, desc->license);
return FALSE;
}
gst_plugin_desc_copy (&plugin->desc, desc);
plugin->module = module;
if (!((desc->plugin_init) (plugin))) {
GST_INFO ("plugin \"%s\" failed to initialise", plugin->filename);
plugin->module = NULL;
return FALSE;
}
GST_DEBUG ("plugin \"%s\" initialised", GST_STR_NULL (plugin->filename));
return plugin; return plugin;
} }
/** /**
* gst_plugin_new: * gst_plugin_load_file:
* @filename: The filename of the plugin
*
* Creates a plugin from the given filename
*
* Returns: A new GstPlugin object
*/
GstPlugin*
gst_plugin_new (const gchar *filename)
{
GstPlugin *plugin = g_new0 (GstPlugin, 1);
plugin->filename = g_strdup (filename);
return plugin;
}
/**
* gst_plugin_load_plugin:
* @plugin: The plugin to load * @plugin: The plugin to load
* @error: Pointer to a NULL-valued GError. * @error: Pointer to a NULL-valued GError.
* *
* Load the given plugin. * Load the given plugin.
* *
* Returns: whether or not the plugin loaded. Sets @error as appropriate. * Returns: a new GstPlugin or NULL, if an error occured
*/ */
gboolean GstPlugin *
gst_plugin_load_plugin (GstPlugin *plugin, GError **error) gst_plugin_load_file (const gchar *filename, GError **error)
{ {
GstPlugin *plugin;
GModule *module; GModule *module;
GstPluginDesc *desc; GstPluginDesc *desc;
struct stat file_status; struct stat file_status;
gchar *filename;
g_return_val_if_fail (plugin != NULL, FALSE); g_return_val_if_fail (filename != NULL, NULL);
if (plugin->module)
return TRUE;
filename = plugin->filename;
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "attempt to load plugin \"%s\"", filename); GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "attempt to load plugin \"%s\"", filename);
@ -165,7 +193,7 @@ gst_plugin_load_plugin (GstPlugin *plugin, GError **error)
GST_PLUGIN_ERROR, GST_PLUGIN_ERROR,
GST_PLUGIN_ERROR_MODULE, GST_PLUGIN_ERROR_MODULE,
"Dynamic loading not supported"); "Dynamic loading not supported");
return FALSE; return NULL;
} }
if (stat (filename, &file_status)) { if (stat (filename, &file_status)) {
@ -173,7 +201,7 @@ gst_plugin_load_plugin (GstPlugin *plugin, GError **error)
GST_PLUGIN_ERROR, GST_PLUGIN_ERROR,
GST_PLUGIN_ERROR_MODULE, GST_PLUGIN_ERROR_MODULE,
"Problem opening file %s (plugin %s)\n", "Problem opening file %s (plugin %s)\n",
filename, plugin->name); filename, plugin->desc.name);
return FALSE; return FALSE;
} }
@ -182,49 +210,105 @@ gst_plugin_load_plugin (GstPlugin *plugin, GError **error)
if (module != NULL) { if (module != NULL) {
gpointer ptr; gpointer ptr;
if (g_module_symbol (module, "plugin_desc", &ptr)) { if (g_module_symbol (module, "gst_plugin_desc", &ptr)) {
desc = (GstPluginDesc *)ptr; desc = (GstPluginDesc *) ptr;
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "plugin \"%s\" loaded, called entry function...", filename); plugin = gst_registry_pool_find_plugin (desc->name);
if (!plugin) {
plugin->filename = g_strdup (filename); plugin = g_new0 (GstPlugin, 1);
plugin = gst_plugin_register_func (desc, plugin, module); plugin->filename = g_strdup (filename);
GST_DEBUG ("created new GstPlugin %p for file \"%s\"", plugin, filename);
if (plugin != NULL) { } else {
GST_CAT_INFO (GST_CAT_PLUGIN_LOADING, "plugin \"%s\" loaded", plugin->filename); if (gst_plugin_is_loaded (plugin)) {
plugin->module = module; if (strcmp (plugin->filename, filename) != 0) {
return TRUE; GST_WARNING ("plugin %p from file \"%s\" with same name %s is already "
"loaded, aborting loading of \"%s\"",
plugin, plugin->filename, plugin->desc.name, filename);
g_set_error (error,
GST_PLUGIN_ERROR,
GST_PLUGIN_ERROR_NAME_MISMATCH,
"already a plugin with name \"%s\" loaded",
desc->name);
return NULL;
}
GST_LOG ("Plugin %p for file \"%s\" already loaded, returning it now", plugin, filename);
return plugin;
}
} }
else { GST_LOG ("Plugin %p for file \"%s\" prepared, called entry function...", plugin, filename);
if (gst_plugin_register_func (plugin, module, desc)) {
GST_INFO ("plugin \"%s\" loaded", plugin->filename);
return plugin;
} else {
GST_DEBUG ("gst_plugin_register_func failed for plugin \"%s\"", filename);
/* plugin == NULL */ /* plugin == NULL */
g_set_error (error, g_set_error (error,
GST_PLUGIN_ERROR, GST_PLUGIN_ERROR,
GST_PLUGIN_ERROR_MODULE, GST_PLUGIN_ERROR_MODULE,
"gst_plugin_register_func failed for plugin \"%s\"", "gst_plugin_register_func failed for plugin \"%s\"",
filename); filename);
return FALSE; g_free (plugin);
return NULL;
} }
} } else {
else { GST_DEBUG ("Could not find plugin entry point in \"%s\"", filename);
g_set_error (error, g_set_error (error,
GST_PLUGIN_ERROR, GST_PLUGIN_ERROR,
GST_PLUGIN_ERROR_MODULE, GST_PLUGIN_ERROR_MODULE,
"Could not find plugin_desc in \"%s\"", "Could not find plugin entry point in \"%s\"",
filename); filename);
} }
return FALSE; return NULL;
} } else {
else { GST_DEBUG ("Error loading plugin %s, reason: %s\n", filename, g_module_error());
g_set_error (error, g_set_error (error,
GST_PLUGIN_ERROR, GST_PLUGIN_ERROR,
GST_PLUGIN_ERROR_MODULE, GST_PLUGIN_ERROR_MODULE,
"Error loading plugin %s, reason: %s\n", "Error loading plugin %s, reason: %s\n",
filename, g_module_error()); filename, g_module_error());
return FALSE; return NULL;
} }
} }
static void
gst_plugin_desc_copy (GstPluginDesc *dest, const GstPluginDesc *src)
{
dest->major_version = src->major_version;
dest->minor_version = src->minor_version;
g_free (dest->name);
dest->name = g_strdup (src->name);
g_free (dest->description);
dest->description = g_strdup (src->description);
dest->plugin_init = src->plugin_init;
dest->plugin_exit = src->plugin_exit;
g_free (dest->version);
dest->version = g_strdup (src->version);
g_free (dest->license);
dest->license = g_strdup (src->license);
g_free (dest->copyright);
dest->copyright = g_strdup (src->copyright);
g_free (dest->package);
dest->package = g_strdup (src->package);
g_free (dest->origin);
dest->origin = g_strdup (src->origin);
}
#if 0
/* unused */
static void
gst_plugin_desc_free (GstPluginDesc *desc)
{
g_free (desc->name);
g_free (desc->description);
g_free (desc->version);
g_free (desc->license);
g_free (desc->copyright);
g_free (desc->package);
g_free (desc->origin);
memset (desc, 0, sizeof (GstPluginDesc));
}
#endif
/** /**
* gst_plugin_unload_plugin: * gst_plugin_unload_plugin:
* @plugin: The plugin to unload * @plugin: The plugin to unload
@ -265,41 +349,7 @@ gst_plugin_get_name (GstPlugin *plugin)
{ {
g_return_val_if_fail (plugin != NULL, NULL); g_return_val_if_fail (plugin != NULL, NULL);
return plugin->name; return plugin->desc.name;
}
/**
* gst_plugin_set_name:
* @plugin: plugin to set name of
* @name: new name
*
* Sets the name (should be short) of the plugin.
*/
void
gst_plugin_set_name (GstPlugin *plugin, const gchar *name)
{
g_return_if_fail (plugin != NULL);
g_free (plugin->name);
plugin->name = g_strdup (name);
}
/**
* gst_plugin_set_longname:
* @plugin: plugin to set long name of
* @longname: new long name
*
* Sets the long name (should be descriptive) of the plugin.
*/
void
gst_plugin_set_longname (GstPlugin *plugin, const gchar *longname)
{
g_return_if_fail(plugin != NULL);
g_free(plugin->longname);
plugin->longname = g_strdup(longname);
} }
/** /**
@ -310,12 +360,12 @@ gst_plugin_set_longname (GstPlugin *plugin, const gchar *longname)
* *
* Returns: the long name of the plugin * Returns: the long name of the plugin
*/ */
const gchar* G_CONST_RETURN gchar*
gst_plugin_get_longname (GstPlugin *plugin) gst_plugin_get_description (GstPlugin *plugin)
{ {
g_return_val_if_fail (plugin != NULL, NULL); g_return_val_if_fail (plugin != NULL, NULL);
return plugin->longname; return plugin->desc.description;
} }
/** /**
@ -326,14 +376,90 @@ gst_plugin_get_longname (GstPlugin *plugin)
* *
* Returns: the filename of the plugin * Returns: the filename of the plugin
*/ */
const gchar* G_CONST_RETURN gchar*
gst_plugin_get_filename (GstPlugin *plugin) gst_plugin_get_filename (GstPlugin *plugin)
{ {
g_return_val_if_fail (plugin != NULL, NULL); g_return_val_if_fail (plugin != NULL, NULL);
return plugin->filename; return plugin->filename;
} }
/**
* gst_plugin_get_license:
* @plugin: plugin to get the license of
*
* get the license of the plugin
*
* Returns: the license of the plugin
*/
G_CONST_RETURN gchar*
gst_plugin_get_license (GstPlugin *plugin)
{
g_return_val_if_fail (plugin != NULL, NULL);
return plugin->desc.license;
}
/**
* gst_plugin_get_copyright:
* @plugin: plugin to get the copyright of
*
* get the informal copyright notice of the plugin
*
* Returns: the copyright of the plugin
*/
G_CONST_RETURN gchar*
gst_plugin_get_copyright (GstPlugin *plugin)
{
g_return_val_if_fail (plugin != NULL, NULL);
return plugin->desc.copyright;
}
/**
* gst_plugin_get_package:
* @plugin: plugin to get the package of
*
* get the package the plugin belongs to.
*
* Returns: the package of the plugin
*/
G_CONST_RETURN gchar*
gst_plugin_get_package (GstPlugin *plugin)
{
g_return_val_if_fail (plugin != NULL, NULL);
return plugin->desc.package;
}
/**
* gst_plugin_get_origin:
* @plugin: plugin to get the origin of
*
* get the URL where the plugin comes from
*
* Returns: the origin of the plugin
*/
G_CONST_RETURN gchar*
gst_plugin_get_origin (GstPlugin *plugin)
{
g_return_val_if_fail (plugin != NULL, NULL);
return plugin->desc.origin;
}
/**
* gst_plugin_get_module:
* @plugin: plugin to query
*
* Gets the #GModule of the plugin. If the plugin isn't loaded yet, NULL is
* returned.
*
* Returns: module belonging to the plugin or NULL if the plugin isn't
* loaded yet.
*/
GModule *
gst_plugin_get_module (GstPlugin *plugin)
{
g_return_val_if_fail (plugin != NULL, FALSE);
return plugin->module;
}
/** /**
* gst_plugin_is_loaded: * gst_plugin_is_loaded:
* @plugin: plugin to query * @plugin: plugin to query
@ -433,7 +559,7 @@ gst_plugin_list_feature_filter (GList *list,
* @plugin: the plugin to check * @plugin: the plugin to check
* @name: the name of the plugin * @name: the name of the plugin
* *
* A standard filterthat returns TRUE when the plugin is of the * A standard filter that returns TRUE when the plugin is of the
* given name. * given name.
* *
* Returns: TRUE if the plugin is of the given name. * Returns: TRUE if the plugin is of the given name.
@ -441,7 +567,7 @@ gst_plugin_list_feature_filter (GList *list,
gboolean gboolean
gst_plugin_name_filter (GstPlugin *plugin, const gchar *name) gst_plugin_name_filter (GstPlugin *plugin, const gchar *name)
{ {
return (plugin->name && !strcmp (plugin->name, name)); return (plugin->desc.name && !strcmp (plugin->desc.name, name));
} }
/** /**
@ -536,18 +662,17 @@ gst_plugin_load (const gchar *name)
plugin = gst_registry_pool_find_plugin (name); plugin = gst_registry_pool_find_plugin (name);
if (plugin) { if (plugin) {
gboolean result = gst_plugin_load_plugin (plugin, &error); gst_plugin_load_file (plugin->filename, &error);
if (error) { if (error) {
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "load_plugin error: %s\n", GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "load_plugin error: %s\n",
error->message); error->message);
g_error_free (error); g_error_free (error);
return FALSE;
} }
return result; return TRUE;;
} }
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "Could not find %s in registry pool", GST_DEBUG ("Could not find %s in registry pool", name);
name);
return FALSE; return FALSE;
} }

View file

@ -38,7 +38,8 @@ GQuark gst_plugin_error_quark (void);
typedef enum typedef enum
{ {
GST_PLUGIN_ERROR_MODULE, GST_PLUGIN_ERROR_MODULE,
GST_PLUGIN_ERROR_DEPENDENCIES GST_PLUGIN_ERROR_DEPENDENCIES,
GST_PLUGIN_ERROR_NAME_MISMATCH
} GstPluginError; } GstPluginError;
#define GST_PLUGIN(plugin) ((GstPlugin *) (plugin)) #define GST_PLUGIN(plugin) ((GstPlugin *) (plugin))
@ -46,58 +47,86 @@ typedef enum
typedef struct _GstPlugin GstPlugin; typedef struct _GstPlugin GstPlugin;
typedef struct _GstPluginDesc GstPluginDesc; typedef struct _GstPluginDesc GstPluginDesc;
/* Initialiser function: returns TRUE if plugin initialised successfully */
typedef gboolean (*GstPluginInitFunc) (GstPlugin *plugin);
/* exiting function when plugin is unloaded */
typedef void (*GstPluginExitFunc) (GstPlugin *plugin);
struct _GstPluginDesc {
gint major_version; /* major version of core that plugin was compiled for */
gint minor_version; /* minor version of core that plugin was compiled for */
gchar *name; /* unique name of plugin */
gchar *description; /* description of plugin */
GstPluginInitFunc plugin_init; /* pointer to plugin_init function */
GstPluginExitFunc plugin_exit; /* pointer to exiting function */
gchar *version; /* version of the plugin */
gchar *license; /* effective license of plugin */
gchar *copyright; /* informal copyright notice */
gchar *package; /* package plugin belongs to */
gchar *origin; /* URL to provider of plugin */
GST_STRUCT_PADDING
};
struct _GstPlugin { struct _GstPlugin {
gchar *name; /* name of the plugin */ GstPluginDesc desc;
gchar *longname; /* long name of plugin */
gchar *filename; /* filename it came from */
GList *features; /* list of features provided */ gchar * filename;
gint numfeatures; GList * features; /* list of features provided */
gint numfeatures;
gpointer manager; /* managing registry */ gpointer manager; /* managing registry */
GModule *module; /* contains the module if the plugin is loaded */ GModule * module; /* contains the module if the plugin is loaded */
gboolean init_called; /* if the init function has been called */
GST_STRUCT_PADDING GST_STRUCT_PADDING
}; };
/* Initialiser function: returns TRUE if plugin initialised successfully */
typedef gboolean (*GstPluginInitFunc) (GModule *module, GstPlugin *plugin);
struct _GstPluginDesc {
gint major_version; /* major version of core that plugin was compiled for */
gint minor_version; /* minor version of core that plugin was compiled for */
gchar *name; /* name of plugin */
GstPluginInitFunc plugin_init; /* pointer to plugin_init function */
};
#ifndef GST_PLUGIN_STATIC #ifndef GST_PLUGIN_STATIC
#define GST_PLUGIN_DESC_DYNAMIC(major,minor,name,init) \ #define GST_PLUGIN_DEFINE_DYNAMIC(major,minor,name,description,init,version,license,copyright,package,origin) \
GstPluginDesc plugin_desc = { \ GstPluginDesc gst_plugin_desc = { \
major, \ major, \
minor, \ minor, \
name, \ name, \
init \ description, \
init, \
NULL, \
version, \
license, \
copyright, \
package, \
origin, \
GST_STRUCT_PADDING_INIT \
}; };
#define GST_PLUGIN_DEFINE_STATIC(major,minor,name,description,init,version,license,copyright,package,origin)
#else #else
#define GST_PLUGIN_DESC_DYNAMIC(major,minor,name,init) #define GST_PLUGIN_DEFINE_DYNAMIC(major,minor,name,description,init,version,license,copyright,package,origin)
#endif #define GST_PLUGIN_DEFINE_STATIC(major,minor,name,description,init,version,license,copyright,package,origin) \
#define GST_PLUGIN_DESC_STATIC(major,minor,name,init) \
static void GST_GNUC_CONSTRUCTOR \ static void GST_GNUC_CONSTRUCTOR \
_gst_plugin_static_init__ ##init (void) \ _gst_plugin_static_init__ ##init (void) \
{ \ { \
static GstPluginDesc plugin_desc_ = { \ static GstPluginDesc plugin_desc_ = { \
major, \ major, \
minor, \ minor, \
name, \ name, \
init \ description, \
init, \
NULL, \
version, \
license, \
copyright, \
package, \
origin, \
GST_STRUCT_PAD_ING_INIT \
}; \ }; \
_gst_plugin_register_static (&plugin_desc_); \ _gst_plugin_register_static (&plugin_desc_); \
} }
#endif
#define GST_PLUGIN_DESC(major,minor,name,init) \ #define GST_PLUGIN_DEFINE(major,minor,name,description,init,version,license,copyright,package,origin)\
GST_PLUGIN_DESC_DYNAMIC (major,minor,name,init) \ GST_PLUGIN_DEFINE_STATIC(major,minor,name,description,init,version,license,copyright,package,origin)\
GST_PLUGIN_DESC_STATIC (major,minor,name,init) GST_PLUGIN_DEFINE_DYNAMIC(major,minor,name,description,init,version,license,copyright,package,origin)
#define GST_LICENSE_UNKNOWN "unknown"
/* function for filters */ /* function for filters */
typedef gboolean (*GstPluginFilter) (GstPlugin *plugin, typedef gboolean (*GstPluginFilter) (GstPlugin *plugin,
@ -106,13 +135,15 @@ typedef gboolean (*GstPluginFilter) (GstPlugin *plugin,
void _gst_plugin_initialize (void); void _gst_plugin_initialize (void);
void _gst_plugin_register_static (GstPluginDesc *desc); void _gst_plugin_register_static (GstPluginDesc *desc);
GstPlugin* gst_plugin_new (const gchar *filename); G_CONST_RETURN gchar* gst_plugin_get_name (GstPlugin *plugin);
const gchar* gst_plugin_get_name (GstPlugin *plugin);
void gst_plugin_set_name (GstPlugin *plugin, const gchar *name); void gst_plugin_set_name (GstPlugin *plugin, const gchar *name);
const gchar* gst_plugin_get_longname (GstPlugin *plugin); G_CONST_RETURN gchar* gst_plugin_get_longname (GstPlugin *plugin);
void gst_plugin_set_longname (GstPlugin *plugin, const gchar *longname); G_CONST_RETURN gchar* gst_plugin_get_filename (GstPlugin *plugin);
const gchar* gst_plugin_get_filename (GstPlugin *plugin); G_CONST_RETURN gchar* gst_plugin_get_license (GstPlugin *plugin);
G_CONST_RETURN gchar* gst_plugin_get_copyright (GstPlugin *plugin);
G_CONST_RETURN gchar* gst_plugin_get_package (GstPlugin *plugin);
G_CONST_RETURN gchar* gst_plugin_get_origin (GstPlugin *plugin);
GModule * gst_plugin_get_module (GstPlugin *plugin);
gboolean gst_plugin_is_loaded (GstPlugin *plugin); gboolean gst_plugin_is_loaded (GstPlugin *plugin);
GList* gst_plugin_feature_filter (GstPlugin *plugin, GList* gst_plugin_feature_filter (GstPlugin *plugin,
@ -128,7 +159,7 @@ gboolean gst_plugin_name_filter (GstPlugin *plugin, const gchar *name);
GList* gst_plugin_get_feature_list (GstPlugin *plugin); GList* gst_plugin_get_feature_list (GstPlugin *plugin);
GstPluginFeature* gst_plugin_find_feature (GstPlugin *plugin, const gchar *name, GType type); GstPluginFeature* gst_plugin_find_feature (GstPlugin *plugin, const gchar *name, GType type);
gboolean gst_plugin_load_plugin (GstPlugin *plugin, GError** error); GstPlugin * gst_plugin_load_file (const gchar *filename, GError** error);
gboolean gst_plugin_unload_plugin (GstPlugin *plugin); gboolean gst_plugin_unload_plugin (GstPlugin *plugin);
void gst_plugin_add_feature (GstPlugin *plugin, GstPluginFeature *feature); void gst_plugin_add_feature (GstPlugin *plugin, GstPluginFeature *feature);

View file

@ -98,7 +98,7 @@ gst_plugin_feature_ensure_loaded (GstPluginFeature *feature)
#ifndef GST_DISABLE_REGISTRY #ifndef GST_DISABLE_REGISTRY
if (GST_IS_REGISTRY (plugin->manager)) { if (GST_IS_REGISTRY (plugin->manager)) {
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING,
"loading plugin %s for feature", plugin->name); "loading plugin %s for feature", plugin->desc.name);
if (gst_registry_load_plugin (GST_REGISTRY (plugin->manager), plugin) != GST_REGISTRY_OK) if (gst_registry_load_plugin (GST_REGISTRY (plugin->manager), plugin) != GST_REGISTRY_OK)
return FALSE; return FALSE;

View file

@ -29,15 +29,12 @@
#include "gstevent.h" #include "gstevent.h"
#include "gstinfo.h" #include "gstinfo.h"
GstElementDetails gst_queue_details = { static GstElementDetails gst_queue_details = GST_ELEMENT_DETAILS (
"Queue", "Queue",
"Generic", "Generic",
"LGPL",
"Simple data queue", "Simple data queue",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>"
"Erik Walthinsen <omega@cse.ogi.edu>", );
"(C) 1999",
};
/* Queue signals and args */ /* Queue signals and args */
@ -62,9 +59,11 @@ enum {
ARG_BLOCK_TIMEOUT, ARG_BLOCK_TIMEOUT,
}; };
static void gst_queue_base_init (gpointer g_class);
static void gst_queue_class_init (GstQueueClass *klass); static void gst_queue_class_init (gpointer g_class,
static void gst_queue_init (GstQueue *queue); gpointer class_data);
static void gst_queue_init (GTypeInstance *instance,
gpointer g_class);
static void gst_queue_dispose (GObject *object); static void gst_queue_dispose (GObject *object);
static void gst_queue_set_property (GObject *object, guint prop_id, static void gst_queue_set_property (GObject *object, guint prop_id,
@ -112,14 +111,14 @@ gst_queue_get_type(void)
if (!queue_type) { if (!queue_type) {
static const GTypeInfo queue_info = { static const GTypeInfo queue_info = {
sizeof(GstQueueClass), sizeof(GstQueueClass),
gst_queue_base_init,
NULL, NULL,
NULL, gst_queue_class_init,
(GClassInitFunc)gst_queue_class_init,
NULL, NULL,
NULL, NULL,
sizeof(GstQueue), sizeof(GstQueue),
4, 4,
(GInstanceInitFunc)gst_queue_init, gst_queue_init,
NULL NULL
}; };
queue_type = g_type_register_static (GST_TYPE_ELEMENT, "GstQueue", &queue_info, 0); queue_type = g_type_register_static (GST_TYPE_ELEMENT, "GstQueue", &queue_info, 0);
@ -128,37 +127,43 @@ gst_queue_get_type(void)
} }
static void static void
gst_queue_class_init (GstQueueClass *klass) gst_queue_base_init (gpointer g_class)
{ {
GObjectClass *gobject_class; GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
GstElementClass *gstelement_class;
gobject_class = (GObjectClass*)klass; gst_element_class_set_details (gstelement_class, &gst_queue_details);
gstelement_class = (GstElementClass*)klass; }
parent_class = g_type_class_ref (GST_TYPE_ELEMENT); static void
gst_queue_class_init (gpointer g_class, gpointer class_data)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (g_class);
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
GstQueueClass *gstqueue_class = GST_QUEUE_CLASS (g_class);
parent_class = g_type_class_peek_parent (g_class);
gst_queue_signals[FULL] = gst_queue_signals[FULL] =
g_signal_new ("full", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST, g_signal_new ("full", G_TYPE_FROM_CLASS (gstqueue_class), G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GstQueueClass, full), NULL, NULL, G_STRUCT_OFFSET (GstQueueClass, full), NULL, NULL,
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LEAKY, g_object_class_install_property (G_OBJECT_CLASS (gstqueue_class), ARG_LEAKY,
g_param_spec_enum ("leaky", "Leaky", "Where the queue leaks, if at all.", g_param_spec_enum ("leaky", "Leaky", "Where the queue leaks, if at all.",
GST_TYPE_QUEUE_LEAKY, GST_QUEUE_NO_LEAK, G_PARAM_READWRITE)); GST_TYPE_QUEUE_LEAKY, GST_QUEUE_NO_LEAK, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LEVEL, g_object_class_install_property (G_OBJECT_CLASS (gstqueue_class), ARG_LEVEL,
g_param_spec_int ("level", "Level", "How many buffers are in the queue.", g_param_spec_int ("level", "Level", "How many buffers are in the queue.",
0, G_MAXINT, 0, G_PARAM_READABLE)); 0, G_MAXINT, 0, G_PARAM_READABLE));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MAX_LEVEL, g_object_class_install_property (G_OBJECT_CLASS (gstqueue_class), ARG_MAX_LEVEL,
g_param_spec_int ("max_level", "Maximum Level", "How many buffers the queue holds.", g_param_spec_int ("max_level", "Maximum Level", "How many buffers the queue holds.",
0, G_MAXINT, 100, G_PARAM_READWRITE)); 0, G_MAXINT, 100, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MIN_THRESHOLD_BYTES, g_object_class_install_property (G_OBJECT_CLASS (gstqueue_class), ARG_MIN_THRESHOLD_BYTES,
g_param_spec_int ("min_threshold_bytes", "Minimum Threshold", g_param_spec_int ("min_threshold_bytes", "Minimum Threshold",
"Minimum bytes required before signalling not_empty to reader.", "Minimum bytes required before signalling not_empty to reader.",
0, G_MAXINT, 0, G_PARAM_READWRITE)); 0, G_MAXINT, 0, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MAY_DEADLOCK, g_object_class_install_property (G_OBJECT_CLASS (gstqueue_class), ARG_MAY_DEADLOCK,
g_param_spec_boolean ("may_deadlock", "May Deadlock", "The queue may deadlock if it's full and not PLAYING", g_param_spec_boolean ("may_deadlock", "May Deadlock", "The queue may deadlock if it's full and not PLAYING",
TRUE, G_PARAM_READWRITE)); TRUE, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BLOCK_TIMEOUT, g_object_class_install_property (G_OBJECT_CLASS (gstqueue_class), ARG_BLOCK_TIMEOUT,
g_param_spec_int ("block_timeout", "Timeout for Block", g_param_spec_int ("block_timeout", "Timeout for Block",
"Microseconds until blocked queue times out and returns filler event. " "Microseconds until blocked queue times out and returns filler event. "
"Value of -1 disables timeout", "Value of -1 disables timeout",
@ -204,8 +209,10 @@ gst_queue_getcaps (GstPad *pad, GstCaps *caps)
} }
static void static void
gst_queue_init (GstQueue *queue) gst_queue_init (GTypeInstance *instance, gpointer g_class)
{ {
GstQueue *queue = GST_QUEUE (instance);
/* scheduling on this kind of element is, well, interesting */ /* scheduling on this kind of element is, well, interesting */
GST_FLAG_SET (queue, GST_ELEMENT_DECOUPLED); GST_FLAG_SET (queue, GST_ELEMENT_DECOUPLED);
GST_FLAG_SET (queue, GST_ELEMENT_EVENT_AWARE); GST_FLAG_SET (queue, GST_ELEMENT_EVENT_AWARE);

View file

@ -30,9 +30,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_queue_details;
#define GST_TYPE_QUEUE \ #define GST_TYPE_QUEUE \
(gst_queue_get_type()) (gst_queue_get_type())
#define GST_QUEUE(obj) \ #define GST_QUEUE(obj) \

View file

@ -31,17 +31,13 @@
#define GST_CAT_DEFAULT GST_CAT_THREAD #define GST_CAT_DEFAULT GST_CAT_THREAD
#define STACK_SIZE 0x200000 #define STACK_SIZE 0x200000
GstElementDetails gst_thread_details = { static GstElementDetails gst_thread_details = GST_ELEMENT_DETAILS (
"Threaded container", "Threaded container",
"Generic/Bin", "Generic/Bin",
"LGPL",
"Container that creates/manages a thread", "Container that creates/manages a thread",
VERSION,
"Erik Walthinsen <omega@cse.ogi.edu>, " "Erik Walthinsen <omega@cse.ogi.edu>, "
"Benjamin Otte <in7y118@informatik.uni-hamburg.de", "Benjamin Otte <in7y118@informatik.uni-hamburg.de"
"(C) 1999-2003", );
};
/* Thread signals and args */ /* Thread signals and args */
enum { enum {
@ -62,9 +58,9 @@ enum {
}; };
static void gst_thread_base_init (gpointer g_class);
static void gst_thread_class_init (GstThreadClass *klass); static void gst_thread_class_init (gpointer g_class, gpointer class_data);
static void gst_thread_init (GstThread *thread); static void gst_thread_init (GTypeInstance *instance, gpointer g_class);
static void gst_thread_dispose (GObject *object); static void gst_thread_dispose (GObject *object);
@ -117,11 +113,15 @@ gst_thread_get_type(void) {
if (!thread_type) { if (!thread_type) {
static const GTypeInfo thread_info = { static const GTypeInfo thread_info = {
sizeof (GstThreadClass), NULL, NULL, sizeof (GstThreadClass),
(GClassInitFunc) gst_thread_class_init, NULL, NULL, gst_thread_base_init,
NULL,
gst_thread_class_init,
NULL,
NULL,
sizeof (GstThread), sizeof (GstThread),
4, 4,
(GInstanceInitFunc) gst_thread_init, gst_thread_init,
NULL NULL
}; };
thread_type = g_type_register_static (GST_TYPE_BIN, "GstThread", thread_type = g_type_register_static (GST_TYPE_BIN, "GstThread",
@ -130,24 +130,27 @@ gst_thread_get_type(void) {
return thread_type; return thread_type;
} }
static void
gst_thread_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_thread_details);
}
static void do_nothing (gpointer hi) {} static void do_nothing (gpointer hi) {}
static void static void
gst_thread_class_init (GstThreadClass *klass) gst_thread_class_init (gpointer g_class, gpointer class_data)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class = G_OBJECT_CLASS (g_class);
GstObjectClass *gstobject_class; GstObjectClass *gstobject_class = GST_OBJECT_CLASS (g_class);
GstElementClass *gstelement_class; GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
GstBinClass *gstbin_class; GstBinClass *gstbin_class = GST_BIN_CLASS (g_class);
GstThreadClass *klass = GST_THREAD_CLASS (g_class);
/* setup gst_thread_current */ /* setup gst_thread_current */
gst_thread_current = g_private_new (do_nothing); gst_thread_current = g_private_new (do_nothing);
gobject_class = (GObjectClass*)klass; parent_class = g_type_class_peek_parent (g_class);
gstobject_class = (GstObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
gstbin_class = (GstBinClass*)klass;
parent_class = g_type_class_ref (GST_TYPE_BIN);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PRIORITY, g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PRIORITY,
g_param_spec_enum ("priority", "Scheduling Policy", "The scheduling priority of the thread", g_param_spec_enum ("priority", "Scheduling Policy", "The scheduling priority of the thread",
@ -174,9 +177,10 @@ gst_thread_class_init (GstThreadClass *klass)
} }
static void static void
gst_thread_init (GstThread *thread) gst_thread_init (GTypeInstance *instance, gpointer g_class)
{ {
GstScheduler *scheduler; GstScheduler *scheduler;
GstThread *thread = GST_THREAD (instance);
GST_DEBUG ("initializing thread"); GST_DEBUG ("initializing thread");

View file

@ -32,8 +32,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GPrivate *gst_thread_current; extern GPrivate *gst_thread_current;
extern GstElementDetails gst_thread_details;
typedef enum { typedef enum {
GST_THREAD_STATE_SPINNING = GST_BIN_FLAG_LAST, GST_THREAD_STATE_SPINNING = GST_BIN_FLAG_LAST,

View file

@ -193,7 +193,7 @@ gst_type_find_factory_call_function (const GstTypeFindFactory *factory, GstTypeF
factory->function (find, factory->user_data); factory->function (find, factory->user_data);
} }
/** /**
* gst_type_find_factory_register: * gst_type_find_register:
* @plugin: the GstPlugin to register with * @plugin: the GstPlugin to register with
* @name: the name for registering * @name: the name for registering
* @rank: rank (or importance) of this typefind function * @rank: rank (or importance) of this typefind function
@ -209,16 +209,16 @@ gst_type_find_factory_call_function (const GstTypeFindFactory *factory, GstTypeF
* *
* Returns: TRUE on success, FALSE otherwise * Returns: TRUE on success, FALSE otherwise
*/ */
void gboolean
gst_type_find_factory_register (GstPlugin *plugin, const gchar *name, guint rank, gst_type_find_register (GstPlugin *plugin, const gchar *name, guint rank,
GstTypeFindFunction func, gchar **extensions, GstCaps *possible_caps, GstTypeFindFunction func, gchar **extensions, GstCaps *possible_caps,
gpointer data) gpointer data)
{ {
GstTypeFindFactory *factory; GstTypeFindFactory *factory;
g_return_if_fail (plugin != NULL); g_return_val_if_fail (plugin != NULL, FALSE);
g_return_if_fail (name != NULL); g_return_val_if_fail (name != NULL, FALSE);
g_return_if_fail (func != NULL); g_return_val_if_fail (func != NULL, FALSE);
GST_INFO ("registering typefind function for %s", name); GST_INFO ("registering typefind function for %s", name);
factory = GST_TYPE_FIND_FACTORY (gst_registry_pool_find_feature (name, GST_TYPE_TYPE_FIND_FACTORY)); factory = GST_TYPE_FIND_FACTORY (gst_registry_pool_find_feature (name, GST_TYPE_TYPE_FIND_FACTORY));
@ -241,6 +241,8 @@ gst_type_find_factory_register (GstPlugin *plugin, const gchar *name, guint rank
factory->user_data = data; factory->user_data = data;
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
return TRUE;
} }
/*** typefind function interface **********************************************/ /*** typefind function interface **********************************************/

View file

@ -100,7 +100,7 @@ void gst_type_find_suggest (GstTypeFind * find,
guint64 gst_type_find_get_length (GstTypeFind * find); guint64 gst_type_find_get_length (GstTypeFind * find);
/* registration interface */ /* registration interface */
void gst_type_find_factory_register (GstPlugin * plugin, gboolean gst_type_find_register (GstPlugin * plugin,
const gchar * name, const gchar * name,
guint rank, guint rank,
GstTypeFindFunction func, GstTypeFindFunction func,

View file

@ -58,10 +58,17 @@ typedef enum {
GST_RESULT_NOT_IMPL GST_RESULT_NOT_IMPL
} GstResult; } GstResult;
#define GST_RANK_PRIMARY 256
#define GST_RANK_SECONDARY 128
#define GST_RANK_MARGINAL 64
#define GST_RANK_NONE 0
#define GST_STRUCT_PADDING gpointer _gst_reserved[4]; #define GST_STRUCT_PADDING gpointer _gst_reserved[4];
#define GST_CLASS_PADDING gpointer _gst_reserved[4]; #define GST_CLASS_PADDING gpointer _gst_reserved[4];
#define GST_OBJECT_PADDING gpointer _gst_reserved[4]; #define GST_OBJECT_PADDING gpointer _gst_reserved[4];
#define GST_STRUCT_PADDING_INIT {NULL, NULL, NULL, NULL}
G_END_DECLS G_END_DECLS
#endif /* __GST_TYPES_H__ */ #endif /* __GST_TYPES_H__ */

View file

@ -993,12 +993,11 @@ gst_file_index_get_assoc_entry (GstIndex *index,
} }
gboolean gboolean
gst_file_index_plugin_init (GModule *module, GstPlugin *plugin) gst_file_index_plugin_init (GstPlugin *plugin)
{ {
GstIndexFactory *factory; GstIndexFactory *factory;
GST_DEBUG_CATEGORY_INIT(DC, "GST_FILEINDEX", 0, NULL); GST_DEBUG_CATEGORY_INIT(DC, "GST_FILEINDEX", 0, NULL);
gst_plugin_set_longname (plugin, "A file index");
factory = gst_index_factory_new ("fileindex", factory = gst_index_factory_new ("fileindex",
"A index that stores entries in file", "A index that stores entries in file",

View file

@ -21,24 +21,31 @@
#include <gst/gstversion.h> #include <gst/gstversion.h>
#include <gst/gstplugin.h> #include <gst/gstplugin.h>
extern gboolean gst_mem_index_plugin_init (GModule *module, GstPlugin *plugin); extern gboolean gst_mem_index_plugin_init (GstPlugin *plugin);
extern gboolean gst_file_index_plugin_init (GModule *module, GstPlugin *plugin); extern gboolean gst_file_index_plugin_init (GstPlugin *plugin);
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GstPlugin *plugin)
{ {
gboolean res = TRUE; gboolean res = TRUE;
res &= gst_mem_index_plugin_init (module, plugin); res &= gst_mem_index_plugin_init (plugin);
res &= gst_file_index_plugin_init (module, plugin); res &= gst_file_index_plugin_init (plugin);
return res; return res;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"gstindexers", "gstindexers",
plugin_init "Gstremaer core indexers",
}; plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)

View file

@ -397,12 +397,10 @@ gst_mem_index_get_assoc_entry (GstIndex *index, gint id,
} }
gboolean gboolean
gst_mem_index_plugin_init (GModule *module, GstPlugin *plugin) gst_mem_index_plugin_init (GstPlugin *plugin)
{ {
GstIndexFactory *factory; GstIndexFactory *factory;
gst_plugin_set_longname (plugin, "A memory index");
factory = gst_index_factory_new ("memindex", factory = gst_index_factory_new ("memindex",
"A index that stores entries in memory", "A index that stores entries in memory",
gst_mem_index_get_type()); gst_mem_index_get_type());

View file

@ -398,8 +398,8 @@ gst_xml_registry_add_path_list_func (GstXMLRegistry *registry)
g_markup_parse_context_parse (context, text, size, &error); g_markup_parse_context_parse (context, text, size, &error);
if (error) { if (error) {
fprintf (stderr, "ERROR: parsing registry %s: %s\n", GST_ERROR ("parsing registry %s: %s\n",
registry->location, error->message); registry->location, error->message);
g_free (text); g_free (text);
fclose (reg); fclose (reg);
return; return;
@ -600,7 +600,7 @@ gst_xml_registry_load (GstRegistry *registry)
g_markup_parse_context_parse (xmlregistry->context, text, size, &error); g_markup_parse_context_parse (xmlregistry->context, text, size, &error);
if (error) { if (error) {
fprintf(stderr, "ERROR: parsing registry: %s\n", error->message); GST_ERROR ("parsing registry: %s\n", error->message);
g_free (text); g_free (text);
CLASS (xmlregistry)->close_func (xmlregistry); CLASS (xmlregistry)->close_func (xmlregistry);
return FALSE; return FALSE;
@ -630,13 +630,17 @@ static GstRegistryReturn
gst_xml_registry_load_plugin (GstRegistry *registry, GstPlugin *plugin) gst_xml_registry_load_plugin (GstRegistry *registry, GstPlugin *plugin)
{ {
GError *error = NULL; GError *error = NULL;
GstPlugin *loaded_plugin;
/* FIXME: add gerror support */ /* FIXME: add gerror support */
if (!gst_plugin_load_plugin (plugin, &error)) { loaded_plugin = gst_plugin_load_file (plugin->filename, &error);
if (!plugin) {
if (error) { if (error) {
g_warning ("could not load plugin %s: %s", plugin->name, error->message); g_warning ("could not load plugin %s: %s", plugin->desc.name, error->message);
} }
return GST_REGISTRY_PLUGIN_LOAD_ERROR; return GST_REGISTRY_PLUGIN_LOAD_ERROR;
} else if (loaded_plugin != plugin) {
g_critical ("how to remove plugins?");
} }
return GST_REGISTRY_OK; return GST_REGISTRY_OK;
@ -649,14 +653,29 @@ gst_xml_registry_parse_plugin (GMarkupParseContext *context, const gchar *tag, c
GstPlugin *plugin = registry->current_plugin; GstPlugin *plugin = registry->current_plugin;
if (!strcmp (tag, "name")) { if (!strcmp (tag, "name")) {
plugin->name = g_strndup (text, text_len); plugin->desc.name = g_strndup (text, text_len);
} }
else if (!strcmp (tag, "longname")) { else if (!strcmp (tag, "description")) {
plugin->longname = g_strndup (text, text_len); plugin->desc.description = g_strndup (text, text_len);
} }
else if (!strcmp (tag, "filename")) { else if (!strcmp (tag, "filename")) {
plugin->filename = g_strndup (text, text_len); plugin->filename = g_strndup (text, text_len);
} }
else if (!strcmp (tag, "version")) {
plugin->desc.version = g_strndup (text, text_len);
}
else if (!strcmp (tag, "copyright")) {
plugin->desc.copyright = g_strndup (text, text_len);
}
else if (!strcmp (tag, "license")) {
plugin->desc.license = g_strndup (text, text_len);
}
else if (!strcmp (tag, "package")) {
plugin->desc.package = g_strndup (text, text_len);
}
else if (!strcmp (tag, "origin")) {
plugin->desc.origin = g_strndup (text, text_len);
}
return TRUE; return TRUE;
} }
@ -672,39 +691,27 @@ gst_xml_registry_parse_element_factory (GMarkupParseContext *context, const gcha
registry->current_feature->name = g_strndup (text, text_len); registry->current_feature->name = g_strndup (text, text_len);
} }
else if (!strcmp (tag, "longname")) { else if (!strcmp (tag, "longname")) {
g_free (factory->details->longname); g_free (factory->details.longname);
factory->details->longname = g_strndup (text, text_len); factory->details.longname = g_strndup (text, text_len);
} }
else if (!strcmp(tag, "class")) { else if (!strcmp(tag, "class")) {
g_free (factory->details->klass); g_free (factory->details.klass);
factory->details->klass = g_strndup (text, text_len); factory->details.klass = g_strndup (text, text_len);
} }
else if (!strcmp(tag, "description")) { else if (!strcmp(tag, "description")) {
g_free (factory->details->description); g_free (factory->details.description);
factory->details->description = g_strndup (text, text_len); factory->details.description = g_strndup (text, text_len);
}
else if (!strcmp(tag, "license")) {
g_free (factory->details->license);
factory->details->license = g_strndup (text, text_len);
}
else if (!strcmp(tag, "version")) {
g_free (factory->details->version);
factory->details->version = g_strndup (text, text_len);
} }
else if (!strcmp(tag, "author")) { else if (!strcmp(tag, "author")) {
g_free (factory->details->author); g_free (factory->details.author);
factory->details->author = g_strndup (text, text_len); factory->details.author = g_strndup (text, text_len);
}
else if (!strcmp(tag, "copyright")) {
g_free (factory->details->copyright);
factory->details->copyright = g_strndup (text, text_len);
} }
else if (!strcmp(tag, "rank")) { else if (!strcmp(tag, "rank")) {
gint rank; gint rank;
gchar *ret; gchar *ret;
rank = strtol (text, &ret, 0); rank = strtol (text, &ret, 0);
if (ret == text + text_len) { if (ret == text + text_len) {
gst_element_factory_set_rank (factory, rank); gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory), rank);
} }
} }
@ -725,7 +732,7 @@ gst_xml_registry_parse_type_find_factory (GMarkupParseContext *context, const gc
gchar *ret; gchar *ret;
rank = strtol (text, &ret, 0); rank = strtol (text, &ret, 0);
if (ret == text + text_len) { if (ret == text + text_len) {
gst_element_factory_set_rank (factory, rank); gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory), rank);
} }
} }
/* FIXME!! /* FIXME!!
@ -922,8 +929,6 @@ gst_xml_registry_start_element (GMarkupParseContext *context,
if (GST_IS_ELEMENT_FACTORY (feature)) { if (GST_IS_ELEMENT_FACTORY (feature)) {
GstElementFactory *factory = GST_ELEMENT_FACTORY (feature); GstElementFactory *factory = GST_ELEMENT_FACTORY (feature);
factory->details_dynamic = TRUE;
factory->details = g_new0(GstElementDetails, 1);
factory->padtemplates = NULL; factory->padtemplates = NULL;
xmlregistry->parser = gst_xml_registry_parse_element_factory; xmlregistry->parser = gst_xml_registry_parse_element_factory;
break; break;
@ -1129,7 +1134,7 @@ gst_xml_registry_end_element (GMarkupParseContext *context,
xmlregistry->name_template = NULL; xmlregistry->name_template = NULL;
xmlregistry->caps = NULL; xmlregistry->caps = NULL;
gst_element_factory_add_pad_template (GST_ELEMENT_FACTORY (xmlregistry->current_feature), __gst_element_factory_add_pad_template (GST_ELEMENT_FACTORY (xmlregistry->current_feature),
template); template);
xmlregistry->state = GST_XML_REGISTRY_FEATURE; xmlregistry->state = GST_XML_REGISTRY_FEATURE;
xmlregistry->parser = gst_xml_registry_parse_element_factory; xmlregistry->parser = gst_xml_registry_parse_element_factory;
@ -1212,7 +1217,7 @@ static void
gst_xml_registry_error (GMarkupParseContext *context, GError *error, gst_xml_registry_error (GMarkupParseContext *context, GError *error,
gpointer user_data) gpointer user_data)
{ {
g_print ("error %s\n", error->message); GST_ERROR ("%s\n", error->message);
} }
static void static void
@ -1461,13 +1466,10 @@ gst_xml_registry_save_feature (GstXMLRegistry *xmlregistry, GstPluginFeature *fe
GstElementFactory *factory = GST_ELEMENT_FACTORY (feature); GstElementFactory *factory = GST_ELEMENT_FACTORY (feature);
GList *templates; GList *templates;
PUT_ESCAPED ("longname", factory->details->longname); PUT_ESCAPED ("longname", factory->details.longname);
PUT_ESCAPED ("class", factory->details->klass); PUT_ESCAPED ("class", factory->details.klass);
PUT_ESCAPED ("description", factory->details->description); PUT_ESCAPED ("description", factory->details.description);
PUT_ESCAPED ("license", factory->details->license); PUT_ESCAPED ("author", factory->details.author);
PUT_ESCAPED ("version", factory->details->version);
PUT_ESCAPED ("author", factory->details->author);
PUT_ESCAPED ("copyright", factory->details->copyright);
templates = factory->padtemplates; templates = factory->padtemplates;
@ -1523,9 +1525,14 @@ gst_xml_registry_save_plugin (GstXMLRegistry *xmlregistry, GstPlugin *plugin)
{ {
GList *walk; GList *walk;
PUT_ESCAPED ("name", plugin->name); PUT_ESCAPED ("name", plugin->desc.name);
PUT_ESCAPED ("longname", plugin->longname); PUT_ESCAPED ("description", plugin->desc.description);
PUT_ESCAPED ("filename", plugin->filename); PUT_ESCAPED ("filename", plugin->filename);
PUT_ESCAPED ("version", plugin->desc.version);
PUT_ESCAPED ("license", plugin->desc.license);
PUT_ESCAPED ("copyright", plugin->desc.copyright);
PUT_ESCAPED ("package", plugin->desc.package);
PUT_ESCAPED ("origin", plugin->desc.origin);
walk = plugin->features; walk = plugin->features;
@ -1594,6 +1601,7 @@ gst_xml_registry_rebuild_recurse (GstXMLRegistry *registry,
const gchar *directory) const gchar *directory)
{ {
GDir *dir; GDir *dir;
gchar *temp;
GList *ret = NULL; GList *ret = NULL;
dir = g_dir_open (directory, 0, NULL); dir = g_dir_open (directory, 0, NULL);
@ -1615,13 +1623,9 @@ gst_xml_registry_rebuild_recurse (GstXMLRegistry *registry,
} }
g_dir_close (dir); g_dir_close (dir);
} else { } else {
if (strstr (directory, ".so")) { if ((temp = strstr (directory, G_MODULE_SUFFIX)) &&
gchar *temp; (!strcmp (temp, G_MODULE_SUFFIX))) {
ret = g_list_prepend (ret, g_strdup (directory));
if ((temp = strstr (directory, ".so")) &&
(!strcmp (temp, ".so"))) {
ret = g_list_prepend (ret, gst_plugin_new (directory));
}
} }
} }
@ -1634,6 +1638,7 @@ gst_xml_registry_rebuild (GstRegistry *registry)
GList *walk = NULL, *plugins = NULL, *prune = NULL; GList *walk = NULL, *plugins = NULL, *prune = NULL;
GError *error = NULL; GError *error = NULL;
guint length; guint length;
GstPlugin *plugin;
GstXMLRegistry *xmlregistry = GST_XML_REGISTRY (registry); GstXMLRegistry *xmlregistry = GST_XML_REGISTRY (registry);
walk = registry->paths; walk = registry->paths;
@ -1659,9 +1664,10 @@ gst_xml_registry_rebuild (GstRegistry *registry)
walk = plugins; walk = plugins;
while (walk) { while (walk) {
g_assert (walk->data); g_assert (walk->data);
if (gst_plugin_load_plugin (GST_PLUGIN (walk->data), NULL)) { plugin = gst_plugin_load_file ((gchar *) walk->data, NULL);
if (plugin) {
prune = g_list_prepend (prune, walk->data); prune = g_list_prepend (prune, walk->data);
gst_registry_add_plugin (registry, GST_PLUGIN (walk->data)); gst_registry_add_plugin (registry, plugin);
} }
walk = g_list_next (walk); walk = g_list_next (walk);
@ -1670,6 +1676,7 @@ gst_xml_registry_rebuild (GstRegistry *registry)
walk = prune; walk = prune;
while (walk) { while (walk) {
plugins = g_list_remove (plugins, walk->data); plugins = g_list_remove (plugins, walk->data);
g_free (walk->data);
walk = g_list_next (walk); walk = g_list_next (walk);
} }
g_list_free (prune); g_list_free (prune);
@ -1678,16 +1685,14 @@ gst_xml_registry_rebuild (GstRegistry *registry)
walk = plugins; walk = plugins;
while (walk) { while (walk) {
if (gst_plugin_load_plugin (GST_PLUGIN (walk->data), &error)) { if ((plugin = gst_plugin_load_file ((gchar *) walk->data, &error))) {
g_warning ("Bizarre behavior: plugin %s actually loaded", g_warning ("Bizarre behavior: plugin %s actually loaded",
((GstPlugin *) walk->data)->filename); (gchar *) walk->data);
gst_registry_add_plugin (registry, plugin);
} else { } else {
GST_CAT_INFO (GST_CAT_PLUGIN_LOADING, "Plugin %s failed to load: %s", GST_CAT_INFO (GST_CAT_PLUGIN_LOADING, "Plugin %s failed to load: %s",
((GstPlugin *) walk->data)->filename, error->message); (gchar *) walk->data, error->message);
g_print ("Plugin %s failed to load\n",
((GstPlugin *) walk->data)->filename);
g_free (((GstPlugin *) walk->data)->filename);
g_free (walk->data); g_free (walk->data);
g_error_free (error); g_error_free (error);
error = NULL; error = NULL;

View file

@ -246,15 +246,13 @@ gst_basic_scheduler_dispose (GObject *object)
} }
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GstPlugin *plugin)
{ {
GstSchedulerFactory *factory; GstSchedulerFactory *factory;
GST_DEBUG_CATEGORY_INIT (debug_dataflow, "dataflow", 0, "basic scheduler dataflow"); GST_DEBUG_CATEGORY_INIT (debug_dataflow, "dataflow", 0, "basic scheduler dataflow");
GST_DEBUG_CATEGORY_INIT (debug_scheduler, "scheduler", 0, "basic scheduler general information"); GST_DEBUG_CATEGORY_INIT (debug_scheduler, "scheduler", 0, "basic scheduler general information");
gst_plugin_set_longname (plugin, "A basic scheduler");
factory = gst_scheduler_factory_new ("basic"COTHREADS_NAME, factory = gst_scheduler_factory_new ("basic"COTHREADS_NAME,
"A basic scheduler using "COTHREADS_NAME" cothreads", "A basic scheduler using "COTHREADS_NAME" cothreads",
gst_basic_scheduler_get_type()); gst_basic_scheduler_get_type());
@ -267,12 +265,18 @@ plugin_init (GModule *module, GstPlugin *plugin)
return TRUE; return TRUE;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"gstbasic"COTHREADS_NAME"scheduler", "gstbasic"COTHREADS_NAME"scheduler",
plugin_init "a basic scheduler using "COTHREADS_NAME" cothreads",
}; plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
static int static int
gst_basic_scheduler_loopfunc_wrapper (int argc, char **argv) gst_basic_scheduler_loopfunc_wrapper (int argc, char **argv)

View file

@ -345,14 +345,12 @@ gst_opt_scheduler_dispose (GObject *object)
} }
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GstPlugin *plugin)
{ {
GstSchedulerFactory *factory; GstSchedulerFactory *factory;
GST_DEBUG_CATEGORY_INIT (debug_scheduler, "scheduler", 0, "optimal scheduler"); GST_DEBUG_CATEGORY_INIT (debug_scheduler, "scheduler", 0, "optimal scheduler");
gst_plugin_set_longname (plugin, "An optimal scheduler");
#ifdef USE_COTHREADS #ifdef USE_COTHREADS
factory = gst_scheduler_factory_new ("opt"COTHREADS_NAME, factory = gst_scheduler_factory_new ("opt"COTHREADS_NAME,
"An optimal scheduler using "COTHREADS_NAME" cothreads", "An optimal scheduler using "COTHREADS_NAME" cothreads",
@ -372,12 +370,18 @@ plugin_init (GModule *module, GstPlugin *plugin)
return TRUE; return TRUE;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"gstopt"COTHREADS_NAME"scheduler", "gstopt"COTHREADS_NAME"scheduler",
plugin_init "An optimal scheduler using "COTHREADS_NAME" cothreads",
}; plugin_init,
VERSION,
GST_LICENSE,
GST_VERSION,
GST_PACKAGE,
GST_ORIGIN
);
static void static void

View file

@ -746,17 +746,22 @@ gst_bytestream_print_status (GstByteStream * bs)
} }
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GstPlugin *plugin)
{ {
GST_DEBUG_CATEGORY_INIT (debug_bs, "bytestream", 0, "bytestream library"); GST_DEBUG_CATEGORY_INIT (debug_bs, "bytestream", 0, "bytestream library");
gst_plugin_set_longname (plugin, "GstByteStream: a byte-oriented layer on top of buffer-passing");
return TRUE; return TRUE;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"gstbytestream", "gstbytestream",
plugin_init "a byte-oriented layer on top of buffer-passing",
}; plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)

View file

@ -214,15 +214,21 @@ void gst_getbits_newbuf(gst_getbits_t *gb,unsigned char *buffer, unsigned long l
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GstPlugin *plugin)
{ {
gst_plugin_set_longname (plugin, "Accelerated routines for getting bits from a data stream");
return TRUE; return TRUE;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"gstgetbits", "gstgetbits",
plugin_init "Accelerated routines for getting bits from a data stream",
}; plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)

View file

@ -26,18 +26,15 @@
#include "gstaggregator.h" #include "gstaggregator.h"
GST_DEBUG_CATEGORY (gst_aggregator_debug); GST_DEBUG_CATEGORY_STATIC (gst_aggregator_debug);
#define GST_CAT_DEFAULT gst_aggregator_debug #define GST_CAT_DEFAULT gst_aggregator_debug
GstElementDetails gst_aggregator_details = { GstElementDetails gst_aggregator_details = GST_ELEMENT_DETAILS (
"Aggregator pipe fitting", "Aggregator pipe fitting",
"Generic", "Generic",
"LGPL",
"N-to-1 pipe fitting", "N-to-1 pipe fitting",
VERSION, "Wim Taymans <wim.taymans@chello.be>"
"Wim Taymans <wim.taymans@chello.be>", );
"(C) 2001",
};
/* Aggregator signals and args */ /* Aggregator signals and args */
enum { enum {
@ -80,6 +77,7 @@ gst_aggregator_sched_get_type (void)
#define AGGREGATOR_IS_LOOP_BASED(ag) ((ag)->sched != AGGREGATOR_CHAIN) #define AGGREGATOR_IS_LOOP_BASED(ag) ((ag)->sched != AGGREGATOR_CHAIN)
static void gst_aggregator_base_init (gpointer g_class);
static void gst_aggregator_class_init (GstAggregatorClass *klass); static void gst_aggregator_class_init (GstAggregatorClass *klass);
static void gst_aggregator_init (GstAggregator *aggregator); static void gst_aggregator_init (GstAggregator *aggregator);
@ -106,7 +104,7 @@ gst_aggregator_get_type (void)
if (!aggregator_type) { if (!aggregator_type) {
static const GTypeInfo aggregator_info = { static const GTypeInfo aggregator_info = {
sizeof(GstAggregatorClass), sizeof(GstAggregatorClass),
NULL, gst_aggregator_base_init,
NULL, NULL,
(GClassInitFunc)gst_aggregator_class_init, (GClassInitFunc)gst_aggregator_class_init,
NULL, NULL,
@ -116,10 +114,19 @@ gst_aggregator_get_type (void)
(GInstanceInitFunc)gst_aggregator_init, (GInstanceInitFunc)gst_aggregator_init,
}; };
aggregator_type = g_type_register_static (GST_TYPE_ELEMENT, "GstAggregator", &aggregator_info, 0); aggregator_type = g_type_register_static (GST_TYPE_ELEMENT, "GstAggregator", &aggregator_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_aggregator_debug, "aggregator", 0, "aggregator element");
} }
return aggregator_type; return aggregator_type;
} }
static void
gst_aggregator_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (aggregator_src_factory));
gst_element_class_set_details (gstelement_class, &gst_aggregator_details);
}
static void static void
gst_aggregator_class_init (GstAggregatorClass *klass) gst_aggregator_class_init (GstAggregatorClass *klass)
{ {
@ -360,11 +367,4 @@ gst_aggregator_chain (GstPad *pad, GstData *_data)
gst_aggregator_push (aggregator, pad, buf, "chain"); gst_aggregator_push (aggregator, pad, buf, "chain");
} }
gboolean
gst_aggregator_factory_init (GstElementFactory *factory)
{
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (aggregator_src_factory));
return TRUE;
}

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_aggregator_details;
GST_DEBUG_CATEGORY_EXTERN(gst_aggregator_debug);
typedef enum { typedef enum {
AGGREGATOR_LOOP = 1, AGGREGATOR_LOOP = 1,

View file

@ -25,7 +25,7 @@
#include "gstbufferstore.h" #include "gstbufferstore.h"
#include <string.h> #include <string.h>
GST_DEBUG_CATEGORY (gst_buffer_store_debug); GST_DEBUG_CATEGORY_STATIC (gst_buffer_store_debug);
#define GST_CAT_DEFAULT gst_buffer_store_debug #define GST_CAT_DEFAULT gst_buffer_store_debug
enum { enum {

View file

@ -46,9 +46,8 @@
struct _elements_entry { struct _elements_entry {
gchar *name; gchar *name;
guint rank;
GType (*type) (void); GType (*type) (void);
GstElementDetails *details;
gboolean (*factoryinit) (GstElementFactory *factory);
}; };
@ -56,75 +55,48 @@ extern GType gst_filesrc_get_type(void);
extern GstElementDetails gst_filesrc_details; extern GstElementDetails gst_filesrc_details;
static struct _elements_entry _elements[] = { static struct _elements_entry _elements[] = {
{ "aggregator", gst_aggregator_get_type, &gst_aggregator_details, gst_aggregator_factory_init }, { "aggregator", GST_RANK_PRIMARY, gst_aggregator_get_type },
{ "fakesrc", gst_fakesrc_get_type, &gst_fakesrc_details, gst_fakesrc_factory_init }, { "fakesrc", GST_RANK_PRIMARY, gst_fakesrc_get_type },
{ "fakesink", gst_fakesink_get_type, &gst_fakesink_details, gst_fakesink_factory_init }, { "fakesink", GST_RANK_PRIMARY, gst_fakesink_get_type },
{ "fdsink", gst_fdsink_get_type, &gst_fdsink_details, NULL }, { "fdsink", GST_RANK_PRIMARY, gst_fdsink_get_type },
{ "fdsrc", gst_fdsrc_get_type, &gst_fdsrc_details, NULL }, { "fdsrc", GST_RANK_PRIMARY, gst_fdsrc_get_type },
{ "filesrc", gst_filesrc_get_type, &gst_filesrc_details, NULL }, { "filesrc", GST_RANK_PRIMARY, gst_filesrc_get_type },
{ "filesink", gst_filesink_get_type, &gst_filesink_details, NULL }, { "filesink", GST_RANK_PRIMARY, gst_filesink_get_type },
{ "identity", gst_identity_get_type, &gst_identity_details, NULL }, { "identity", GST_RANK_PRIMARY, gst_identity_get_type },
{ "md5sink", gst_md5sink_get_type, &gst_md5sink_details, gst_md5sink_factory_init }, { "md5sink", GST_RANK_PRIMARY, gst_md5sink_get_type },
{ "multidisksrc", gst_multidisksrc_get_type, &gst_multidisksrc_details, NULL }, { "multidisksrc", GST_RANK_PRIMARY, gst_multidisksrc_get_type },
{ "pipefilter", gst_pipefilter_get_type, &gst_pipefilter_details, NULL }, { "pipefilter", GST_RANK_PRIMARY, gst_pipefilter_get_type },
{ "shaper", gst_shaper_get_type, &gst_shaper_details, gst_shaper_factory_init }, { "shaper", GST_RANK_PRIMARY, gst_shaper_get_type },
{ "statistics", gst_statistics_get_type, &gst_statistics_details, NULL }, { "statistics", GST_RANK_PRIMARY, gst_statistics_get_type },
{ "tee", gst_tee_get_type, &gst_tee_details, gst_tee_factory_init }, { "tee", GST_RANK_PRIMARY, gst_tee_get_type },
{ "typefind", gst_type_find_element_get_type, &gst_type_find_element_details, NULL }, { "typefind", GST_RANK_PRIMARY, gst_type_find_element_get_type },
{ NULL, 0 }, { NULL, 0 },
}; };
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GstPlugin *plugin)
{ {
GstElementFactory *factory; struct _elements_entry *my_elements = _elements;
gint i = 0;
while ((*my_elements).name) {
gst_plugin_set_longname (plugin, "Standard GST Elements"); if (!gst_element_register (plugin, (*my_elements).name, (*my_elements).rank, ((*my_elements).type) ()))
return FALSE;
GST_DEBUG_CATEGORY_INIT (gst_aggregator_debug, "aggregator", 0, "aggregator element"); my_elements++;
GST_DEBUG_CATEGORY_INIT (gst_fakesink_debug, "fakesink", 0, "fakesink element");
GST_DEBUG_CATEGORY_INIT (gst_fakesrc_debug, "fakesrc", 0, "fakesrc element");
GST_DEBUG_CATEGORY_INIT (gst_fdsink_debug, "fdsink", 0, "fdsink element");
GST_DEBUG_CATEGORY_INIT (gst_fdsrc_debug, "fdsrc", 0, "fdsrc element");
GST_DEBUG_CATEGORY_INIT (gst_filesink_debug, "filesink", 0, "filesink element");
GST_DEBUG_CATEGORY_INIT (gst_filesrc_debug, "filesrc", 0, "filesrc element");
GST_DEBUG_CATEGORY_INIT (gst_identity_debug, "identity", 0, "identity element");
GST_DEBUG_CATEGORY_INIT (gst_md5sink_debug, "md5sink", 0, "md5sink element");
GST_DEBUG_CATEGORY_INIT (gst_multidisksrc_debug, "multidisksrc", 0, "multidisksrc element");
GST_DEBUG_CATEGORY_INIT (gst_pipefilter_debug, "pipefilter", 0, "pipefilter element");
GST_DEBUG_CATEGORY_INIT (gst_shaper_debug, "shaper", 0, "shaper element");
GST_DEBUG_CATEGORY_INIT (gst_statistics_debug, "statistics", 0, "statistics element");
GST_DEBUG_CATEGORY_INIT (gst_tee_debug, "tee", 0, "tee element");
GST_DEBUG_CATEGORY_INIT (gst_type_find_element_debug, "typefind", GST_DEBUG_BG_YELLOW | GST_DEBUG_FG_GREEN, "typefind element");
while (_elements[i].name) {
factory = gst_element_factory_new (_elements[i].name,
(_elements[i].type) (),
_elements[i].details);
if (!factory)
{
g_warning ("gst_element_factory_new failed for `%s'",
_elements[i].name);
continue;
}
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
if (_elements[i].factoryinit) {
_elements[i].factoryinit (factory);
}
/* g_print("added factory '%s'\n",_elements[i].name); */
i++;
} }
/* INFO (GST_INFO_PLUGIN_LOAD,"gstelements: loaded %d standard elements", i);*/
return TRUE; return TRUE;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"gstelements", "gstelements",
plugin_init "standard GStreamer elements",
}; plugin_init,
VERSION,
GST_LICENSE,
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)

View file

@ -27,18 +27,15 @@
#include "gstfakesink.h" #include "gstfakesink.h"
GST_DEBUG_CATEGORY (gst_fakesink_debug); GST_DEBUG_CATEGORY_STATIC (gst_fakesink_debug);
#define GST_CAT_DEFAULT gst_fakesink_debug #define GST_CAT_DEFAULT gst_fakesink_debug
GstElementDetails gst_fakesink_details = { GstElementDetails gst_fakesink_details = GST_ELEMENT_DETAILS (
"Fake Sink", "Fake Sink",
"Sink", "Sink",
"LGPL",
"Black hole for data", "Black hole for data",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>"
"Erik Walthinsen <omega@cse.ogi.edu>", );
"(C) 1999",
};
/* FakeSink signals and args */ /* FakeSink signals and args */
@ -87,6 +84,7 @@ gst_fakesink_state_error_get_type (void)
return fakesink_state_error_type; return fakesink_state_error_type;
} }
static void gst_fakesink_base_init (gpointer g_class);
static void gst_fakesink_class_init (GstFakeSinkClass *klass); static void gst_fakesink_class_init (GstFakeSinkClass *klass);
static void gst_fakesink_init (GstFakeSink *fakesink); static void gst_fakesink_init (GstFakeSink *fakesink);
@ -114,7 +112,8 @@ gst_fakesink_get_type (void)
if (!fakesink_type) { if (!fakesink_type) {
static const GTypeInfo fakesink_info = { static const GTypeInfo fakesink_info = {
sizeof(GstFakeSinkClass), NULL, sizeof(GstFakeSinkClass),
gst_fakesink_base_init,
NULL, NULL,
(GClassInitFunc)gst_fakesink_class_init, (GClassInitFunc)gst_fakesink_class_init,
NULL, NULL,
@ -124,10 +123,20 @@ gst_fakesink_get_type (void)
(GInstanceInitFunc)gst_fakesink_init, (GInstanceInitFunc)gst_fakesink_init,
}; };
fakesink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFakeSink", &fakesink_info, 0); fakesink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFakeSink", &fakesink_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_fakesink_debug, "fakesink", 0, "fakesink element");
} }
return fakesink_type; return fakesink_type;
} }
static void
gst_fakesink_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_fakesink_details);
gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (fakesink_sink_factory));
}
static void static void
gst_fakesink_class_init (GstFakeSinkClass *klass) gst_fakesink_class_init (GstFakeSinkClass *klass)
{ {
@ -411,10 +420,3 @@ error:
return GST_STATE_FAILURE; return GST_STATE_FAILURE;
} }
gboolean
gst_fakesink_factory_init (GstElementFactory *factory)
{
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (fakesink_sink_factory));
return TRUE;
}

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_fakesink_details;
GST_DEBUG_CATEGORY_EXTERN(gst_fakesink_debug);
#define GST_TYPE_FAKESINK \ #define GST_TYPE_FAKESINK \
(gst_fakesink_get_type()) (gst_fakesink_get_type())

View file

@ -34,19 +34,16 @@
#define DEFAULT_SIZEMAX 4096 #define DEFAULT_SIZEMAX 4096
#define DEFAULT_PARENTSIZE 4096*10 #define DEFAULT_PARENTSIZE 4096*10
GST_DEBUG_CATEGORY (gst_fakesrc_debug); GST_DEBUG_CATEGORY_STATIC (gst_fakesrc_debug);
#define GST_CAT_DEFAULT gst_fakesrc_debug #define GST_CAT_DEFAULT gst_fakesrc_debug
GstElementDetails gst_fakesrc_details = { GstElementDetails gst_fakesrc_details = GST_ELEMENT_DETAILS (
"Fake Source", "Fake Source",
"Source", "Source",
"LGPL",
"Push empty (no data) buffers around", "Push empty (no data) buffers around",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>, "
"Erik Walthinsen <omega@cse.ogi.edu>\n" "Wim Taymans <wim.taymans@chello.be>"
"Wim Taymans <wim.taymans@chello.be>", );
"(C) 1999",
};
/* FakeSrc signals and args */ /* FakeSrc signals and args */
@ -101,6 +98,8 @@ gst_fakesrc_output_get_type (void)
}; };
if (!fakesrc_output_type) { if (!fakesrc_output_type) {
fakesrc_output_type = g_enum_register_static ("GstFakeSrcOutput", fakesrc_output); fakesrc_output_type = g_enum_register_static ("GstFakeSrcOutput", fakesrc_output);
GST_DEBUG_CATEGORY_INIT (gst_fakesrc_debug, "fakesrc", 0, "fakesrc element");
} }
return fakesrc_output_type; return fakesrc_output_type;
} }
@ -158,6 +157,7 @@ gst_fakesrc_filltype_get_type (void)
return fakesrc_filltype_type; return fakesrc_filltype_type;
} }
static void gst_fakesrc_base_init (gpointer g_class);
static void gst_fakesrc_class_init (GstFakeSrcClass *klass); static void gst_fakesrc_class_init (GstFakeSrcClass *klass);
static void gst_fakesrc_init (GstFakeSrc *fakesrc); static void gst_fakesrc_init (GstFakeSrc *fakesrc);
@ -184,7 +184,7 @@ gst_fakesrc_get_type (void)
if (!fakesrc_type) { if (!fakesrc_type) {
static const GTypeInfo fakesrc_info = { static const GTypeInfo fakesrc_info = {
sizeof(GstFakeSrcClass), sizeof(GstFakeSrcClass),
NULL, gst_fakesrc_base_init,
NULL, NULL,
(GClassInitFunc)gst_fakesrc_class_init, (GClassInitFunc)gst_fakesrc_class_init,
NULL, NULL,
@ -198,6 +198,14 @@ gst_fakesrc_get_type (void)
return fakesrc_type; return fakesrc_type;
} }
static void
gst_fakesrc_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_fakesrc_details);
gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (fakesrc_src_factory));
}
static void static void
gst_fakesrc_class_init (GstFakeSrcClass *klass) gst_fakesrc_class_init (GstFakeSrcClass *klass)
{ {
@ -879,10 +887,3 @@ gst_fakesrc_change_state (GstElement *element)
return GST_STATE_SUCCESS; return GST_STATE_SUCCESS;
} }
gboolean
gst_fakesrc_factory_init (GstElementFactory *factory)
{
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (fakesrc_src_factory));
return TRUE;
}

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_fakesrc_details;
GST_DEBUG_CATEGORY_EXTERN(gst_fakesrc_debug);
typedef enum { typedef enum {
FAKESRC_FIRST_LAST_LOOP = 1, FAKESRC_FIRST_LAST_LOOP = 1,

View file

@ -27,18 +27,15 @@
#include "gstfdsink.h" #include "gstfdsink.h"
#include <unistd.h> #include <unistd.h>
GST_DEBUG_CATEGORY (gst_fdsink_debug); GST_DEBUG_CATEGORY_STATIC (gst_fdsink_debug);
#define GST_CAT_DEFAULT gst_fdsink_debug #define GST_CAT_DEFAULT gst_fdsink_debug
GstElementDetails gst_fdsink_details = { GstElementDetails gst_fdsink_details = GST_ELEMENT_DETAILS (
"Filedescriptor Sink", "Filedescriptor Sink",
"Sink/File", "Sink/File",
"LGPL",
"Write data to a file descriptor", "Write data to a file descriptor",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>"
"Erik Walthinsen <omega@cse.ogi.edu>", );
"(C) 1999",
};
/* FdSink signals and args */ /* FdSink signals and args */
@ -53,6 +50,7 @@ enum {
}; };
static void gst_fdsink_base_init (gpointer g_class);
static void gst_fdsink_class_init (GstFdSinkClass *klass); static void gst_fdsink_class_init (GstFdSinkClass *klass);
static void gst_fdsink_init (GstFdSink *fdsink); static void gst_fdsink_init (GstFdSink *fdsink);
@ -73,7 +71,8 @@ gst_fdsink_get_type (void)
if (!fdsink_type) { if (!fdsink_type) {
static const GTypeInfo fdsink_info = { static const GTypeInfo fdsink_info = {
sizeof(GstFdSinkClass), NULL, sizeof(GstFdSinkClass),
gst_fdsink_base_init,
NULL, NULL,
(GClassInitFunc)gst_fdsink_class_init, (GClassInitFunc)gst_fdsink_class_init,
NULL, NULL,
@ -83,16 +82,25 @@ gst_fdsink_get_type (void)
(GInstanceInitFunc)gst_fdsink_init, (GInstanceInitFunc)gst_fdsink_init,
}; };
fdsink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFdSink", &fdsink_info, 0); fdsink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFdSink", &fdsink_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_fdsink_debug, "fdsink", 0, "fdsink element");
} }
return fdsink_type; return fdsink_type;
} }
static void
gst_fdsink_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_fdsink_details);
}
static void static void
gst_fdsink_class_init (GstFdSinkClass *klass) gst_fdsink_class_init (GstFdSinkClass *klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
gobject_class = (GObjectClass*)klass; gobject_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT); parent_class = g_type_class_ref (GST_TYPE_ELEMENT);

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_fdsink_details;
GST_DEBUG_CATEGORY_EXTERN(gst_fdsink_debug);
#define GST_TYPE_FDSINK \ #define GST_TYPE_FDSINK \
(gst_fdsink_get_type()) (gst_fdsink_get_type())

View file

@ -35,19 +35,15 @@
#define DEFAULT_BLOCKSIZE 4096 #define DEFAULT_BLOCKSIZE 4096
GST_DEBUG_CATEGORY (gst_fdsrc_debug); GST_DEBUG_CATEGORY_STATIC (gst_fdsrc_debug);
#define GST_CAT_DEFAULT gst_fdsrc_debug #define GST_CAT_DEFAULT gst_fdsrc_debug
GstElementDetails gst_fdsrc_details = GstElementDetails gst_fdsrc_details = GST_ELEMENT_DETAILS (
{
"Disk Source", "Disk Source",
"Source/File", "Source/File",
"LGPL",
"Synchronous read from a file", "Synchronous read from a file",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>"
"Erik Walthinsen <omega@cse.ogi.edu>", );
"(C) 1999",
};
/* FdSrc signals and args */ /* FdSrc signals and args */
@ -62,7 +58,7 @@ enum {
ARG_BLOCKSIZE, ARG_BLOCKSIZE,
}; };
static void gst_fdsrc_base_init (gpointer g_class);
static void gst_fdsrc_class_init (GstFdSrcClass *klass); static void gst_fdsrc_class_init (GstFdSrcClass *klass);
static void gst_fdsrc_init (GstFdSrc *fdsrc); static void gst_fdsrc_init (GstFdSrc *fdsrc);
@ -85,7 +81,7 @@ gst_fdsrc_get_type (void)
if (!fdsrc_type) { if (!fdsrc_type) {
static const GTypeInfo fdsrc_info = { static const GTypeInfo fdsrc_info = {
sizeof(GstFdSrcClass), sizeof(GstFdSrcClass),
NULL, gst_fdsrc_base_init,
NULL, NULL,
(GClassInitFunc)gst_fdsrc_class_init, (GClassInitFunc)gst_fdsrc_class_init,
NULL, NULL,
@ -95,17 +91,26 @@ gst_fdsrc_get_type (void)
(GInstanceInitFunc)gst_fdsrc_init, (GInstanceInitFunc)gst_fdsrc_init,
}; };
fdsrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFdSrc", &fdsrc_info, 0); fdsrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFdSrc", &fdsrc_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_fdsrc_debug, "fdsrc", 0, "fdsrc element");
} }
return fdsrc_type; return fdsrc_type;
} }
static void
gst_fdsrc_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_fdsrc_details);
}
static void static void
gst_fdsrc_class_init (GstFdSrcClass *klass) gst_fdsrc_class_init (GstFdSrcClass *klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
gobject_class = (GObjectClass*)klass; gobject_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_ref(GST_TYPE_ELEMENT); parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD, g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD,

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_fdsrc_details;
GST_DEBUG_CATEGORY_EXTERN(gst_fdsrc_debug);
#define GST_TYPE_FDSRC \ #define GST_TYPE_FDSRC \
(gst_fdsrc_get_type()) (gst_fdsrc_get_type())

View file

@ -33,18 +33,15 @@
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
GST_DEBUG_CATEGORY (gst_filesink_debug); GST_DEBUG_CATEGORY_STATIC (gst_filesink_debug);
#define GST_CAT_DEFAULT gst_filesink_debug #define GST_CAT_DEFAULT gst_filesink_debug
GstElementDetails gst_filesink_details = { GstElementDetails gst_filesink_details = GST_ELEMENT_DETAILS (
"File Sink", "File Sink",
"Sink/File", "Sink/File",
"LGPL",
"Write stream to a file", "Write stream to a file",
VERSION, "Thomas <thomas@apestaart.org>"
"Thomas <thomas@apestaart.org>", );
"(C) 2001"
};
/* FileSink signals and args */ /* FileSink signals and args */
@ -69,6 +66,7 @@ GST_PAD_FORMATS_FUNCTION (gst_filesink_get_formats,
) )
static void gst_filesink_base_init (gpointer g_class);
static void gst_filesink_class_init (GstFileSinkClass *klass); static void gst_filesink_class_init (GstFileSinkClass *klass);
static void gst_filesink_init (GstFileSink *filesink); static void gst_filesink_init (GstFileSink *filesink);
@ -97,7 +95,8 @@ gst_filesink_get_type (void)
if (!filesink_type) { if (!filesink_type) {
static const GTypeInfo filesink_info = { static const GTypeInfo filesink_info = {
sizeof(GstFileSinkClass), NULL, sizeof(GstFileSinkClass),
gst_filesink_base_init,
NULL, NULL,
(GClassInitFunc)gst_filesink_class_init, (GClassInitFunc)gst_filesink_class_init,
NULL, NULL,
@ -107,20 +106,26 @@ gst_filesink_get_type (void)
(GInstanceInitFunc)gst_filesink_init, (GInstanceInitFunc)gst_filesink_init,
}; };
filesink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFileSink", &filesink_info, 0); filesink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFileSink", &filesink_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_filesink_debug, "filesink", 0, "filesink element");
} }
return filesink_type; return filesink_type;
} }
static void
gst_filesink_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gstelement_class->change_state = gst_filesink_change_state;
gst_element_class_set_details (gstelement_class, &gst_filesink_details);
}
static void static void
gst_filesink_class_init (GstFileSinkClass *klass) gst_filesink_class_init (GstFileSinkClass *klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *gstelement_class;
gobject_class = (GObjectClass*)klass; parent_class = g_type_class_peek_parent (klass);
gstelement_class = (GstElementClass*)klass;
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOCATION, g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOCATION,
g_param_spec_string ("location", "File Location", "Location of the file to write", g_param_spec_string ("location", "File Location", "Location of the file to write",
@ -133,8 +138,6 @@ gst_filesink_class_init (GstFileSinkClass *klass)
gobject_class->set_property = gst_filesink_set_property; gobject_class->set_property = gst_filesink_set_property;
gobject_class->get_property = gst_filesink_get_property; gobject_class->get_property = gst_filesink_get_property;
gstelement_class->change_state = gst_filesink_change_state;
} }
static void static void

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_filesink_details;
GST_DEBUG_CATEGORY_EXTERN(gst_filesink_debug);
#define GST_TYPE_FILESINK \ #define GST_TYPE_FILESINK \
(gst_filesink_get_type()) (gst_filesink_get_type())

View file

@ -72,18 +72,15 @@
*/ */
GST_DEBUG_CATEGORY (gst_filesrc_debug); GST_DEBUG_CATEGORY_STATIC (gst_filesrc_debug);
#define GST_CAT_DEFAULT gst_filesrc_debug #define GST_CAT_DEFAULT gst_filesrc_debug
GstElementDetails gst_filesrc_details = { GstElementDetails gst_filesrc_details = GST_ELEMENT_DETAILS (
"File Source", "File Source",
"Source/File", "Source/File",
"LGPL",
"Read from arbitrary point in a file", "Read from arbitrary point in a file",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>"
"Erik Walthinsen <omega@cse.ogi.edu>", );
"(C) 1999",
};
#define DEFAULT_BLOCKSIZE 4*1024 #define DEFAULT_BLOCKSIZE 4*1024
#define DEFAULT_MMAPSIZE 4*1024*1024 #define DEFAULT_MMAPSIZE 4*1024*1024
@ -121,6 +118,7 @@ GST_PAD_FORMATS_FUNCTION (gst_filesrc_get_formats,
GST_FORMAT_BYTES GST_FORMAT_BYTES
) )
static void gst_filesrc_base_init (gpointer g_class);
static void gst_filesrc_class_init (GstFileSrcClass *klass); static void gst_filesrc_class_init (GstFileSrcClass *klass);
static void gst_filesrc_init (GstFileSrc *filesrc); static void gst_filesrc_init (GstFileSrc *filesrc);
static void gst_filesrc_dispose (GObject *object); static void gst_filesrc_dispose (GObject *object);
@ -148,7 +146,8 @@ gst_filesrc_get_type(void)
if (!filesrc_type) { if (!filesrc_type) {
static const GTypeInfo filesrc_info = { static const GTypeInfo filesrc_info = {
sizeof(GstFileSrcClass), NULL, sizeof(GstFileSrcClass),
gst_filesrc_base_init,
NULL, NULL,
(GClassInitFunc)gst_filesrc_class_init, (GClassInitFunc)gst_filesrc_class_init,
NULL, NULL,
@ -158,20 +157,28 @@ gst_filesrc_get_type(void)
(GInstanceInitFunc)gst_filesrc_init, (GInstanceInitFunc)gst_filesrc_init,
}; };
filesrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFileSrc", &filesrc_info, 0); filesrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstFileSrc", &filesrc_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_filesrc_debug, "filesrc", 0, "filesrc element");
} }
return filesrc_type; return filesrc_type;
} }
static void
gst_filesrc_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_filesrc_details);
}
static void static void
gst_filesrc_class_init (GstFileSrcClass *klass) gst_filesrc_class_init (GstFileSrcClass *klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *gstelement_class; GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
gobject_class = (GObjectClass*)klass; gobject_class = (GObjectClass*)klass;
gstelement_class = (GstElementClass*)klass;
parent_class = g_type_class_ref (GST_TYPE_ELEMENT); parent_class = g_type_class_peek_parent (klass);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD, g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD,
g_param_spec_int ("fd", "File-descriptor", "File-descriptor for the file being mmap()d", g_param_spec_int ("fd", "File-descriptor", "File-descriptor for the file being mmap()d",

View file

@ -30,8 +30,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_filesrc_details;
GST_DEBUG_CATEGORY_EXTERN(gst_filesrc_debug);
#define GST_TYPE_FILESRC \ #define GST_TYPE_FILESRC \
(gst_filesrc_get_type()) (gst_filesrc_get_type())

View file

@ -29,18 +29,15 @@
#include "gstidentity.h" #include "gstidentity.h"
GST_DEBUG_CATEGORY (gst_identity_debug); GST_DEBUG_CATEGORY_STATIC (gst_identity_debug);
#define GST_CAT_DEFAULT gst_identity_debug #define GST_CAT_DEFAULT gst_identity_debug
GstElementDetails gst_identity_details = { GstElementDetails gst_identity_details = GST_ELEMENT_DETAILS (
"Identity", "Identity",
"Generic", "Generic",
"LGPL",
"Pass data without modification", "Pass data without modification",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>"
"Erik Walthinsen <omega@cse.ogi.edu>", );
"(C) 1999",
};
/* Identity signals and args */ /* Identity signals and args */
@ -64,6 +61,7 @@ enum {
}; };
static void gst_identity_base_init (gpointer g_class);
static void gst_identity_class_init (GstIdentityClass *klass); static void gst_identity_class_init (GstIdentityClass *klass);
static void gst_identity_init (GstIdentity *identity); static void gst_identity_init (GstIdentity *identity);
@ -82,7 +80,8 @@ gst_identity_get_type (void)
if (!identity_type) { if (!identity_type) {
static const GTypeInfo identity_info = { static const GTypeInfo identity_info = {
sizeof(GstIdentityClass), NULL, sizeof(GstIdentityClass),
gst_identity_base_init,
NULL, NULL,
(GClassInitFunc)gst_identity_class_init, (GClassInitFunc)gst_identity_class_init,
NULL, NULL,
@ -92,18 +91,27 @@ gst_identity_get_type (void)
(GInstanceInitFunc)gst_identity_init, (GInstanceInitFunc)gst_identity_init,
}; };
identity_type = g_type_register_static (GST_TYPE_ELEMENT, "GstIdentity", &identity_info, 0); identity_type = g_type_register_static (GST_TYPE_ELEMENT, "GstIdentity", &identity_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_identity_debug, "identity", 0, "identity element");
} }
return identity_type; return identity_type;
} }
static void
gst_identity_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_identity_details);
}
static void static void
gst_identity_class_init (GstIdentityClass *klass) gst_identity_class_init (GstIdentityClass *klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
gobject_class = (GObjectClass*)klass; gobject_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT); parent_class = g_type_class_peek_parent (klass);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOOP_BASED, g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOOP_BASED,
g_param_spec_boolean ("loop-based", "Loop-based", g_param_spec_boolean ("loop-based", "Loop-based",

View file

@ -29,8 +29,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_identity_details;
GST_DEBUG_CATEGORY_EXTERN(gst_identity_debug);
#define GST_TYPE_IDENTITY \ #define GST_TYPE_IDENTITY \
(gst_identity_get_type()) (gst_identity_get_type())

View file

@ -32,9 +32,16 @@
#include <gst/gst.h> #include <gst/gst.h>
#include "gstmd5sink.h" #include "gstmd5sink.h"
GST_DEBUG_CATEGORY (gst_md5sink_debug); GST_DEBUG_CATEGORY_STATIC (gst_md5sink_debug);
#define GST_CAT_DEFAULT gst_md5sink_debug #define GST_CAT_DEFAULT gst_md5sink_debug
GstElementDetails gst_md5sink_details = GST_ELEMENT_DETAILS (
"MD5 Sink",
"Sink",
"compute MD5 for incoming data",
"Benjamin Otte <in7y118@public.uni-hamburg.de>"
);
/* MD5Sink signals and args */ /* MD5Sink signals and args */
enum { enum {
/* FILL ME */ /* FILL ME */
@ -55,6 +62,7 @@ GST_PAD_TEMPLATE_FACTORY (md5_sink_factory,
); );
/* GObject stuff */ /* GObject stuff */
static void gst_md5sink_base_init (gpointer g_class);
static void gst_md5sink_class_init (GstMD5SinkClass *klass); static void gst_md5sink_class_init (GstMD5SinkClass *klass);
static void gst_md5sink_init (GstMD5Sink *md5sink); static void gst_md5sink_init (GstMD5Sink *md5sink);
@ -381,7 +389,7 @@ gst_md5sink_get_type (void)
if (!md5sink_type) { if (!md5sink_type) {
static const GTypeInfo md5sink_info = { static const GTypeInfo md5sink_info = {
sizeof(GstMD5SinkClass), sizeof(GstMD5SinkClass),
NULL, gst_md5sink_base_init,
NULL, NULL,
(GClassInitFunc) gst_md5sink_class_init, (GClassInitFunc) gst_md5sink_class_init,
NULL, NULL,
@ -392,10 +400,20 @@ gst_md5sink_get_type (void)
}; };
md5sink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstMD5Sink", md5sink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstMD5Sink",
&md5sink_info, 0); &md5sink_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_md5sink_debug, "md5sink", 0, "md5sink element");
} }
return md5sink_type; return md5sink_type;
} }
static void
gst_md5sink_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_md5sink_details);
gst_element_class_add_pad_template (gstelement_class, GST_PAD_TEMPLATE_GET (md5_sink_factory));
}
static void static void
gst_md5sink_class_init (GstMD5SinkClass *klass) gst_md5sink_class_init (GstMD5SinkClass *klass)
{ {
@ -405,15 +423,15 @@ gst_md5sink_class_init (GstMD5SinkClass *klass)
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
parent_class = g_type_class_ref (GST_TYPE_ELEMENT); parent_class = g_type_class_peek_parent (klass);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_md5sink_get_property);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MD5, g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MD5,
g_param_spec_string ("md5", "md5", "current value of the md5 sum", g_param_spec_string ("md5", "md5", "current value of the md5 sum",
"", G_PARAM_READABLE)); "", G_PARAM_READABLE));
gstelement_class->change_state = GST_DEBUG_FUNCPTR(gst_md5sink_change_state); gstelement_class->change_state = GST_DEBUG_FUNCPTR(gst_md5sink_change_state);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_md5sink_get_property);
} }
static void static void
@ -508,20 +526,3 @@ gst_md5sink_chain (GstPad *pad, GstData *_data)
gst_buffer_unref (buf); gst_buffer_unref (buf);
} }
GstElementDetails gst_md5sink_details = {
"MD5 Sink",
"Sink",
"LGPL",
"compute MD5 for incoming data",
VERSION,
"Benjamin Otte <in7y118@public.uni-hamburg.de>",
"(C) 2002",
};
gboolean
gst_md5sink_factory_init (GstElementFactory *factory)
{
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (md5_sink_factory));
return TRUE;
}

View file

@ -29,8 +29,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_md5sink_details;
GST_DEBUG_CATEGORY_EXTERN(gst_md5sink_debug);
#define GST_TYPE_MD5SINK \ #define GST_TYPE_MD5SINK \
(gst_md5sink_get_type()) (gst_md5sink_get_type())

View file

@ -33,18 +33,15 @@
#include "gstmultidisksrc.h" #include "gstmultidisksrc.h"
GST_DEBUG_CATEGORY (gst_multidisksrc_debug); GST_DEBUG_CATEGORY_STATIC (gst_multidisksrc_debug);
#define GST_CAT_DEFAULT gst_multidisksrc_debug #define GST_CAT_DEFAULT gst_multidisksrc_debug
GstElementDetails gst_multidisksrc_details = { GstElementDetails gst_multidisksrc_details = GST_ELEMENT_DETAILS (
"Multi Disk Source", "Multi Disk Source",
"Source/File", "Source/File",
"LGPL",
"Read from multiple files in order", "Read from multiple files in order",
VERSION, "Dominic Ludlam <dom@openfx.org>"
"Dominic Ludlam <dom@openfx.org>", );
"(C) 2001",
};
/* DiskSrc signals and args */ /* DiskSrc signals and args */
enum { enum {
@ -57,6 +54,7 @@ enum {
ARG_LOCATIONS, ARG_LOCATIONS,
}; };
static void gst_multidiscsrc_base_init (gpointer g_class);
static void gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass); static void gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass);
static void gst_multidisksrc_init (GstMultiDiskSrc *disksrc); static void gst_multidisksrc_init (GstMultiDiskSrc *disksrc);
@ -81,7 +79,8 @@ gst_multidisksrc_get_type(void)
if (!multidisksrc_type) { if (!multidisksrc_type) {
static const GTypeInfo multidisksrc_info = { static const GTypeInfo multidisksrc_info = {
sizeof(GstMultiDiskSrcClass), NULL, sizeof(GstMultiDiskSrcClass),
gst_multidiscsrc_base_init,
NULL, NULL,
(GClassInitFunc)gst_multidisksrc_class_init, (GClassInitFunc)gst_multidisksrc_class_init,
NULL, NULL,
@ -91,10 +90,19 @@ gst_multidisksrc_get_type(void)
(GInstanceInitFunc)gst_multidisksrc_init, (GInstanceInitFunc)gst_multidisksrc_init,
}; };
multidisksrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstMultiDiskSrc", &multidisksrc_info, 0); multidisksrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstMultiDiskSrc", &multidisksrc_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_multidisksrc_debug, "multidisksrc", 0, "multidisksrc element");
} }
return multidisksrc_type; return multidisksrc_type;
} }
static void
gst_multidiscsrc_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_multidisksrc_details);
}
static void static void
gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass) gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass)
{ {

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_multidisksrc_details;
GST_DEBUG_CATEGORY_EXTERN(gst_multidisksrc_debug);
#define GST_TYPE_MULTIDISKSRC \ #define GST_TYPE_MULTIDISKSRC \
(gst_multidisksrc_get_type()) (gst_multidisksrc_get_type())

View file

@ -33,18 +33,15 @@
#include "gstmultidisksrc.h" #include "gstmultidisksrc.h"
GST_DEBUG_CATEGORY (gst_multidisksrc_debug); GST_DEBUG_CATEGORY_STATIC (gst_multidisksrc_debug);
#define GST_CAT_DEFAULT gst_multidisksrc_debug #define GST_CAT_DEFAULT gst_multidisksrc_debug
GstElementDetails gst_multidisksrc_details = { GstElementDetails gst_multidisksrc_details = GST_ELEMENT_DETAILS (
"Multi Disk Source", "Multi Disk Source",
"Source/File", "Source/File",
"LGPL",
"Read from multiple files in order", "Read from multiple files in order",
VERSION, "Dominic Ludlam <dom@openfx.org>"
"Dominic Ludlam <dom@openfx.org>", );
"(C) 2001",
};
/* DiskSrc signals and args */ /* DiskSrc signals and args */
enum { enum {
@ -57,6 +54,7 @@ enum {
ARG_LOCATIONS, ARG_LOCATIONS,
}; };
static void gst_multidiscsrc_base_init (gpointer g_class);
static void gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass); static void gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass);
static void gst_multidisksrc_init (GstMultiDiskSrc *disksrc); static void gst_multidisksrc_init (GstMultiDiskSrc *disksrc);
@ -81,7 +79,8 @@ gst_multidisksrc_get_type(void)
if (!multidisksrc_type) { if (!multidisksrc_type) {
static const GTypeInfo multidisksrc_info = { static const GTypeInfo multidisksrc_info = {
sizeof(GstMultiDiskSrcClass), NULL, sizeof(GstMultiDiskSrcClass),
gst_multidiscsrc_base_init,
NULL, NULL,
(GClassInitFunc)gst_multidisksrc_class_init, (GClassInitFunc)gst_multidisksrc_class_init,
NULL, NULL,
@ -91,10 +90,19 @@ gst_multidisksrc_get_type(void)
(GInstanceInitFunc)gst_multidisksrc_init, (GInstanceInitFunc)gst_multidisksrc_init,
}; };
multidisksrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstMultiDiskSrc", &multidisksrc_info, 0); multidisksrc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstMultiDiskSrc", &multidisksrc_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_multidisksrc_debug, "multidisksrc", 0, "multidisksrc element");
} }
return multidisksrc_type; return multidisksrc_type;
} }
static void
gst_multidiscsrc_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_multidisksrc_details);
}
static void static void
gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass) gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass)
{ {

View file

@ -28,8 +28,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_multidisksrc_details;
GST_DEBUG_CATEGORY_EXTERN(gst_multidisksrc_debug);
#define GST_TYPE_MULTIDISKSRC \ #define GST_TYPE_MULTIDISKSRC \
(gst_multidisksrc_get_type()) (gst_multidisksrc_get_type())

View file

@ -35,19 +35,16 @@
#include "gstpipefilter.h" #include "gstpipefilter.h"
GST_DEBUG_CATEGORY (gst_pipefilter_debug); GST_DEBUG_CATEGORY_STATIC (gst_pipefilter_debug);
#define GST_CAT_DEFAULT gst_pipefilter_debug #define GST_CAT_DEFAULT gst_pipefilter_debug
GstElementDetails gst_pipefilter_details = { GstElementDetails gst_pipefilter_details = GST_ELEMENT_DETAILS (
"Pipefilter", "Pipefilter",
"Filter", "Filter",
"LGPL",
"Interoperate with an external program using stdin and stdout", "Interoperate with an external program using stdin and stdout",
VERSION, "Erik Walthinsen <omega@cse.ogi.edu>, "
"Erik Walthinsen <omega@cse.ogi.edu>\n" "Wim Taymans <wim.taymans@chello.be>"
"Wim Taymans <wim.taymans@chello.be>", );
"(C) 1999",
};
/* Pipefilter signals and args */ /* Pipefilter signals and args */
@ -62,13 +59,14 @@ enum {
}; };
static void gst_pipefilter_base_init (gpointer g_class);
static void gst_pipefilter_class_init (GstPipefilterClass *klass); static void gst_pipefilter_class_init (GstPipefilterClass *klass);
static void gst_pipefilter_init (GstPipefilter *pipefilter); static void gst_pipefilter_init (GstPipefilter *pipefilter);
static void gst_pipefilter_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void gst_pipefilter_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_pipefilter_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void gst_pipefilter_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstData* gst_pipefilter_get (GstPad *pad); static GstData* gst_pipefilter_get (GstPad *pad);
static void gst_pipefilter_chain (GstPad *pad, GstData *_data); static void gst_pipefilter_chain (GstPad *pad, GstData *_data);
static gboolean gst_pipefilter_handle_event (GstPad *pad, GstEvent *event); static gboolean gst_pipefilter_handle_event (GstPad *pad, GstEvent *event);
@ -84,7 +82,8 @@ gst_pipefilter_get_type (void)
if (!pipefilter_type) { if (!pipefilter_type) {
static const GTypeInfo pipefilter_info = { static const GTypeInfo pipefilter_info = {
sizeof(GstPipefilterClass), NULL, sizeof(GstPipefilterClass),
gst_pipefilter_base_init,
NULL, NULL,
(GClassInitFunc)gst_pipefilter_class_init, (GClassInitFunc)gst_pipefilter_class_init,
NULL, NULL,
@ -94,10 +93,19 @@ gst_pipefilter_get_type (void)
(GInstanceInitFunc)gst_pipefilter_init, (GInstanceInitFunc)gst_pipefilter_init,
}; };
pipefilter_type = g_type_register_static(GST_TYPE_ELEMENT, "GstPipefilter", &pipefilter_info, 0); pipefilter_type = g_type_register_static(GST_TYPE_ELEMENT, "GstPipefilter", &pipefilter_info, 0);
GST_DEBUG_CATEGORY_INIT (gst_pipefilter_debug, "pipefilter", 0, "pipefilter element");
} }
return pipefilter_type; return pipefilter_type;
} }
static void
gst_pipefilter_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_pipefilter_details);
}
static void static void
gst_pipefilter_class_init (GstPipefilterClass *klass) gst_pipefilter_class_init (GstPipefilterClass *klass)
{ {
@ -109,14 +117,14 @@ gst_pipefilter_class_init (GstPipefilterClass *klass)
parent_class = g_type_class_ref(GST_TYPE_ELEMENT); parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
gstelement_class->change_state = gst_pipefilter_change_state; gobject_class->set_property = gst_pipefilter_set_property;
gobject_class->get_property = gst_pipefilter_get_property;
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_COMMAND, g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_COMMAND,
g_param_spec_string("command","command","command", g_param_spec_string("command","command","command",
NULL, G_PARAM_READWRITE)); /* CHECKME */ NULL, G_PARAM_READWRITE)); /* CHECKME */
gobject_class->set_property = gst_pipefilter_set_property; gstelement_class->change_state = gst_pipefilter_change_state;
gobject_class->get_property = gst_pipefilter_get_property;
} }
static void static void

View file

@ -29,8 +29,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
extern GstElementDetails gst_pipefilter_details;
GST_DEBUG_CATEGORY_EXTERN(gst_pipefilter_debug);
#define GST_TYPE_PIPEFILTER \ #define GST_TYPE_PIPEFILTER \
(gst_pipefilter_get_type()) (gst_pipefilter_get_type())

Some files were not shown because too many files have changed in this diff Show more