Commit 9500bd21 authored by Wim Taymans's avatar Wim Taymans

Code cleanup, make it adhere to the Gnome/Gtk+ code formatting, which is quite...

Code cleanup, make it adhere to the Gnome/Gtk+ code formatting, which is quite clean and more readable.

Original commit message from CVS:
Code cleanup, make it adhere to the Gnome/Gtk+ code formatting, which is
quite clean and more readable.
Renamed parseavi to avidecoder
Implemented seeking/time display/pause/play/stop/clean exit to gstmediaplay
Added an element flag to indicate that it cannot deal with noncontigous
buffers. If such an element is found in the pipeline, seeking is disabled
for the complete stream (avidecoder cannot deal with seeking until we convert
it to a loop based element with pull_region to fetch the indeces etc...)
parent c69c6914
......@@ -37,16 +37,16 @@ extern "C" {
typedef enum {
GST_STATE_NONE_PENDING = -1,
GST_STATE_NULL = 0,
GST_STATE_READY = 1,
GST_STATE_PLAYING = 2,
GST_STATE_PAUSED = 3,
GST_STATE_NULL = 0,
GST_STATE_READY = 1,
GST_STATE_PLAYING = 2,
GST_STATE_PAUSED = 3,
} GstElementState;
typedef enum {
GST_STATE_FAILURE = 0,
GST_STATE_SUCCESS = 1,
GST_STATE_ASYNC = 2,
GST_STATE_FAILURE = 0,
GST_STATE_SUCCESS = 1,
GST_STATE_ASYNC = 2,
} GstElementStateReturn;
static inline char *_gst_print_statename(int state) {
......@@ -78,6 +78,7 @@ static inline char *_gst_print_statename(int state) {
typedef enum {
GST_ELEMENT_MULTI_IN = (1 << 4),
GST_ELEMENT_THREAD_SUGGESTED = (1 << 5),
GST_ELEMENT_NO_SEEK = (1 << 6),
} GstElementFlags;
#define GST_ELEMENT_IS_MULTI_IN(obj) (GST_FLAGS(obj) & GST_ELEMENT_MULTI_IN)
......@@ -115,10 +116,10 @@ struct _GstElementClass {
GstElementFactory *elementfactory;
/* signal callbacks */
void (*state_change) (GstElement *element,GstElementState state);
void (*new_pad) (GstElement *element,GstPad *pad);
void (*state_change) (GstElement *element,GstElementState state);
void (*new_pad) (GstElement *element,GstPad *pad);
void (*new_ghost_pad) (GstElement *element,GstPad *pad);
void (*error) (GstElement *element,gchar *error);
void (*error) (GstElement *element,gchar *error);
/* events */
// gboolean (*start) (GstElement *element,GstElementState state);
......@@ -151,59 +152,57 @@ struct _GstElementFactory {
GList *sink_types;
};
GtkType gst_element_get_type(void);
GstElement *gst_element_new(void);
GtkType gst_element_get_type (void);
GstElement* gst_element_new (void);
#define gst_element_destroy(element) gst_object_destroy (GST_OBJECT (element))
void gst_element_set_loop_function(GstElement *element,
GstElementLoopFunction loop);
void gst_element_set_loop_function (GstElement *element,
GstElementLoopFunction loop);
void gst_element_set_name(GstElement *element,gchar *name);
gchar *gst_element_get_name(GstElement *element);
void gst_element_set_name (GstElement *element, gchar *name);
gchar* gst_element_get_name (GstElement *element);
void gst_element_set_manager(GstElement *element,GstElement *manager);
GstElement *gst_element_get_manager(GstElement *element);
void gst_element_set_manager (GstElement *element, GstElement *manager);
GstElement* gst_element_get_manager (GstElement *element);
void gst_element_add_pad(GstElement *element,GstPad *pad);
void gst_element_add_ghost_pad(GstElement *element,GstPad *pad);
GstPad *gst_element_get_pad(GstElement *element,gchar *name);
GList *gst_element_get_pad_list(GstElement *element);
void gst_element_add_pad (GstElement *element, GstPad *pad);
GstPad* gst_element_get_pad (GstElement *element, gchar *name);
GList* gst_element_get_pad_list (GstElement *element);
void gst_element_add_ghost_pad (GstElement *element, GstPad *pad);
void gst_element_connect(GstElement *src,gchar *srcpadname,
GstElement *dest,gchar *destpadname);
void gst_element_connect (GstElement *src, gchar *srcpadname,
GstElement *dest, gchar *destpadname);
/* called by the app to set the state of the element */
gint gst_element_set_state(GstElement *element,GstElementState state);
gint gst_element_set_state (GstElement *element, GstElementState state);
void gst_element_error(GstElement *element,gchar *error);
void gst_element_error (GstElement *element, gchar *error);
GstElementFactory *gst_element_get_factory(GstElement *element);
#define gst_element_destroy(element) gst_object_destroy(GST_OBJECT(element))
GstElementFactory* gst_element_get_factory (GstElement *element);
int gst_element_loopfunc_wrapper (int argc,char **argv);
/* XML write and read */
xmlNodePtr gst_element_save_thyself(GstElement *element,xmlNodePtr parent);
GstElement *gst_element_load_thyself(xmlNodePtr parent, GHashTable *elements);
xmlNodePtr gst_element_save_thyself (GstElement *element, xmlNodePtr parent);
GstElement* gst_element_load_thyself (xmlNodePtr parent, GHashTable *elements);
GstElementFactory *gst_elementfactory_new(gchar *name,GtkType type,
GstElementDetails *details);
void gst_elementfactory_register(GstElementFactory *elementfactory);
void gst_elementfactory_add_src(GstElementFactory *elementfactory, guint16 id);
void gst_elementfactory_add_sink(GstElementFactory *elementfactory, guint16 id);
GstElementFactory* gst_elementfactory_new (gchar *name,GtkType type,
GstElementDetails *details);
void gst_elementfactory_register (GstElementFactory *elementfactory);
GstElementFactory *gst_elementfactory_find(gchar *name);
GList *gst_elementfactory_get_list();
void gst_elementfactory_add_src (GstElementFactory *elementfactory, guint16 id);
void gst_elementfactory_add_sink (GstElementFactory *elementfactory, guint16 id);
GstElement *gst_elementfactory_create(GstElementFactory *factory,
gchar *name);
// FIXME this name is wrong, probably so is the one above it
GstElement *gst_elementfactory_make(gchar *factoryname,gchar *name);
GstElementFactory* gst_elementfactory_find (gchar *name);
GList* gst_elementfactory_get_list (void);
xmlNodePtr gst_elementfactory_save_thyself(GstElementFactory *factory, xmlNodePtr parent);
GstElementFactory *gst_elementfactory_load_thyself(xmlNodePtr parent);
GstElement* gst_elementfactory_create (GstElementFactory *factory,
gchar *name);
// FIXME this name is wrong, probably so is the one above it
GstElement* gst_elementfactory_make (gchar *factoryname, gchar *name);
int gst_element_loopfunc_wrapper(int argc,char **argv);
xmlNodePtr gst_elementfactory_save_thyself (GstElementFactory *factory, xmlNodePtr parent);
GstElementFactory* gst_elementfactory_load_thyself (xmlNodePtr parent);
#ifdef __cplusplus
}
......
......@@ -66,7 +66,8 @@ gst_pad_get_type(void) {
}
static void
gst_pad_class_init(GstPadClass *klass) {
gst_pad_class_init (GstPadClass *klass)
{
GtkObjectClass *gtkobject_class;
gtkobject_class = (GtkObjectClass*)klass;
......@@ -76,7 +77,9 @@ gst_pad_class_init(GstPadClass *klass) {
gtkobject_class->destroy = gst_pad_real_destroy;
}
static void gst_pad_init(GstPad *pad) {
static void
gst_pad_init (GstPad *pad)
{
pad->type = 0;
pad->direction = GST_PAD_UNKNOWN;
pad->peer = NULL;
......@@ -97,14 +100,17 @@ static void gst_pad_init(GstPad *pad) {
*
* Returns: new pad
*/
GstPad *gst_pad_new(gchar *name,GstPadDirection direction) {
GstPad*
gst_pad_new (gchar *name,
GstPadDirection direction)
{
GstPad *pad;
g_return_val_if_fail(name != NULL, NULL);
g_return_val_if_fail(direction != GST_PAD_UNKNOWN, NULL);
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (direction != GST_PAD_UNKNOWN, NULL);
pad = GST_PAD(gtk_type_new(gst_pad_get_type()));
pad->name = g_strdup(name);
pad = GST_PAD (gtk_type_new (gst_pad_get_type ()));
pad->name = g_strdup (name);
pad->direction = direction;
return pad;
}
......@@ -117,9 +123,11 @@ GstPad *gst_pad_new(gchar *name,GstPadDirection direction) {
*
* Returns: the direction of the pad
*/
GstPadDirection gst_pad_get_direction(GstPad *pad) {
g_return_val_if_fail(pad != NULL, GST_PAD_UNKNOWN);
g_return_val_if_fail(GST_IS_PAD(pad), GST_PAD_UNKNOWN);
GstPadDirection
gst_pad_get_direction (GstPad *pad)
{
g_return_val_if_fail (pad != NULL, GST_PAD_UNKNOWN);
g_return_val_if_fail (GST_IS_PAD (pad), GST_PAD_UNKNOWN);
return pad->direction;
}
......@@ -131,14 +139,17 @@ GstPadDirection gst_pad_get_direction(GstPad *pad) {
*
* set the name of a pad
*/
void gst_pad_set_name(GstPad *pad,gchar *name) {
g_return_if_fail(pad != NULL);
g_return_if_fail(GST_IS_PAD(pad));
void
gst_pad_set_name (GstPad *pad,
const gchar *name)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
if (pad->name != NULL)
g_free(pad->name);
g_free (pad->name);
pad->name = g_strdup(name);
pad->name = g_strdup (name);
}
/**
......@@ -147,11 +158,13 @@ void gst_pad_set_name(GstPad *pad,gchar *name) {
*
* get the name of a pad
*
* Returns: the name of the pad
* Returns: the name of the pad, don't free.
*/
gchar *gst_pad_get_name(GstPad *pad) {
g_return_val_if_fail(pad != NULL, NULL);
g_return_val_if_fail(GST_IS_PAD(pad), NULL);
const gchar*
gst_pad_get_name (GstPad *pad)
{
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
return pad->name;
}
......@@ -163,9 +176,12 @@ gchar *gst_pad_get_name(GstPad *pad) {
*
* Set the given pull function for the pad
*/
void gst_pad_set_pull_function(GstPad *pad,GstPadPullFunction pull) {
g_return_if_fail(pad != NULL);
g_return_if_fail(GST_IS_PAD(pad));
void
gst_pad_set_pull_function (GstPad *pad,
GstPadPullFunction pull)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
g_print("gstpad: pad setting pull function\n");
......@@ -179,9 +195,11 @@ void gst_pad_set_pull_function(GstPad *pad,GstPadPullFunction pull) {
*
* Set the given chain function for the pad
*/
void gst_pad_set_chain_function(GstPad *pad,GstPadChainFunction chain) {
g_return_if_fail(pad != NULL);
g_return_if_fail(GST_IS_PAD(pad));
void gst_pad_set_chain_function (GstPad *pad,
GstPadChainFunction chain)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
pad->chainfunc = chain;
}
......@@ -193,9 +211,12 @@ void gst_pad_set_chain_function(GstPad *pad,GstPadChainFunction chain) {
*
* Set the given qos function for the pad
*/
void gst_pad_set_qos_function(GstPad *pad,GstPadQoSFunction qos) {
g_return_if_fail(pad != NULL);
g_return_if_fail(GST_IS_PAD(pad));
void
gst_pad_set_qos_function (GstPad *pad,
GstPadQoSFunction qos)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
pad->qosfunc = qos;
}
......@@ -207,7 +228,10 @@ void gst_pad_set_qos_function(GstPad *pad,GstPadQoSFunction qos) {
*
* pushes a buffer along a src pad
*/
void gst_pad_push(GstPad *pad,GstBuffer *buffer) {
void
gst_pad_push (GstPad *pad,
GstBuffer *buffer)
{
g_return_if_fail(pad != NULL);
g_return_if_fail(GST_IS_PAD(pad));
g_return_if_fail(GST_PAD_CONNECTED(pad));
......@@ -241,7 +265,9 @@ void gst_pad_push(GstPad *pad,GstBuffer *buffer) {
*
* Returns: the buffer that was pulled
*/
GstBuffer *gst_pad_pull(GstPad *pad) {
GstBuffer*
gst_pad_pull (GstPad *pad)
{
GstBuffer *buf;
// GstElement *peerparent;
// cothread_state *state;
......@@ -280,20 +306,41 @@ GstBuffer *gst_pad_pull(GstPad *pad) {
return NULL;
}
/**
* gst_pad_pull_region:
* @pad: the pad to pull
* @offset: the offset to pull
* @size: the size to pull
*
* pulls a buffer along a sink pad with a given offset and size
*
* Returns: the buffer that was pulled
*/
GstBuffer*
gst_pad_pull_region (GstPad *pad,
gulong offset,
gulong size)
{
// FIXME
return gst_pad_pull (pad);
}
/**
* gst_pad_chain:
* @pad: the pad to chain
*
* call the chain function of the given pad
*/
void gst_pad_chain(GstPad *pad) {
g_return_if_fail(pad != NULL);
g_return_if_fail(GST_IS_PAD(pad));
g_return_if_fail(pad->peer != NULL);
g_return_if_fail(pad->chainfunc != NULL);
void
gst_pad_chain (GstPad *pad)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
g_return_if_fail (pad->peer != NULL);
g_return_if_fail (pad->chainfunc != NULL);
if (pad->bufpen && pad->chainfunc)
(pad->chainfunc)(pad,pad->bufpen);
(pad->chainfunc) (pad,pad->bufpen);
}
......@@ -304,8 +351,9 @@ void gst_pad_chain(GstPad *pad) {
*
* pass the qos message downstream
*/
void gst_pad_handle_qos(GstPad *pad,
glong qos_message)
void
gst_pad_handle_qos(GstPad *pad,
glong qos_message)
{
GstElement *element;
GList *pads;
......@@ -314,19 +362,19 @@ void gst_pad_handle_qos(GstPad *pad,
DEBUG("gst_pad_handle_qos(\"%s\",%08ld)\n", GST_ELEMENT(pad->parent)->name,qos_message);
if (pad->qosfunc) {
(pad->qosfunc)(pad,qos_message);
(pad->qosfunc) (pad,qos_message);
}
else {
element = GST_ELEMENT(pad->peer->parent);
element = GST_ELEMENT (pad->peer->parent);
pads = element->pads;
DEBUG("gst_pad_handle_qos recurse(\"%s\",%08ld)\n", element->name,qos_message);
while (pads) {
target_pad = GST_PAD(pads->data);
target_pad = GST_PAD (pads->data);
if (target_pad->direction == GST_PAD_SINK) {
gst_pad_handle_qos(target_pad, qos_message);
gst_pad_handle_qos (target_pad, qos_message);
}
pads = g_list_next(pads);
pads = g_list_next (pads);
}
}
......@@ -340,18 +388,20 @@ void gst_pad_handle_qos(GstPad *pad,
*
* disconnects the source pad from the sink pad
*/
void gst_pad_disconnect(GstPad *srcpad,GstPad *sinkpad) {
void
gst_pad_disconnect (GstPad *srcpad,
GstPad *sinkpad)
{
/* generic checks */
g_return_if_fail(srcpad != NULL);
g_return_if_fail(GST_IS_PAD(srcpad));
g_return_if_fail(srcpad->peer != NULL);
g_return_if_fail(sinkpad != NULL);
g_return_if_fail(GST_IS_PAD(sinkpad));
g_return_if_fail(sinkpad->peer != NULL);
g_return_if_fail (srcpad != NULL);
g_return_if_fail (GST_IS_PAD (srcpad));
g_return_if_fail (srcpad->peer != NULL);
g_return_if_fail (sinkpad != NULL);
g_return_if_fail (GST_IS_PAD (sinkpad));
g_return_if_fail (sinkpad->peer != NULL);
g_return_if_fail((srcpad->direction == GST_PAD_SRC) &&
(sinkpad->direction == GST_PAD_SINK));
g_return_if_fail ((srcpad->direction == GST_PAD_SRC) &&
(sinkpad->direction == GST_PAD_SINK));
/* first clear peers */
srcpad->peer = NULL;
......@@ -368,7 +418,10 @@ void gst_pad_disconnect(GstPad *srcpad,GstPad *sinkpad) {
*
* connects the source pad to the sink pad
*/
void gst_pad_connect(GstPad *srcpad,GstPad *sinkpad) {
void
gst_pad_connect (GstPad *srcpad,
GstPad *sinkpad)
{
GstPad *temppad;
/* generic checks */
......@@ -410,13 +463,16 @@ void gst_pad_connect(GstPad *srcpad,GstPad *sinkpad) {
*
* sets the parent object of a pad.
*/
void gst_pad_set_parent(GstPad *pad,GstObject *parent) {
g_return_if_fail(pad != NULL);
g_return_if_fail(GST_IS_PAD(pad));
g_return_if_fail(pad->parent == NULL);
g_return_if_fail(parent != NULL);
g_return_if_fail(GTK_IS_OBJECT(parent));
g_return_if_fail((gpointer)pad != (gpointer)parent);
void
gst_pad_set_parent (GstPad *pad,
GstObject *parent)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
g_return_if_fail (pad->parent == NULL);
g_return_if_fail (parent != NULL);
g_return_if_fail (GTK_IS_OBJECT (parent));
g_return_if_fail ((gpointer)pad != (gpointer)parent);
//g_print("set parent %s\n", gst_element_get_name(parent));
......@@ -430,13 +486,16 @@ void gst_pad_set_parent(GstPad *pad,GstObject *parent) {
*
* add a ghost parent object to a pad.
*/
void gst_pad_add_ghost_parent(GstPad *pad,GstObject *parent) {
g_return_if_fail(pad != NULL);
g_return_if_fail(GST_IS_PAD(pad));
g_return_if_fail(parent != NULL);
g_return_if_fail(GTK_IS_OBJECT(parent));
void
gst_pad_add_ghost_parent (GstPad *pad,
GstObject *parent)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
g_return_if_fail (parent != NULL);
g_return_if_fail (GTK_IS_OBJECT (parent));
pad->ghostparents = g_list_prepend(pad->ghostparents,parent);
pad->ghostparents = g_list_prepend (pad->ghostparents, parent);
}
......@@ -447,13 +506,16 @@ void gst_pad_add_ghost_parent(GstPad *pad,GstObject *parent) {
*
* remove a ghost parent object from a pad.
*/
void gst_pad_remove_ghost_parent(GstPad *pad,GstObject *parent) {
g_return_if_fail(pad != NULL);
g_return_if_fail(GST_IS_PAD(pad));
g_return_if_fail(parent != NULL);
g_return_if_fail(GTK_IS_OBJECT(parent));
void
gst_pad_remove_ghost_parent (GstPad *pad,
GstObject *parent)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
g_return_if_fail (parent != NULL);
g_return_if_fail (GTK_IS_OBJECT (parent));
pad->ghostparents = g_list_remove(pad->ghostparents,parent);
pad->ghostparents = g_list_remove (pad->ghostparents, parent);
}
/**
......@@ -464,9 +526,11 @@ void gst_pad_remove_ghost_parent(GstPad *pad,GstObject *parent) {
*
* Returns: the parent object
*/
GstObject *gst_pad_get_parent(GstPad *pad) {
g_return_val_if_fail(pad != NULL, NULL);
g_return_val_if_fail(GST_IS_PAD(pad), NULL);
GstObject*
gst_pad_get_parent (GstPad *pad)
{
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
return pad->parent;
}
......@@ -479,9 +543,11 @@ GstObject *gst_pad_get_parent(GstPad *pad) {
*
* Returns: a list of ghost parent objects
*/
GList *gst_pad_get_ghost_parents(GstPad *pad) {
g_return_val_if_fail(pad != NULL, NULL);
g_return_val_if_fail(GST_IS_PAD(pad), NULL);
GList*
gst_pad_get_ghost_parents (GstPad *pad)
{
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
return pad->ghostparents;
}
......@@ -494,9 +560,11 @@ GList *gst_pad_get_ghost_parents(GstPad *pad) {
*
* Returns: the type of this pad
*/
guint16 gst_pad_get_type_id(GstPad *pad) {
g_return_val_if_fail(pad != NULL, 0);
g_return_val_if_fail(GST_IS_PAD(pad), 0);
guint16
gst_pad_get_type_id (GstPad *pad)
{
g_return_val_if_fail (pad != NULL, 0);
g_return_val_if_fail (GST_IS_PAD (pad), 0);
return pad->type;
}
......@@ -508,10 +576,13 @@ guint16 gst_pad_get_type_id(GstPad *pad) {
*
* set the type of this pad
*/
void gst_pad_set_type_id(GstPad *pad,guint16 id) {
g_return_if_fail(pad != NULL);
g_return_if_fail(GST_IS_PAD(pad));
g_return_if_fail(gst_type_find_by_id(id) != NULL);
void
gst_pad_set_type_id (GstPad *pad,
guint16 id)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
g_return_if_fail (gst_type_find_by_id (id) != NULL);
pad->type = id;
}
......@@ -524,21 +595,25 @@ void gst_pad_set_type_id(GstPad *pad,guint16 id) {
*
* Returns: the peer pad
*/
GstPad *gst_pad_get_peer(GstPad *pad) {
g_return_val_if_fail(pad != NULL, NULL);
g_return_val_if_fail(GST_IS_PAD(pad), NULL);
GstPad*
gst_pad_get_peer (GstPad *pad)
{
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
return pad->peer;
}
static void gst_pad_real_destroy(GtkObject *object) {
GstPad *pad = GST_PAD(object);
static void
gst_pad_real_destroy (GtkObject *object)
{
GstPad *pad = GST_PAD (object);
// g_print("in gst_pad_real_destroy()\n");
if (pad->name)
g_free(pad->name);
g_list_free(pad->ghostparents);
g_free (pad->name);
g_list_free (pad->ghostparents);
}
......@@ -551,7 +626,11 @@ static void gst_pad_real_destroy(GtkObject *object) {
* Read the pad definition from the XML node and connect the given pad
* in element to a pad of an element in the hashtable.
*/
void gst_pad_load_and_connect(xmlNodePtr parent, GstObject *element, GHashTable *elements) {
void
gst_pad_load_and_connect (xmlNodePtr parent,
GstObject *element,
GHashTable *elements)
{
xmlNodePtr field = parent->childs;
GstPad *pad = NULL, *targetpad;
guchar *peer = NULL;
......@@ -599,7 +678,10 @@ cleanup:
*
* Returns: the xml representation of the pad
*/
xmlNodePtr gst_pad_save_thyself(GstPad *pad,xmlNodePtr parent) {
xmlNodePtr
gst_pad_save_thyself (GstPad *pad,
xmlNodePtr parent)
{
GstPad *peer;
xmlNewChild(parent,NULL,"name",pad->name);
......@@ -626,7 +708,11 @@ xmlNodePtr gst_pad_save_thyself(GstPad *pad,xmlNodePtr parent) {
*
* Returns: the xml representation of the pad
*/
xmlNodePtr gst_pad_ghost_save_thyself(GstPad *pad,GstElement *bin,xmlNodePtr parent) {
xmlNodePtr
gst_pad_ghost_save_thyself (GstPad *pad,
GstElement *bin,
xmlNodePtr parent)
{
xmlNodePtr self;
self = xmlNewChild(parent,NULL,"ghostpad",NULL);
......