- 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
- *
- * Checks if the factory can sink the given capability
- *
- * 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;
-}
-
-/**
- * gst_elementfactory_save_thyself:
- * @factory: factory to save
- * @parent: the parent xmlNodePtr
- *
- * Saves the factory into an XML tree
- *
- * Returns: the new xmlNodePtr
- */
-xmlNodePtr
-gst_elementfactory_save_thyself (GstElementFactory *factory,
- xmlNodePtr parent)
-{
- GList *pads;
-
- g_return_val_if_fail(factory != NULL, NULL);
-
- xmlNewChild(parent,NULL,"name",factory->name);
- xmlNewChild(parent,NULL,"longname", factory->details->longname);
- xmlNewChild(parent,NULL,"class", factory->details->klass);
- 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);
-
- pads = factory->padtemplates;
- if (pads) {
- while (pads) {
- xmlNodePtr subtree;
- GstPadTemplate *padtemplate = (GstPadTemplate *)pads->data;
-
- subtree = xmlNewChild(parent, NULL, "padtemplate", NULL);
- gst_padtemplate_save_thyself(padtemplate, subtree);
-
- pads = g_list_next (pads);
- }
- }
- return parent;
-}
-
-/**
- * gst_elementfactory_load_thyself:
- * @parent: the parent xmlNodePtr
- *
- * Creates a new factory from an xmlNodePtr
- *
- * Returns: the new factory
- */
-GstElementFactory *
-gst_elementfactory_load_thyself (xmlNodePtr parent)
-{
- GstElementFactory *factory = g_new0(GstElementFactory, 1);
- xmlNodePtr children = parent->childs;
- factory->details = g_new0(GstElementDetails, 1);
- factory->padtemplates = NULL;
-
- 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")) {
- factory->details->klass = g_strdup(xmlNodeGetContent(children));
- }
- 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));
- }
- if (!strcmp(children->name, "padtemplate")) {
- GstPadTemplate *template;
-
- template = gst_padtemplate_load_thyself (children);