Commit 12bbbd5c authored by Wim Taymans's avatar Wim Taymans

Lots of modifications to the plugin system.

Original commit message from CVS:
Lots of modifications to the plugin system.
- Added a GstPluginfeature object that serves as a base class for all
plugin contents.
- changed the plugin API, everyhting is now added with
gst_plugin_add_feature
- typefactories are named now so that they can be located easily and filled
in at plugin load.
- mime types like "video/raw image/raw" are gone for now.
- lots of plugin updates (style and API changes)
- tested with an without registry.
- updates to various tools.
- added a little testsuite to test/show how you can load plugins (4 modes)

Test this one, Almost everything has changed :-)
parent 0732e929
......@@ -841,6 +841,7 @@ GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
GST_DEFINE_CFLAGS="$GST_DEFINE_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
......@@ -1224,6 +1225,7 @@ tests/muxing/Makefile
testsuite/Makefile
testsuite/capsnego/Makefile
testsuite/refcounting/Makefile
testsuite/plugin/Makefile
tests/nego/Makefile
examples/Makefile
examples/autoplug/Makefile
......
......@@ -36,7 +36,7 @@ gst_editor_create_item(gdouble x,gdouble y)
factory = element_select_dialog();
if (factory) {
// g_print("got factory \"%s\"\n",factory->name);
element = gst_elementfactory_create(factory,factory->name);
element = gst_elementfactory_create(factory, GST_OBJECT_NAME (factory));
if (element) {
if (GST_IS_BIN(element)) {
// g_print("factory is a bin\n");
......
......@@ -479,7 +479,7 @@ gst_editor_property_create (GstEditorProperty *property, GstEditorElement *eleme
gtk_widget_show(entry);
gtk_entry_set_editable(GTK_ENTRY(entry), FALSE);
gtk_entry_set_text(GTK_ENTRY(entry),
gst_element_get_factory(element->element)->name);
gst_object_get_name (GST_OBJECT (gst_element_get_factory(element->element))));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, count, count+1, GTK_FILL, 0, 0, 0);
gtk_table_attach(GTK_TABLE(table), entry, 1, 2, count, count+1, GTK_FILL|GTK_EXPAND, 0, 0, 0);
count++;
......
......@@ -33,8 +33,8 @@ struct element_select_details {
};
static gint compare_name(gconstpointer a,gconstpointer b) {
return (strcmp(((GstElementFactory *)a)->name,
((GstElementFactory *)b)->name));
return (strcmp(GST_OBJECT_NAME (a),
GST_OBJECT_NAME (b)));
}
gint str_compare(gconstpointer a,gconstpointer b) {
......@@ -64,7 +64,7 @@ static void make_ctree(GtkCTree *tree,GtkCTreeNode *parent,
traverse = class->factories;
while (traverse) {
GstElementFactory *factory = (GstElementFactory *)(traverse->data);
data[0] = g_strdup(factory->name);
data[0] = g_strdup(GST_OBJECT_NAME (factory));
data[1] = g_strdup(factory->details->description);
node = gtk_ctree_insert_node(tree,classnode,NULL,data,0,
NULL,NULL,NULL,NULL,TRUE,FALSE);
......@@ -200,7 +200,7 @@ GstElementFactory *element_select_dialog() {
elements = gst_elementfactory_get_list();
while (elements) {
element = (GstElementFactory *)(elements->data);
printf("%s %s\n", element->name, element->details->klass);
printf("%s %s\n", GST_OBJECT_NAME (element), element->details->klass);
/* split up the factory's class */
classes = g_strsplit(element->details->klass,"/",0);
class = classes;
......
......@@ -87,18 +87,15 @@ GST_PADTEMPLATE_FACTORY (src_factory,
/* A number of functon prototypes are given so we can refer to them later. */
static void gst_example_class_init (GstExampleClass *klass);
static void gst_example_init (GstExample *example);
static void gst_example_class_init (GstExampleClass *klass);
static void gst_example_init (GstExample *example);
static void gst_example_chain (GstPad *pad, GstBuffer *buf);
static void gst_example_chain (GstPad *pad, GstBuffer *buf);
static void gst_example_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_example_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
/* These hold the constructed pad templates, which are created during
* plugin load, and used during element instantiation.
*/
static GstPadTemplate *src_template, *sink_template;
static void gst_example_set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec);
static void gst_example_get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec);
/* The parent class pointer needs to be kept around for some object
* operations.
......@@ -189,10 +186,10 @@ static void
gst_example_init(GstExample *example)
{
/* First we create the sink pad, which is the input to the element.
* We will use the sink_template constructed in the plugin_init function
* (below) to quickly generate the pad we need.
* We will use the template constructed by the factory.
*/
example->sinkpad = gst_pad_new_from_template (sink_template, "sink");
example->sinkpad = gst_pad_new_from_template (
GST_PADTEMPLATE_GET (sink_factory), "sink");
/* Setting the chain function allows us to supply the function that will
* actually be performing the work. Without this, the element would do
* nothing, with undefined results (assertion failures and such).
......@@ -208,7 +205,8 @@ gst_example_init(GstExample *example)
* pads don't have chain functions, because they can't accept buffers,
* they only produce them.
*/
example->srcpad = gst_pad_new_from_template (src_template, "src");
example->srcpad = gst_pad_new_from_template (
GST_PADTEMPLATE_GET (src_factory), "src");
gst_element_add_pad(GST_ELEMENT(example),example->srcpad);
/* Initialization of element's private variables. */
......@@ -344,17 +342,12 @@ plugin_init (GModule *module, GstPlugin *plugin)
/* The pad templates can be easily generated from the factories above,
* and then added to the list of padtemplates for the elementfactory.
* Note that the generated padtemplates are stored in static global
* variables, for the gst_example_init function to use later on.
*/
sink_template = sink_factory ();
gst_elementfactory_add_padtemplate (factory, sink_template);
src_template = src_factory ();
gst_elementfactory_add_padtemplate (factory, src_template);
gst_elementfactory_add_padtemplate (factory, GST_PADTEMPLATE_GET (sink_factory));
gst_elementfactory_add_padtemplate (factory, GST_PADTEMPLATE_GET (src_factory));
/* The very last thing is to register the elementfactory with the plugin. */
gst_plugin_add_factory (plugin, factory);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
/* Now we can return successfully. */
return TRUE;
......
......@@ -72,6 +72,7 @@ libgst_la_SOURCES = \
gstpad.c \
gstpipeline.c \
gstplugin.c \
gstpluginfeature.c \
gstprops.c \
gstqueue.c \
gstscheduler.c \
......@@ -171,6 +172,7 @@ libgstinclude_HEADERS = \
gstpad.h \
gstpipeline.h \
gstplugin.h \
gstpluginfeature.h \
gstprops.h \
gstqueue.h \
gstscheduler.h \
......
......@@ -362,7 +362,7 @@ plugin_init (GModule *module, GstPlugin *plugin)
&gst_autoplugcache_details);
g_return_val_if_fail (factory != NULL, FALSE);
gst_plugin_add_factory (plugin, factory);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
return TRUE;
}
......
......@@ -594,7 +594,7 @@ plugin_init (GModule *module, GstPlugin *plugin)
&gst_autoplugger_details);
g_return_val_if_fail (factory != NULL, FALSE);
gst_plugin_add_factory (plugin, factory);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
return TRUE;
}
......
......@@ -93,7 +93,7 @@ plugin_init (GModule *module, GstPlugin *plugin)
gst_static_autoplug_get_type ());
if (factory != NULL) {
gst_plugin_add_autoplugger (plugin, factory);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
}
return TRUE;
}
......@@ -125,7 +125,8 @@ gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest)
if (gst_caps_check_compatibility (gst_padtemplate_get_caps (srctemp),
gst_padtemplate_get_caps (desttemp))) {
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT,
"factory \"%s\" can connect with factory \"%s\"\n", src->name, dest->name);
"factory \"%s\" can connect with factory \"%s\"\n", GST_OBJECT_NAME (src),
GST_OBJECT_NAME (dest));
return TRUE;
}
}
......@@ -135,7 +136,8 @@ gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest)
srctemps = g_list_next (srctemps);
}
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT,
"factory \"%s\" cannot connect with factory \"%s\"\n", src->name, dest->name);
"factory \"%s\" cannot connect with factory \"%s\"\n", GST_OBJECT_NAME (src),
GST_OBJECT_NAME (dest));
return FALSE;
}
......@@ -363,9 +365,9 @@ gst_static_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *s
}
}
GST_DEBUG (0,"common factory \"%s\"\n", factory->name);
GST_DEBUG (0,"common factory \"%s\"\n", GST_OBJECT_NAME (factory));
element = gst_elementfactory_create (factory, factory->name);
element = gst_elementfactory_create (factory, GST_OBJECT_NAME (factory));
gst_bin_add (GST_BIN(result), element);
if (srcelement != NULL) {
......@@ -415,8 +417,8 @@ differ:
factory = (GstElementFactory *)(factories[i]->data);
GST_DEBUG (0,"factory \"%s\"\n", factory->name);
element = gst_elementfactory_create(factory, factory->name);
GST_DEBUG (0,"factory \"%s\"\n", GST_OBJECT_NAME (factory));
element = gst_elementfactory_create(factory, GST_OBJECT_NAME (factory));
GST_DEBUG (0,"adding element %s\n", GST_ELEMENT_NAME (element));
gst_bin_add(GST_BIN(thebin), element);
......@@ -513,7 +515,7 @@ construct_path (gst_autoplug_node *rgnNodes, gpointer factory)
next = rgnNodes[find_factory(rgnNodes, current)].iPrev;
if (next) {
factories = g_list_prepend (factories, current);
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factory: \"%s\"", current->name);
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factory: \"%s\"", GST_OBJECT_NAME (current));
}
current = next;
}
......
......@@ -93,7 +93,7 @@ plugin_init (GModule *module, GstPlugin *plugin)
gst_static_autoplug_render_get_type ());
if (factory != NULL) {
gst_plugin_add_autoplugger (plugin, factory);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
}
return TRUE;
}
......@@ -151,7 +151,8 @@ gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest)
if (desttemp->direction == GST_PAD_SINK && desttemp->presence != GST_PAD_REQUEST) {
if (gst_caps_check_compatibility (GST_PADTEMPLATE_CAPS (srctemp), GST_PADTEMPLATE_CAPS (desttemp))) {
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT,
"factory \"%s\" can connect with factory \"%s\"\n", src->name, dest->name);
"factory \"%s\" can connect with factory \"%s\"\n",
GST_OBJECT_NAME (src), GST_OBJECT_NAME (dest));
return TRUE;
}
}
......@@ -159,7 +160,8 @@ gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest)
}
}
GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT,
"factory \"%s\" cannot connect with factory \"%s\"\n", src->name, dest->name);
"factory \"%s\" cannot connect with factory \"%s\"\n",
GST_OBJECT_NAME (src), GST_OBJECT_NAME (dest));
return FALSE;
}
......@@ -283,7 +285,7 @@ gst_autoplug_caps_find_cost (gpointer src, gpointer dest, gpointer data)
else {
res = gst_autoplug_can_match ((GstElementFactory *)src, (GstElementFactory *)dest);
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factory %s to factory %s %d",
((GstElementFactory *)src)->name, ((GstElementFactory *)dest)->name, res);
GST_OBJECT_NAME (src), GST_OBJECT_NAME (dest), res);
}
if (res)
......@@ -394,9 +396,9 @@ next:
}
}
GST_DEBUG (0,"common factory \"%s\"\n", factory->name);
GST_DEBUG (0,"common factory \"%s\"\n", GST_OBJECT_NAME (factory));
element = gst_elementfactory_create (factory, factory->name);
element = gst_elementfactory_create (factory, GST_OBJECT_NAME (factory));
gst_bin_add (GST_BIN(result), element);
if (srcelement != NULL) {
......@@ -454,8 +456,8 @@ differ:
if (factories[i]) {
factory = (GstElementFactory *)(factories[i]->data);
GST_DEBUG (0,"factory \"%s\"\n", factory->name);
element = gst_elementfactory_create(factory, factory->name);
GST_DEBUG (0,"factory \"%s\"\n", GST_OBJECT_NAME (factory));
element = gst_elementfactory_create(factory, GST_OBJECT_NAME (factory));
}
else {
element = sinkelement;
......@@ -553,7 +555,7 @@ construct_path (gst_autoplug_node *rgnNodes, gpointer factory)
next = rgnNodes[find_factory(rgnNodes, current)].iPrev;
if (next) {
factories = g_list_prepend (factories, current);
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factory: \"%s\"", current->name);
GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT,"factory: \"%s\"", GST_OBJECT_NAME (current));
}
current = next;
}
......
......@@ -82,7 +82,7 @@ plugin_init (GModule *module, GstPlugin *plugin)
(_elements[i].type) (),
_elements[i].details);
if (factory != NULL) {
gst_plugin_add_factory (plugin, factory);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
if (_elements[i].factoryinit) {
_elements[i].factoryinit (factory);
}
......
......@@ -32,6 +32,7 @@
#include "gstpipeline.h"
#include "gstthread.h"
#include "gstqueue.h"
#include "gstautoplug.h"
#ifndef GST_DISABLE_TYPEFIND
#include "gsttypefind.h"
#endif
......@@ -88,8 +89,11 @@ gst_init (int *argc, char **argv[])
GST_INFO (GST_CAT_GST_INIT, "Initializing GStreamer Core Library");
gst_elementfactory_get_type ();
gst_typefactory_get_type ();
gst_autoplugfactory_get_type ();
_gst_cpu_initialize ();
_gst_type_initialize ();
_gst_props_initialize ();
_gst_caps_initialize ();
_gst_plugin_initialize ();
......
......@@ -24,9 +24,8 @@
#include "gst_private.h"
#include "gstautoplug.h"
#include "gstplugin.h"
GList* _gst_autoplugfactories;
static GList* _gst_autoplugfactories;
enum {
NEW_OBJECT,
......@@ -60,7 +59,7 @@ GType gst_autoplug_get_type(void)
4,
(GInstanceInitFunc)gst_autoplug_init,
};
autoplug_type = g_type_register_static (GST_TYPE_OBJECT, "GstAutoplug", &autoplug_info, 0);
autoplug_type = g_type_register_static (GST_TYPE_OBJECT, "GstAutoplug", &autoplug_info, G_TYPE_FLAG_ABSTRACT);
}
return autoplug_type;
}
......@@ -81,16 +80,11 @@ gst_autoplug_class_init(GstAutoplugClass *klass)
G_STRUCT_OFFSET (GstAutoplugClass, new_object), NULL, NULL,
g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
GST_TYPE_OBJECT);
}
static void gst_autoplug_init(GstAutoplug *autoplug)
{
}
void
_gst_autoplug_initialize (void)
static void gst_autoplug_init(GstAutoplug *autoplug)
{
_gst_autoplugfactories = NULL;
}
/**
......@@ -170,6 +164,63 @@ gst_autoplug_to_renderers (GstAutoplug *autoplug, GstCaps *srccaps, GstElement *
return element;
}
static void gst_autoplugfactory_class_init (GstAutoplugFactoryClass *klass);
static void gst_autoplugfactory_init (GstAutoplugFactory *factory);
static xmlNodePtr gst_autoplugfactory_save_thyself (GstObject *object, xmlNodePtr parent);
static void gst_autoplugfactory_restore_thyself (GstObject *object, xmlNodePtr parent);
static GstPluginFeatureClass *factory_parent_class = NULL;
//static guint gst_autoplugfactory_signals[LAST_SIGNAL] = { 0 };
GType
gst_autoplugfactory_get_type (void)
{
static GType autoplugfactory_type = 0;
if (!autoplugfactory_type) {
static const GTypeInfo autoplugfactory_info = {
sizeof (GstAutoplugFactoryClass),
NULL,
NULL,
(GClassInitFunc) gst_autoplugfactory_class_init,
NULL,
NULL,
sizeof(GstAutoplugFactory),
0,
(GInstanceInitFunc) gst_autoplugfactory_init,
};
autoplugfactory_type = g_type_register_static (GST_TYPE_PLUGIN_FEATURE,
"GstAutoplugFactory", &autoplugfactory_info, 0);
}
return autoplugfactory_type;
}
static void
gst_autoplugfactory_class_init (GstAutoplugFactoryClass *klass)
{
GObjectClass *gobject_class;
GstObjectClass *gstobject_class;
GstPluginFeatureClass *gstpluginfeature_class;
gobject_class = (GObjectClass*)klass;
gstobject_class = (GstObjectClass*)klass;
gstpluginfeature_class = (GstPluginFeatureClass*) klass;
factory_parent_class = g_type_class_ref (GST_TYPE_PLUGIN_FEATURE);
gstobject_class->save_thyself = GST_DEBUG_FUNCPTR (gst_autoplugfactory_save_thyself);
gstobject_class->restore_thyself = GST_DEBUG_FUNCPTR (gst_autoplugfactory_restore_thyself);
_gst_autoplugfactories = NULL;
}
static void
gst_autoplugfactory_init (GstAutoplugFactory *factory)
{
_gst_autoplugfactories = g_list_prepend (_gst_autoplugfactories, factory);
}
/**
* gst_autoplugfactory_new:
......@@ -187,15 +238,17 @@ gst_autoplugfactory_new (const gchar *name, const gchar *longdesc, GType type)
GstAutoplugFactory *factory;
g_return_val_if_fail(name != NULL, NULL);
factory = gst_autoplugfactory_find (name);
if (!factory) {
factory = GST_AUTOPLUGFACTORY (g_object_new (GST_TYPE_AUTOPLUGFACTORY, NULL));
}
factory = g_new0(GstAutoplugFactory, 1);
factory->name = g_strdup(name);
gst_object_set_name (GST_OBJECT (factory), name);
if (factory->longdesc)
g_free (factory->longdesc);
factory->longdesc = g_strdup (longdesc);
factory->type = type;
_gst_autoplugfactories = g_list_prepend (_gst_autoplugfactories, factory);
return factory;
}
......@@ -236,7 +289,7 @@ gst_autoplugfactory_find (const gchar *name)
walk = _gst_autoplugfactories;
while (walk) {
factory = (GstAutoplugFactory *)(walk->data);
if (!strcmp (name, factory->name))
if (!strcmp (name, GST_OBJECT_NAME (factory)))
return factory;
walk = g_list_next (walk);
}
......@@ -273,10 +326,8 @@ gst_autoplugfactory_create (GstAutoplugFactory *factory)
g_return_val_if_fail (factory != NULL, NULL);
if (factory->type == 0){
factory = gst_plugin_load_autoplugfactory (factory->name);
}
g_return_val_if_fail (factory != NULL, NULL);
gst_plugin_feature_ensure_loaded (GST_PLUGIN_FEATURE (factory));
g_return_val_if_fail (factory->type != 0, NULL);
new = GST_AUTOPLUG (g_object_new(factory->type,NULL));
......@@ -308,21 +359,19 @@ gst_autoplugfactory_make (const gchar *name)
return gst_autoplugfactory_create (factory);;
}
/**
* gst_autoplugfactory_save_thyself:
* @factory: The facory to save
* @parent: the parent XML node pointer
*
* Save the autoplugfactory into an XML representation
*
* Returns: The new XML parent.
*/
xmlNodePtr
gst_autoplugfactory_save_thyself (GstAutoplugFactory *factory, xmlNodePtr parent)
static xmlNodePtr
gst_autoplugfactory_save_thyself (GstObject *object, xmlNodePtr parent)
{
g_return_val_if_fail(factory != NULL, NULL);
GstAutoplugFactory *factory;
g_return_val_if_fail(GST_IS_AUTOPLUGFACTORY (object), parent);
factory = GST_AUTOPLUGFACTORY (object);
if (GST_OBJECT_CLASS (factory_parent_class)->save_thyself) {
GST_OBJECT_CLASS (factory_parent_class)->save_thyself (object, parent);
}
xmlNewChild(parent,NULL,"name",factory->name);
xmlNewChild(parent,NULL,"longdesc", factory->longdesc);
return parent;
......@@ -336,23 +385,23 @@ gst_autoplugfactory_save_thyself (GstAutoplugFactory *factory, xmlNodePtr parent
*
* Returns: A new factory based on the XML node.
*/
GstAutoplugFactory*
gst_autoplugfactory_load_thyself (xmlNodePtr parent)
static void
gst_autoplugfactory_restore_thyself (GstObject *object, xmlNodePtr parent)
{
GstAutoplugFactory *factory = g_new0(GstAutoplugFactory, 1);
GstAutoplugFactory *factory = GST_AUTOPLUGFACTORY (object);
xmlNodePtr children = parent->xmlChildrenNode;
if (GST_OBJECT_CLASS (factory_parent_class)->restore_thyself) {
GST_OBJECT_CLASS (factory_parent_class)->restore_thyself (object, parent);
}
while (children) {
if (!strcmp(children->name, "name")) {
factory->name = xmlNodeGetContent(children);
gst_object_set_name (GST_OBJECT (factory), xmlNodeGetContent(children));
}
if (!strcmp(children->name, "longdesc")) {
factory->longdesc = xmlNodeGetContent(children);
}
children = children->next;
}
_gst_autoplugfactories = g_list_prepend (_gst_autoplugfactories, factory);
return factory;
}
......@@ -69,13 +69,6 @@ struct _GstAutoplugClass {
GstElement* (*autoplug_to_renderers) (GstAutoplug *autoplug, GstCaps *srccaps, GstElement *target, va_list args);
};
typedef struct _GstAutoplugFactory GstAutoplugFactory;
struct _GstAutoplugFactory {
gchar *name; /* name of autoplugger */
gchar *longdesc; /* long description of the autoplugger (well, don't overdo it..) */
GType type; /* unique GType of the autoplugger */
};
GType gst_autoplug_get_type (void);
......@@ -90,6 +83,33 @@ GstElement* gst_autoplug_to_renderers (GstAutoplug *autoplug, GstCaps *srccaps
* creating autopluggers
*
*/
#define GST_TYPE_AUTOPLUGFACTORY \
(gst_autoplugfactory_get_type())
#define GST_AUTOPLUGFACTORY(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUTOPLUGFACTORY,GstAutoplugFactory))
#define GST_AUTOPLUGFACTORY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUTOPLUGFACTORY,GstAutoplugFactoryClass))
#define GST_IS_AUTOPLUGFACTORY(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUTOPLUGFACTORY))
#define GST_IS_AUTOPLUGFACTORY_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUTOPLUGFACTORY))
typedef struct _GstAutoplugFactory GstAutoplugFactory;
typedef struct _GstAutoplugFactoryClass GstAutoplugFactoryClass;
struct _GstAutoplugFactory {
GstPluginFeature feature;
gchar *longdesc; /* long description of the autoplugger (well, don't overdo it..) */
GType type; /* unique GType of the autoplugger */
};
struct _GstAutoplugFactoryClass {
GstPluginFeatureClass parent;
};
GType gst_autoplugfactory_get_type (void);
GstAutoplugFactory* gst_autoplugfactory_new (const gchar *name, const gchar *longdesc, GType type);
void gst_autoplugfactory_destroy (GstAutoplugFactory *factory);
......@@ -99,9 +119,6 @@ GList* gst_autoplugfactory_get_list (void);
GstAutoplug* gst_autoplugfactory_create (GstAutoplugFactory *factory);
GstAutoplug* gst_autoplugfactory_make (const gchar *name);
xmlNodePtr gst_autoplugfactory_save_thyself (GstAutoplugFactory *factory, xmlNodePtr parent);
GstAutoplugFactory* gst_autoplugfactory_load_thyself (xmlNodePtr parent);
#ifdef __cplusplus
}
#endif /* __cplusplus */
......@@ -113,6 +130,7 @@ GstAutoplugFactory* gst_autoplugfactory_load_thyself (xmlNodePtr parent);
#pragma GCC poison gst_autoplug_to_caps
#pragma GCC poison gst_autoplug_to_renderers
#pragma GCC poison gst_autoplugfactory_get_type
#pragma GCC poison gst_autoplugfactory_new
#pragma GCC poison gst_autoplugfactory_destroy
......@@ -122,9 +140,6 @@ GstAutoplugFactory* gst_autoplugfactory_load_thyself (xmlNodePtr parent);
#pragma GCC poison gst_autoplugfactory_create
#pragma GCC poison gst_autoplugfactory_make
#pragma GCC poison gst_autoplugfactory_save_thyself
#pragma GCC poison gst_autoplugfactory_load_thyself
#endif // GST_DISABLE_AUTOPLUG
#endif /* __GST_AUTOPLUG_H__ */
......
......@@ -47,13 +47,17 @@ get_type_for_mime (const gchar *mime)
typeid = gst_type_find_by_mime (mime);
if (typeid == 0) {
GstTypeFactory factory; // = g_new0 (GstTypeFactory, 1);
GstTypeDefinition definition;
GstTypeFactory *factory;