dnl # Set up some more defines #
dnl ############################
-dnl Set location of registry dir.
-AC_DEFINE_UNQUOTED(GST_CACHE_DIR, "$GST_CACHE_DIR", [Define the registry directory])
-AC_SUBST(GST_CACHE_DIR)
+dnl set license and copyright notice
+AC_DEFINE(GST_LICENSE, "LGPL", [GStreamer license])
+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
if test "x${prefix}" = "xNONE"; then
#include <string.h>
#include "example.h"
-/* The ElementDetails structure gives a human-readable description
- * of the plugin, as well as author and version data.
+/* The ElementDetails structure gives a human-readable description of the
+ * 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",
"Example/FirstExample",
- "LGPL",
"Shows the basic structure of a plugin",
- "0.1",
- "your name <your.name@your.isp>",
- "(C) 2001",
-};
+ "your name <your.name@your.isp>"
+);
/* These are the signals that this element can fire. They are zero-
* based because the numbers themselves are private to the object.
/* we also override the default state change handler with our own
* implementation */
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 called to register everything that the plugin provides.
*/
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
- GstElementFactory *factory;
-
- /* We need to create an ElementFactory for each element we provide.
- * This consists of the name of the element, the GType identifier,
- * and a pointer to the details structure at the top of the file.
+ /* 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
+ * when compared to similar plugins and the GType identifier.
*/
- factory = gst_element_factory_new("example", GST_TYPE_EXAMPLE, &example_details);
- g_return_val_if_fail(factory != NULL, 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));
+ if (!gst_element_register (plugin, "example", GST_RANK_MARGINAL, GST_TYPE_EXAMPLE))
+ return FALSE;
/* Now we can return successfully. */
return TRUE;
/* 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.
*/
}
* The symbol pointing to this structure is the only symbol looked up when
* loading the plugin.
*/
-GstPluginDesc plugin_desc = {
- 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 */
- "example", /* The name of the plugin. This must be unique: plugins with
- * the same name will be assumed to be identical, and only
- * one will be loaded. */
- plugin_init /* Pointer to the initialisation function for the plugin. */
-};
+GST_PLUGIN_DEFINE (
+ 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 */
+ "example", /* The name of the plugin. This must be unique: plugins with
+ * the same name will be assumed to be identical, and only
+ * one will be loaded. */
+ "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. */
+);
GST_DEBUG_CATEGORY_STATIC(debug_category);
#define GST_CAT_DEFAULT debug_category
-GstElementDetails gst_autoplugcache_details = {
+GstElementDetails gst_autoplugcache_details = GST_ELEMENT_DETAILS (
"AutoplugCache",
"Generic",
- "LGPL",
"Data cache for the dynamic autoplugger",
- VERSION,
- "Erik Walthinsen <omega@temple-baptist.com>",
- "(C) 2001 RidgeRun, Inc. (www.ridgerun.com)",
-};
+ "Erik Walthinsen <omega@temple-baptist.com>"
+);
#define GST_TYPE_AUTOPLUGCACHE \
(gst_autoplugcache_get_type())
gobject_class->get_property = gst_autoplugcache_get_property;
gstelement_class->change_state = gst_autoplugcache_change_state;
+ gst_element_class_set_details (gstelement_class, &gst_autoplugcache_details);
}
static void
}
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
- GstElementFactory *factory;
-
GST_DEBUG_CATEGORY_INIT (debug_category, "AUTOPLUGCACHE", 0, "autoplugcache element");
- factory = gst_element_factory_new ("autoplugcache", GST_TYPE_AUTOPLUGCACHE,
- &gst_autoplugcache_details);
- g_return_val_if_fail (factory != NULL, FALSE);
-
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
+ if (!gst_element_register (plugin, "autoplugcache", GST_RANK_NONE, GST_TYPE_AUTOPLUGCACHE))
+ return FALSE;
return TRUE;
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"autoplugcache",
- plugin_init
-};
+ "an autoplug cache",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
+)
#include <gst/gst.h>
-GstElementDetails gst_autoplugger_details = {
+GstElementDetails gst_autoplugger_details = GST_ELEMENT_DETAILS (
"Dynamic autoplugger",
"Generic",
- "LGPL",
"Magic element that converts from any type to any other",
- VERSION,
- "Erik Walthinsen <omega@temple-baptist.com>",
- "(C) 2001 RidgeRun, Inc. (www.ridgerun.com)",
-};
+ "Erik Walthinsen <omega@temple-baptist.com>"
+);
#define GST_TYPE_AUTOPLUGGER \
(gst_autoplugger_get_type())
gobject_class->get_property = gst_autoplugger_get_property;
/* gstelement_class->change_state = gst_autoplugger_change_state; */
+ gst_element_class_set_details (gstelement_class, &gst_autoplugger_details);
}
static void
}
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
- GstElementFactory *factory;
-
- 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));
+ if (!gst_element_register (plugin, "autoplugger", GST_RANK_NONE, GST_TYPE_AUTOPLUGGER))
+ return FALSE;
return TRUE;
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"autoplugger",
- plugin_init
-};
+ "magic element that converts from any type tom any other",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
+)
GstAutoplugNode *node = g_new0 (GstAutoplugNode, 1);
node->prev = NULL;
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->cost = (node->templ ? gst_autoplug_get_cost (node->fac)
: GST_AUTOPLUG_MAX_COST);
node->endpoint = gst_autoplug_can_connect_sink (node->fac, sinkcaps);
if (node->templ && node->endpoint)
GST_DEBUG ("%s makes connection possible",
- node->fac->details->longname);
+ node->fac->details.longname);
else
GST_DEBUG ("direct connection with %s not possible",
- node->fac->details->longname);
+ node->fac->details.longname);
if ((node->endpoint != NULL) &&
((bestnode == NULL) || (node->cost < bestnode->cost)))
{
gobject_class->dispose = gst_spider_dispose;
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);
}
{
/* is the element the pad is linked to of the right type? */
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 result;
}
-GstElementDetails gst_spider_details = {
+GstElementDetails gst_spider_details = GST_ELEMENT_DETAILS (
"Spider",
"Generic",
- "LGPL",
"Automatically link sinks and sources",
- VERSION,
- "Benjamin Otte <in7y118@public.uni-hamburg.de>",
- "(C) 2002",
-};
+ "Benjamin Otte <in7y118@public.uni-hamburg.de>"
+);
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_identity_debug, "spideridentity", 0, "spider autoplugging proxy element");
-
- factory = gst_element_factory_new("spider", GST_TYPE_SPIDER,
- &gst_spider_details);
- gst_plugin_set_longname (plugin, "Spider autoplugging elements");
- g_return_val_if_fail(factory != NULL, 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));
+ if (!gst_element_register (plugin, "spider", GST_RANK_SECONDARY, GST_TYPE_SPIDER))
+ return FALSE;
+ if (!gst_element_register (plugin, "spideridentity", GST_RANK_NONE, GST_TYPE_SPIDER_IDENTITY))
+ return FALSE;
return TRUE;
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"gstspider",
- plugin_init
-};
+ "a 1:n autoplugger",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
+)
#include "gstspideridentity.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
-GstElementDetails gst_spider_identity_details = {
+static GstElementDetails gst_spider_identity_details = GST_ELEMENT_DETAILS (
"SpiderIdentity",
"Generic",
- "LGPL",
"Link between spider and outside elements",
- VERSION,
- "Benjamin Otte <in7y118@public.uni-hamburg.de>",
- "(C) 2002",
-};
+ "Benjamin Otte <in7y118@public.uni-hamburg.de>"
+);
/* generic templates
GST_PAD_TEMPLATE_FACTORY (spider_src_factory,
"src",
GST_PAD_SRC,
- GST_PAD_REQUEST,
+ GST_PAD_ALWAYS,
NULL /* no caps */
);
GST_PAD_TEMPLATE_FACTORY (spider_sink_factory,
"sink",
GST_PAD_SINK,
- GST_PAD_REQUEST,
+ GST_PAD_ALWAYS,
NULL /* no caps */
);
0,
(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;
}
/* 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_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->request_new_pad = GST_DEBUG_FUNCPTR(gst_spider_identity_request_new_pad);
/* variables */
ident->plugged = FALSE;
-
}
static void
G_BEGIN_DECLS
-extern GstElementDetails gst_spider_identity_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_spider_identity_debug);
-
#define GST_TYPE_SPIDER_IDENTITY \
(gst_spider_identity_get_type())
#define GST_SPIDER_IDENTITY(obj) \
* Boston, MA 02111-1307, USA.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include "gststaticautoplug.h"
#include <gst/gst.h>
}
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
GstAutoplugFactory *factory;
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",
"A static autoplugger, it constructs the complete element before running it",
gst_static_autoplug_get_type ());
return TRUE;
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"gststaticautoplug",
- plugin_init
-};
+ "a static autoplugger",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
+)
static gboolean
gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest)
* Boston, MA 02111-1307, USA.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include "gststaticautoplugrender.h"
#include <gst/gst.h>
}
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
GstAutoplugFactory *factory;
- gst_plugin_set_longname (plugin, "A static autoplugger");
-
GST_DEBUG_CATEGORY_INIT (debug_category, "STATIC_AUTOPLUG", 0, "static autoplug render element");
factory = gst_autoplug_factory_new ("staticrender",
return TRUE;
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"gststaticautoplugrender",
- plugin_init
-};
+ "a static autoplugger",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
+)
static GstPadTemplate*
gst_autoplug_match_caps (GstElementFactory *factory, GstPadDirection direction, GstCaps *caps)
#include "gstaggregator.h"
-GST_DEBUG_CATEGORY (gst_aggregator_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_aggregator_debug);
#define GST_CAT_DEFAULT gst_aggregator_debug
-GstElementDetails gst_aggregator_details = {
+GstElementDetails gst_aggregator_details = GST_ELEMENT_DETAILS (
"Aggregator pipe fitting",
"Generic",
- "LGPL",
"N-to-1 pipe fitting",
- VERSION,
- "Wim Taymans <wim.taymans@chello.be>",
- "(C) 2001",
-};
+ "Wim Taymans <wim.taymans@chello.be>"
+);
/* Aggregator signals and args */
enum {
#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_init (GstAggregator *aggregator);
if (!aggregator_type) {
static const GTypeInfo aggregator_info = {
sizeof(GstAggregatorClass),
- NULL,
+ gst_aggregator_base_init,
NULL,
(GClassInitFunc)gst_aggregator_class_init,
NULL,
(GInstanceInitFunc)gst_aggregator_init,
};
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;
}
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
gst_aggregator_class_init (GstAggregatorClass *klass)
{
GObjectClass *gobject_class;
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;
-}
+
G_BEGIN_DECLS
-extern GstElementDetails gst_aggregator_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_aggregator_debug);
typedef enum {
AGGREGATOR_LOOP = 1,
#include "gstbufferstore.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
enum {
struct _elements_entry {
gchar *name;
+ guint rank;
GType (*type) (void);
- GstElementDetails *details;
- gboolean (*factoryinit) (GstElementFactory *factory);
};
extern GstElementDetails gst_filesrc_details;
static struct _elements_entry _elements[] = {
- { "aggregator", gst_aggregator_get_type, &gst_aggregator_details, gst_aggregator_factory_init },
- { "fakesrc", gst_fakesrc_get_type, &gst_fakesrc_details, gst_fakesrc_factory_init },
- { "fakesink", gst_fakesink_get_type, &gst_fakesink_details, gst_fakesink_factory_init },
- { "fdsink", gst_fdsink_get_type, &gst_fdsink_details, NULL },
- { "fdsrc", gst_fdsrc_get_type, &gst_fdsrc_details, NULL },
- { "filesrc", gst_filesrc_get_type, &gst_filesrc_details, NULL },
- { "filesink", gst_filesink_get_type, &gst_filesink_details, NULL },
- { "identity", gst_identity_get_type, &gst_identity_details, NULL },
- { "md5sink", gst_md5sink_get_type, &gst_md5sink_details, gst_md5sink_factory_init },
- { "multidisksrc", gst_multidisksrc_get_type, &gst_multidisksrc_details, NULL },
- { "pipefilter", gst_pipefilter_get_type, &gst_pipefilter_details, NULL },
- { "shaper", gst_shaper_get_type, &gst_shaper_details, gst_shaper_factory_init },
- { "statistics", gst_statistics_get_type, &gst_statistics_details, NULL },
- { "tee", gst_tee_get_type, &gst_tee_details, gst_tee_factory_init },
- { "typefind", gst_type_find_element_get_type, &gst_type_find_element_details, NULL },
+ { "aggregator", GST_RANK_PRIMARY, gst_aggregator_get_type },
+ { "fakesrc", GST_RANK_PRIMARY, gst_fakesrc_get_type },
+ { "fakesink", GST_RANK_PRIMARY, gst_fakesink_get_type },
+ { "fdsink", GST_RANK_PRIMARY, gst_fdsink_get_type },
+ { "fdsrc", GST_RANK_PRIMARY, gst_fdsrc_get_type },
+ { "filesrc", GST_RANK_PRIMARY, gst_filesrc_get_type },
+ { "filesink", GST_RANK_PRIMARY, gst_filesink_get_type },
+ { "identity", GST_RANK_PRIMARY, gst_identity_get_type },
+ { "md5sink", GST_RANK_PRIMARY, gst_md5sink_get_type },
+ { "multidisksrc", GST_RANK_PRIMARY, gst_multidisksrc_get_type },
+ { "pipefilter", GST_RANK_PRIMARY, gst_pipefilter_get_type },
+ { "shaper", GST_RANK_PRIMARY, gst_shaper_get_type },
+ { "statistics", GST_RANK_PRIMARY, gst_statistics_get_type },
+ { "tee", GST_RANK_PRIMARY, gst_tee_get_type },
+ { "typefind", GST_RANK_PRIMARY, gst_type_find_element_get_type },
{ NULL, 0 },
};
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
- GstElementFactory *factory;
- gint i = 0;
-
- gst_plugin_set_longname (plugin, "Standard GST Elements");
-
- GST_DEBUG_CATEGORY_INIT (gst_aggregator_debug, "aggregator", 0, "aggregator element");
- 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++;
+ struct _elements_entry *my_elements = _elements;
+
+ while ((*my_elements).name) {
+ if (!gst_element_register (plugin, (*my_elements).name, (*my_elements).rank, ((*my_elements).type) ()))
+ return FALSE;
+ my_elements++;
}
-/* INFO (GST_INFO_PLUGIN_LOAD,"gstelements: loaded %d standard elements", i);*/
return TRUE;
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"gstelements",
- plugin_init
-};
+ "standard GStreamer elements",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
+)
+
#include "gstfakesink.h"
-GST_DEBUG_CATEGORY (gst_fakesink_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_fakesink_debug);
#define GST_CAT_DEFAULT gst_fakesink_debug
-GstElementDetails gst_fakesink_details = {
+GstElementDetails gst_fakesink_details = GST_ELEMENT_DETAILS (
"Fake Sink",
"Sink",
- "LGPL",
"Black hole for data",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>"
+);
/* FakeSink signals and args */
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_init (GstFakeSink *fakesink);
if (!fakesink_type) {
static const GTypeInfo fakesink_info = {
- sizeof(GstFakeSinkClass), NULL,
+ sizeof(GstFakeSinkClass),
+ gst_fakesink_base_init,
NULL,
(GClassInitFunc)gst_fakesink_class_init,
NULL,
(GInstanceInitFunc)gst_fakesink_init,
};
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;
}
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
gst_fakesink_class_init (GstFakeSinkClass *klass)
{
GObjectClass *gobject_class;
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;
-}
G_BEGIN_DECLS
-extern GstElementDetails gst_fakesink_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_fakesink_debug);
#define GST_TYPE_FAKESINK \
(gst_fakesink_get_type())
#define DEFAULT_SIZEMAX 4096
#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
-GstElementDetails gst_fakesrc_details = {
+GstElementDetails gst_fakesrc_details = GST_ELEMENT_DETAILS (
"Fake Source",
"Source",
- "LGPL",
"Push empty (no data) buffers around",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>\n"
- "Wim Taymans <wim.taymans@chello.be>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>, "
+ "Wim Taymans <wim.taymans@chello.be>"
+);
/* FakeSrc signals and args */
};
if (!fakesrc_output_type) {
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_filltype_type;
}
+static void gst_fakesrc_base_init (gpointer g_class);
static void gst_fakesrc_class_init (GstFakeSrcClass *klass);
static void gst_fakesrc_init (GstFakeSrc *fakesrc);
if (!fakesrc_type) {
static const GTypeInfo fakesrc_info = {
sizeof(GstFakeSrcClass),
- NULL,
+ gst_fakesrc_base_init,
NULL,
(GClassInitFunc)gst_fakesrc_class_init,
NULL,
}
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
gst_fakesrc_class_init (GstFakeSrcClass *klass)
{
GObjectClass *gobject_class;
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;
-}
G_BEGIN_DECLS
-extern GstElementDetails gst_fakesrc_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_fakesrc_debug);
typedef enum {
FAKESRC_FIRST_LAST_LOOP = 1,
#include "gstfdsink.h"
#include <unistd.h>
-GST_DEBUG_CATEGORY (gst_fdsink_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_fdsink_debug);
#define GST_CAT_DEFAULT gst_fdsink_debug
-GstElementDetails gst_fdsink_details = {
+GstElementDetails gst_fdsink_details = GST_ELEMENT_DETAILS (
"Filedescriptor Sink",
"Sink/File",
- "LGPL",
"Write data to a file descriptor",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>"
+);
/* FdSink signals and args */
};
+static void gst_fdsink_base_init (gpointer g_class);
static void gst_fdsink_class_init (GstFdSinkClass *klass);
static void gst_fdsink_init (GstFdSink *fdsink);
if (!fdsink_type) {
static const GTypeInfo fdsink_info = {
- sizeof(GstFdSinkClass), NULL,
+ sizeof(GstFdSinkClass),
+ gst_fdsink_base_init,
NULL,
(GClassInitFunc)gst_fdsink_class_init,
NULL,
(GInstanceInitFunc)gst_fdsink_init,
};
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;
}
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
gst_fdsink_class_init (GstFdSinkClass *klass)
{
GObjectClass *gobject_class;
- gobject_class = (GObjectClass*)klass;
+ gobject_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
G_BEGIN_DECLS
-extern GstElementDetails gst_fdsink_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_fdsink_debug);
#define GST_TYPE_FDSINK \
(gst_fdsink_get_type())
#define DEFAULT_BLOCKSIZE 4096
-GST_DEBUG_CATEGORY (gst_fdsrc_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_fdsrc_debug);
#define GST_CAT_DEFAULT gst_fdsrc_debug
-GstElementDetails gst_fdsrc_details =
-{
+GstElementDetails gst_fdsrc_details = GST_ELEMENT_DETAILS (
"Disk Source",
"Source/File",
- "LGPL",
"Synchronous read from a file",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>"
+);
/* FdSrc signals and args */
ARG_BLOCKSIZE,
};
-
+static void gst_fdsrc_base_init (gpointer g_class);
static void gst_fdsrc_class_init (GstFdSrcClass *klass);
static void gst_fdsrc_init (GstFdSrc *fdsrc);
if (!fdsrc_type) {
static const GTypeInfo fdsrc_info = {
sizeof(GstFdSrcClass),
- NULL,
+ gst_fdsrc_base_init,
NULL,
(GClassInitFunc)gst_fdsrc_class_init,
NULL,
(GInstanceInitFunc)gst_fdsrc_init,
};
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;
}
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
gst_fdsrc_class_init (GstFdSrcClass *klass)
{
GObjectClass *gobject_class;
- gobject_class = (GObjectClass*)klass;
-
+ gobject_class = G_OBJECT_CLASS (klass);
+
parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD,
G_BEGIN_DECLS
-extern GstElementDetails gst_fdsrc_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_fdsrc_debug);
#define GST_TYPE_FDSRC \
(gst_fdsrc_get_type())
#include <sys/types.h>
#include <unistd.h>
-GST_DEBUG_CATEGORY (gst_filesink_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_filesink_debug);
#define GST_CAT_DEFAULT gst_filesink_debug
-GstElementDetails gst_filesink_details = {
+GstElementDetails gst_filesink_details = GST_ELEMENT_DETAILS (
"File Sink",
"Sink/File",
- "LGPL",
"Write stream to a file",
- VERSION,
- "Thomas <thomas@apestaart.org>",
- "(C) 2001"
-};
+ "Thomas <thomas@apestaart.org>"
+);
/* FileSink signals and args */
)
+static void gst_filesink_base_init (gpointer g_class);
static void gst_filesink_class_init (GstFileSinkClass *klass);
static void gst_filesink_init (GstFileSink *filesink);
if (!filesink_type) {
static const GTypeInfo filesink_info = {
- sizeof(GstFileSinkClass), NULL,
+ sizeof(GstFileSinkClass),
+ gst_filesink_base_init,
NULL,
(GClassInitFunc)gst_filesink_class_init,
NULL,
(GInstanceInitFunc)gst_filesink_init,
};
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;
}
static void
-gst_filesink_class_init (GstFileSinkClass *klass)
+gst_filesink_base_init (gpointer g_class)
{
- GObjectClass *gobject_class;
- GstElementClass *gstelement_class;
+ GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
- gobject_class = (GObjectClass*)klass;
- gstelement_class = (GstElementClass*)klass;
+ gstelement_class->change_state = gst_filesink_change_state;
+ gst_element_class_set_details (gstelement_class, &gst_filesink_details);
+}
+static void
+gst_filesink_class_init (GstFileSinkClass *klass)
+{
+ GObjectClass *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_LOCATION,
g_param_spec_string ("location", "File Location", "Location of the file to write",
gobject_class->set_property = gst_filesink_set_property;
gobject_class->get_property = gst_filesink_get_property;
-
- gstelement_class->change_state = gst_filesink_change_state;
}
static void
G_BEGIN_DECLS
-extern GstElementDetails gst_filesink_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_filesink_debug);
#define GST_TYPE_FILESINK \
(gst_filesink_get_type())
*/
-GST_DEBUG_CATEGORY (gst_filesrc_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_filesrc_debug);
#define GST_CAT_DEFAULT gst_filesrc_debug
-GstElementDetails gst_filesrc_details = {
+GstElementDetails gst_filesrc_details = GST_ELEMENT_DETAILS (
"File Source",
"Source/File",
- "LGPL",
"Read from arbitrary point in a file",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>"
+);
#define DEFAULT_BLOCKSIZE 4*1024
#define DEFAULT_MMAPSIZE 4*1024*1024
GST_FORMAT_BYTES
)
+static void gst_filesrc_base_init (gpointer g_class);
static void gst_filesrc_class_init (GstFileSrcClass *klass);
static void gst_filesrc_init (GstFileSrc *filesrc);
static void gst_filesrc_dispose (GObject *object);
if (!filesrc_type) {
static const GTypeInfo filesrc_info = {
- sizeof(GstFileSrcClass), NULL,
+ sizeof(GstFileSrcClass),
+ gst_filesrc_base_init,
NULL,
(GClassInitFunc)gst_filesrc_class_init,
NULL,
(GInstanceInitFunc)gst_filesrc_init,
};
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;
}
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
gst_filesrc_class_init (GstFileSrcClass *klass)
{
- GObjectClass *gobject_class;
- GstElementClass *gstelement_class;
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GstElementClass *gstelement_class = GST_ELEMENT_CLASS (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_param_spec_int ("fd", "File-descriptor", "File-descriptor for the file being mmap()d",
G_BEGIN_DECLS
-extern GstElementDetails gst_filesrc_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_filesrc_debug);
#define GST_TYPE_FILESRC \
(gst_filesrc_get_type())
#include "gstidentity.h"
-GST_DEBUG_CATEGORY (gst_identity_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_identity_debug);
#define GST_CAT_DEFAULT gst_identity_debug
-GstElementDetails gst_identity_details = {
+GstElementDetails gst_identity_details = GST_ELEMENT_DETAILS (
"Identity",
"Generic",
- "LGPL",
"Pass data without modification",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>"
+);
/* Identity signals and args */
};
+static void gst_identity_base_init (gpointer g_class);
static void gst_identity_class_init (GstIdentityClass *klass);
static void gst_identity_init (GstIdentity *identity);
if (!identity_type) {
static const GTypeInfo identity_info = {
- sizeof(GstIdentityClass), NULL,
+ sizeof(GstIdentityClass),
+ gst_identity_base_init,
NULL,
(GClassInitFunc)gst_identity_class_init,
NULL,
(GInstanceInitFunc)gst_identity_init,
};
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;
}
+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
gst_identity_class_init (GstIdentityClass *klass)
{
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_param_spec_boolean ("loop-based", "Loop-based",
G_BEGIN_DECLS
-extern GstElementDetails gst_identity_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_identity_debug);
#define GST_TYPE_IDENTITY \
(gst_identity_get_type())
#include <gst/gst.h>
#include "gstmd5sink.h"
-GST_DEBUG_CATEGORY (gst_md5sink_debug);
+GST_DEBUG_CATEGORY_STATIC (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 */
enum {
/* FILL ME */
);
/* GObject stuff */
+static void gst_md5sink_base_init (gpointer g_class);
static void gst_md5sink_class_init (GstMD5SinkClass *klass);
static void gst_md5sink_init (GstMD5Sink *md5sink);
if (!md5sink_type) {
static const GTypeInfo md5sink_info = {
sizeof(GstMD5SinkClass),
- NULL,
+ gst_md5sink_base_init,
NULL,
(GClassInitFunc) gst_md5sink_class_init,
NULL,
};
md5sink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstMD5Sink",
&md5sink_info, 0);
+
+ GST_DEBUG_CATEGORY_INIT (gst_md5sink_debug, "md5sink", 0, "md5sink element");
}
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
gst_md5sink_class_init (GstMD5SinkClass *klass)
{
GObjectClass *gobject_class;
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);
+
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_md5sink_get_property);
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_READABLE));
gstelement_class->change_state = GST_DEBUG_FUNCPTR(gst_md5sink_change_state);
-
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_md5sink_get_property);
}
static void
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;
-}
G_BEGIN_DECLS
-extern GstElementDetails gst_md5sink_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_md5sink_debug);
#define GST_TYPE_MD5SINK \
(gst_md5sink_get_type())
#include "gstmultidisksrc.h"
-GST_DEBUG_CATEGORY (gst_multidisksrc_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_multidisksrc_debug);
#define GST_CAT_DEFAULT gst_multidisksrc_debug
-GstElementDetails gst_multidisksrc_details = {
+GstElementDetails gst_multidisksrc_details = GST_ELEMENT_DETAILS (
"Multi Disk Source",
"Source/File",
- "LGPL",
"Read from multiple files in order",
- VERSION,
- "Dominic Ludlam <dom@openfx.org>",
- "(C) 2001",
-};
+ "Dominic Ludlam <dom@openfx.org>"
+);
/* DiskSrc signals and args */
enum {
ARG_LOCATIONS,
};
+static void gst_multidiscsrc_base_init (gpointer g_class);
static void gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass);
static void gst_multidisksrc_init (GstMultiDiskSrc *disksrc);
if (!multidisksrc_type) {
static const GTypeInfo multidisksrc_info = {
- sizeof(GstMultiDiskSrcClass), NULL,
+ sizeof(GstMultiDiskSrcClass),
+ gst_multidiscsrc_base_init,
NULL,
(GClassInitFunc)gst_multidisksrc_class_init,
NULL,
(GInstanceInitFunc)gst_multidisksrc_init,
};
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;
}
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
gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass)
{
GObjectClass *gobject_class;
G_BEGIN_DECLS
-extern GstElementDetails gst_multidisksrc_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_multidisksrc_debug);
#define GST_TYPE_MULTIDISKSRC \
(gst_multidisksrc_get_type())
#include "gstmultidisksrc.h"
-GST_DEBUG_CATEGORY (gst_multidisksrc_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_multidisksrc_debug);
#define GST_CAT_DEFAULT gst_multidisksrc_debug
-GstElementDetails gst_multidisksrc_details = {
+GstElementDetails gst_multidisksrc_details = GST_ELEMENT_DETAILS (
"Multi Disk Source",
"Source/File",
- "LGPL",
"Read from multiple files in order",
- VERSION,
- "Dominic Ludlam <dom@openfx.org>",
- "(C) 2001",
-};
+ "Dominic Ludlam <dom@openfx.org>"
+);
/* DiskSrc signals and args */
enum {
ARG_LOCATIONS,
};
+static void gst_multidiscsrc_base_init (gpointer g_class);
static void gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass);
static void gst_multidisksrc_init (GstMultiDiskSrc *disksrc);
if (!multidisksrc_type) {
static const GTypeInfo multidisksrc_info = {
- sizeof(GstMultiDiskSrcClass), NULL,
+ sizeof(GstMultiDiskSrcClass),
+ gst_multidiscsrc_base_init,
NULL,
(GClassInitFunc)gst_multidisksrc_class_init,
NULL,
(GInstanceInitFunc)gst_multidisksrc_init,
};
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;
}
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
gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass)
{
GObjectClass *gobject_class;
G_BEGIN_DECLS
-extern GstElementDetails gst_multidisksrc_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_multidisksrc_debug);
#define GST_TYPE_MULTIDISKSRC \
(gst_multidisksrc_get_type())
#include "gstpipefilter.h"
-GST_DEBUG_CATEGORY (gst_pipefilter_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_pipefilter_debug);
#define GST_CAT_DEFAULT gst_pipefilter_debug
-GstElementDetails gst_pipefilter_details = {
+GstElementDetails gst_pipefilter_details = GST_ELEMENT_DETAILS (
"Pipefilter",
"Filter",
- "LGPL",
"Interoperate with an external program using stdin and stdout",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>\n"
- "Wim Taymans <wim.taymans@chello.be>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>, "
+ "Wim Taymans <wim.taymans@chello.be>"
+);
/* Pipefilter signals and args */
};
+static void gst_pipefilter_base_init (gpointer g_class);
static void gst_pipefilter_class_init (GstPipefilterClass *klass);
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_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 gboolean gst_pipefilter_handle_event (GstPad *pad, GstEvent *event);
if (!pipefilter_type) {
static const GTypeInfo pipefilter_info = {
- sizeof(GstPipefilterClass), NULL,
+ sizeof(GstPipefilterClass),
+ gst_pipefilter_base_init,
NULL,
(GClassInitFunc)gst_pipefilter_class_init,
NULL,
(GInstanceInitFunc)gst_pipefilter_init,
};
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;
}
+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
gst_pipefilter_class_init (GstPipefilterClass *klass)
{
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_param_spec_string("command","command","command",
NULL, G_PARAM_READWRITE)); /* CHECKME */
- gobject_class->set_property = gst_pipefilter_set_property;
- gobject_class->get_property = gst_pipefilter_get_property;
+ gstelement_class->change_state = gst_pipefilter_change_state;
}
static void
G_BEGIN_DECLS
-extern GstElementDetails gst_pipefilter_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_pipefilter_debug);
#define GST_TYPE_PIPEFILTER \
(gst_pipefilter_get_type())
#include "gstshaper.h"
-GST_DEBUG_CATEGORY (gst_shaper_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_shaper_debug);
#define GST_CAT_DEFAULT gst_shaper_debug
-GstElementDetails gst_shaper_details = {
+GstElementDetails gst_shaper_details = GST_ELEMENT_DETAILS (
"Shaper",
"Generic",
- "LGPL",
"Synchronizes streams on different pads",
- VERSION,
- "Wim Taymans <wim.taymans@chello.be>",
- "(C) 2003",
-};
+ "Wim Taymans <wim.taymans@chello.be>"
+);
/* Shaper signals and args */
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_init (GstShaper *shaper);
if (!shaper_type) {
static const GTypeInfo shaper_info = {
- sizeof(GstShaperClass), NULL,
+ sizeof(GstShaperClass),
+ gst_shaper_base_init,
NULL,
(GClassInitFunc)gst_shaper_class_init,
NULL,
(GInstanceInitFunc)gst_shaper_init,
};
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;
}
+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
gst_shaper_class_init (GstShaperClass *klass)
{
}
}
-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;
-}
G_BEGIN_DECLS
-extern GstElementDetails gst_shaper_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_shaper_debug);
#define GST_TYPE_SHAPER \
(gst_shaper_get_type())
#include "gststatistics.h"
-GST_DEBUG_CATEGORY (gst_statistics_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_statistics_debug);
#define GST_CAT_DEFAULT gst_statistics_debug
-GstElementDetails gst_statistics_details = {
+GstElementDetails gst_statistics_details = GST_ELEMENT_DETAILS (
"Statistics",
"Generic",
- "LGPL",
"Statistics on buffers/bytes/events",
- VERSION,
- "David I. Lehn <dlehn@users.sourceforge.net>",
- "(C) 2001",
-};
+ "David I. Lehn <dlehn@users.sourceforge.net>"
+);
/* Statistics signals and args */
};
+static void gst_statistics_base_init (gpointer g_class);
static void gst_statistics_class_init (GstStatisticsClass *klass);
static void gst_statistics_init (GstStatistics *statistics);
if (!statistics_type) {
static const GTypeInfo statistics_info = {
- sizeof(GstStatisticsClass), NULL,
+ sizeof(GstStatisticsClass),
+ gst_statistics_base_init,
NULL,
(GClassInitFunc)gst_statistics_class_init,
NULL,
(GInstanceInitFunc)gst_statistics_init,
};
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;
}
+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
gst_statistics_class_init (GstStatisticsClass *klass)
{
GObjectClass *gobject_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
- gobject_class = (GObjectClass*)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_BUFFERS,
g_param_spec_int64 ("buffers", "buffers", "total buffers count",
G_BEGIN_DECLS
-extern GstElementDetails gst_statistics_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_statistics_debug);
#define GST_TYPE_STATISTICS \
(gst_statistics_get_type())
#include "gsttee.h"
-GST_DEBUG_CATEGORY (gst_tee_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_tee_debug);
#define GST_CAT_DEFAULT gst_tee_debug
-GstElementDetails gst_tee_details = {
+GstElementDetails gst_tee_details = GST_ELEMENT_DETAILS (
"Tee pipe fitting",
"Generic",
- "LGPL",
"1-to-N pipe fitting",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>\n"
- "Wim Taymans <wim.taymans@chello.be>",
- "(C) 1999, 2000",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>, "
+ "Wim Taymans <wim.taymans@chello.be>"
+);
/* Tee signals and args */
enum {
GST_CAPS_ANY
);
+static void gst_tee_base_init (gpointer g_class);
static void gst_tee_class_init (GstTeeClass *klass);
static void gst_tee_init (GstTee *tee);
if (!tee_type) {
static const GTypeInfo tee_info = {
- sizeof(GstTeeClass), NULL,
+ sizeof(GstTeeClass),
+ gst_tee_base_init,
NULL,
(GClassInitFunc)gst_tee_class_init,
NULL,
(GInstanceInitFunc)gst_tee_init,
};
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;
}
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
gst_tee_class_init (GstTeeClass *klass)
{
GObjectClass *gobject_class;
}
}
-gboolean
-gst_tee_factory_init (GstElementFactory *factory)
-{
- gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (tee_src_factory));
-
- return TRUE;
-}
G_BEGIN_DECLS
-extern GstElementDetails gst_tee_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_tee_debug);
#define GST_TYPE_TEE \
(gst_tee_get_type())
#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
-GstElementDetails gst_type_find_element_details = {
+GstElementDetails gst_type_find_element_details = GST_ELEMENT_DETAILS (
"TypeFind",
"Generic",
- "LGPL",
"Finds the media type of a stream",
- VERSION,
- "Benjamin Otte <in7y118@public.uni-hamburg.de>",
- "(C) 2003",
-};
+ "Benjamin Otte <in7y118@public.uni-hamburg.de>"
+);
/* generic templates */
GST_PAD_TEMPLATE_FACTORY (type_find_element_sink_factory,
};
+static void gst_type_find_element_base_init (gpointer g_class);
static void gst_type_find_element_class_init (gpointer g_class,
gpointer class_data);
static void gst_type_find_element_init (GTypeInstance *instance,
if (!typefind_type) {
static const GTypeInfo typefind_info = {
sizeof (GstTypeFindElementClass),
- NULL,
+ gst_type_find_element_base_init,
NULL,
gst_type_find_element_class_init,
NULL,
typefind_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstTypeFindElement",
&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;
}
}
}
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)
{
GObjectClass *gobject_class;
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_FIND_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TYPE_FIND_ELEMENT, GstTypeFindElement))
#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
-GstElementDetails gst_type_find_element_details = {
+GstElementDetails gst_type_find_element_details = GST_ELEMENT_DETAILS (
"TypeFind",
"Generic",
- "LGPL",
"Finds the media type of a stream",
- VERSION,
- "Benjamin Otte <in7y118@public.uni-hamburg.de>",
- "(C) 2003",
-};
+ "Benjamin Otte <in7y118@public.uni-hamburg.de>"
+);
/* generic templates */
GST_PAD_TEMPLATE_FACTORY (type_find_element_sink_factory,
};
+static void gst_type_find_element_base_init (gpointer g_class);
static void gst_type_find_element_class_init (gpointer g_class,
gpointer class_data);
static void gst_type_find_element_init (GTypeInstance *instance,
if (!typefind_type) {
static const GTypeInfo typefind_info = {
sizeof (GstTypeFindElementClass),
- NULL,
+ gst_type_find_element_base_init,
NULL,
gst_type_find_element_class_init,
NULL,
typefind_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstTypeFindElement",
&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;
}
}
}
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)
{
GObjectClass *gobject_class;
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_FIND_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TYPE_FIND_ELEMENT, GstTypeFindElement))
static void
load_plugin_func (gpointer data, gpointer user_data)
{
- gboolean ret;
GstPlugin *plugin;
const gchar *filename;
filename = (const gchar *) data;
- plugin = gst_plugin_new (filename);
- ret = gst_plugin_load_plugin (plugin, NULL);
+ plugin = gst_plugin_load_file (filename, NULL);
- if (ret) {
+ if (plugin) {
GST_INFO ("Loaded plugin: \"%s\"", filename);
gst_registry_pool_add_plugin (plugin);
}
static gboolean
-gst_register_core_elements (GModule *module, GstPlugin *plugin)
+gst_register_core_elements (GstPlugin *plugin)
{
- GstElementFactory *factory;
-
/* register some standard builtin types */
- factory = gst_element_factory_new ("bin", gst_bin_get_type (), &gst_bin_details);
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
- factory = gst_element_factory_new ("pipeline", gst_pipeline_get_type (), &gst_pipeline_details);
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
- 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));
+ g_assert (gst_element_register (plugin, "bin", GST_RANK_PRIMARY, GST_TYPE_BIN));
+ g_assert (gst_element_register (plugin, "pipeline", GST_RANK_PRIMARY, GST_TYPE_PIPELINE));
+ g_assert (gst_element_register (plugin, "thread", GST_RANK_PRIMARY, GST_TYPE_THREAD));
+ g_assert (gst_element_register (plugin, "queue", GST_RANK_PRIMARY, GST_TYPE_QUEUE));
return TRUE;
}
static GstPluginDesc plugin_desc = {
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
- "gst_core_plugins",
- gst_register_core_elements
+ "gst_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
};
/*
extern GstDebugCategory *GST_CAT_CAPS;
extern GstDebugCategory *GST_CAT_CLOCK;
extern GstDebugCategory *GST_CAT_ELEMENT_PADS;
-extern GstDebugCategory *GST_CAT_ELEMENT_FACTORY;
extern GstDebugCategory *GST_CAT_PADS;
extern GstDebugCategory *GST_CAT_PIPELINE;
extern GstDebugCategory *GST_CAT_PLUGIN_LOADING;
#include "gstscheduler.h"
#include "gstindex.h"
-GstElementDetails gst_bin_details = {
+static GstElementDetails gst_bin_details = GST_ELEMENT_DETAILS (
"Generic bin",
"Generic/Bin",
- "LGPL",
"Simple container object",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>"
+);
GType _gst_bin_type = 0;
/* FILL ME */
};
+static void gst_bin_base_init (gpointer g_class);
static void gst_bin_class_init (GstBinClass * klass);
static void gst_bin_init (GstBin * bin);
if (!_gst_bin_type) {
static const GTypeInfo bin_info = {
sizeof (GstBinClass),
- NULL,
+ gst_bin_base_init,
NULL,
(GClassInitFunc) gst_bin_class_init,
NULL,
}
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
gst_bin_class_init (GstBinClass * klass)
{
GObjectClass *gobject_class;
G_BEGIN_DECLS
-extern GstElementDetails gst_bin_details;
extern GType _gst_bin_type;
#define GST_TYPE_BIN (_gst_bin_type)
/* 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_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,
const GValue *value, GParamSpec *pspec);
if (!_gst_element_type) {
static const GTypeInfo element_info = {
sizeof(GstElementClass),
- (GBaseInitFunc)gst_element_base_class_init,
- NULL,
+ gst_element_base_class_init,
+ gst_element_base_class_finalize,
(GClassInitFunc)gst_element_class_init,
NULL,
NULL,
klass->change_state = GST_DEBUG_FUNCPTR (gst_element_change_state);
klass->error = GST_DEBUG_FUNCPTR (gst_element_error_func);
- klass->elementfactory = NULL;
klass->padtemplates = NULL;
klass->numpadtemplates = 0;
}
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;
gobject_class = (GObjectClass*) klass;
}
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
gst_element_init (GstElement *element)
{
element->current_state = GST_STATE_NULL;
* @klass: the #GstElementClass to add the pad template to.
* @templ: a #GstPadTemplate to add to the element class.
*
- * Adds a padtemplate to an element class.
- * This is useful if you have derived a custom bin and wish to provide
- * an on-request pad at runtime. Plug-in writers should use
- * gst_element_factory_add_pad_template instead.
+ * Adds a padtemplate to an element class. This is mainly used in the _base_init
+ * functions of classes.
*/
void
gst_element_class_add_pad_template (GstElementClass *klass,
}
/**
+ * 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:
* @element: a #GstElement to get pad templates of.
*
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
gst_element_dispose (GObject *object)
{
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? */
/* if (element->manager) */
/* xmlNewChild(parent, NULL, "manager", GST_ELEMENT_NAME(element->manager)); */
#include <gst/gstobject.h>
#include <gst/gstpad.h>
#include <gst/gstclock.h>
+#include <gst/gstplugin.h>
#include <gst/gstpluginfeature.h>
#include <gst/gstindex.h>
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
/* NOTE: this probably should be done with an #ifdef to decide
struct _GstElementClass {
GstObjectClass parent_class;
- /* the elementfactory that created us */
- GstElementFactory *elementfactory;
+ /* the element details */
+ GstElementDetails details;
/* templates for our pads */
GList *padtemplates;
gint numpadtemplates;
void gst_element_class_add_pad_template (GstElementClass *klass, GstPadTemplate *templ);
void gst_element_class_install_std_props (GstElementClass *klass,
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
* 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_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST((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_ELEMENT_RANK_PRIMARY 256
-#define GST_ELEMENT_RANK_SECONDARY 128
-#define GST_ELEMENT_RANK_MARGINAL 64
-#define GST_ELEMENT_RANK_NONE 0
-
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;
- guint16 numpadtemplates;
+ GList * padtemplates;
+ guint numpadtemplates;
GST_OBJECT_PADDING
};
GType gst_element_factory_get_type (void);
-GstElementFactory* gst_element_factory_new (const gchar *name, GType type,
- GstElementDetails *details);
+gboolean gst_element_register (GstPlugin *plugin,
+ const gchar *elementname,
+ guint rank,
+ GType type);
+
GstElementFactory* gst_element_factory_find (const gchar *name);
+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);
-void gst_element_factory_add_pad_template (GstElementFactory *elementfactory,
- GstPadTemplate *templ);
+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,
GstCaps *caps);
gboolean gst_element_factory_can_sink_caps (GstElementFactory *factory,
GstCaps *caps);
-GstElement* gst_element_factory_create (GstElementFactory *factory,
- const gchar *name);
-GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
-GstElement* gst_element_factory_make_or_warn (const gchar *factoryname, const gchar *name);
+void __gst_element_factory_add_pad_template (GstElementFactory *elementfactory,
+ GstPadTemplate *templ);
-#define gst_element_factory_set_rank(factory, rank) \
- gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory), rank)
G_END_DECLS
/* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
+ * 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
*
* gstelementfactory.c: GstElementFactory object, support routines
*
#include "gstregistrypool.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_init (GstElementFactory *factory);
};
elementfactory_type = g_type_register_static (GST_TYPE_PLUGIN_FEATURE,
"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;
}
-
static void
gst_element_factory_class_init (GstElementFactoryClass *klass)
{
gstobject_class = (GstObjectClass*)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);
-
}
-
static void
gst_element_factory_init (GstElementFactory *factory)
{
factory->padtemplates = NULL;
factory->numpadtemplates = 0;
}
-
/**
* gst_element_factory_find:
* @name: name of factory to find
GST_DEBUG ("no such elementfactory \"%s\"", name);
return NULL;
}
-
-static void
-gst_element_details_free (GstElementDetails *dp)
+void
+__gst_element_details_clear (GstElementDetails *dp)
{
g_free (dp->longname);
+ dp->longname = NULL;
g_free (dp->klass);
- g_free (dp->license);
+ dp->klass = NULL;
g_free (dp->description);
- g_free (dp->version);
+ dp->description = NULL;
g_free (dp->author);
- g_free (dp->copyright);
- g_free (dp);
+ dp->author = NULL;
+}
+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
gst_element_factory_cleanup (GstElementFactory *factory)
{
- GList *padtemplates;
-
- if (factory->details_dynamic) {
- gst_element_details_free (factory->details);
- factory->details_dynamic = FALSE;
+ __gst_element_details_clear (&factory->details);
+ if (factory->type) {
+ g_type_class_unref (g_type_class_peek (factory->type));
+ factory->type = 0;
}
- padtemplates = factory->padtemplates;
-
- while (padtemplates) {
- GstPadTemplate *oldtempl = GST_PAD_TEMPLATE (padtemplates->data);
-
- gst_object_unref (GST_OBJECT (oldtempl));
-
- padtemplates = g_list_next (padtemplates);
- }
+ g_list_foreach (factory->padtemplates, (GFunc) g_object_unref, NULL);
g_list_free (factory->padtemplates);
-
factory->padtemplates = NULL;
factory->numpadtemplates = 0;
-
- g_free (GST_PLUGIN_FEATURE (factory)->name);
}
-
/**
- * gst_element_factory_new:
- * @name: name of new elementfactory
- * @type: GType of new element
- * @details: #GstElementDetails structure with element details
+ * gst_element_register:
+ * @plugin:
+ * @name: name of elements of this type
+ * @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
* given type.
*
- * Returns: new elementfactory
+ * Returns: TRUE, if the registering succeeded, FALSE on error
*/
-GstElementFactory*
-gst_element_factory_new (const gchar *name, GType type,
- GstElementDetails *details)
+gboolean
+gst_element_register (GstPlugin *plugin, const gchar *name, guint rank, GType type)
{
GstElementFactory *factory;
+ GstElementClass *klass;
- g_return_val_if_fail (name != NULL, NULL);
- g_return_val_if_fail (type, NULL);
- 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);
+ g_return_val_if_fail (name != NULL, FALSE);
+ g_return_val_if_fail (g_type_is_a (type, GST_TYPE_ELEMENT), FALSE);
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));
- 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_LOG_OBJECT (factory, "Reuse existing elementfactory for type %s", g_type_name (type));
}
- factory->details = details;
- factory->details_dynamic = FALSE;
+ factory->type = type;
+ __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)
- factory->type = type;
- else if (factory->type != type)
- g_critical ("`%s' requested type change (!)", name);
+ gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory), rank);
- 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:
* @factory: factory to instantiate
* It will be given the name supplied, since all elements require a name as
* their first argument.
*
- * Returns: new #GstElement
+ * Returns: new #GstElement or NULL if the element couldn't be created
*/
GstElement*
gst_element_factory_create (GstElementFactory *factory,
const gchar *name)
{
GstElement *element;
- GstElementClass *oclass;
g_return_val_if_fail (factory != NULL, NULL);
return NULL;
}
- GST_LOG ("creating element from factory \"%s\" (name \"%s\", type %d)",
- GST_PLUGIN_FEATURE_NAME (factory), GST_STR_NULL (name), (gint) factory->type);
+ GST_LOG_OBJECT (factory, "creating element (name \"%s\", type %d)",
+ GST_STR_NULL (name), (gint) factory->type);
if (factory->type == 0) {
g_critical ("Factory for `%s' has no type",
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 */
element = GST_ELEMENT (g_object_new (factory->type, NULL));
g_assert (element != NULL);
- g_type_class_unref (oclass);
-
gst_object_set_name (GST_OBJECT (element), name);
return element;
}
-
/**
* gst_element_factory_make:
* @factoryname: a named factory to instantiate
* consisting of the element factory name and a number.
* 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*
gst_element_factory_make (const gchar *factoryname, const gchar *name)
}
element = gst_element_factory_create (factory, name);
if (element == NULL) {
- GST_INFO ("couldn't create instance of element factory \"%s\"!",
- factoryname);
+ GST_INFO_OBJECT (factory, "couldn't create instance!");
return NULL;
}
return element;
}
+void
+__gst_element_factory_add_pad_template (GstElementFactory *factory,
+ GstPadTemplate *templ)
+{
+ g_return_if_fail (factory != NULL);
+ g_return_if_fail (templ != NULL);
+
+ gst_object_ref (GST_OBJECT (templ));
+ gst_object_sink (GST_OBJECT (templ));
+ factory->padtemplates = g_list_append (factory->padtemplates, templ);
+ factory->numpadtemplates++;
+}
/**
- * gst_element_factory_make_or_warn:
- * @factoryname: a named factory to instantiate
- * @name: name of new element
+ * gst_element_factory_get_element_type:
+ * @factory: factory to get managed #GType from
+ *
+ * Get the #GType for elements managed by this factory
*
- * 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: 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: new #GstElement (or NULL if unable to create element)
+ * Returns: the longname
*/
-GstElement*
-gst_element_factory_make_or_warn (const gchar *factoryname, const gchar *name)
+G_CONST_RETURN gchar *
+gst_element_factory_get_longname (GstElementFactory *factory)
{
- GstElement *element;
-
- element = gst_element_factory_make (factoryname, name);
+ g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL);
- if (element == NULL)
- g_warning ("Could not create element from factory %s !\n", factoryname);
+ 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 element;
+ return factory->details.klass;
}
-
/**
- * gst_element_factory_add_pad_template :
- * @elementfactory: factory to add the src id to
- * @templ: the padtemplate to add
+ * gst_element_factory_get_description:
+ * @factory: a #GstElementFactory
+ *
+ * Gets the description for this factory.
*
- * Add the given padtemplate to this elementfactory.
+ * Returns: the description
*/
-void
-gst_element_factory_add_pad_template (GstElementFactory *factory,
- GstPadTemplate *templ)
+G_CONST_RETURN gchar *
+gst_element_factory_get_description (GstElementFactory *factory)
{
- g_return_if_fail (factory != NULL);
- g_return_if_fail (templ != NULL);
+ g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL);
- gst_object_ref (GST_OBJECT (templ));
- gst_object_sink (GST_OBJECT (templ));
+ 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);
- factory->padtemplates = g_list_append (factory->padtemplates, templ);
- factory->numpadtemplates++;
+ 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 :
* @factory: factory to query
return FALSE;
}
-
/**
* gst_element_factory_can_sink_caps :
* @factory: factory to query
return FALSE;
}
-
static void
gst_element_factory_unload_thyself (GstPluginFeature *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;
+ }
}
GstDebugCategory *GST_CAT_CAPS = NULL;
GstDebugCategory *GST_CAT_CLOCK = NULL;
GstDebugCategory *GST_CAT_ELEMENT_PADS = NULL;
-GstDebugCategory *GST_CAT_ELEMENT_FACTORY = NULL;
GstDebugCategory *GST_CAT_PADS = NULL;
GstDebugCategory *GST_CAT_PIPELINE = NULL;
GstDebugCategory *GST_CAT_PLUGIN_LOADING = NULL;
GST_CAT_ELEMENT_PADS = _gst_debug_category_new ("GST_ELEMENT_PADS",
GST_DEBUG_BOLD | GST_DEBUG_FG_WHITE | GST_DEBUG_BG_RED,
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_DEBUG_BOLD | GST_DEBUG_FG_WHITE | GST_DEBUG_BG_RED,
NULL);
#include "gstinfo.h"
#include "gstscheduler.h"
-GstElementDetails gst_pipeline_details = {
+static GstElementDetails gst_pipeline_details = GST_ELEMENT_DETAILS (
"Pipeline object",
"Generic/Bin",
- "LGPL",
"Complete pipeline object",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>"
+);
/* Pipeline signals and args */
enum {
};
-static void gst_pipeline_class_init (GstPipelineClass *klass);
-static void gst_pipeline_init (GstPipeline *pipeline);
+static void gst_pipeline_base_init (gpointer g_class);
+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 guint gst_pipeline_signals[LAST_SIGNAL] = { 0 }; */
if (!pipeline_type) {
static const GTypeInfo pipeline_info = {
sizeof(GstPipelineClass),
- NULL,
+ gst_pipeline_base_init,
NULL,
(GClassInitFunc)gst_pipeline_class_init,
NULL,
NULL,
sizeof(GstPipeline),
0,
- (GInstanceInitFunc)gst_pipeline_init,
+ gst_pipeline_init,
NULL
};
pipeline_type = g_type_register_static (GST_TYPE_BIN, "GstPipeline", &pipeline_info, 0);
}
static void
-gst_pipeline_class_init (GstPipelineClass *klass)
+gst_pipeline_base_init (gpointer g_class)
{
- GObjectClass *gobject_class;
GstElementClass *gstelement_class;
+
+ gst_element_class_set_details (gstelement_class, &gst_pipeline_details);
+}
- gobject_class = (GObjectClass *)klass;
- gstelement_class = (GstElementClass*)klass;
+static void
+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);
}
static void
-gst_pipeline_init (GstPipeline *pipeline)
+gst_pipeline_init (GTypeInstance *instance, gpointer g_class)
{
GstScheduler *scheduler;
-
+ GstPipeline *pipeline = GST_PIPELINE (instance);
+
/* pipelines are managing bins */
GST_FLAG_SET (pipeline, GST_BIN_FLAG_MANAGER);
G_BEGIN_DECLS
-extern GstElementDetails gst_pipeline_details;
-
#define GST_TYPE_PIPELINE (gst_pipeline_get_type ())
#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))
#include "config.h"
#include "gstfilter.h"
+#define GST_CAT_DEFAULT GST_CAT_PLUGIN_LOADING
+
static GModule *main_module = NULL;
static GList *_gst_plugin_static = NULL;
-static GstPlugin* gst_plugin_register_func (GstPluginDesc *desc, GstPlugin *plugin,
- GModule *module);
+/* list of valid licenses.
+ * 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
gst_plugin_error_quark (void)
{
_gst_plugin_register_static (GstPluginDesc *desc)
{
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);
}
else {
GstPlugin *plugin;
+ GST_LOG ("attempting to load static plugin \"%s\" now...", desc->name);
plugin = g_new0 (GstPlugin, 1);
- plugin->filename = NULL;
- plugin->module = NULL;
- plugin = gst_plugin_register_func (desc, plugin, main_module);
-
- if (plugin) {
- plugin->module = main_module;
+ if (gst_plugin_register_func (plugin, main_module, desc)) {
+ GST_INFO ("loaded static plugin \"%s\"", desc->name);
gst_registry_pool_add_plugin (plugin);
}
}
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
gst_plugin_check_version (gint major, gint minor)
{
}
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)) {
- 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);
- return NULL;
+ return FALSE;
}
- g_free (plugin->name);
- plugin->name = g_strdup(desc->name);
-
- if (!((desc->plugin_init) (module, plugin))) {
- GST_CAT_INFO (GST_CAT_PLUGIN_LOADING,"plugin \"%s\" failed to initialise",
+ if (!desc->license || !desc->description || !desc->package ||
+ !desc->copyright || !desc->origin) {
+ GST_INFO ("plugin \"%s\" has incorrect GstPluginDesc, not loading",
plugin->filename);
- return NULL;
+ return FALSE;
}
- GST_CAT_INFO (GST_CAT_PLUGIN_LOADING,"plugin \"%s\" initialised", GST_STR_NULL (plugin->filename));
-
- return plugin;
-}
+
+ 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;
-/**
- * gst_plugin_new:
- * @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);
+ 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;
}
/**
- * gst_plugin_load_plugin:
+ * gst_plugin_load_file:
* @plugin: The plugin to load
* @error: Pointer to a NULL-valued GError.
*
* 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
-gst_plugin_load_plugin (GstPlugin *plugin, GError **error)
+GstPlugin *
+gst_plugin_load_file (const gchar *filename, GError **error)
{
+ GstPlugin *plugin;
GModule *module;
GstPluginDesc *desc;
struct stat file_status;
- gchar *filename;
- g_return_val_if_fail (plugin != NULL, FALSE);
-
- if (plugin->module)
- return TRUE;
-
- filename = plugin->filename;
+ g_return_val_if_fail (filename != NULL, NULL);
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "attempt to load plugin \"%s\"", filename);
GST_PLUGIN_ERROR,
GST_PLUGIN_ERROR_MODULE,
"Dynamic loading not supported");
- return FALSE;
+ return NULL;
}
if (stat (filename, &file_status)) {
GST_PLUGIN_ERROR,
GST_PLUGIN_ERROR_MODULE,
"Problem opening file %s (plugin %s)\n",
- filename, plugin->name);
+ filename, plugin->desc.name);
return FALSE;
}
if (module != NULL) {
gpointer ptr;
- if (g_module_symbol (module, "plugin_desc", &ptr)) {
- desc = (GstPluginDesc *)ptr;
-
- GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "plugin \"%s\" loaded, called entry function...", filename);
-
- plugin->filename = g_strdup (filename);
- plugin = gst_plugin_register_func (desc, plugin, module);
-
- if (plugin != NULL) {
- GST_CAT_INFO (GST_CAT_PLUGIN_LOADING, "plugin \"%s\" loaded", plugin->filename);
- plugin->module = module;
- return TRUE;
+ if (g_module_symbol (module, "gst_plugin_desc", &ptr)) {
+ desc = (GstPluginDesc *) ptr;
+
+ plugin = gst_registry_pool_find_plugin (desc->name);
+ if (!plugin) {
+ plugin = g_new0 (GstPlugin, 1);
+ plugin->filename = g_strdup (filename);
+ GST_DEBUG ("created new GstPlugin %p for file \"%s\"", plugin, filename);
+ } else {
+ if (gst_plugin_is_loaded (plugin)) {
+ if (strcmp (plugin->filename, filename) != 0) {
+ 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 */
g_set_error (error,
GST_PLUGIN_ERROR,
GST_PLUGIN_ERROR_MODULE,
"gst_plugin_register_func failed for plugin \"%s\"",
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,
GST_PLUGIN_ERROR,
GST_PLUGIN_ERROR_MODULE,
- "Could not find plugin_desc in \"%s\"",
+ "Could not find plugin entry point in \"%s\"",
filename);
}
- return FALSE;
- }
- else {
+ return NULL;
+ } else {
+ GST_DEBUG ("Error loading plugin %s, reason: %s\n", filename, g_module_error());
g_set_error (error,
GST_PLUGIN_ERROR,
GST_PLUGIN_ERROR_MODULE,
"Error loading plugin %s, reason: %s\n",
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:
* @plugin: The plugin to unload
{
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
+ * gst_plugin_get_longname:
+ * @plugin: plugin to get long name of
*
- * Sets the name (should be short) of the plugin.
+ * Get the long descriptive name of the plugin
+ *
+ * Returns: the long name of the plugin
*/
-void
-gst_plugin_set_name (GstPlugin *plugin, const gchar *name)
+G_CONST_RETURN gchar*
+gst_plugin_get_description (GstPlugin *plugin)
{
- g_return_if_fail (plugin != NULL);
-
- g_free (plugin->name);
+ g_return_val_if_fail (plugin != NULL, NULL);
- plugin->name = g_strdup (name);
+ return plugin->desc.description;
}
/**
- * gst_plugin_set_longname:
- * @plugin: plugin to set long name of
- * @longname: new long name
+ * gst_plugin_get_filename:
+ * @plugin: plugin to get the filename of
+ *
+ * get the filename of the plugin
*
- * Sets the long name (should be descriptive) of the plugin.
+ * Returns: the filename of the plugin
*/
-void
-gst_plugin_set_longname (GstPlugin *plugin, const gchar *longname)
+G_CONST_RETURN gchar*
+gst_plugin_get_filename (GstPlugin *plugin)
{
- g_return_if_fail(plugin != NULL);
-
- g_free(plugin->longname);
+ g_return_val_if_fail (plugin != NULL, NULL);
- plugin->longname = g_strdup(longname);
+ 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_longname:
- * @plugin: plugin to get long name of
+ * gst_plugin_get_copyright:
+ * @plugin: plugin to get the copyright of
*
- * Get the long descriptive name of the plugin
+ * get the informal copyright notice of the plugin
*
- * Returns: the long name of the plugin
+ * Returns: the copyright of the plugin
*/
-const gchar*
-gst_plugin_get_longname (GstPlugin *plugin)
+G_CONST_RETURN gchar*
+gst_plugin_get_copyright (GstPlugin *plugin)
{
g_return_val_if_fail (plugin != NULL, NULL);
- return plugin->longname;
+ 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_filename:
- * @plugin: plugin to get the filename of
+ * gst_plugin_get_origin:
+ * @plugin: plugin to get the origin of
*
- * get the filename of the plugin
+ * get the URL where the plugin comes from
*
- * Returns: the filename of the plugin
+ * Returns: the origin of the plugin
*/
-const gchar*
-gst_plugin_get_filename (GstPlugin *plugin)
+G_CONST_RETURN gchar*
+gst_plugin_get_origin (GstPlugin *plugin)
{
g_return_val_if_fail (plugin != NULL, NULL);
- return plugin->filename;
+ 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:
* @plugin: plugin to query
* @plugin: the plugin to check
* @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.
*
* Returns: TRUE if the plugin is of the given name.
gboolean
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));
}
/**
plugin = gst_registry_pool_find_plugin (name);
if (plugin) {
- gboolean result = gst_plugin_load_plugin (plugin, &error);
+ gst_plugin_load_file (plugin->filename, &error);
if (error) {
GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "load_plugin error: %s\n",
error->message);
g_error_free (error);
+ return FALSE;
}
- return result;
+ return TRUE;;
}
- GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "Could not find %s in registry pool",
- name);
-
+ GST_DEBUG ("Could not find %s in registry pool", name);
return FALSE;
}
typedef enum
{
GST_PLUGIN_ERROR_MODULE,
- GST_PLUGIN_ERROR_DEPENDENCIES
+ GST_PLUGIN_ERROR_DEPENDENCIES,
+ GST_PLUGIN_ERROR_NAME_MISMATCH
} GstPluginError;
#define GST_PLUGIN(plugin) ((GstPlugin *) (plugin))
typedef struct _GstPlugin GstPlugin;
typedef struct _GstPluginDesc GstPluginDesc;
-struct _GstPlugin {
- gchar *name; /* name of the plugin */
- gchar *longname; /* long name of plugin */
- gchar *filename; /* filename it came from */
-
- GList *features; /* list of features provided */
- gint numfeatures;
-
- gpointer manager; /* managing registry */
- GModule *module; /* contains the module if the plugin is loaded */
- gboolean init_called; /* if the init function has been called */
+/* 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
};
-/* Initialiser function: returns TRUE if plugin initialised successfully */
-typedef gboolean (*GstPluginInitFunc) (GModule *module, GstPlugin *plugin);
+struct _GstPlugin {
+ GstPluginDesc desc;
-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 */
+ gchar * filename;
+ GList * features; /* list of features provided */
+ gint numfeatures;
+
+ gpointer manager; /* managing registry */
+ GModule * module; /* contains the module if the plugin is loaded */
+
+ GST_STRUCT_PADDING
};
#ifndef GST_PLUGIN_STATIC
-#define GST_PLUGIN_DESC_DYNAMIC(major,minor,name,init) \
-GstPluginDesc plugin_desc = { \
+#define GST_PLUGIN_DEFINE_DYNAMIC(major,minor,name,description,init,version,license,copyright,package,origin) \
+GstPluginDesc gst_plugin_desc = { \
major, \
minor, \
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
-#define GST_PLUGIN_DESC_DYNAMIC(major,minor,name,init)
-#endif
-#define GST_PLUGIN_DESC_STATIC(major,minor,name,init) \
+#define GST_PLUGIN_DEFINE_DYNAMIC(major,minor,name,description,init,version,license,copyright,package,origin)
+#define GST_PLUGIN_DEFINE_STATIC(major,minor,name,description,init,version,license,copyright,package,origin) \
static void GST_GNUC_CONSTRUCTOR \
_gst_plugin_static_init__ ##init (void) \
{ \
static GstPluginDesc plugin_desc_ = { \
major, \
minor, \
- name, \
- init \
+ name, \
+ description, \
+ init, \
+ NULL, \
+ version, \
+ license, \
+ copyright, \
+ package, \
+ origin, \
+ GST_STRUCT_PAD_ING_INIT \
}; \
_gst_plugin_register_static (&plugin_desc_); \
}
+#endif
-#define GST_PLUGIN_DESC(major,minor,name,init) \
- GST_PLUGIN_DESC_DYNAMIC (major,minor,name,init) \
- GST_PLUGIN_DESC_STATIC (major,minor,name,init)
+#define GST_PLUGIN_DEFINE(major,minor,name,description,init,version,license,copyright,package,origin)\
+ GST_PLUGIN_DEFINE_STATIC(major,minor,name,description,init,version,license,copyright,package,origin)\
+ GST_PLUGIN_DEFINE_DYNAMIC(major,minor,name,description,init,version,license,copyright,package,origin)
+
+#define GST_LICENSE_UNKNOWN "unknown"
/* function for filters */
typedef gboolean (*GstPluginFilter) (GstPlugin *plugin,
void _gst_plugin_initialize (void);
void _gst_plugin_register_static (GstPluginDesc *desc);
-GstPlugin* gst_plugin_new (const gchar *filename);
-
-const gchar* gst_plugin_get_name (GstPlugin *plugin);
+G_CONST_RETURN gchar* gst_plugin_get_name (GstPlugin *plugin);
void gst_plugin_set_name (GstPlugin *plugin, const gchar *name);
-const gchar* gst_plugin_get_longname (GstPlugin *plugin);
-void gst_plugin_set_longname (GstPlugin *plugin, const gchar *longname);
-const gchar* gst_plugin_get_filename (GstPlugin *plugin);
+G_CONST_RETURN gchar* gst_plugin_get_longname (GstPlugin *plugin);
+G_CONST_RETURN 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);
GList* gst_plugin_feature_filter (GstPlugin *plugin,
GList* gst_plugin_get_feature_list (GstPlugin *plugin);
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);
void gst_plugin_add_feature (GstPlugin *plugin, GstPluginFeature *feature);
#ifndef GST_DISABLE_REGISTRY
if (GST_IS_REGISTRY (plugin->manager)) {
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)
return FALSE;
#include "gstevent.h"
#include "gstinfo.h"
-GstElementDetails gst_queue_details = {
+static GstElementDetails gst_queue_details = GST_ELEMENT_DETAILS (
"Queue",
"Generic",
- "LGPL",
"Simple data queue",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>"
+);
/* Queue signals and args */
ARG_BLOCK_TIMEOUT,
};
-
-static void gst_queue_class_init (GstQueueClass *klass);
-static void gst_queue_init (GstQueue *queue);
+static void gst_queue_base_init (gpointer g_class);
+static void gst_queue_class_init (gpointer g_class,
+ gpointer class_data);
+static void gst_queue_init (GTypeInstance *instance,
+ gpointer g_class);
static void gst_queue_dispose (GObject *object);
static void gst_queue_set_property (GObject *object, guint prop_id,
if (!queue_type) {
static const GTypeInfo queue_info = {
sizeof(GstQueueClass),
+ gst_queue_base_init,
NULL,
- NULL,
- (GClassInitFunc)gst_queue_class_init,
+ gst_queue_class_init,
NULL,
NULL,
sizeof(GstQueue),
4,
- (GInstanceInitFunc)gst_queue_init,
+ gst_queue_init,
NULL
};
queue_type = g_type_register_static (GST_TYPE_ELEMENT, "GstQueue", &queue_info, 0);
}
static void
-gst_queue_class_init (GstQueueClass *klass)
+gst_queue_base_init (gpointer g_class)
{
- GObjectClass *gobject_class;
- GstElementClass *gstelement_class;
+ GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_set_details (gstelement_class, &gst_queue_details);
+}
- gobject_class = (GObjectClass*)klass;
- gstelement_class = (GstElementClass*)klass;
+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_ref (GST_TYPE_ELEMENT);
+ parent_class = g_type_class_peek_parent (g_class);
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_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.",
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.",
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.",
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",
"Minimum bytes required before signalling not_empty to reader.",
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",
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",
"Microseconds until blocked queue times out and returns filler event. "
"Value of -1 disables timeout",
}
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 */
GST_FLAG_SET (queue, GST_ELEMENT_DECOUPLED);
GST_FLAG_SET (queue, GST_ELEMENT_EVENT_AWARE);
G_BEGIN_DECLS
-extern GstElementDetails gst_queue_details;
-
-
#define GST_TYPE_QUEUE \
(gst_queue_get_type())
#define GST_QUEUE(obj) \
#define GST_CAT_DEFAULT GST_CAT_THREAD
#define STACK_SIZE 0x200000
-GstElementDetails gst_thread_details = {
+static GstElementDetails gst_thread_details = GST_ELEMENT_DETAILS (
"Threaded container",
"Generic/Bin",
- "LGPL",
"Container that creates/manages a thread",
- VERSION,
"Erik Walthinsen <omega@cse.ogi.edu>, "
- "Benjamin Otte <in7y118@informatik.uni-hamburg.de",
- "(C) 1999-2003",
-};
-
+ "Benjamin Otte <in7y118@informatik.uni-hamburg.de"
+);
/* Thread signals and args */
enum {
};
-
-static void gst_thread_class_init (GstThreadClass *klass);
-static void gst_thread_init (GstThread *thread);
+static void gst_thread_base_init (gpointer g_class);
+static void gst_thread_class_init (gpointer g_class, gpointer class_data);
+static void gst_thread_init (GTypeInstance *instance, gpointer g_class);
static void gst_thread_dispose (GObject *object);
if (!thread_type) {
static const GTypeInfo thread_info = {
- sizeof (GstThreadClass), NULL, NULL,
- (GClassInitFunc) gst_thread_class_init, NULL, NULL,
+ sizeof (GstThreadClass),
+ gst_thread_base_init,
+ NULL,
+ gst_thread_class_init,
+ NULL,
+ NULL,
sizeof (GstThread),
4,
- (GInstanceInitFunc) gst_thread_init,
+ gst_thread_init,
NULL
};
thread_type = g_type_register_static (GST_TYPE_BIN, "GstThread",
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
-gst_thread_class_init (GstThreadClass *klass)
+gst_thread_class_init (gpointer g_class, gpointer class_data)
{
- GObjectClass *gobject_class;
- GstObjectClass *gstobject_class;
- GstElementClass *gstelement_class;
- GstBinClass *gstbin_class;
+ GObjectClass *gobject_class = G_OBJECT_CLASS (g_class);
+ GstObjectClass *gstobject_class = GST_OBJECT_CLASS (g_class);
+ GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
+ GstBinClass *gstbin_class = GST_BIN_CLASS (g_class);
+ GstThreadClass *klass = GST_THREAD_CLASS (g_class);
/* setup gst_thread_current */
gst_thread_current = g_private_new (do_nothing);
- gobject_class = (GObjectClass*)klass;
- gstobject_class = (GstObjectClass*)klass;
- gstelement_class = (GstElementClass*)klass;
- gstbin_class = (GstBinClass*)klass;
-
- parent_class = g_type_class_ref (GST_TYPE_BIN);
+ parent_class = g_type_class_peek_parent (g_class);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PRIORITY,
g_param_spec_enum ("priority", "Scheduling Policy", "The scheduling priority of the thread",
}
static void
-gst_thread_init (GstThread *thread)
+gst_thread_init (GTypeInstance *instance, gpointer g_class)
{
GstScheduler *scheduler;
+ GstThread *thread = GST_THREAD (instance);
GST_DEBUG ("initializing thread");
G_BEGIN_DECLS
extern GPrivate *gst_thread_current;
-extern GstElementDetails gst_thread_details;
-
typedef enum {
GST_THREAD_STATE_SPINNING = GST_BIN_FLAG_LAST,
factory->function (find, factory->user_data);
}
/**
- * gst_type_find_factory_register:
+ * gst_type_find_register:
* @plugin: the GstPlugin to register with
* @name: the name for registering
* @rank: rank (or importance) of this typefind function
*
* Returns: TRUE on success, FALSE otherwise
*/
-void
-gst_type_find_factory_register (GstPlugin *plugin, const gchar *name, guint rank,
- GstTypeFindFunction func, gchar **extensions, GstCaps *possible_caps,
- gpointer data)
+gboolean
+gst_type_find_register (GstPlugin *plugin, const gchar *name, guint rank,
+ GstTypeFindFunction func, gchar **extensions, GstCaps *possible_caps,
+ gpointer data)
{
GstTypeFindFactory *factory;
- g_return_if_fail (plugin != NULL);
- g_return_if_fail (name != NULL);
- g_return_if_fail (func != NULL);
+ g_return_val_if_fail (plugin != NULL, FALSE);
+ g_return_val_if_fail (name != NULL, FALSE);
+ g_return_val_if_fail (func != NULL, FALSE);
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->user_data = data;
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
+
+ return TRUE;
}
/*** typefind function interface **********************************************/
guint64 gst_type_find_get_length (GstTypeFind * find);
/* registration interface */
-void gst_type_find_factory_register (GstPlugin * plugin,
+gboolean gst_type_find_register (GstPlugin * plugin,
const gchar * name,
guint rank,
GstTypeFindFunction func,
GST_RESULT_NOT_IMPL
} 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_CLASS_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
#endif /* __GST_TYPES_H__ */
}
gboolean
-gst_file_index_plugin_init (GModule *module, GstPlugin *plugin)
+gst_file_index_plugin_init (GstPlugin *plugin)
{
GstIndexFactory *factory;
GST_DEBUG_CATEGORY_INIT(DC, "GST_FILEINDEX", 0, NULL);
- gst_plugin_set_longname (plugin, "A file index");
factory = gst_index_factory_new ("fileindex",
"A index that stores entries in file",
#include <gst/gstversion.h>
#include <gst/gstplugin.h>
-extern gboolean gst_mem_index_plugin_init (GModule *module, GstPlugin *plugin);
-extern gboolean gst_file_index_plugin_init (GModule *module, GstPlugin *plugin);
+extern gboolean gst_mem_index_plugin_init (GstPlugin *plugin);
+extern gboolean gst_file_index_plugin_init (GstPlugin *plugin);
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
gboolean res = TRUE;
- res &= gst_mem_index_plugin_init (module, plugin);
- res &= gst_file_index_plugin_init (module, plugin);
+ res &= gst_mem_index_plugin_init (plugin);
+ res &= gst_file_index_plugin_init (plugin);
return res;
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"gstindexers",
- plugin_init
-};
+ "Gstremaer core indexers",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
+)
+
}
gboolean
-gst_mem_index_plugin_init (GModule *module, GstPlugin *plugin)
+gst_mem_index_plugin_init (GstPlugin *plugin)
{
GstIndexFactory *factory;
- gst_plugin_set_longname (plugin, "A memory index");
-
factory = gst_index_factory_new ("memindex",
"A index that stores entries in memory",
gst_mem_index_get_type());
g_markup_parse_context_parse (context, text, size, &error);
if (error) {
- fprintf (stderr, "ERROR: parsing registry %s: %s\n",
- registry->location, error->message);
+ GST_ERROR ("parsing registry %s: %s\n",
+ registry->location, error->message);
g_free (text);
fclose (reg);
return;
g_markup_parse_context_parse (xmlregistry->context, text, size, &error);
if (error) {
- fprintf(stderr, "ERROR: parsing registry: %s\n", error->message);
+ GST_ERROR ("parsing registry: %s\n", error->message);
g_free (text);
CLASS (xmlregistry)->close_func (xmlregistry);
return FALSE;
gst_xml_registry_load_plugin (GstRegistry *registry, GstPlugin *plugin)
{
GError *error = NULL;
+ GstPlugin *loaded_plugin;
/* FIXME: add gerror support */
- if (!gst_plugin_load_plugin (plugin, &error)) {
+ loaded_plugin = gst_plugin_load_file (plugin->filename, &error);
+ if (!plugin) {
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;
+ } else if (loaded_plugin != plugin) {
+ g_critical ("how to remove plugins?");
}
return GST_REGISTRY_OK;
GstPlugin *plugin = registry->current_plugin;
if (!strcmp (tag, "name")) {
- plugin->name = g_strndup (text, text_len);
+ plugin->desc.name = g_strndup (text, text_len);
}
- else if (!strcmp (tag, "longname")) {
- plugin->longname = g_strndup (text, text_len);
+ else if (!strcmp (tag, "description")) {
+ plugin->desc.description = g_strndup (text, text_len);
}
else if (!strcmp (tag, "filename")) {
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;
}
registry->current_feature->name = g_strndup (text, text_len);
}
else if (!strcmp (tag, "longname")) {
- g_free (factory->details->longname);
- factory->details->longname = g_strndup (text, text_len);
+ g_free (factory->details.longname);
+ factory->details.longname = g_strndup (text, text_len);
}
else if (!strcmp(tag, "class")) {
- g_free (factory->details->klass);
- factory->details->klass = g_strndup (text, text_len);
+ g_free (factory->details.klass);
+ factory->details.klass = g_strndup (text, text_len);
}
else if (!strcmp(tag, "description")) {
- g_free (factory->details->description);
- 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);
+ g_free (factory->details.description);
+ factory->details.description = g_strndup (text, text_len);
}
else if (!strcmp(tag, "author")) {
- g_free (factory->details->author);
- 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);
+ g_free (factory->details.author);
+ factory->details.author = g_strndup (text, text_len);
}
else if (!strcmp(tag, "rank")) {
gint rank;
gchar *ret;
rank = strtol (text, &ret, 0);
if (ret == text + text_len) {
- gst_element_factory_set_rank (factory, rank);
+ gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory), rank);
}
}
gchar *ret;
rank = strtol (text, &ret, 0);
if (ret == text + text_len) {
- gst_element_factory_set_rank (factory, rank);
+ gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory), rank);
}
}
/* FIXME!!
if (GST_IS_ELEMENT_FACTORY (feature)) {
GstElementFactory *factory = GST_ELEMENT_FACTORY (feature);
- factory->details_dynamic = TRUE;
- factory->details = g_new0(GstElementDetails, 1);
factory->padtemplates = NULL;
xmlregistry->parser = gst_xml_registry_parse_element_factory;
break;
xmlregistry->name_template = 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);
xmlregistry->state = GST_XML_REGISTRY_FEATURE;
xmlregistry->parser = gst_xml_registry_parse_element_factory;
gst_xml_registry_error (GMarkupParseContext *context, GError *error,
gpointer user_data)
{
- g_print ("error %s\n", error->message);
+ GST_ERROR ("%s\n", error->message);
}
static void
GstElementFactory *factory = GST_ELEMENT_FACTORY (feature);
GList *templates;
- PUT_ESCAPED ("longname", factory->details->longname);
- PUT_ESCAPED ("class", factory->details->klass);
- PUT_ESCAPED ("description", factory->details->description);
- PUT_ESCAPED ("license", factory->details->license);
- PUT_ESCAPED ("version", factory->details->version);
- PUT_ESCAPED ("author", factory->details->author);
- PUT_ESCAPED ("copyright", factory->details->copyright);
+ PUT_ESCAPED ("longname", factory->details.longname);
+ PUT_ESCAPED ("class", factory->details.klass);
+ PUT_ESCAPED ("description", factory->details.description);
+ PUT_ESCAPED ("author", factory->details.author);
templates = factory->padtemplates;
{
GList *walk;
- PUT_ESCAPED ("name", plugin->name);
- PUT_ESCAPED ("longname", plugin->longname);
+ PUT_ESCAPED ("name", plugin->desc.name);
+ PUT_ESCAPED ("description", plugin->desc.description);
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;
const gchar *directory)
{
GDir *dir;
+ gchar *temp;
GList *ret = NULL;
dir = g_dir_open (directory, 0, NULL);
}
g_dir_close (dir);
} else {
- if (strstr (directory, ".so")) {
- gchar *temp;
-
- if ((temp = strstr (directory, ".so")) &&
- (!strcmp (temp, ".so"))) {
- ret = g_list_prepend (ret, gst_plugin_new (directory));
- }
+ if ((temp = strstr (directory, G_MODULE_SUFFIX)) &&
+ (!strcmp (temp, G_MODULE_SUFFIX))) {
+ ret = g_list_prepend (ret, g_strdup (directory));
}
}
GList *walk = NULL, *plugins = NULL, *prune = NULL;
GError *error = NULL;
guint length;
+ GstPlugin *plugin;
GstXMLRegistry *xmlregistry = GST_XML_REGISTRY (registry);
walk = registry->paths;
walk = plugins;
while (walk) {
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);
- gst_registry_add_plugin (registry, GST_PLUGIN (walk->data));
+ gst_registry_add_plugin (registry, plugin);
}
walk = g_list_next (walk);
walk = prune;
while (walk) {
plugins = g_list_remove (plugins, walk->data);
+ g_free (walk->data);
walk = g_list_next (walk);
}
g_list_free (prune);
walk = plugins;
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",
- ((GstPlugin *) walk->data)->filename);
+ (gchar *) walk->data);
+ gst_registry_add_plugin (registry, plugin);
} else {
GST_CAT_INFO (GST_CAT_PLUGIN_LOADING, "Plugin %s failed to load: %s",
- ((GstPlugin *) walk->data)->filename, error->message);
- g_print ("Plugin %s failed to load\n",
- ((GstPlugin *) walk->data)->filename);
+ (gchar *) walk->data, error->message);
- g_free (((GstPlugin *) walk->data)->filename);
g_free (walk->data);
g_error_free (error);
error = NULL;
}
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
GstSchedulerFactory *factory;
GST_DEBUG_CATEGORY_INIT (debug_dataflow, "dataflow", 0, "basic scheduler dataflow");
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,
"A basic scheduler using "COTHREADS_NAME" cothreads",
gst_basic_scheduler_get_type());
return TRUE;
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"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
gst_basic_scheduler_loopfunc_wrapper (int argc, char **argv)
}
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
GstSchedulerFactory *factory;
GST_DEBUG_CATEGORY_INIT (debug_scheduler, "scheduler", 0, "optimal scheduler");
- gst_plugin_set_longname (plugin, "An optimal scheduler");
-
#ifdef USE_COTHREADS
factory = gst_scheduler_factory_new ("opt"COTHREADS_NAME,
"An optimal scheduler using "COTHREADS_NAME" cothreads",
return TRUE;
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"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 gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
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;
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"gstbytestream",
- plugin_init
-};
+ "a byte-oriented layer on top of buffer-passing",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
+)
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;
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"gstgetbits",
- plugin_init
-};
+ "Accelerated routines for getting bits from a data stream",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
+)
+
#include "gstaggregator.h"
-GST_DEBUG_CATEGORY (gst_aggregator_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_aggregator_debug);
#define GST_CAT_DEFAULT gst_aggregator_debug
-GstElementDetails gst_aggregator_details = {
+GstElementDetails gst_aggregator_details = GST_ELEMENT_DETAILS (
"Aggregator pipe fitting",
"Generic",
- "LGPL",
"N-to-1 pipe fitting",
- VERSION,
- "Wim Taymans <wim.taymans@chello.be>",
- "(C) 2001",
-};
+ "Wim Taymans <wim.taymans@chello.be>"
+);
/* Aggregator signals and args */
enum {
#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_init (GstAggregator *aggregator);
if (!aggregator_type) {
static const GTypeInfo aggregator_info = {
sizeof(GstAggregatorClass),
- NULL,
+ gst_aggregator_base_init,
NULL,
(GClassInitFunc)gst_aggregator_class_init,
NULL,
(GInstanceInitFunc)gst_aggregator_init,
};
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;
}
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
gst_aggregator_class_init (GstAggregatorClass *klass)
{
GObjectClass *gobject_class;
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;
-}
+
G_BEGIN_DECLS
-extern GstElementDetails gst_aggregator_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_aggregator_debug);
typedef enum {
AGGREGATOR_LOOP = 1,
#include "gstbufferstore.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
enum {
struct _elements_entry {
gchar *name;
+ guint rank;
GType (*type) (void);
- GstElementDetails *details;
- gboolean (*factoryinit) (GstElementFactory *factory);
};
extern GstElementDetails gst_filesrc_details;
static struct _elements_entry _elements[] = {
- { "aggregator", gst_aggregator_get_type, &gst_aggregator_details, gst_aggregator_factory_init },
- { "fakesrc", gst_fakesrc_get_type, &gst_fakesrc_details, gst_fakesrc_factory_init },
- { "fakesink", gst_fakesink_get_type, &gst_fakesink_details, gst_fakesink_factory_init },
- { "fdsink", gst_fdsink_get_type, &gst_fdsink_details, NULL },
- { "fdsrc", gst_fdsrc_get_type, &gst_fdsrc_details, NULL },
- { "filesrc", gst_filesrc_get_type, &gst_filesrc_details, NULL },
- { "filesink", gst_filesink_get_type, &gst_filesink_details, NULL },
- { "identity", gst_identity_get_type, &gst_identity_details, NULL },
- { "md5sink", gst_md5sink_get_type, &gst_md5sink_details, gst_md5sink_factory_init },
- { "multidisksrc", gst_multidisksrc_get_type, &gst_multidisksrc_details, NULL },
- { "pipefilter", gst_pipefilter_get_type, &gst_pipefilter_details, NULL },
- { "shaper", gst_shaper_get_type, &gst_shaper_details, gst_shaper_factory_init },
- { "statistics", gst_statistics_get_type, &gst_statistics_details, NULL },
- { "tee", gst_tee_get_type, &gst_tee_details, gst_tee_factory_init },
- { "typefind", gst_type_find_element_get_type, &gst_type_find_element_details, NULL },
+ { "aggregator", GST_RANK_PRIMARY, gst_aggregator_get_type },
+ { "fakesrc", GST_RANK_PRIMARY, gst_fakesrc_get_type },
+ { "fakesink", GST_RANK_PRIMARY, gst_fakesink_get_type },
+ { "fdsink", GST_RANK_PRIMARY, gst_fdsink_get_type },
+ { "fdsrc", GST_RANK_PRIMARY, gst_fdsrc_get_type },
+ { "filesrc", GST_RANK_PRIMARY, gst_filesrc_get_type },
+ { "filesink", GST_RANK_PRIMARY, gst_filesink_get_type },
+ { "identity", GST_RANK_PRIMARY, gst_identity_get_type },
+ { "md5sink", GST_RANK_PRIMARY, gst_md5sink_get_type },
+ { "multidisksrc", GST_RANK_PRIMARY, gst_multidisksrc_get_type },
+ { "pipefilter", GST_RANK_PRIMARY, gst_pipefilter_get_type },
+ { "shaper", GST_RANK_PRIMARY, gst_shaper_get_type },
+ { "statistics", GST_RANK_PRIMARY, gst_statistics_get_type },
+ { "tee", GST_RANK_PRIMARY, gst_tee_get_type },
+ { "typefind", GST_RANK_PRIMARY, gst_type_find_element_get_type },
{ NULL, 0 },
};
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
- GstElementFactory *factory;
- gint i = 0;
-
- gst_plugin_set_longname (plugin, "Standard GST Elements");
-
- GST_DEBUG_CATEGORY_INIT (gst_aggregator_debug, "aggregator", 0, "aggregator element");
- 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++;
+ struct _elements_entry *my_elements = _elements;
+
+ while ((*my_elements).name) {
+ if (!gst_element_register (plugin, (*my_elements).name, (*my_elements).rank, ((*my_elements).type) ()))
+ return FALSE;
+ my_elements++;
}
-/* INFO (GST_INFO_PLUGIN_LOAD,"gstelements: loaded %d standard elements", i);*/
return TRUE;
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"gstelements",
- plugin_init
-};
+ "standard GStreamer elements",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
+)
+
#include "gstfakesink.h"
-GST_DEBUG_CATEGORY (gst_fakesink_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_fakesink_debug);
#define GST_CAT_DEFAULT gst_fakesink_debug
-GstElementDetails gst_fakesink_details = {
+GstElementDetails gst_fakesink_details = GST_ELEMENT_DETAILS (
"Fake Sink",
"Sink",
- "LGPL",
"Black hole for data",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>"
+);
/* FakeSink signals and args */
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_init (GstFakeSink *fakesink);
if (!fakesink_type) {
static const GTypeInfo fakesink_info = {
- sizeof(GstFakeSinkClass), NULL,
+ sizeof(GstFakeSinkClass),
+ gst_fakesink_base_init,
NULL,
(GClassInitFunc)gst_fakesink_class_init,
NULL,
(GInstanceInitFunc)gst_fakesink_init,
};
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;
}
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
gst_fakesink_class_init (GstFakeSinkClass *klass)
{
GObjectClass *gobject_class;
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;
-}
G_BEGIN_DECLS
-extern GstElementDetails gst_fakesink_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_fakesink_debug);
#define GST_TYPE_FAKESINK \
(gst_fakesink_get_type())
#define DEFAULT_SIZEMAX 4096
#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
-GstElementDetails gst_fakesrc_details = {
+GstElementDetails gst_fakesrc_details = GST_ELEMENT_DETAILS (
"Fake Source",
"Source",
- "LGPL",
"Push empty (no data) buffers around",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>\n"
- "Wim Taymans <wim.taymans@chello.be>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>, "
+ "Wim Taymans <wim.taymans@chello.be>"
+);
/* FakeSrc signals and args */
};
if (!fakesrc_output_type) {
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_filltype_type;
}
+static void gst_fakesrc_base_init (gpointer g_class);
static void gst_fakesrc_class_init (GstFakeSrcClass *klass);
static void gst_fakesrc_init (GstFakeSrc *fakesrc);
if (!fakesrc_type) {
static const GTypeInfo fakesrc_info = {
sizeof(GstFakeSrcClass),
- NULL,
+ gst_fakesrc_base_init,
NULL,
(GClassInitFunc)gst_fakesrc_class_init,
NULL,
}
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
gst_fakesrc_class_init (GstFakeSrcClass *klass)
{
GObjectClass *gobject_class;
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;
-}
G_BEGIN_DECLS
-extern GstElementDetails gst_fakesrc_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_fakesrc_debug);
typedef enum {
FAKESRC_FIRST_LAST_LOOP = 1,
#include "gstfdsink.h"
#include <unistd.h>
-GST_DEBUG_CATEGORY (gst_fdsink_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_fdsink_debug);
#define GST_CAT_DEFAULT gst_fdsink_debug
-GstElementDetails gst_fdsink_details = {
+GstElementDetails gst_fdsink_details = GST_ELEMENT_DETAILS (
"Filedescriptor Sink",
"Sink/File",
- "LGPL",
"Write data to a file descriptor",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>"
+);
/* FdSink signals and args */
};
+static void gst_fdsink_base_init (gpointer g_class);
static void gst_fdsink_class_init (GstFdSinkClass *klass);
static void gst_fdsink_init (GstFdSink *fdsink);
if (!fdsink_type) {
static const GTypeInfo fdsink_info = {
- sizeof(GstFdSinkClass), NULL,
+ sizeof(GstFdSinkClass),
+ gst_fdsink_base_init,
NULL,
(GClassInitFunc)gst_fdsink_class_init,
NULL,
(GInstanceInitFunc)gst_fdsink_init,
};
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;
}
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
gst_fdsink_class_init (GstFdSinkClass *klass)
{
GObjectClass *gobject_class;
- gobject_class = (GObjectClass*)klass;
+ gobject_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
G_BEGIN_DECLS
-extern GstElementDetails gst_fdsink_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_fdsink_debug);
#define GST_TYPE_FDSINK \
(gst_fdsink_get_type())
#define DEFAULT_BLOCKSIZE 4096
-GST_DEBUG_CATEGORY (gst_fdsrc_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_fdsrc_debug);
#define GST_CAT_DEFAULT gst_fdsrc_debug
-GstElementDetails gst_fdsrc_details =
-{
+GstElementDetails gst_fdsrc_details = GST_ELEMENT_DETAILS (
"Disk Source",
"Source/File",
- "LGPL",
"Synchronous read from a file",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>"
+);
/* FdSrc signals and args */
ARG_BLOCKSIZE,
};
-
+static void gst_fdsrc_base_init (gpointer g_class);
static void gst_fdsrc_class_init (GstFdSrcClass *klass);
static void gst_fdsrc_init (GstFdSrc *fdsrc);
if (!fdsrc_type) {
static const GTypeInfo fdsrc_info = {
sizeof(GstFdSrcClass),
- NULL,
+ gst_fdsrc_base_init,
NULL,
(GClassInitFunc)gst_fdsrc_class_init,
NULL,
(GInstanceInitFunc)gst_fdsrc_init,
};
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;
}
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
gst_fdsrc_class_init (GstFdSrcClass *klass)
{
GObjectClass *gobject_class;
- gobject_class = (GObjectClass*)klass;
-
+ gobject_class = G_OBJECT_CLASS (klass);
+
parent_class = g_type_class_ref(GST_TYPE_ELEMENT);
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FD,
G_BEGIN_DECLS
-extern GstElementDetails gst_fdsrc_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_fdsrc_debug);
#define GST_TYPE_FDSRC \
(gst_fdsrc_get_type())
#include <sys/types.h>
#include <unistd.h>
-GST_DEBUG_CATEGORY (gst_filesink_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_filesink_debug);
#define GST_CAT_DEFAULT gst_filesink_debug
-GstElementDetails gst_filesink_details = {
+GstElementDetails gst_filesink_details = GST_ELEMENT_DETAILS (
"File Sink",
"Sink/File",
- "LGPL",
"Write stream to a file",
- VERSION,
- "Thomas <thomas@apestaart.org>",
- "(C) 2001"
-};
+ "Thomas <thomas@apestaart.org>"
+);
/* FileSink signals and args */
)
+static void gst_filesink_base_init (gpointer g_class);
static void gst_filesink_class_init (GstFileSinkClass *klass);
static void gst_filesink_init (GstFileSink *filesink);
if (!filesink_type) {
static const GTypeInfo filesink_info = {
- sizeof(GstFileSinkClass), NULL,
+ sizeof(GstFileSinkClass),
+ gst_filesink_base_init,
NULL,
(GClassInitFunc)gst_filesink_class_init,
NULL,
(GInstanceInitFunc)gst_filesink_init,
};
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;
}
static void
-gst_filesink_class_init (GstFileSinkClass *klass)
+gst_filesink_base_init (gpointer g_class)
{
- GObjectClass *gobject_class;
- GstElementClass *gstelement_class;
+ GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
- gobject_class = (GObjectClass*)klass;
- gstelement_class = (GstElementClass*)klass;
+ gstelement_class->change_state = gst_filesink_change_state;
+ gst_element_class_set_details (gstelement_class, &gst_filesink_details);
+}
+static void
+gst_filesink_class_init (GstFileSinkClass *klass)
+{
+ GObjectClass *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_LOCATION,
g_param_spec_string ("location", "File Location", "Location of the file to write",
gobject_class->set_property = gst_filesink_set_property;
gobject_class->get_property = gst_filesink_get_property;
-
- gstelement_class->change_state = gst_filesink_change_state;
}
static void
G_BEGIN_DECLS
-extern GstElementDetails gst_filesink_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_filesink_debug);
#define GST_TYPE_FILESINK \
(gst_filesink_get_type())
*/
-GST_DEBUG_CATEGORY (gst_filesrc_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_filesrc_debug);
#define GST_CAT_DEFAULT gst_filesrc_debug
-GstElementDetails gst_filesrc_details = {
+GstElementDetails gst_filesrc_details = GST_ELEMENT_DETAILS (
"File Source",
"Source/File",
- "LGPL",
"Read from arbitrary point in a file",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>"
+);
#define DEFAULT_BLOCKSIZE 4*1024
#define DEFAULT_MMAPSIZE 4*1024*1024
GST_FORMAT_BYTES
)
+static void gst_filesrc_base_init (gpointer g_class);
static void gst_filesrc_class_init (GstFileSrcClass *klass);
static void gst_filesrc_init (GstFileSrc *filesrc);
static void gst_filesrc_dispose (GObject *object);
if (!filesrc_type) {
static const GTypeInfo filesrc_info = {
- sizeof(GstFileSrcClass), NULL,
+ sizeof(GstFileSrcClass),
+ gst_filesrc_base_init,
NULL,
(GClassInitFunc)gst_filesrc_class_init,
NULL,
(GInstanceInitFunc)gst_filesrc_init,
};
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;
}
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
gst_filesrc_class_init (GstFileSrcClass *klass)
{
- GObjectClass *gobject_class;
- GstElementClass *gstelement_class;
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ GstElementClass *gstelement_class = GST_ELEMENT_CLASS (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_param_spec_int ("fd", "File-descriptor", "File-descriptor for the file being mmap()d",
G_BEGIN_DECLS
-extern GstElementDetails gst_filesrc_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_filesrc_debug);
#define GST_TYPE_FILESRC \
(gst_filesrc_get_type())
#include "gstidentity.h"
-GST_DEBUG_CATEGORY (gst_identity_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_identity_debug);
#define GST_CAT_DEFAULT gst_identity_debug
-GstElementDetails gst_identity_details = {
+GstElementDetails gst_identity_details = GST_ELEMENT_DETAILS (
"Identity",
"Generic",
- "LGPL",
"Pass data without modification",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>"
+);
/* Identity signals and args */
};
+static void gst_identity_base_init (gpointer g_class);
static void gst_identity_class_init (GstIdentityClass *klass);
static void gst_identity_init (GstIdentity *identity);
if (!identity_type) {
static const GTypeInfo identity_info = {
- sizeof(GstIdentityClass), NULL,
+ sizeof(GstIdentityClass),
+ gst_identity_base_init,
NULL,
(GClassInitFunc)gst_identity_class_init,
NULL,
(GInstanceInitFunc)gst_identity_init,
};
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;
}
+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
gst_identity_class_init (GstIdentityClass *klass)
{
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_param_spec_boolean ("loop-based", "Loop-based",
G_BEGIN_DECLS
-extern GstElementDetails gst_identity_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_identity_debug);
#define GST_TYPE_IDENTITY \
(gst_identity_get_type())
#include <gst/gst.h>
#include "gstmd5sink.h"
-GST_DEBUG_CATEGORY (gst_md5sink_debug);
+GST_DEBUG_CATEGORY_STATIC (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 */
enum {
/* FILL ME */
);
/* GObject stuff */
+static void gst_md5sink_base_init (gpointer g_class);
static void gst_md5sink_class_init (GstMD5SinkClass *klass);
static void gst_md5sink_init (GstMD5Sink *md5sink);
if (!md5sink_type) {
static const GTypeInfo md5sink_info = {
sizeof(GstMD5SinkClass),
- NULL,
+ gst_md5sink_base_init,
NULL,
(GClassInitFunc) gst_md5sink_class_init,
NULL,
};
md5sink_type = g_type_register_static (GST_TYPE_ELEMENT, "GstMD5Sink",
&md5sink_info, 0);
+
+ GST_DEBUG_CATEGORY_INIT (gst_md5sink_debug, "md5sink", 0, "md5sink element");
}
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
gst_md5sink_class_init (GstMD5SinkClass *klass)
{
GObjectClass *gobject_class;
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);
+
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_md5sink_get_property);
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_READABLE));
gstelement_class->change_state = GST_DEBUG_FUNCPTR(gst_md5sink_change_state);
-
- gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_md5sink_get_property);
}
static void
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;
-}
G_BEGIN_DECLS
-extern GstElementDetails gst_md5sink_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_md5sink_debug);
#define GST_TYPE_MD5SINK \
(gst_md5sink_get_type())
#include "gstmultidisksrc.h"
-GST_DEBUG_CATEGORY (gst_multidisksrc_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_multidisksrc_debug);
#define GST_CAT_DEFAULT gst_multidisksrc_debug
-GstElementDetails gst_multidisksrc_details = {
+GstElementDetails gst_multidisksrc_details = GST_ELEMENT_DETAILS (
"Multi Disk Source",
"Source/File",
- "LGPL",
"Read from multiple files in order",
- VERSION,
- "Dominic Ludlam <dom@openfx.org>",
- "(C) 2001",
-};
+ "Dominic Ludlam <dom@openfx.org>"
+);
/* DiskSrc signals and args */
enum {
ARG_LOCATIONS,
};
+static void gst_multidiscsrc_base_init (gpointer g_class);
static void gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass);
static void gst_multidisksrc_init (GstMultiDiskSrc *disksrc);
if (!multidisksrc_type) {
static const GTypeInfo multidisksrc_info = {
- sizeof(GstMultiDiskSrcClass), NULL,
+ sizeof(GstMultiDiskSrcClass),
+ gst_multidiscsrc_base_init,
NULL,
(GClassInitFunc)gst_multidisksrc_class_init,
NULL,
(GInstanceInitFunc)gst_multidisksrc_init,
};
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;
}
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
gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass)
{
GObjectClass *gobject_class;
G_BEGIN_DECLS
-extern GstElementDetails gst_multidisksrc_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_multidisksrc_debug);
#define GST_TYPE_MULTIDISKSRC \
(gst_multidisksrc_get_type())
#include "gstmultidisksrc.h"
-GST_DEBUG_CATEGORY (gst_multidisksrc_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_multidisksrc_debug);
#define GST_CAT_DEFAULT gst_multidisksrc_debug
-GstElementDetails gst_multidisksrc_details = {
+GstElementDetails gst_multidisksrc_details = GST_ELEMENT_DETAILS (
"Multi Disk Source",
"Source/File",
- "LGPL",
"Read from multiple files in order",
- VERSION,
- "Dominic Ludlam <dom@openfx.org>",
- "(C) 2001",
-};
+ "Dominic Ludlam <dom@openfx.org>"
+);
/* DiskSrc signals and args */
enum {
ARG_LOCATIONS,
};
+static void gst_multidiscsrc_base_init (gpointer g_class);
static void gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass);
static void gst_multidisksrc_init (GstMultiDiskSrc *disksrc);
if (!multidisksrc_type) {
static const GTypeInfo multidisksrc_info = {
- sizeof(GstMultiDiskSrcClass), NULL,
+ sizeof(GstMultiDiskSrcClass),
+ gst_multidiscsrc_base_init,
NULL,
(GClassInitFunc)gst_multidisksrc_class_init,
NULL,
(GInstanceInitFunc)gst_multidisksrc_init,
};
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;
}
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
gst_multidisksrc_class_init (GstMultiDiskSrcClass *klass)
{
GObjectClass *gobject_class;
G_BEGIN_DECLS
-extern GstElementDetails gst_multidisksrc_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_multidisksrc_debug);
#define GST_TYPE_MULTIDISKSRC \
(gst_multidisksrc_get_type())
#include "gstpipefilter.h"
-GST_DEBUG_CATEGORY (gst_pipefilter_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_pipefilter_debug);
#define GST_CAT_DEFAULT gst_pipefilter_debug
-GstElementDetails gst_pipefilter_details = {
+GstElementDetails gst_pipefilter_details = GST_ELEMENT_DETAILS (
"Pipefilter",
"Filter",
- "LGPL",
"Interoperate with an external program using stdin and stdout",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>\n"
- "Wim Taymans <wim.taymans@chello.be>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>, "
+ "Wim Taymans <wim.taymans@chello.be>"
+);
/* Pipefilter signals and args */
};
+static void gst_pipefilter_base_init (gpointer g_class);
static void gst_pipefilter_class_init (GstPipefilterClass *klass);
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_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 gboolean gst_pipefilter_handle_event (GstPad *pad, GstEvent *event);
if (!pipefilter_type) {
static const GTypeInfo pipefilter_info = {
- sizeof(GstPipefilterClass), NULL,
+ sizeof(GstPipefilterClass),
+ gst_pipefilter_base_init,
NULL,
(GClassInitFunc)gst_pipefilter_class_init,
NULL,
(GInstanceInitFunc)gst_pipefilter_init,
};
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;
}
+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
gst_pipefilter_class_init (GstPipefilterClass *klass)
{
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_param_spec_string("command","command","command",
NULL, G_PARAM_READWRITE)); /* CHECKME */
- gobject_class->set_property = gst_pipefilter_set_property;
- gobject_class->get_property = gst_pipefilter_get_property;
+ gstelement_class->change_state = gst_pipefilter_change_state;
}
static void
G_BEGIN_DECLS
-extern GstElementDetails gst_pipefilter_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_pipefilter_debug);
#define GST_TYPE_PIPEFILTER \
(gst_pipefilter_get_type())
#include "gstevent.h"
#include "gstinfo.h"
-GstElementDetails gst_queue_details = {
+static GstElementDetails gst_queue_details = GST_ELEMENT_DETAILS (
"Queue",
"Generic",
- "LGPL",
"Simple data queue",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>"
+);
/* Queue signals and args */
ARG_BLOCK_TIMEOUT,
};
-
-static void gst_queue_class_init (GstQueueClass *klass);
-static void gst_queue_init (GstQueue *queue);
+static void gst_queue_base_init (gpointer g_class);
+static void gst_queue_class_init (gpointer g_class,
+ gpointer class_data);
+static void gst_queue_init (GTypeInstance *instance,
+ gpointer g_class);
static void gst_queue_dispose (GObject *object);
static void gst_queue_set_property (GObject *object, guint prop_id,
if (!queue_type) {
static const GTypeInfo queue_info = {
sizeof(GstQueueClass),
+ gst_queue_base_init,
NULL,
- NULL,
- (GClassInitFunc)gst_queue_class_init,
+ gst_queue_class_init,
NULL,
NULL,
sizeof(GstQueue),
4,
- (GInstanceInitFunc)gst_queue_init,
+ gst_queue_init,
NULL
};
queue_type = g_type_register_static (GST_TYPE_ELEMENT, "GstQueue", &queue_info, 0);
}
static void
-gst_queue_class_init (GstQueueClass *klass)
+gst_queue_base_init (gpointer g_class)
{
- GObjectClass *gobject_class;
- GstElementClass *gstelement_class;
+ GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_set_details (gstelement_class, &gst_queue_details);
+}
- gobject_class = (GObjectClass*)klass;
- gstelement_class = (GstElementClass*)klass;
+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_ref (GST_TYPE_ELEMENT);
+ parent_class = g_type_class_peek_parent (g_class);
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_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.",
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.",
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.",
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",
"Minimum bytes required before signalling not_empty to reader.",
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",
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",
"Microseconds until blocked queue times out and returns filler event. "
"Value of -1 disables timeout",
}
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 */
GST_FLAG_SET (queue, GST_ELEMENT_DECOUPLED);
GST_FLAG_SET (queue, GST_ELEMENT_EVENT_AWARE);
G_BEGIN_DECLS
-extern GstElementDetails gst_queue_details;
-
-
#define GST_TYPE_QUEUE \
(gst_queue_get_type())
#define GST_QUEUE(obj) \
#include "gstshaper.h"
-GST_DEBUG_CATEGORY (gst_shaper_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_shaper_debug);
#define GST_CAT_DEFAULT gst_shaper_debug
-GstElementDetails gst_shaper_details = {
+GstElementDetails gst_shaper_details = GST_ELEMENT_DETAILS (
"Shaper",
"Generic",
- "LGPL",
"Synchronizes streams on different pads",
- VERSION,
- "Wim Taymans <wim.taymans@chello.be>",
- "(C) 2003",
-};
+ "Wim Taymans <wim.taymans@chello.be>"
+);
/* Shaper signals and args */
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_init (GstShaper *shaper);
if (!shaper_type) {
static const GTypeInfo shaper_info = {
- sizeof(GstShaperClass), NULL,
+ sizeof(GstShaperClass),
+ gst_shaper_base_init,
NULL,
(GClassInitFunc)gst_shaper_class_init,
NULL,
(GInstanceInitFunc)gst_shaper_init,
};
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;
}
+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
gst_shaper_class_init (GstShaperClass *klass)
{
}
}
-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;
-}
G_BEGIN_DECLS
-extern GstElementDetails gst_shaper_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_shaper_debug);
#define GST_TYPE_SHAPER \
(gst_shaper_get_type())
#include "gststatistics.h"
-GST_DEBUG_CATEGORY (gst_statistics_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_statistics_debug);
#define GST_CAT_DEFAULT gst_statistics_debug
-GstElementDetails gst_statistics_details = {
+GstElementDetails gst_statistics_details = GST_ELEMENT_DETAILS (
"Statistics",
"Generic",
- "LGPL",
"Statistics on buffers/bytes/events",
- VERSION,
- "David I. Lehn <dlehn@users.sourceforge.net>",
- "(C) 2001",
-};
+ "David I. Lehn <dlehn@users.sourceforge.net>"
+);
/* Statistics signals and args */
};
+static void gst_statistics_base_init (gpointer g_class);
static void gst_statistics_class_init (GstStatisticsClass *klass);
static void gst_statistics_init (GstStatistics *statistics);
if (!statistics_type) {
static const GTypeInfo statistics_info = {
- sizeof(GstStatisticsClass), NULL,
+ sizeof(GstStatisticsClass),
+ gst_statistics_base_init,
NULL,
(GClassInitFunc)gst_statistics_class_init,
NULL,
(GInstanceInitFunc)gst_statistics_init,
};
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;
}
+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
gst_statistics_class_init (GstStatisticsClass *klass)
{
GObjectClass *gobject_class;
+
+ gobject_class = G_OBJECT_CLASS (klass);
- gobject_class = (GObjectClass*)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_BUFFERS,
g_param_spec_int64 ("buffers", "buffers", "total buffers count",
G_BEGIN_DECLS
-extern GstElementDetails gst_statistics_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_statistics_debug);
#define GST_TYPE_STATISTICS \
(gst_statistics_get_type())
#include "gsttee.h"
-GST_DEBUG_CATEGORY (gst_tee_debug);
+GST_DEBUG_CATEGORY_STATIC (gst_tee_debug);
#define GST_CAT_DEFAULT gst_tee_debug
-GstElementDetails gst_tee_details = {
+GstElementDetails gst_tee_details = GST_ELEMENT_DETAILS (
"Tee pipe fitting",
"Generic",
- "LGPL",
"1-to-N pipe fitting",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>\n"
- "Wim Taymans <wim.taymans@chello.be>",
- "(C) 1999, 2000",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>, "
+ "Wim Taymans <wim.taymans@chello.be>"
+);
/* Tee signals and args */
enum {
GST_CAPS_ANY
);
+static void gst_tee_base_init (gpointer g_class);
static void gst_tee_class_init (GstTeeClass *klass);
static void gst_tee_init (GstTee *tee);
if (!tee_type) {
static const GTypeInfo tee_info = {
- sizeof(GstTeeClass), NULL,
+ sizeof(GstTeeClass),
+ gst_tee_base_init,
NULL,
(GClassInitFunc)gst_tee_class_init,
NULL,
(GInstanceInitFunc)gst_tee_init,
};
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;
}
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
gst_tee_class_init (GstTeeClass *klass)
{
GObjectClass *gobject_class;
}
}
-gboolean
-gst_tee_factory_init (GstElementFactory *factory)
-{
- gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (tee_src_factory));
-
- return TRUE;
-}
G_BEGIN_DECLS
-extern GstElementDetails gst_tee_details;
-GST_DEBUG_CATEGORY_EXTERN(gst_tee_debug);
#define GST_TYPE_TEE \
(gst_tee_get_type())
#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
-GstElementDetails gst_type_find_element_details = {
+GstElementDetails gst_type_find_element_details = GST_ELEMENT_DETAILS (
"TypeFind",
"Generic",
- "LGPL",
"Finds the media type of a stream",
- VERSION,
- "Benjamin Otte <in7y118@public.uni-hamburg.de>",
- "(C) 2003",
-};
+ "Benjamin Otte <in7y118@public.uni-hamburg.de>"
+);
/* generic templates */
GST_PAD_TEMPLATE_FACTORY (type_find_element_sink_factory,
};
+static void gst_type_find_element_base_init (gpointer g_class);
static void gst_type_find_element_class_init (gpointer g_class,
gpointer class_data);
static void gst_type_find_element_init (GTypeInstance *instance,
if (!typefind_type) {
static const GTypeInfo typefind_info = {
sizeof (GstTypeFindElementClass),
- NULL,
+ gst_type_find_element_base_init,
NULL,
gst_type_find_element_class_init,
NULL,
typefind_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstTypeFindElement",
&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;
}
}
}
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)
{
GObjectClass *gobject_class;
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_FIND_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TYPE_FIND_ELEMENT, GstTypeFindElement))
#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
-GstElementDetails gst_type_find_element_details = {
+GstElementDetails gst_type_find_element_details = GST_ELEMENT_DETAILS (
"TypeFind",
"Generic",
- "LGPL",
"Finds the media type of a stream",
- VERSION,
- "Benjamin Otte <in7y118@public.uni-hamburg.de>",
- "(C) 2003",
-};
+ "Benjamin Otte <in7y118@public.uni-hamburg.de>"
+);
/* generic templates */
GST_PAD_TEMPLATE_FACTORY (type_find_element_sink_factory,
};
+static void gst_type_find_element_base_init (gpointer g_class);
static void gst_type_find_element_class_init (gpointer g_class,
gpointer class_data);
static void gst_type_find_element_init (GTypeInstance *instance,
if (!typefind_type) {
static const GTypeInfo typefind_info = {
sizeof (GstTypeFindElementClass),
- NULL,
+ gst_type_find_element_base_init,
NULL,
gst_type_find_element_class_init,
NULL,
typefind_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstTypeFindElement",
&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;
}
}
}
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)
{
GObjectClass *gobject_class;
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_FIND_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TYPE_FIND_ELEMENT, GstTypeFindElement))
}
gboolean
-gst_file_index_plugin_init (GModule *module, GstPlugin *plugin)
+gst_file_index_plugin_init (GstPlugin *plugin)
{
GstIndexFactory *factory;
GST_DEBUG_CATEGORY_INIT(DC, "GST_FILEINDEX", 0, NULL);
- gst_plugin_set_longname (plugin, "A file index");
factory = gst_index_factory_new ("fileindex",
"A index that stores entries in file",
#include <gst/gstversion.h>
#include <gst/gstplugin.h>
-extern gboolean gst_mem_index_plugin_init (GModule *module, GstPlugin *plugin);
-extern gboolean gst_file_index_plugin_init (GModule *module, GstPlugin *plugin);
+extern gboolean gst_mem_index_plugin_init (GstPlugin *plugin);
+extern gboolean gst_file_index_plugin_init (GstPlugin *plugin);
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
gboolean res = TRUE;
- res &= gst_mem_index_plugin_init (module, plugin);
- res &= gst_file_index_plugin_init (module, plugin);
+ res &= gst_mem_index_plugin_init (plugin);
+ res &= gst_file_index_plugin_init (plugin);
return res;
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"gstindexers",
- plugin_init
-};
+ "Gstremaer core indexers",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
+)
+
}
gboolean
-gst_mem_index_plugin_init (GModule *module, GstPlugin *plugin)
+gst_mem_index_plugin_init (GstPlugin *plugin)
{
GstIndexFactory *factory;
- gst_plugin_set_longname (plugin, "A memory index");
-
factory = gst_index_factory_new ("memindex",
"A index that stores entries in memory",
gst_mem_index_get_type());
#include <string.h>
#include "example.h"
-/* The ElementDetails structure gives a human-readable description
- * of the plugin, as well as author and version data.
+/* The ElementDetails structure gives a human-readable description of the
+ * 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",
"Example/FirstExample",
- "LGPL",
"Shows the basic structure of a plugin",
- "0.1",
- "your name <your.name@your.isp>",
- "(C) 2001",
-};
+ "your name <your.name@your.isp>"
+);
/* These are the signals that this element can fire. They are zero-
* based because the numbers themselves are private to the object.
/* we also override the default state change handler with our own
* implementation */
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 called to register everything that the plugin provides.
*/
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
- GstElementFactory *factory;
-
- /* We need to create an ElementFactory for each element we provide.
- * This consists of the name of the element, the GType identifier,
- * and a pointer to the details structure at the top of the file.
+ /* 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
+ * when compared to similar plugins and the GType identifier.
*/
- factory = gst_element_factory_new("example", GST_TYPE_EXAMPLE, &example_details);
- g_return_val_if_fail(factory != NULL, 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));
+ if (!gst_element_register (plugin, "example", GST_RANK_MARGINAL, GST_TYPE_EXAMPLE))
+ return FALSE;
/* Now we can return successfully. */
return TRUE;
/* 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.
*/
}
* The symbol pointing to this structure is the only symbol looked up when
* loading the plugin.
*/
-GstPluginDesc plugin_desc = {
- 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 */
- "example", /* The name of the plugin. This must be unique: plugins with
- * the same name will be assumed to be identical, and only
- * one will be loaded. */
- plugin_init /* Pointer to the initialisation function for the plugin. */
-};
+GST_PLUGIN_DEFINE (
+ 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 */
+ "example", /* The name of the plugin. This must be unique: plugins with
+ * the same name will be assumed to be identical, and only
+ * one will be loaded. */
+ "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. */
+);
tests_fail = test1
test1_SOURCES = test1.c gstbstest.c
-
+test1_LDFLAGS = -lgstbytestream -L$(top_srcdir)/libs/gst/bytestream
#include <string.h>
#include <gst/gst.h>
-#include <gst/gstbytestream.h>
+#include <gst/bytestream/bytestream.h>
#define GST_TYPE_BSTEST (gst_bstest_get_type())
#define GST_BSTEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BSTEST,GstBsTest))
GType gst_bstest_get_type (void);
-GstElementDetails gst_bstest_details = {
+GstElementDetails gst_bstest_details = GST_ELEMENT_DETAILS (
"ByteStreamTest",
"Filter",
- "LGPL",
"Test for the GstByteStream code",
- VERSION,
- "Erik Walthinsen <omega@temple-baptist.com>,"
- "Wim Taymans <wim.taymans@chello.be>",
- "(C) 2001",
-};
+ "Erik Walthinsen <omega@temple-baptist.com>, "
+ "Wim Taymans <wim.taymans@chello.be>"
+);
/* BsTest signals and args */
};
+static void gst_bstest_base_init (gpointer g_class);
static void gst_bstest_class_init (GstBsTestClass * klass);
static void gst_bstest_init (GstBsTest * bstest);
if (!bstest_type) {
static const GTypeInfo bstest_info = {
- sizeof (GstBsTestClass), NULL,
+ sizeof (GstBsTestClass),
+ gst_bstest_base_init,
NULL,
(GClassInitFunc) gst_bstest_class_init,
NULL,
}
return bstest_type;
}
+static void
+gst_bstest_base_init (gpointer g_class)
+{
+ GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_set_details (gstelement_class, &gst_bstest_details);
+}
static void
gst_bstest_class_init (GstBsTestClass * klass)
}
static gboolean
-plugin_init (GModule * module, GstPlugin * plugin)
+plugin_init (GstPlugin * plugin)
{
- GstElementFactory *factory;
-
/* We need to create an ElementFactory for each element we provide.
* 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 ("bstest", GST_TYPE_BSTEST, &gst_bstest_details);
- g_return_val_if_fail (factory != NULL, FALSE);
-
- /* The very last thing is to register the elementfactory with the plugin. */
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-
- return TRUE;
+ return gst_element_register (plugin, "bstest", GST_RANK_PRIMARY, GST_TYPE_BSTEST);
}
-GST_PLUGIN_DESC (GST_VERSION_MAJOR, GST_VERSION_MINOR, "bstest", plugin_init);
+GST_PLUGIN_DEFINE (
+ GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ "bstest",
+ "test for the bytestream element",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
+)
return TRUE;
}
-GST_PLUGIN_DESC (
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"testplugin",
return TRUE;
}
-GST_PLUGIN_DESC (
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"testplugin2",
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <gst/gst.h>
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
return TRUE;
}
-GST_PLUGIN_DESC (
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"testplugin",
- plugin_init
+ "a plugin for testing",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
);
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <gst/gst.h>
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
return TRUE;
}
-GST_PLUGIN_DESC (
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"testplugin2",
- plugin_init
+ "another testplugin for testing",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
);
tests_fail = test1
test1_SOURCES = test1.c gstbstest.c
-
+test1_LDFLAGS = -lgstbytestream -L$(top_srcdir)/libs/gst/bytestream
#include <string.h>
#include <gst/gst.h>
-#include <gst/gstbytestream.h>
+#include <gst/bytestream/bytestream.h>
#define GST_TYPE_BSTEST (gst_bstest_get_type())
#define GST_BSTEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BSTEST,GstBsTest))
GType gst_bstest_get_type (void);
-GstElementDetails gst_bstest_details = {
+GstElementDetails gst_bstest_details = GST_ELEMENT_DETAILS (
"ByteStreamTest",
"Filter",
- "LGPL",
"Test for the GstByteStream code",
- VERSION,
- "Erik Walthinsen <omega@temple-baptist.com>,"
- "Wim Taymans <wim.taymans@chello.be>",
- "(C) 2001",
-};
+ "Erik Walthinsen <omega@temple-baptist.com>, "
+ "Wim Taymans <wim.taymans@chello.be>"
+);
/* BsTest signals and args */
};
+static void gst_bstest_base_init (gpointer g_class);
static void gst_bstest_class_init (GstBsTestClass * klass);
static void gst_bstest_init (GstBsTest * bstest);
if (!bstest_type) {
static const GTypeInfo bstest_info = {
- sizeof (GstBsTestClass), NULL,
+ sizeof (GstBsTestClass),
+ gst_bstest_base_init,
NULL,
(GClassInitFunc) gst_bstest_class_init,
NULL,
}
return bstest_type;
}
+static void
+gst_bstest_base_init (gpointer g_class)
+{
+ GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_set_details (gstelement_class, &gst_bstest_details);
+}
static void
gst_bstest_class_init (GstBsTestClass * klass)
}
static gboolean
-plugin_init (GModule * module, GstPlugin * plugin)
+plugin_init (GstPlugin * plugin)
{
- GstElementFactory *factory;
-
/* We need to create an ElementFactory for each element we provide.
* 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 ("bstest", GST_TYPE_BSTEST, &gst_bstest_details);
- g_return_val_if_fail (factory != NULL, FALSE);
-
- /* The very last thing is to register the elementfactory with the plugin. */
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-
- return TRUE;
+ return gst_element_register (plugin, "bstest", GST_RANK_PRIMARY, GST_TYPE_BSTEST);
}
-GST_PLUGIN_DESC (GST_VERSION_MAJOR, GST_VERSION_MINOR, "bstest", plugin_init);
+GST_PLUGIN_DEFINE (
+ GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ "bstest",
+ "test for the bytestream element",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
+)
return TRUE;
}
-GST_PLUGIN_DESC (
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"testplugin",
return TRUE;
}
-GST_PLUGIN_DESC (
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"testplugin2",
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <gst/gst.h>
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
return TRUE;
}
-GST_PLUGIN_DESC (
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"testplugin",
- plugin_init
+ "a plugin for testing",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
);
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <gst/gst.h>
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
return TRUE;
}
-GST_PLUGIN_DESC (
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"testplugin2",
- plugin_init
+ "another testplugin for testing",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
);
get_rank_name (gint rank)
{
switch(rank){
- case GST_ELEMENT_RANK_NONE:
+ case GST_RANK_NONE:
return "none";
- case GST_ELEMENT_RANK_MARGINAL:
+ case GST_RANK_MARGINAL:
return "marginal";
- case GST_ELEMENT_RANK_SECONDARY:
+ case GST_RANK_SECONDARY:
return "secondary";
- case GST_ELEMENT_RANK_PRIMARY:
+ case GST_RANK_PRIMARY:
return "primary";
default:
return "unknown";
gstelement_class = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS (element));
g_print ("Factory Details:\n");
- g_print (" Long name:\t%s\n", factory->details->longname);
- g_print (" Class:\t%s\n", factory->details->klass);
- g_print (" License:\t%s\n", factory->details->license);
- g_print (" Description:\t%s\n", factory->details->description);
- g_print (" Version:\t%s\n", factory->details->version);
- g_print (" Author(s):\t%s\n", factory->details->author);
- g_print (" Copyright:\t%s\n", factory->details->copyright);
+ g_print (" Long name:\t%s\n", factory->details.longname);
+ g_print (" Class:\t%s\n", factory->details.klass);
+ g_print (" Description:\t%s\n", factory->details.description);
+ g_print (" Author(s):\t%s\n", factory->details.author);
g_print (" Rank:\t\t%s\n", get_rank_name(GST_PLUGIN_FEATURE(factory)->rank));
g_print ("\n");
GstElementFactory *factory;
factory = GST_ELEMENT_FACTORY (feature);
- g_print ("%s: %s: %s\n", plugin->name,
- GST_PLUGIN_FEATURE_NAME (factory) ,factory->details->longname);
+ g_print ("%s: %s: %s\n", plugin->desc.name,
+ GST_PLUGIN_FEATURE_NAME (factory) ,factory->details.longname);
}
#ifndef GST_DISABLE_AUTOPLUG
else if (GST_IS_AUTOPLUG_FACTORY (feature)) {
GstAutoplugFactory *factory;
factory = GST_AUTOPLUG_FACTORY (feature);
- g_print ("%s: %s: %s\n", plugin->name,
+ g_print ("%s: %s: %s\n", plugin->desc.name,
GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
}
#endif
GstIndexFactory *factory;
factory = GST_INDEX_FACTORY (feature);
- g_print ("%s: %s: %s\n", plugin->name,
+ g_print ("%s: %s: %s\n", plugin->desc.name,
GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
}
#endif
factory = GST_TYPE_FIND_FACTORY (feature);
if (factory->extensions) {
guint i = 0;
- g_print ("%s type: ", plugin->name);
+ g_print ("%s type: ", plugin->desc.name);
while (factory->extensions[i]) {
g_print ("%s%s", i > 0 ? ", " : "", factory->extensions[i]);
i++;
}
} else
- g_print ("%s type: N/A\n", plugin->name);
+ g_print ("%s type: N/A\n", plugin->desc.name);
}
else if (GST_IS_SCHEDULER_FACTORY (feature)) {
GstSchedulerFactory *factory;
factory = GST_SCHEDULER_FACTORY (feature);
- g_print ("%s: %s: %s\n", plugin->name,
+ g_print ("%s: %s: %s\n", plugin->desc.name,
GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
}
#ifndef GST_DISABLE_URI
handler = GST_URI_HANDLER (feature);
g_print ("%s: %s: \"%s\" (%s) element \"%s\" property \"%s\"\n",
- plugin->name, GST_PLUGIN_FEATURE_NAME (handler), handler->uri,
+ plugin->desc.name, GST_PLUGIN_FEATURE_NAME (handler), handler->uri,
handler->longdesc, handler->element, handler->property);
}
#endif
else {
- g_print ("%s: %s (%s)\n", plugin->name,
+ g_print ("%s: %s (%s)\n", plugin->desc.name,
GST_PLUGIN_FEATURE_NAME (feature),
g_type_name (G_OBJECT_TYPE (feature)));
}
gint num_other = 0;
g_print ("Plugin Details:\n");
- g_print (" Name:\t\t%s\n", plugin->name);
- g_print (" Long Name:\t%s\n", plugin->longname);
- g_print (" Filename:\t%s\n", plugin->filename);
+ g_print (" Name:\t\t%s\n", plugin->desc.name);
+ g_print (" Description:\t%s\n", plugin->desc.description);
+ g_print (" Filename:\t%s\n", plugin->filename);
+ g_print (" Version:\t%s\n", plugin->desc.version);
+ g_print (" License:\t%s\n", plugin->desc.license);
+ g_print (" Copyright:\t%s\n", plugin->desc.copyright);
+ g_print (" Package:\t%s\n", plugin->desc.package);
+ g_print (" Origin URL:\t%s\n", plugin->desc.origin);
g_print ("\n");
features = gst_plugin_get_feature_list (plugin);
factory = GST_ELEMENT_FACTORY (feature);
g_print (" %s: %s\n", GST_OBJECT_NAME (factory),
- factory->details->longname);
+ factory->details.longname);
num_elements++;
}
#ifndef GST_DISABLE_AUTOPLUG
factory = GST_TYPE_FIND_FACTORY (feature);
if (factory->extensions) {
guint i = 0;
- g_print ("%s type: ", plugin->name);
+ g_print ("%s type: ", plugin->desc.name);
while (factory->extensions[i]) {
g_print ("%s%s", i > 0 ? ", " : "", factory->extensions[i]);
i++;
}
} else
- g_print ("%s type: N/A\n", plugin->name);
+ g_print ("%s type: N/A\n", plugin->desc.name);
num_types++;
}
static void
plugin_added_func (GstRegistry *registry, GstPlugin *plugin, gpointer user_data)
{
- g_print ("added plugin %s with %d feature(s)\n", plugin->name,
+ g_print ("added plugin %s with %d feature(s)\n", plugin->desc.name,
plugin->numfeatures);
num_features += plugin->numfeatures;
gstelement_class = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS (element));
PUT_START_TAG (1, "details");
- PUT_ESCAPED (2, "long-name", factory->details->longname);
- PUT_ESCAPED (2, "class", factory->details->klass);
- PUT_ESCAPED (2, "license", factory->details->license);
- PUT_ESCAPED (2, "description", factory->details->description);
- PUT_ESCAPED (2, "version", factory->details->version);
- PUT_ESCAPED (2, "authors", factory->details->author);
- PUT_ESCAPED (2, "copyright", factory->details->copyright);
+ PUT_ESCAPED (2, "long-name", factory->details.longname);
+ PUT_ESCAPED (2, "class", factory->details.klass);
+ PUT_ESCAPED (2, "description",factory->details.description);
+ PUT_ESCAPED (2, "authors", factory->details.author);
PUT_END_TAG (1, "details");
output_hierarchy (G_OBJECT_TYPE (element), 0, &maxlevel);
GstElementFactory *factory;
factory = GST_ELEMENT_FACTORY (feature);
- g_print ("%s: %s: %s\n", plugin->name,
- GST_PLUGIN_FEATURE_NAME (factory) ,factory->details->longname);
+ g_print ("%s: %s: %s\n", plugin->desc.name,
+ GST_PLUGIN_FEATURE_NAME (factory) ,factory->details.longname);
}
#ifndef GST_DISABLE_AUTOPLUG
else if (GST_IS_AUTOPLUG_FACTORY (feature)) {
GstAutoplugFactory *factory;
factory = GST_AUTOPLUG_FACTORY (feature);
- g_print ("%s: %s: %s\n", plugin->name,
+ g_print ("%s: %s: %s\n", plugin->desc.name,
GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
}
#endif
GstIndexFactory *factory;
factory = GST_INDEX_FACTORY (feature);
- g_print ("%s: %s: %s\n", plugin->name,
+ g_print ("%s: %s: %s\n", plugin->desc.name,
GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
}
#endif
factory = GST_TYPE_FIND_FACTORY (feature);
if (factory->extensions) {
guint i = 0;
- g_print ("%s type: ", plugin->name);
+ g_print ("%s type: ", plugin->desc.name);
while (factory->extensions[i]) {
g_print ("%s%s", i > 0 ? ", " : "", factory->extensions[i]);
i++;
}
} else
- g_print ("%s type: N/A\n", plugin->name);
+ g_print ("%s type: N/A\n", plugin->desc.name);
}
else if (GST_IS_SCHEDULER_FACTORY (feature)) {
GstSchedulerFactory *factory;
factory = GST_SCHEDULER_FACTORY (feature);
- g_print ("%s: %s: %s\n", plugin->name,
+ g_print ("%s: %s: %s\n", plugin->desc.name,
GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
}
#ifndef GST_DISABLE_URI
handler = GST_URI_HANDLER (feature);
g_print ("%s: %s: \"%s\" (%s) element \"%s\" property \"%s\"\n",
- plugin->name, GST_PLUGIN_FEATURE_NAME (handler), handler->uri,
+ plugin->desc.name, GST_PLUGIN_FEATURE_NAME (handler), handler->uri,
handler->longdesc, handler->element, handler->property);
}
#endif
else {
- g_print ("%s: %s (%s)\n", plugin->name,
+ g_print ("%s: %s (%s)\n", plugin->desc.name,
GST_PLUGIN_FEATURE_NAME (feature),
g_type_name (G_OBJECT_TYPE (feature)));
}
gint num_other = 0;
g_print ("Plugin Details:\n");
- g_print (" Name:\t\t%s\n", plugin->name);
- g_print (" Long Name:\t%s\n", plugin->longname);
- g_print (" Filename:\t%s\n", plugin->filename);
+ g_print (" Name:\t\t%s\n", plugin->desc.name);
+ g_print (" Description:\t%s\n", plugin->desc.description);
+ g_print (" Filename:\t%s\n", plugin->filename);
+ g_print (" Version:\t%s\n", plugin->desc.version);
+ g_print (" License:\t%s\n", plugin->desc.license);
+ g_print (" Copyright:\t%s\n", plugin->desc.copyright);
+ g_print (" Package:\t%s\n", plugin->desc.package);
+ g_print (" Origin URL:\t%s\n", plugin->desc.origin);
g_print ("\n");
features = gst_plugin_get_feature_list (plugin);
factory = GST_ELEMENT_FACTORY (feature);
g_print (" %s: %s\n", GST_OBJECT_NAME (factory),
- factory->details->longname);
+ factory->details.longname);
num_elements++;
}
#ifndef GST_DISABLE_AUTOPLUG
factory = GST_TYPE_FIND_FACTORY (feature);
if (factory->extensions) {
guint i = 0;
- g_print ("%s type: ", plugin->name);
+ g_print ("%s type: ", plugin->desc.name);
while (factory->extensions[i]) {
g_print ("%s%s", i > 0 ? ", " : "", factory->extensions[i]);
i++;
}
} else
- g_print ("%s type: N/A\n", plugin->name);
+ g_print ("%s type: N/A\n", plugin->desc.name);
num_types++;
}
else if (GST_IS_SCHEDULER_FACTORY (feature)) {