2000-12-28 22:12:02 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* 2000 Wim Taymans <wtay@chello.be>
|
|
|
|
*
|
|
|
|
* gstelementfactory.c: GstElementFactory object, support routines
|
2000-01-30 09:03:00 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2000-09-27 19:33:10 +00:00
|
|
|
//#define DEBUG_ENABLED
|
2000-12-28 22:12:02 +00:00
|
|
|
#include "gst_private.h"
|
2000-09-27 19:33:10 +00:00
|
|
|
|
2000-12-15 01:57:34 +00:00
|
|
|
#include "gstelement.h"
|
|
|
|
#include "gstplugin.h"
|
2000-01-30 09:03:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* global list of registered elementfactories */
|
|
|
|
GList* _gst_elementfactories;
|
|
|
|
|
2000-12-12 19:29:43 +00:00
|
|
|
void
|
|
|
|
_gst_elementfactory_initialize (void)
|
|
|
|
{
|
2000-01-30 09:03:00 +00:00
|
|
|
_gst_elementfactories = NULL;
|
|
|
|
}
|
|
|
|
|
2000-12-11 00:04:25 +00:00
|
|
|
/**
|
2000-12-28 21:42:23 +00:00
|
|
|
* gst_elementfactory_destroy:
|
|
|
|
* @elementfactory: factory to destroy
|
2000-12-11 00:04:25 +00:00
|
|
|
*
|
|
|
|
* Removes the elementfactory from the global list.
|
|
|
|
*/
|
|
|
|
void
|
2000-12-28 21:42:23 +00:00
|
|
|
gst_elementfactory_destroy (GstElementFactory *elementfactory)
|
2000-12-11 00:04:25 +00:00
|
|
|
{
|
2000-12-28 21:42:23 +00:00
|
|
|
g_return_if_fail (elementfactory != NULL);
|
2000-12-11 00:04:25 +00:00
|
|
|
|
2000-12-28 21:42:23 +00:00
|
|
|
_gst_elementfactories = g_list_remove (_gst_elementfactories, elementfactory);
|
2000-12-11 00:04:25 +00:00
|
|
|
|
2000-12-28 00:18:26 +00:00
|
|
|
// we don't free the struct bacause someone might have a handle to it..
|
2000-12-11 00:04:25 +00:00
|
|
|
}
|
|
|
|
|
2000-01-30 09:03:00 +00:00
|
|
|
/**
|
|
|
|
* gst_elementfactory_find:
|
|
|
|
* @name: name of factory to find
|
|
|
|
*
|
|
|
|
* Search for an elementfactory of the given name.
|
|
|
|
*
|
|
|
|
* Returns: #GstElementFactory if found, NULL otherwise
|
|
|
|
*/
|
2000-12-12 19:29:43 +00:00
|
|
|
GstElementFactory*
|
2001-01-06 02:35:17 +00:00
|
|
|
gst_elementfactory_find (const gchar *name)
|
2000-12-12 19:29:43 +00:00
|
|
|
{
|
2000-09-14 22:18:43 +00:00
|
|
|
GList *walk;
|
2000-01-30 09:03:00 +00:00
|
|
|
GstElementFactory *factory;
|
|
|
|
|
2000-12-23 03:17:52 +00:00
|
|
|
g_return_val_if_fail(name != NULL, NULL);
|
|
|
|
|
2001-01-01 03:14:40 +00:00
|
|
|
GST_DEBUG (0,"gstelementfactory: find \"%s\"\n", name);
|
2000-09-27 19:33:10 +00:00
|
|
|
|
2000-09-14 22:18:43 +00:00
|
|
|
walk = _gst_elementfactories;
|
2000-01-30 09:03:00 +00:00
|
|
|
while (walk) {
|
|
|
|
factory = (GstElementFactory *)(walk->data);
|
|
|
|
if (!strcmp(name,factory->name))
|
|
|
|
return factory;
|
|
|
|
walk = g_list_next(walk);
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_elementfactory_get_list:
|
|
|
|
*
|
|
|
|
* Get the global list of elementfactories.
|
|
|
|
*
|
2000-10-25 19:09:53 +00:00
|
|
|
* Returns: GList of type #GstElementFactory
|
2000-01-30 09:03:00 +00:00
|
|
|
*/
|
2000-12-12 19:29:43 +00:00
|
|
|
GList*
|
|
|
|
gst_elementfactory_get_list (void)
|
|
|
|
{
|
2000-01-30 09:03:00 +00:00
|
|
|
return _gst_elementfactories;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_elementfactory_new:
|
|
|
|
* @name: name of new elementfactory
|
|
|
|
* @type: GtkType of new element
|
|
|
|
* @details: #GstElementDetails structure with element details
|
|
|
|
*
|
|
|
|
* Create a new elementfactory capable of insantiating objects of the
|
|
|
|
* given type.
|
|
|
|
*
|
|
|
|
* Returns: new elementfactory
|
|
|
|
*/
|
2000-12-12 19:29:43 +00:00
|
|
|
GstElementFactory*
|
2001-01-06 02:35:17 +00:00
|
|
|
gst_elementfactory_new (const gchar *name, GtkType type,
|
2000-12-12 19:29:43 +00:00
|
|
|
GstElementDetails *details)
|
|
|
|
{
|
2000-01-30 09:03:00 +00:00
|
|
|
GstElementFactory *factory = g_new0(GstElementFactory, 1);
|
2000-12-19 13:41:55 +00:00
|
|
|
|
2000-12-23 03:17:52 +00:00
|
|
|
g_return_val_if_fail(name != NULL, NULL);
|
|
|
|
|
2000-01-30 09:03:00 +00:00
|
|
|
factory->name = g_strdup(name);
|
|
|
|
factory->type = type;
|
|
|
|
factory->details = details;
|
2000-12-13 19:29:35 +00:00
|
|
|
factory->padtemplates = NULL;
|
2001-01-03 20:44:28 +00:00
|
|
|
factory->numpadtemplates = 0;
|
2000-12-12 19:29:43 +00:00
|
|
|
|
2000-12-19 13:41:55 +00:00
|
|
|
_gst_elementfactories = g_list_prepend (_gst_elementfactories, factory);
|
|
|
|
|
2000-01-30 09:03:00 +00:00
|
|
|
return factory;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_elementfactory_create:
|
|
|
|
* @factory: factory to instantiate
|
|
|
|
* @name: name of new element
|
|
|
|
*
|
|
|
|
* Create a new element of the type defined by the given elementfactory.
|
|
|
|
* It wll be given the name supplied, since all elements require a name as
|
|
|
|
* their first argument.
|
|
|
|
*
|
|
|
|
* Returns: new #GstElement
|
|
|
|
*/
|
2000-12-12 19:29:43 +00:00
|
|
|
GstElement *
|
|
|
|
gst_elementfactory_create (GstElementFactory *factory,
|
2001-01-06 02:35:17 +00:00
|
|
|
const gchar *name)
|
2000-12-12 19:29:43 +00:00
|
|
|
{
|
2000-01-30 09:03:00 +00:00
|
|
|
GstElement *element;
|
|
|
|
GstElementClass *oclass;
|
|
|
|
|
2000-03-13 22:13:11 +00:00
|
|
|
g_return_val_if_fail(factory != NULL, NULL);
|
2000-12-23 03:17:52 +00:00
|
|
|
g_return_val_if_fail(name != NULL, NULL);
|
2000-08-28 20:20:55 +00:00
|
|
|
|
2001-01-01 03:14:40 +00:00
|
|
|
GST_DEBUG (0,"gstelementfactory: create \"%s\" \"%s\"\n", factory->name, name);
|
2000-08-28 20:20:55 +00:00
|
|
|
|
2000-12-11 00:04:25 +00:00
|
|
|
// it's not loaded, try to load the plugin
|
2000-09-24 22:45:48 +00:00
|
|
|
if (factory->type == 0) {
|
2000-09-27 19:33:10 +00:00
|
|
|
factory = gst_plugin_load_elementfactory(factory->name);
|
2000-09-24 22:45:48 +00:00
|
|
|
}
|
2000-09-27 19:33:10 +00:00
|
|
|
g_return_val_if_fail(factory != NULL, NULL);
|
2000-03-13 22:13:11 +00:00
|
|
|
g_return_val_if_fail(factory->type != 0, NULL);
|
2000-01-30 09:03:00 +00:00
|
|
|
|
|
|
|
// create an instance of the element
|
|
|
|
element = GST_ELEMENT(gtk_type_new(factory->type));
|
|
|
|
g_assert(element != NULL);
|
2000-09-09 16:36:10 +00:00
|
|
|
gst_object_ref(GST_OBJECT(element));
|
2000-01-30 09:03:00 +00:00
|
|
|
|
|
|
|
// attempt to set the elemenfactory class pointer if necessary
|
|
|
|
oclass = GST_ELEMENT_CLASS(GTK_OBJECT(element)->klass);
|
2000-12-22 23:23:10 +00:00
|
|
|
if (oclass->elementfactory == NULL) {
|
2001-01-01 03:14:40 +00:00
|
|
|
GST_DEBUG (0,"gstelementfactory: class %s\n", factory->name);
|
2000-01-30 09:03:00 +00:00
|
|
|
oclass->elementfactory = factory;
|
2000-12-22 23:23:10 +00:00
|
|
|
}
|
2000-01-30 09:03:00 +00:00
|
|
|
|
|
|
|
gst_element_set_name(GST_ELEMENT(element),name);
|
|
|
|
|
|
|
|
return element;
|
|
|
|
}
|
|
|
|
|
2000-09-14 20:31:03 +00:00
|
|
|
/**
|
|
|
|
* gst_elementfactory_make:
|
|
|
|
* @factoryname: a named factory to instantiate
|
|
|
|
* @name: name of new element
|
|
|
|
*
|
|
|
|
* Create a new element of the type defined by the given elementfactory.
|
|
|
|
* It wll be given the name supplied, since all elements require a name as
|
|
|
|
* their first argument.
|
|
|
|
*
|
|
|
|
* Returns: new #GstElement
|
|
|
|
*/
|
2000-12-12 19:29:43 +00:00
|
|
|
GstElement*
|
2001-01-06 02:35:17 +00:00
|
|
|
gst_elementfactory_make (const gchar *factoryname, const gchar *name)
|
2000-12-12 19:29:43 +00:00
|
|
|
{
|
2000-01-30 09:03:00 +00:00
|
|
|
GstElementFactory *factory;
|
|
|
|
GstElement *element;
|
|
|
|
|
2000-12-23 03:17:52 +00:00
|
|
|
g_return_val_if_fail(factoryname != NULL, NULL);
|
|
|
|
g_return_val_if_fail(name != NULL, NULL);
|
|
|
|
|
2001-01-01 03:14:40 +00:00
|
|
|
GST_DEBUG (0,"gstelementfactory: make \"%s\" \"%s\"\n", factoryname, name);
|
2000-09-27 19:33:10 +00:00
|
|
|
|
2000-09-14 22:18:43 +00:00
|
|
|
//gst_plugin_load_elementfactory(factoryname);
|
2000-01-30 09:03:00 +00:00
|
|
|
factory = gst_elementfactory_find(factoryname);
|
|
|
|
if (factory == NULL) return NULL;
|
|
|
|
element = gst_elementfactory_create(factory,name);
|
|
|
|
return element;
|
|
|
|
}
|
2000-08-21 21:20:38 +00:00
|
|
|
|
2000-09-14 20:31:03 +00:00
|
|
|
/**
|
2000-12-13 19:29:35 +00:00
|
|
|
* gst_elementfactory_add_padtemplate :
|
2000-09-14 20:31:03 +00:00
|
|
|
* @elementfactory: factory to add the src id to
|
2000-12-28 21:42:23 +00:00
|
|
|
* @temp: the padtemplate to add
|
2000-09-14 20:31:03 +00:00
|
|
|
*
|
2000-12-13 19:29:35 +00:00
|
|
|
* Add the given padtemplate to this elementfactory.
|
2000-09-14 20:31:03 +00:00
|
|
|
*/
|
2000-12-11 00:04:25 +00:00
|
|
|
void
|
2000-12-13 19:29:35 +00:00
|
|
|
gst_elementfactory_add_padtemplate (GstElementFactory *factory,
|
2000-12-28 21:42:23 +00:00
|
|
|
GstPadTemplate *temp)
|
2000-12-11 00:04:25 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail(factory != NULL);
|
2000-12-28 21:42:23 +00:00
|
|
|
g_return_if_fail(temp != NULL);
|
2000-12-11 00:04:25 +00:00
|
|
|
|
2000-12-28 21:42:23 +00:00
|
|
|
factory->padtemplates = g_list_append (factory->padtemplates, temp);
|
2001-01-03 20:44:28 +00:00
|
|
|
factory->numpadtemplates++;
|
2000-12-19 13:41:55 +00:00
|
|
|
}
|
2000-08-21 21:20:38 +00:00
|
|
|
|
2000-12-28 21:42:23 +00:00
|
|
|
/**
|
2000-12-31 16:12:48 +00:00
|
|
|
* gst_elementfactory_can_src_caps_list :
|
2000-12-28 21:42:23 +00:00
|
|
|
* @factory: factory to query
|
2000-12-31 16:12:48 +00:00
|
|
|
* @caps: the caps list to check
|
2000-12-28 21:42:23 +00:00
|
|
|
*
|
2001-01-06 22:05:15 +00:00
|
|
|
* Checks if the factory can source the given capability list.
|
2000-12-28 21:42:23 +00:00
|
|
|
*
|
2000-12-31 16:12:48 +00:00
|
|
|
* Returns: true if it can src the capabilities
|
2000-12-28 21:42:23 +00:00
|
|
|
*/
|
2000-12-19 13:41:55 +00:00
|
|
|
gboolean
|
2000-12-31 16:12:48 +00:00
|
|
|
gst_elementfactory_can_src_caps_list (GstElementFactory *factory,
|
|
|
|
GList *caps)
|
2000-12-19 13:41:55 +00:00
|
|
|
{
|
|
|
|
GList *templates;
|
|
|
|
|
|
|
|
g_return_val_if_fail(factory != NULL, FALSE);
|
|
|
|
g_return_val_if_fail(caps != NULL, FALSE);
|
|
|
|
|
|
|
|
templates = factory->padtemplates;
|
|
|
|
|
|
|
|
while (templates) {
|
|
|
|
GstPadTemplate *template = (GstPadTemplate *)templates->data;
|
|
|
|
|
|
|
|
if (template->direction == GST_PAD_SRC) {
|
2000-12-31 16:12:48 +00:00
|
|
|
if (gst_caps_list_check_compatibility (template->caps, caps))
|
2000-12-19 13:41:55 +00:00
|
|
|
return TRUE;
|
2000-12-12 19:29:43 +00:00
|
|
|
}
|
2000-12-19 13:41:55 +00:00
|
|
|
templates = g_list_next (templates);
|
2000-12-11 00:04:25 +00:00
|
|
|
}
|
2000-12-19 13:41:55 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2000-12-28 21:42:23 +00:00
|
|
|
/**
|
2000-12-31 16:12:48 +00:00
|
|
|
* gst_elementfactory_can_sink_caps_list :
|
2000-12-28 21:42:23 +00:00
|
|
|
* @factory: factory to query
|
2000-12-31 16:12:48 +00:00
|
|
|
* @caps: the caps list to check
|
2000-12-28 21:42:23 +00:00
|
|
|
*
|
2001-01-06 22:05:15 +00:00
|
|
|
* Checks if the factory can sink the given capability list.
|
2000-12-28 21:42:23 +00:00
|
|
|
*
|
2000-12-31 16:12:48 +00:00
|
|
|
* Returns: true if it can sink the capabilities
|
2000-12-28 21:42:23 +00:00
|
|
|
*/
|
2000-12-19 13:41:55 +00:00
|
|
|
gboolean
|
2000-12-31 16:12:48 +00:00
|
|
|
gst_elementfactory_can_sink_caps_list (GstElementFactory *factory,
|
|
|
|
GList *caps)
|
2000-12-19 13:41:55 +00:00
|
|
|
{
|
|
|
|
GList *templates;
|
|
|
|
|
|
|
|
g_return_val_if_fail(factory != NULL, FALSE);
|
|
|
|
g_return_val_if_fail(caps != NULL, FALSE);
|
|
|
|
|
|
|
|
templates = factory->padtemplates;
|
|
|
|
|
|
|
|
while (templates) {
|
|
|
|
GstPadTemplate *template = (GstPadTemplate *)templates->data;
|
|
|
|
|
|
|
|
if (template->direction == GST_PAD_SINK) {
|
2000-12-31 16:12:48 +00:00
|
|
|
if (gst_caps_list_check_compatibility (caps, template->caps))
|
2000-12-19 13:41:55 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
templates = g_list_next (templates);
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
2000-08-21 21:20:38 +00:00
|
|
|
}
|
|
|
|
|
2000-12-31 16:12:48 +00:00
|
|
|
/**
|
|
|
|
* gst_elementfactory_can_src_caps :
|
|
|
|
* @factory: factory to query
|
|
|
|
* @caps: the caps to check
|
|
|
|
*
|
2001-01-06 22:05:15 +00:00
|
|
|
* Checks if the factory can src the given capability.
|
2000-12-31 16:12:48 +00:00
|
|
|
*
|
|
|
|
* Returns: true if it can sink the capability
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gst_elementfactory_can_src_caps (GstElementFactory *factory,
|
|
|
|
GstCaps *caps)
|
|
|
|
{
|
|
|
|
GList *dummy;
|
|
|
|
gboolean ret;
|
|
|
|
|
|
|
|
dummy = g_list_prepend (NULL, caps);
|
|
|
|
|
|
|
|
ret = gst_elementfactory_can_src_caps_list (factory, dummy);
|
|
|
|
|
|
|
|
g_list_free (dummy);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_elementfactory_can_sink_caps :
|
|
|
|
* @factory: factory to query
|
|
|
|
* @caps: the caps to check
|
|
|
|
*
|
2001-01-06 22:05:15 +00:00
|
|
|
* Checks if the factory can sink the given capability.
|
2000-12-31 16:12:48 +00:00
|
|
|
*
|
|
|
|
* Returns: true if it can sink the capability
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gst_elementfactory_can_sink_caps (GstElementFactory *factory,
|
|
|
|
GstCaps *caps)
|
|
|
|
{
|
|
|
|
GList *dummy;
|
|
|
|
gboolean ret;
|
|
|
|
|
|
|
|
dummy = g_list_prepend (NULL, caps);
|
|
|
|
|
|
|
|
ret = gst_elementfactory_can_sink_caps_list (factory, dummy);
|
|
|
|
|
|
|
|
g_list_free (dummy);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2000-09-14 20:31:03 +00:00
|
|
|
/**
|
|
|
|
* gst_elementfactory_save_thyself:
|
|
|
|
* @factory: factory to save
|
|
|
|
* @parent: the parent xmlNodePtr
|
|
|
|
*
|
2001-01-06 22:05:15 +00:00
|
|
|
* Saves the factory into an XML tree.
|
2000-09-14 20:31:03 +00:00
|
|
|
*
|
|
|
|
* Returns: the new xmlNodePtr
|
|
|
|
*/
|
2000-12-12 19:29:43 +00:00
|
|
|
xmlNodePtr
|
|
|
|
gst_elementfactory_save_thyself (GstElementFactory *factory,
|
|
|
|
xmlNodePtr parent)
|
|
|
|
{
|
|
|
|
GList *pads;
|
2000-08-28 20:20:55 +00:00
|
|
|
|
2000-12-23 03:17:52 +00:00
|
|
|
g_return_val_if_fail(factory != NULL, NULL);
|
|
|
|
|
2000-08-28 20:20:55 +00:00
|
|
|
xmlNewChild(parent,NULL,"name",factory->name);
|
|
|
|
xmlNewChild(parent,NULL,"longname", factory->details->longname);
|
2000-12-11 00:04:25 +00:00
|
|
|
xmlNewChild(parent,NULL,"class", factory->details->klass);
|
2000-08-28 20:20:55 +00:00
|
|
|
xmlNewChild(parent,NULL,"description", factory->details->description);
|
|
|
|
xmlNewChild(parent,NULL,"version", factory->details->version);
|
|
|
|
xmlNewChild(parent,NULL,"author", factory->details->author);
|
|
|
|
xmlNewChild(parent,NULL,"copyright", factory->details->copyright);
|
|
|
|
|
2000-12-13 19:29:35 +00:00
|
|
|
pads = factory->padtemplates;
|
2000-12-12 19:29:43 +00:00
|
|
|
if (pads) {
|
|
|
|
while (pads) {
|
|
|
|
xmlNodePtr subtree;
|
2000-12-13 19:29:35 +00:00
|
|
|
GstPadTemplate *padtemplate = (GstPadTemplate *)pads->data;
|
2000-08-28 20:20:55 +00:00
|
|
|
|
2000-12-13 19:29:35 +00:00
|
|
|
subtree = xmlNewChild(parent, NULL, "padtemplate", NULL);
|
|
|
|
gst_padtemplate_save_thyself(padtemplate, subtree);
|
2000-08-28 20:20:55 +00:00
|
|
|
|
2000-12-12 19:29:43 +00:00
|
|
|
pads = g_list_next (pads);
|
2000-08-28 20:20:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return parent;
|
|
|
|
}
|
|
|
|
|
2000-09-14 20:31:03 +00:00
|
|
|
/**
|
|
|
|
* gst_elementfactory_load_thyself:
|
|
|
|
* @parent: the parent xmlNodePtr
|
|
|
|
*
|
2001-01-06 22:05:15 +00:00
|
|
|
* Creates a new factory from an xmlNodePtr.
|
2000-09-14 20:31:03 +00:00
|
|
|
*
|
|
|
|
* Returns: the new factory
|
|
|
|
*/
|
2000-12-11 00:04:25 +00:00
|
|
|
GstElementFactory *
|
|
|
|
gst_elementfactory_load_thyself (xmlNodePtr parent)
|
|
|
|
{
|
2000-08-28 20:20:55 +00:00
|
|
|
GstElementFactory *factory = g_new0(GstElementFactory, 1);
|
|
|
|
xmlNodePtr children = parent->childs;
|
|
|
|
factory->details = g_new0(GstElementDetails, 1);
|
2000-12-13 19:29:35 +00:00
|
|
|
factory->padtemplates = NULL;
|
2000-08-28 20:20:55 +00:00
|
|
|
|
|
|
|
while (children) {
|
|
|
|
if (!strcmp(children->name, "name")) {
|
|
|
|
factory->name = g_strdup(xmlNodeGetContent(children));
|
|
|
|
}
|
|
|
|
if (!strcmp(children->name, "longname")) {
|
|
|
|
factory->details->longname = g_strdup(xmlNodeGetContent(children));
|
|
|
|
}
|
|
|
|
if (!strcmp(children->name, "class")) {
|
2000-12-11 00:04:25 +00:00
|
|
|
factory->details->klass = g_strdup(xmlNodeGetContent(children));
|
2000-08-28 20:20:55 +00:00
|
|
|
}
|
|
|
|
if (!strcmp(children->name, "description")) {
|
|
|
|
factory->details->description = g_strdup(xmlNodeGetContent(children));
|
|
|
|
}
|
|
|
|
if (!strcmp(children->name, "version")) {
|
|
|
|
factory->details->version = g_strdup(xmlNodeGetContent(children));
|
|
|
|
}
|
|
|
|
if (!strcmp(children->name, "author")) {
|
|
|
|
factory->details->author = g_strdup(xmlNodeGetContent(children));
|
|
|
|
}
|
|
|
|
if (!strcmp(children->name, "copyright")) {
|
|
|
|
factory->details->copyright = g_strdup(xmlNodeGetContent(children));
|
|
|
|
}
|
2000-12-13 19:29:35 +00:00
|
|
|
if (!strcmp(children->name, "padtemplate")) {
|
|
|
|
GstPadTemplate *template;
|
2000-12-12 19:29:43 +00:00
|
|
|
|
2000-12-13 19:29:35 +00:00
|
|
|
template = gst_padtemplate_load_thyself (children);
|
2000-12-12 19:29:43 +00:00
|
|
|
|
2000-12-13 19:29:35 +00:00
|
|
|
gst_elementfactory_add_padtemplate (factory, template);
|
2000-08-28 20:20:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
children = children->next;
|
|
|
|
}
|
|
|
|
|
2000-12-19 13:41:55 +00:00
|
|
|
_gst_elementfactories = g_list_prepend (_gst_elementfactories, factory);
|
|
|
|
|
2000-08-28 20:20:55 +00:00
|
|
|
return factory;
|
|
|
|
}
|
|
|
|
|