|
1 /* GStreamer |
|
2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu> |
|
3 * 2000 Wim Taymans <wim.taymans@chello.be> |
|
4 * |
|
5 * gstxml.h: Header for XML save/restore operations of pipelines |
|
6 * |
|
7 * This library is free software; you can redistribute it and/or |
|
8 * modify it under the terms of the GNU Library General Public |
|
9 * License as published by the Free Software Foundation; either |
|
10 * version 2 of the License, or (at your option) any later version. |
|
11 * |
|
12 * This library is distributed in the hope that it will be useful, |
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
15 * Library General Public License for more details. |
|
16 * |
|
17 * You should have received a copy of the GNU Library General Public |
|
18 * License along with this library; if not, write to the |
|
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
|
20 * Boston, MA 02111-1307, USA. |
|
21 */ |
|
22 |
|
23 #ifndef __GST_XML_H__ |
|
24 #define __GST_XML_H__ |
|
25 |
|
26 #include <gst/gstconfig.h> |
|
27 |
|
28 #ifndef GST_DISABLE_LOADSAVE |
|
29 |
|
30 #include <gst/gstelement.h> |
|
31 |
|
32 G_BEGIN_DECLS |
|
33 |
|
34 #define GST_TYPE_XML (gst_xml_get_type ()) |
|
35 #define GST_XML(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_XML, GstXML)) |
|
36 #define GST_IS_XML(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_XML)) |
|
37 #define GST_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_XML, GstXMLClass)) |
|
38 #define GST_IS_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_XML)) |
|
39 #define GST_XML_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_XML, GstXMLClass)) |
|
40 |
|
41 typedef struct _GstXML GstXML; |
|
42 typedef struct _GstXMLClass GstXMLClass; |
|
43 |
|
44 /** |
|
45 * GstXML: |
|
46 * @topelements: list of element nodes |
|
47 * @ns: name space |
|
48 * |
|
49 * XML parser object |
|
50 */ |
|
51 struct _GstXML { |
|
52 GstObject object; |
|
53 |
|
54 /*< public >*/ |
|
55 GList *topelements; |
|
56 |
|
57 xmlNsPtr ns; |
|
58 |
|
59 /*< private >*/ |
|
60 gpointer _gst_reserved[GST_PADDING]; |
|
61 }; |
|
62 |
|
63 struct _GstXMLClass { |
|
64 GstObjectClass parent_class; |
|
65 |
|
66 /* signal callbacks */ |
|
67 void (*object_loaded) (GstXML *xml, GstObject *object, xmlNodePtr self); |
|
68 void (*object_saved) (GstXML *xml, GstObject *object, xmlNodePtr self); |
|
69 |
|
70 gpointer _gst_reserved[GST_PADDING]; |
|
71 }; |
|
72 |
|
73 GType gst_xml_get_type (void); |
|
74 |
|
75 |
|
76 /* create an XML document out of a pipeline */ |
|
77 xmlDocPtr gst_xml_write (GstElement *element); |
|
78 |
|
79 /* write a formatted representation of a pipeline to an open file */ |
|
80 gint gst_xml_write_file (GstElement *element, FILE *out); |
|
81 |
|
82 GstXML* gst_xml_new (void); |
|
83 |
|
84 gboolean gst_xml_parse_doc (GstXML *xml, xmlDocPtr doc, const guchar *root); |
|
85 gboolean gst_xml_parse_file (GstXML *xml, const guchar *fname, const guchar *root); |
|
86 gboolean gst_xml_parse_memory (GstXML *xml, guchar *buffer, guint size, const gchar *root); |
|
87 |
|
88 |
|
89 GstElement* gst_xml_get_element (GstXML *xml, const guchar *name); |
|
90 GList* gst_xml_get_topelements (GstXML *xml); |
|
91 |
|
92 GstElement* gst_xml_make_element (xmlNodePtr cur, GstObject *parent); |
|
93 |
|
94 G_END_DECLS |
|
95 |
|
96 #else /* GST_DISABLE_LOADSAVE */ |
|
97 |
|
98 #if defined _GNUC_ && _GNUC_ >= 3 |
|
99 #pragma GCC poison gst_xml_write |
|
100 #pragma GCC poison gst_xml_new |
|
101 #pragma GCC poison gst_xml_parse_doc |
|
102 #pragma GCC poison gst_xml_parse_file |
|
103 #pragma GCC poison gst_xml_parse_memory |
|
104 #pragma GCC poison gst_xml_get_element |
|
105 #pragma GCC poison gst_xml_get_topelements |
|
106 #endif |
|
107 |
|
108 #endif /* GST_DISABLE_LOADSAVE */ |
|
109 |
|
110 #endif /* __GST_XML_H__ */ |