2000-12-28 22:12:02 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
2001-01-29 00:06:02 +00:00
|
|
|
* 2000 Wim Taymans <wim.taymans@chello.be>
|
2000-12-28 22:12:02 +00:00
|
|
|
*
|
2004-07-21 11:32:09 +00:00
|
|
|
* gstxml.h: Header for XML save/restore operations of pipelines
|
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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GST_XML_H__
|
|
|
|
#define __GST_XML_H__
|
|
|
|
|
2001-10-17 10:21:27 +00:00
|
|
|
#include <gst/gstconfig.h>
|
2001-01-18 11:16:53 +00:00
|
|
|
|
2001-10-17 10:21:27 +00:00
|
|
|
#ifndef GST_DISABLE_LOADSAVE
|
2001-01-18 11:16:53 +00:00
|
|
|
|
2000-12-15 01:57:34 +00:00
|
|
|
#include <gst/gstelement.h>
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2002-07-08 19:07:30 +00:00
|
|
|
G_BEGIN_DECLS
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2002-12-19 21:31:03 +00:00
|
|
|
#define GST_TYPE_XML (gst_xml_get_type ())
|
|
|
|
#define GST_XML(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_XML, GstXML))
|
|
|
|
#define GST_IS_XML(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_XML))
|
|
|
|
#define GST_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_XML, GstXMLClass))
|
|
|
|
#define GST_IS_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_XML))
|
|
|
|
#define GST_XML_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_XML, GstXMLClass))
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2000-09-24 22:45:48 +00:00
|
|
|
typedef struct _GstXML GstXML;
|
|
|
|
typedef struct _GstXMLClass GstXMLClass;
|
|
|
|
|
2005-09-27 20:40:35 +00:00
|
|
|
/**
|
|
|
|
* GstXML:
|
2007-07-25 13:00:23 +00:00
|
|
|
* @topelements: list of element nodes
|
|
|
|
* @ns: name space
|
2005-09-27 20:40:35 +00:00
|
|
|
*
|
|
|
|
* XML parser object
|
|
|
|
*/
|
2004-03-15 14:43:35 +00:00
|
|
|
struct _GstXML {
|
2001-01-29 00:06:02 +00:00
|
|
|
GstObject object;
|
2000-09-27 19:33:10 +00:00
|
|
|
|
2007-07-25 13:00:23 +00:00
|
|
|
/*< public >*/
|
2004-03-15 14:43:35 +00:00
|
|
|
GList *topelements;
|
2001-01-29 00:06:02 +00:00
|
|
|
|
|
|
|
xmlNsPtr ns;
|
2003-10-07 21:58:42 +00:00
|
|
|
|
2007-07-25 13:00:23 +00:00
|
|
|
/*< private >*/
|
2003-12-09 02:39:31 +00:00
|
|
|
gpointer _gst_reserved[GST_PADDING];
|
2000-09-24 22:45:48 +00:00
|
|
|
};
|
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
struct _GstXMLClass {
|
2001-01-29 00:06:02 +00:00
|
|
|
GstObjectClass parent_class;
|
|
|
|
|
|
|
|
/* signal callbacks */
|
2004-03-15 14:43:35 +00:00
|
|
|
void (*object_loaded) (GstXML *xml, GstObject *object, xmlNodePtr self);
|
|
|
|
void (*object_saved) (GstXML *xml, GstObject *object, xmlNodePtr self);
|
2003-10-07 21:58:42 +00:00
|
|
|
|
2003-12-09 02:39:31 +00:00
|
|
|
gpointer _gst_reserved[GST_PADDING];
|
2000-09-24 22:45:48 +00:00
|
|
|
};
|
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
GType gst_xml_get_type (void);
|
2000-09-24 22:45:48 +00:00
|
|
|
|
|
|
|
|
2000-01-30 09:03:00 +00:00
|
|
|
/* create an XML document out of a pipeline */
|
2004-03-15 14:43:35 +00:00
|
|
|
xmlDocPtr gst_xml_write (GstElement *element);
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2002-01-11 01:48:17 +00:00
|
|
|
/* write a formatted representation of a pipeline to an open file */
|
2004-03-15 14:43:35 +00:00
|
|
|
gint gst_xml_write_file (GstElement *element, FILE *out);
|
2002-01-11 01:48:17 +00:00
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
GstXML* gst_xml_new (void);
|
2001-01-29 00:06:02 +00:00
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
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);
|
2001-01-21 23:20:46 +00:00
|
|
|
|
2000-09-24 22:45:48 +00:00
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
GstElement* gst_xml_get_element (GstXML *xml, const guchar *name);
|
|
|
|
GList* gst_xml_get_topelements (GstXML *xml);
|
2000-09-27 19:33:10 +00:00
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
GstElement* gst_xml_make_element (xmlNodePtr cur, GstObject *parent);
|
2002-01-11 15:49:47 +00:00
|
|
|
|
2002-07-08 19:07:30 +00:00
|
|
|
G_END_DECLS
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2001-12-15 18:15:13 +00:00
|
|
|
#else /* GST_DISABLE_LOADSAVE */
|
2001-06-25 06:45:56 +00:00
|
|
|
|
2004-07-03 04:59:12 +00:00
|
|
|
#if defined _GNUC_ && _GNUC_ >= 3
|
2001-06-25 06:45:56 +00:00
|
|
|
#pragma GCC poison gst_xml_write
|
|
|
|
#pragma GCC poison gst_xml_new
|
|
|
|
#pragma GCC poison gst_xml_parse_doc
|
|
|
|
#pragma GCC poison gst_xml_parse_file
|
|
|
|
#pragma GCC poison gst_xml_parse_memory
|
|
|
|
#pragma GCC poison gst_xml_get_element
|
|
|
|
#pragma GCC poison gst_xml_get_topelements
|
2004-07-03 04:59:12 +00:00
|
|
|
#endif
|
2001-06-25 06:45:56 +00:00
|
|
|
|
2001-12-15 18:15:13 +00:00
|
|
|
#endif /* GST_DISABLE_LOADSAVE */
|
2001-06-25 06:45:56 +00:00
|
|
|
|
2000-01-30 09:03:00 +00:00
|
|
|
#endif /* __GST_XML_H__ */
|