From 8aff242e77c4fc7465b7e5623616dc59def09f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Noreau-H=C3=A9bert?= Date: Wed, 27 Jun 2007 09:34:01 +0000 Subject: [PATCH] gst/gstghostpad.c: Add peer and direction in the XML serialisation of ghostpads. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message from CVS: Patch by: Étienne Noreau-Hébert * gst/gstghostpad.c: (gst_proxy_pad_save_thyself): Add peer and direction in the XML serialisation of ghostpads. Fixes #449226. --- ChangeLog | 8 ++++++++ gst/gstghostpad.c | 29 +++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d52d2cc2d4..a59e33abea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-06-27 Wim Taymans + + Patch by: Étienne Noreau-Hébert + + * gst/gstghostpad.c: (gst_proxy_pad_save_thyself): + Add peer and direction in the XML serialisation of ghostpads. + Fixes #449226. + 2007-06-26 Stefan Kost * configure.ac: diff --git a/gst/gstghostpad.c b/gst/gstghostpad.c index 0a178ca890..f53dcfa76c 100644 --- a/gst/gstghostpad.c +++ b/gst/gstghostpad.c @@ -48,6 +48,7 @@ #include "gstinfo.h" #include "gstghostpad.h" +#include "gst.h" #define GST_CAT_DEFAULT GST_CAT_PADS @@ -86,7 +87,6 @@ struct _GstProxyPadClass gpointer _gst_reserved[1]; }; - G_DEFINE_TYPE (GstProxyPad, gst_proxy_pad, GST_TYPE_PAD); static GstPad *gst_proxy_pad_get_target (GstPad * pad); @@ -438,6 +438,9 @@ static xmlNodePtr gst_proxy_pad_save_thyself (GstObject * object, xmlNodePtr parent) { xmlNodePtr self; + GstProxyPad *proxypad; + GstPad *pad; + GstPad *peer; g_return_val_if_fail (GST_IS_PROXY_PAD (object), NULL); @@ -447,7 +450,29 @@ gst_proxy_pad_save_thyself (GstObject * object, xmlNodePtr parent) xmlNewChild (self, NULL, (xmlChar *) "parent", (xmlChar *) GST_OBJECT_NAME (GST_OBJECT_PARENT (object))); - /* FIXME FIXME FIXME! */ + proxypad = GST_PROXY_PAD_CAST (object); + pad = GST_PAD_CAST (proxypad); + peer = GST_PAD_CAST (pad->peer); + + if (GST_IS_PAD (pad)) { + if (GST_PAD_IS_SRC (pad)) + xmlNewChild (self, NULL, (xmlChar *) "direction", (xmlChar *) "source"); + else if (GST_PAD_IS_SINK (pad)) + xmlNewChild (self, NULL, (xmlChar *) "direction", (xmlChar *) "sink"); + else + xmlNewChild (self, NULL, (xmlChar *) "direction", (xmlChar *) "unknown"); + } else { + xmlNewChild (self, NULL, (xmlChar *) "direction", (xmlChar *) "unknown"); + } + if (GST_IS_PAD (peer)) { + gchar *content = g_strdup_printf ("%s.%s", + GST_OBJECT_NAME (GST_PAD_PARENT (peer)), GST_PAD_NAME (peer)); + + xmlNewChild (self, NULL, (xmlChar *) "peer", (xmlChar *) content); + g_free (content); + } else { + xmlNewChild (self, NULL, (xmlChar *) "peer", NULL); + } return self; }