A class facilitating XML save/restore operations of pipelines. More...
Inherits Gst::Object.

Public Member Functions | |
| virtual | ~XML () |
| GstXML* | gobj () |
| Provides access to the underlying C GObject. | |
| const GstXML* | gobj () const |
| Provides access to the underlying C GObject. | |
| GstXML* | gobj_copy () |
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
| bool | parse_doc (xmlpp::Document* doc, Glib::ustring& root) |
| Fills the GstXML object with the elements from the xmlDocPtr. | |
| bool | parse_file (const std::string& filename, const Glib::ustring& root) |
| Fills the GstXML object with the corresponding elements from the XML file fname. | |
| bool | parse_memory (const std::string& buffer, const Glib::ustring& root) |
| Fills the Gst::XML object with the corresponding elements from an in memory XML buffer. | |
| Glib::RefPtr< Gst::Element > | get_element (const Glib::ustring& name) |
| This function is used to get a pointer to the GstElement corresponding to name in the pipeline description. | |
| Glib::RefPtr< const Gst::Element > | get_element (const Glib::ustring& name) const |
| This function is used to get a pointer to the GstElement corresponding to name in the pipeline description. | |
| Glib::ListHandle< Glib::RefPtr < Gst::Element > > | get_topelements () |
| Retrieve a list of toplevel elements. | |
| Glib::ListHandle< Glib::RefPtr < const Gst::Element > > | get_topelements () const |
| Retrieve a list of toplevel elements. | |
| Glib::SignalProxy2< void, const Glib::RefPtr < Gst::Object >&, xmlNodePtr > | signal_object_loaded () |
| Signals that a new object has been deserialized. | |
Static Public Member Functions | |
| static Glib::RefPtr< XML > | create () |
| Create a new Gst::XML parser object. | |
| static xmlDocPtr | write (const Glib::RefPtr< const Gst::Element >& element) |
| Converts the given element into an XML presentation. | |
| static void | write_to_stream (const Glib::RefPtr< const Gst::Element >& element, std::ostream& out) |
| Converts the given element into XML and writes the formatted XML to an open output stream. | |
| static Glib::RefPtr< Gst::Element > | make_element (xmlpp::Node* curr, const Glib::RefPtr< Gst::Object >& parent) |
| Load the element from the XML description. | |
Protected Member Functions | |
| XML () | |
| virtual void | on_object_loaded (const Glib::RefPtr< Gst::Object >& object, xmlNodePtr xml_node) |
Related Functions | |
(Note that these are not member functions.) | |
| Glib::RefPtr< Gst::XML > | wrap (GstXML* object, bool take_copy=false) |
| A Glib::wrap() method for this object. | |
A class facilitating XML save/restore operations of pipelines.
GStreamer pipelines can be saved to xml files using write_to_stream(). They can be loaded back using parse_doc() / parse_file() / parse_memory(). Additionally one can load saved pipelines into the gst-editor to inspect the graph.
Gst::Element implementations need to override Gst::Object::save_vfunc() and Gst::Object::restore_vfunc().
| virtual Gst::XML::~XML | ( | ) | [virtual] |
| Gst::XML::XML | ( | ) | [protected] |
| static Glib::RefPtr<XML> Gst::XML::create | ( | ) | [static] |
| Glib::RefPtr<const Gst::Element> Gst::XML::get_element | ( | const Glib::ustring & | name | ) | const |
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.
| name | The name of element to retrieve. |
| Glib::RefPtr<Gst::Element> Gst::XML::get_element | ( | const Glib::ustring & | name | ) |
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.
| name | The name of element to retrieve. |
| Glib::ListHandle< Glib::RefPtr<const Gst::Element> > Gst::XML::get_topelements | ( | ) | const |
Retrieve a list of toplevel elements.
| Glib::ListHandle< Glib::RefPtr<Gst::Element> > Gst::XML::get_topelements | ( | ) |
Retrieve a list of toplevel elements.
| const GstXML* Gst::XML::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gst::Object.
| GstXML* Gst::XML::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gst::Object.
| GstXML* Gst::XML::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Reimplemented from Gst::Object.
| static Glib::RefPtr<Gst::Element> Gst::XML::make_element | ( | xmlpp::Node * | curr, | |
| const Glib::RefPtr< Gst::Object >& | parent | |||
| ) | [static] |
Load the element from the XML description.
| cur | The xml node. | |
| parent | The parent of this object when it's loaded. |
| virtual void Gst::XML::on_object_loaded | ( | const Glib::RefPtr< Gst::Object >& | object, | |
| xmlNodePtr | xml_node | |||
| ) | [protected, virtual] |
| bool Gst::XML::parse_doc | ( | xmlpp::Document * | doc, | |
| Glib::ustring & | root | |||
| ) |
Fills the GstXML object with the elements from the xmlDocPtr.
| doc | A pointer to an xml document to parse. | |
| root | The name of the root object to build. |
true on success, false otherwise. | bool Gst::XML::parse_file | ( | const std::string & | filename, | |
| const Glib::ustring & | root | |||
| ) |
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 0). 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.
| fname | The filename with the xml description. | |
| root | The name of the root object to build. |
true on success, false otherwise. | bool Gst::XML::parse_memory | ( | const std::string & | buffer, | |
| const Glib::ustring & | root | |||
| ) |
| Glib::SignalProxy2< void,const Glib::RefPtr<Gst::Object>&,xmlNodePtr > Gst::XML::signal_object_loaded | ( | ) |
Signals that a new object has been deserialized.
void on_my_object_loaded(const Glib::RefPtr<Gst::Object>& object, xmlNodePtr xml_node) | static xmlDocPtr Gst::XML::write | ( | const Glib::RefPtr< const Gst::Element >& | element | ) | [static] |
| static void Gst::XML::write_to_stream | ( | const Glib::RefPtr< const Gst::Element >& | element, | |
| std::ostream & | out | |||
| ) | [static] |
| Glib::RefPtr< Gst::XML > wrap | ( | GstXML * | object, | |
| bool | take_copy = false | |||
| ) | [related] |
A Glib::wrap() method for this object.
| object | The C instance. | |
| take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
1.6.3