![]() |
![]() |
![]() |
GStreamer 0.10 Core Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
#include <gst/gst.h> struct GstXML; xmlDocPtr gst_xml_write (GstElement *element
); gint gst_xml_write_file (GstElement *element
,FILE *out
); GstXML * gst_xml_new (void
); gboolean gst_xml_parse_doc (GstXML *xml
,xmlDocPtr doc
,const guchar *root
); gboolean gst_xml_parse_file (GstXML *xml
,const guchar *fname
,const guchar *root
); gboolean gst_xml_parse_memory (GstXML *xml
,guchar *buffer
,guint size
,const gchar *root
); GstElement * gst_xml_get_element (GstXML *xml
,const guchar *name
); GList * gst_xml_get_topelements (GstXML *xml
); GstElement * gst_xml_make_element (xmlNodePtr cur
,GstObject *parent
);
GStreamer pipelines can be saved to xml files using gst_xml_write_file()
.
They can be loaded back using gst_xml_parse_doc()
/ gst_xml_parse_file()
/
gst_xml_parse_memory()
.
Additionally one can load saved pipelines into the gst-editor to inspect the
graph.
GstElement implementations need to override the GstObjectClass.save_thyself()
and GstObjectClass.restore_thyself()
virtual functions of GstObject.
struct GstXML { GList *topelements; xmlNsPtr ns; };
GstXML
is deprecated and should not be used in newly-written code.
XML parser object
GList * |
list of element nodes |
name space |
xmlDocPtr gst_xml_write (GstElement *element
);
gst_xml_write
is deprecated and should not be used in newly-written code.
Converts the given element into an XML presentation.
|
The element to write out |
Returns : |
a pointer to an XML document |
gint gst_xml_write_file (GstElement *element
,FILE *out
);
gst_xml_write_file
is deprecated and should not be used in newly-written code.
Converts the given element into XML and writes the formatted XML to an open file.
|
The element to write out |
|
an open file, like stdout |
Returns : |
number of bytes written on success, -1 otherwise. |
GstXML * gst_xml_new (void
);
gst_xml_new
is deprecated and should not be used in newly-written code.
Create a new GstXML parser object.
Returns : |
a pointer to a new GstXML object. |
gboolean gst_xml_parse_doc (GstXML *xml
,xmlDocPtr doc
,const guchar *root
);
gst_xml_parse_doc
is deprecated and should not be used in newly-written code.
Fills the GstXML object with the elements from the xmlDocPtr.
|
a pointer to a GstXML object |
|
a pointer to an xml document to parse |
|
The name of the root object to build |
Returns : |
TRUE on success, FALSE otherwise |
gboolean gst_xml_parse_file (GstXML *xml
,const guchar *fname
,const guchar *root
);
gst_xml_parse_file
is deprecated and should not be used in newly-written code.
Fills the GstXML object with the corresponding elements from the XML file fname. Optionally it will only build the element from the element node root (if it is not NULL). This feature is useful if you only want to build a specific element from an XML file but not the pipeline it is embedded in.
Pass "-" as fname to read from stdin. You can also pass a URI of any format that libxml supports, including http.
|
a pointer to a GstXML object |
|
The filename with the xml description |
|
The name of the root object to build |
Returns : |
TRUE on success, FALSE otherwise |
gboolean gst_xml_parse_memory (GstXML *xml
,guchar *buffer
,guint size
,const gchar *root
);
gst_xml_parse_memory
is deprecated and should not be used in newly-written code.
Fills the GstXML object with the corresponding elements from an in memory XML buffer.
|
a pointer to a GstXML object |
|
a pointer to the in memory XML buffer |
|
the size of the buffer |
|
the name of the root objects to build |
Returns : |
TRUE on success |
GstElement * gst_xml_get_element (GstXML *xml
,const guchar *name
);
gst_xml_get_element
is deprecated and should not be used in newly-written code.
This function is used to get a pointer to the GstElement corresponding to name in the pipeline description. You would use this if you have to do anything to the element after loading.
|
The GstXML to get the element from |
|
The name of element to retrieve |
Returns : |
a pointer to a new GstElement, caller owns returned reference. |
GList * gst_xml_get_topelements (GstXML *xml
);
gst_xml_get_topelements
is deprecated and should not be used in newly-written code.
Retrieve a list of toplevel elements.
|
The GstXML to get the elements from |
Returns : |
a GList of top-level elements. The caller does not own a copy
of the list and must not free or modify the list. The caller also does not
own a reference to any of the elements in the list and should obtain its own
reference using gst_object_ref() if necessary. |
GstElement * gst_xml_make_element (xmlNodePtr cur
,GstObject *parent
);
gst_xml_make_element
is deprecated and should not be used in newly-written code.
Load the element from the XML description
|
the xml node |
|
the parent of this object when it's loaded |
Returns : |
the new element |
"object-loaded"
signalvoid user_function (GstXML *xml,
GstObject *object,
gpointer xml_node,
gpointer user_data) : Run Last
Signals that a new object has been deserialized.
|
the xml persistence instance |
|
the object that has been loaded |
|
the related xml_node pointer to the document tree |
|
user data set when the signal handler was connected. |