mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
gstxml: Deprecate GstXml and related functions
Pipeline serialisation to and from XML is horribly broken for all but the most simple use cases, and will likely never be fixed. Make sure everyone playing around with these tools is aware of this, to avoid frustration. See countless bug reports in bugzilla. Fixes bug #622685.
This commit is contained in:
parent
e0467b0100
commit
5f4a965f67
15 changed files with 173 additions and 62 deletions
24
gst/gstbin.c
24
gst/gstbin.c
|
@ -171,6 +171,17 @@
|
|||
#include "gstutils.h"
|
||||
#include "gstchildproxy.h"
|
||||
|
||||
#ifdef GST_DISABLE_DEPRECATED
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
#undef GstXmlNodePtr
|
||||
#define GstXmlNodePtr xmlNodePtr
|
||||
GstXmlNodePtr gst_object_save_thyself (GstObject * object,
|
||||
GstXmlNodePtr parent);
|
||||
void gst_object_restore_thyself (GstObject * object, GstXmlNodePtr parent);
|
||||
GstElement *gst_xml_make_element (xmlNodePtr cur, GstObject * parent);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* enable for DURATION caching.
|
||||
* FIXME currently too many elements don't update
|
||||
* their duration when it changes so we return inaccurate values. */
|
||||
|
@ -248,7 +259,7 @@ static gboolean gst_bin_query (GstElement * element, GstQuery * query);
|
|||
|
||||
static gboolean gst_bin_do_latency_func (GstBin * bin);
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
static xmlNodePtr gst_bin_save_thyself (GstObject * object, xmlNodePtr parent);
|
||||
static void gst_bin_restore_thyself (GstObject * object, xmlNodePtr self);
|
||||
#endif
|
||||
|
@ -456,10 +467,13 @@ gst_bin_class_init (GstBinClass * klass)
|
|||
|
||||
gobject_class->dispose = gst_bin_dispose;
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
gstobject_class->save_thyself = GST_DEBUG_FUNCPTR (gst_bin_save_thyself);
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
gstobject_class->save_thyself =
|
||||
((gpointer (*)(GstObject * object,
|
||||
gpointer self)) * GST_DEBUG_FUNCPTR (gst_bin_save_thyself));
|
||||
gstobject_class->restore_thyself =
|
||||
GST_DEBUG_FUNCPTR (gst_bin_restore_thyself);
|
||||
((void (*)(GstObject * object,
|
||||
gpointer self)) *GST_DEBUG_FUNCPTR (gst_bin_restore_thyself));
|
||||
#endif
|
||||
|
||||
gstelement_class->change_state =
|
||||
|
@ -3738,7 +3752,7 @@ gst_bin_iterate_all_by_interface (GstBin * bin, GType iface)
|
|||
return result;
|
||||
}
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
static xmlNodePtr
|
||||
gst_bin_save_thyself (GstObject * object, xmlNodePtr parent)
|
||||
{
|
||||
|
|
|
@ -73,6 +73,13 @@
|
|||
#include <gst/gst.h>
|
||||
#include <gobject/gvaluecollector.h>
|
||||
|
||||
#ifdef GST_DISABLE_DEPRECATED
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
xmlNodePtr gst_caps_save_thyself (const GstCaps * caps, xmlNodePtr parent);
|
||||
GstCaps *gst_caps_load_thyself (xmlNodePtr parent);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define DEBUG_REFCOUNT
|
||||
|
||||
#define CAPS_POISON(caps) G_STMT_START{ \
|
||||
|
@ -1961,7 +1968,7 @@ gst_caps_do_simplify (GstCaps * caps)
|
|||
|
||||
/* persistence */
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
/**
|
||||
* gst_caps_save_thyself:
|
||||
* @caps: a #GstCaps structure
|
||||
|
|
|
@ -244,7 +244,7 @@ GstCaps * gst_caps_union (const GstCaps *caps1,
|
|||
GstCaps * gst_caps_normalize (const GstCaps *caps);
|
||||
gboolean gst_caps_do_simplify (GstCaps *caps);
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_DISABLE_DEPRECATED)
|
||||
xmlNodePtr gst_caps_save_thyself (const GstCaps *caps,
|
||||
xmlNodePtr parent);
|
||||
GstCaps * gst_caps_load_thyself (xmlNodePtr parent);
|
||||
|
|
|
@ -109,6 +109,15 @@ enum
|
|||
/* FILL ME */
|
||||
};
|
||||
|
||||
#ifdef GST_DISABLE_DEPRECATED
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
xmlNodePtr gst_object_save_thyself (const GstObject * object,
|
||||
xmlNodePtr parent);
|
||||
GstObject *gst_object_load_thyself (xmlNodePtr parent);
|
||||
void gst_pad_load_and_link (xmlNodePtr self, GstObject * parent);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void gst_element_class_init (GstElementClass * klass);
|
||||
static void gst_element_init (GstElement * element);
|
||||
static void gst_element_base_class_init (gpointer g_class);
|
||||
|
@ -134,7 +143,7 @@ static GstPadTemplate
|
|||
* gst_element_class_get_request_pad_template (GstElementClass *
|
||||
element_class, const gchar * name);
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
static xmlNodePtr gst_element_save_thyself (GstObject * object,
|
||||
xmlNodePtr parent);
|
||||
static void gst_element_restore_thyself (GstObject * parent, xmlNodePtr self);
|
||||
|
@ -223,10 +232,13 @@ gst_element_class_init (GstElementClass * klass)
|
|||
gobject_class->dispose = gst_element_dispose;
|
||||
gobject_class->finalize = gst_element_finalize;
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
gstobject_class->save_thyself = GST_DEBUG_FUNCPTR (gst_element_save_thyself);
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
gstobject_class->save_thyself =
|
||||
((gpointer (*)(GstObject * object,
|
||||
gpointer self)) * GST_DEBUG_FUNCPTR (gst_element_save_thyself));
|
||||
gstobject_class->restore_thyself =
|
||||
GST_DEBUG_FUNCPTR (gst_element_restore_thyself);
|
||||
((void (*)(GstObject * object,
|
||||
gpointer self)) *GST_DEBUG_FUNCPTR (gst_element_restore_thyself));
|
||||
#endif
|
||||
|
||||
klass->change_state = GST_DEBUG_FUNCPTR (gst_element_change_state_func);
|
||||
|
@ -2905,7 +2917,7 @@ gst_element_finalize (GObject * object)
|
|||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
/**
|
||||
* gst_element_save_thyself:
|
||||
* @element: a #GstElement to save.
|
||||
|
|
|
@ -77,7 +77,7 @@ static GstPad *gst_proxy_pad_get_target (GstPad * pad);
|
|||
static void gst_proxy_pad_dispose (GObject * object);
|
||||
static void gst_proxy_pad_finalize (GObject * object);
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
static xmlNodePtr gst_proxy_pad_save_thyself (GstObject * object,
|
||||
xmlNodePtr parent);
|
||||
#endif
|
||||
|
@ -381,12 +381,14 @@ gst_proxy_pad_class_init (GstProxyPadClass * klass)
|
|||
gobject_class->dispose = gst_proxy_pad_dispose;
|
||||
gobject_class->finalize = gst_proxy_pad_finalize;
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
{
|
||||
GstObjectClass *gstobject_class = (GstObjectClass *) klass;
|
||||
|
||||
gstobject_class->save_thyself =
|
||||
GST_DEBUG_FUNCPTR (gst_proxy_pad_save_thyself);
|
||||
((gpointer (*)(GstObject * object,
|
||||
gpointer self)) *
|
||||
GST_DEBUG_FUNCPTR (gst_proxy_pad_save_thyself));
|
||||
}
|
||||
#endif
|
||||
/* Register common function pointer descriptions */
|
||||
|
@ -457,7 +459,7 @@ gst_proxy_pad_init (GstProxyPad * ppad)
|
|||
gst_pad_set_unlink_function (pad, gst_proxy_pad_do_unlink);
|
||||
}
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
/**
|
||||
* gst_proxy_pad_save_thyself:
|
||||
* @pad: a ghost #GstPad to save.
|
||||
|
|
|
@ -104,7 +104,7 @@ enum
|
|||
{
|
||||
PARENT_SET,
|
||||
PARENT_UNSET,
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
OBJECT_SAVED,
|
||||
#endif
|
||||
DEEP_NOTIFY,
|
||||
|
@ -134,7 +134,7 @@ typedef struct _GstSignalObjectClass GstSignalObjectClass;
|
|||
|
||||
static GType gst_signal_object_get_type (void);
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
static guint gst_signal_object_signals[SO_LAST_SIGNAL] = { 0 };
|
||||
#endif
|
||||
|
||||
|
@ -150,9 +150,21 @@ static void gst_object_finalize (GObject * object);
|
|||
|
||||
static gboolean gst_object_set_name_default (GstObject * object);
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#ifdef GST_DISABLE_DEPRECATED
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
#undef GstXmlNodePtr
|
||||
#define GstXmlNodePtr xmlNodePtr
|
||||
GstXmlNodePtr gst_object_save_thyself (GstObject * object,
|
||||
GstXmlNodePtr parent);
|
||||
void gst_object_restore_thyself (GstObject * object, GstXmlNodePtr parent);
|
||||
void gst_class_signal_emit_by_name (GstObject * object, const gchar * name,
|
||||
GstXmlNodePtr self);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
static void gst_object_real_restore_thyself (GstObject * object,
|
||||
xmlNodePtr self);
|
||||
GstXmlNodePtr self);
|
||||
#endif
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
@ -203,7 +215,7 @@ gst_object_class_init (GstObjectClass * klass)
|
|||
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstObjectClass, parent_unset), NULL,
|
||||
NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GST_TYPE_OBJECT);
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
/**
|
||||
* GstObject::object-saved:
|
||||
* @gstobject: a #GstObject
|
||||
|
@ -220,7 +232,9 @@ gst_object_class_init (GstObjectClass * klass)
|
|||
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstObjectClass, object_saved), NULL,
|
||||
NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER);
|
||||
|
||||
klass->restore_thyself = gst_object_real_restore_thyself;
|
||||
klass->restore_thyself =
|
||||
((void (*)(GstObject * object,
|
||||
gpointer self)) *gst_object_real_restore_thyself);
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -976,7 +990,7 @@ gst_object_check_uniqueness (GList * list, const gchar * name)
|
|||
}
|
||||
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
/**
|
||||
* gst_object_save_thyself:
|
||||
* @object: a #GstObject to save
|
||||
|
@ -986,8 +1000,8 @@ gst_object_check_uniqueness (GList * list, const gchar * name)
|
|||
*
|
||||
* Returns: the new xmlNodePtr with the saved object
|
||||
*/
|
||||
xmlNodePtr
|
||||
gst_object_save_thyself (GstObject * object, xmlNodePtr parent)
|
||||
GstXmlNodePtr
|
||||
gst_object_save_thyself (GstObject * object, GstXmlNodePtr parent)
|
||||
{
|
||||
GstObjectClass *oclass;
|
||||
|
||||
|
@ -1012,7 +1026,7 @@ gst_object_save_thyself (GstObject * object, xmlNodePtr parent)
|
|||
* Restores @object with the data from the parent XML node.
|
||||
*/
|
||||
void
|
||||
gst_object_restore_thyself (GstObject * object, xmlNodePtr self)
|
||||
gst_object_restore_thyself (GstObject * object, GstXmlNodePtr self)
|
||||
{
|
||||
GstObjectClass *oclass;
|
||||
|
||||
|
@ -1026,7 +1040,7 @@ gst_object_restore_thyself (GstObject * object, xmlNodePtr self)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_object_real_restore_thyself (GstObject * object, xmlNodePtr self)
|
||||
gst_object_real_restore_thyself (GstObject * object, GstXmlNodePtr self)
|
||||
{
|
||||
g_return_if_fail (GST_IS_OBJECT (object));
|
||||
g_return_if_fail (self != NULL);
|
||||
|
@ -1166,9 +1180,9 @@ struct _GstSignalObjectClass
|
|||
GObjectClass parent_class;
|
||||
|
||||
/* signals */
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
void (*object_loaded) (GstSignalObject * object, GstObject * new,
|
||||
xmlNodePtr self);
|
||||
GstXmlNodePtr self);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -1179,7 +1193,7 @@ gst_signal_object_class_init (GstSignalObjectClass * klass)
|
|||
{
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
gst_signal_object_signals[SO_OBJECT_LOADED] =
|
||||
g_signal_new ("object-loaded", G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstSignalObjectClass, object_loaded),
|
||||
|
@ -1214,7 +1228,7 @@ gst_class_signal_connect (GstObjectClass * klass,
|
|||
func_data);
|
||||
}
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
/**
|
||||
* gst_class_signal_emit_by_name:
|
||||
* @object: a #GstObject that emits the signal
|
||||
|
@ -1225,7 +1239,7 @@ gst_class_signal_connect (GstObjectClass * klass,
|
|||
*/
|
||||
void
|
||||
gst_class_signal_emit_by_name (GstObject * object,
|
||||
const gchar * name, xmlNodePtr self)
|
||||
const gchar * name, GstXmlNodePtr self)
|
||||
{
|
||||
GstObjectClass *oclass;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ G_BEGIN_DECLS
|
|||
|
||||
/* make sure we don't change the object size but still make it compile
|
||||
* without libxml */
|
||||
#ifdef GST_DISABLE_LOADSAVE
|
||||
#if defined(GST_DISABLE_LOADSAVE) || defined(GST_DISABLE_DEPRECATED)
|
||||
#define GstXmlNodePtr gpointer
|
||||
#else
|
||||
#define GstXmlNodePtr xmlNodePtr
|
||||
|
@ -267,11 +267,13 @@ struct _GstObjectClass {
|
|||
/* FIXME-0.11: remove, and pass NULL in g_signal_new(), we never used them */
|
||||
void (*parent_set) (GstObject * object, GstObject * parent);
|
||||
void (*parent_unset) (GstObject * object, GstObject * parent);
|
||||
/* FIXME 0.11: Remove this, it's deprecated */
|
||||
void (*object_saved) (GstObject * object, GstXmlNodePtr parent);
|
||||
void (*deep_notify) (GstObject * object, GstObject * orig, GParamSpec * pspec);
|
||||
|
||||
/*< public >*/
|
||||
/* virtual methods for subclasses */
|
||||
/* FIXME 0.11: Remove this, it's deprecated */
|
||||
GstXmlNodePtr (*save_thyself) (GstObject * object, GstXmlNodePtr parent);
|
||||
void (*restore_thyself) (GstObject * object, GstXmlNodePtr self);
|
||||
|
||||
|
@ -316,6 +318,7 @@ gchar * gst_object_get_path_string (GstObject *object);
|
|||
gboolean gst_object_check_uniqueness (GList *list, const gchar *name);
|
||||
|
||||
/* load/save */
|
||||
#ifndef GST_DISABLE_DEPRECATED
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
GstXmlNodePtr gst_object_save_thyself (GstObject *object, GstXmlNodePtr parent);
|
||||
void gst_object_restore_thyself (GstObject *object, GstXmlNodePtr self);
|
||||
|
@ -325,6 +328,7 @@ void gst_object_restore_thyself (GstObject *object, GstXmlNodePtr sel
|
|||
#pragma GCC poison gst_object_restore_thyself
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* class signal stuff */
|
||||
guint gst_class_signal_connect (GstObjectClass *klass,
|
||||
|
@ -332,6 +336,7 @@ guint gst_class_signal_connect (GstObjectClass *klass,
|
|||
gpointer func,
|
||||
gpointer func_data);
|
||||
|
||||
#ifndef GST_DISABLE_DEPRECATED
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
void gst_class_signal_emit_by_name (GstObject * object,
|
||||
const gchar * name,
|
||||
|
@ -341,7 +346,7 @@ void gst_class_signal_emit_by_name (GstObject * object,
|
|||
#pragma GCC poison gst_class_signal_emit_by_name
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
11
gst/gstpad.c
11
gst/gstpad.c
|
@ -118,8 +118,9 @@ static void gst_pad_set_pad_template (GstPad * pad, GstPadTemplate * templ);
|
|||
static gboolean gst_pad_activate_default (GstPad * pad);
|
||||
static gboolean gst_pad_acceptcaps_default (GstPad * pad, GstCaps * caps);
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
static xmlNodePtr gst_pad_save_thyself (GstObject * object, xmlNodePtr parent);
|
||||
void gst_pad_load_and_link (xmlNodePtr self, GstObject * parent);
|
||||
#endif
|
||||
|
||||
/* Some deprecated stuff that we need inside here for
|
||||
|
@ -322,8 +323,10 @@ gst_pad_class_init (GstPadClass * klass)
|
|||
"The GstPadTemplate of this pad", GST_TYPE_PAD_TEMPLATE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
gstobject_class->save_thyself = GST_DEBUG_FUNCPTR (gst_pad_save_thyself);
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
gstobject_class->save_thyself =
|
||||
((gpointer (*)(GstObject * object,
|
||||
gpointer self)) * GST_DEBUG_FUNCPTR (gst_pad_save_thyself));
|
||||
#endif
|
||||
gstobject_class->path_string_separator = ".";
|
||||
|
||||
|
@ -3753,7 +3756,7 @@ gst_pad_query_default (GstPad * pad, GstQuery * query)
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
/* FIXME: why isn't this on a GstElement ? */
|
||||
/**
|
||||
* gst_pad_load_and_link:
|
||||
|
|
|
@ -1001,7 +1001,7 @@ gboolean gst_pad_query_default (GstPad *pad, GstQuery *query);
|
|||
gboolean gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch,
|
||||
gpointer data);
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_DISABLE_DEPRECATED)
|
||||
void gst_pad_load_and_link (xmlNodePtr self, GstObject *parent);
|
||||
#endif
|
||||
|
||||
|
|
64
gst/gstxml.c
64
gst/gstxml.c
|
@ -32,6 +32,10 @@
|
|||
*
|
||||
* #GstElement implementations need to override the #GstObjectClass.save_thyself()
|
||||
* and #GstObjectClass.restore_thyself() virtual functions of #GstObject.
|
||||
*
|
||||
* Deprecated: This feature is deprecated pipeline serialization to XML is
|
||||
* broken for all but the most simple pipelines. It will most likely be
|
||||
* removed in future. Don't use it.
|
||||
*/
|
||||
|
||||
#include "gst_private.h"
|
||||
|
@ -41,6 +45,64 @@
|
|||
#include "gstinfo.h"
|
||||
#include "gstbin.h"
|
||||
|
||||
#ifdef GST_DISABLE_DEPRECATED
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
xmlNodePtr gst_object_save_thyself (const GstObject * object,
|
||||
xmlNodePtr parent);
|
||||
GstObject *gst_object_load_thyself (xmlNodePtr parent);
|
||||
void gst_object_restore_thyself (GstObject * object, GstXmlNodePtr self);
|
||||
|
||||
#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))
|
||||
|
||||
typedef struct _GstXML GstXML;
|
||||
typedef struct _GstXMLClass GstXMLClass;
|
||||
|
||||
struct _GstXML
|
||||
{
|
||||
GstObject object;
|
||||
|
||||
/*< public > */
|
||||
GList *topelements;
|
||||
|
||||
xmlNsPtr ns;
|
||||
|
||||
/*< private > */
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstXMLClass
|
||||
{
|
||||
GstObjectClass parent_class;
|
||||
|
||||
/* signal callbacks */
|
||||
void (*object_loaded) (GstXML * xml, GstObject * object, xmlNodePtr self);
|
||||
void (*object_saved) (GstXML * xml, GstObject * object, xmlNodePtr self);
|
||||
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
GType gst_xml_get_type (void);
|
||||
xmlDocPtr gst_xml_write (GstElement * element);
|
||||
gint gst_xml_write_file (GstElement * element, FILE * out);
|
||||
GstXML *gst_xml_new (void);
|
||||
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);
|
||||
GstElement *gst_xml_get_element (GstXML * xml, const guchar * name);
|
||||
GList *gst_xml_get_topelements (GstXML * xml);
|
||||
GstElement *gst_xml_make_element (xmlNodePtr cur, GstObject * parent);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
|
||||
enum
|
||||
{
|
||||
OBJECT_LOADED,
|
||||
|
@ -461,3 +523,5 @@ gst_xml_make_element (xmlNodePtr cur, GstObject * parent)
|
|||
|
||||
return element;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include <gst/gstconfig.h>
|
||||
|
||||
#ifndef GST_DISABLE_DEPRECATED
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
|
||||
#include <gst/gstelement.h>
|
||||
|
@ -107,4 +108,6 @@ G_END_DECLS
|
|||
|
||||
#endif /* GST_DISABLE_LOADSAVE */
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __GST_XML_H__ */
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
if GST_DISABLE_LOADSAVE
|
||||
GST_LOADSAVE_DIRS =
|
||||
else
|
||||
GST_LOADSAVE_DIRS = xml typefind
|
||||
endif
|
||||
|
||||
if GST_DISABLE_PARSE
|
||||
GST_PARSE_DIRS =
|
||||
else
|
||||
|
@ -24,7 +18,8 @@ always_dirs = \
|
|||
metadata \
|
||||
queue \
|
||||
stepping \
|
||||
streams
|
||||
streams \
|
||||
typefind
|
||||
|
||||
#appreader
|
||||
#cutter
|
||||
|
@ -45,9 +40,8 @@ always_dirs = \
|
|||
SUBDIRS = \
|
||||
$(always_dirs) \
|
||||
$(ADAPTER_TEST_DIR) \
|
||||
$(GST_PARSE_DIRS) \
|
||||
$(GST_LOADSAVE_DIRS)
|
||||
$(GST_PARSE_DIRS)
|
||||
|
||||
DIST_SUBDIRS = $(always_dirs) adapter xml typefind launch
|
||||
DIST_SUBDIRS = $(always_dirs) adapter launch
|
||||
|
||||
include $(top_srcdir)/common/parallel-subdirs.mak
|
||||
|
|
|
@ -4,13 +4,6 @@
|
|||
GNOME =
|
||||
# endif
|
||||
|
||||
if GST_DISABLE_LOADSAVE
|
||||
GST_LOADSAVE_SRC =
|
||||
else
|
||||
GST_LOADSAVE_SRC = xml-mp3
|
||||
endif
|
||||
|
||||
|
||||
# gnome_LDADD = $(GST_OBJ_LIBS) $(LIBGNOMEUI_LIBS)
|
||||
# gnome_CFLAGS = $(GST_OBJ_CFLAGS) $(LIBGNOMEUI_CFLAGS)
|
||||
|
||||
|
|
|
@ -38,13 +38,13 @@ bin_SCRIPTS = gst-feedback-@GST_MAJORMINOR@
|
|||
# make sure each versioned tool has the right source file and flags
|
||||
if !GST_DISABLE_LOADSAVE
|
||||
gst_xmllaunch_@GST_MAJORMINOR@_SOURCES = gst-launch.c tools.h
|
||||
gst_xmllaunch_@GST_MAJORMINOR@_CFLAGS = $(GST_OBJ_CFLAGS)
|
||||
gst_xmllaunch_@GST_MAJORMINOR@_CFLAGS = $(GST_OBJ_CFLAGS) -UGST_DISABLE_DEPRECATED
|
||||
gst_xmllaunch_@GST_MAJORMINOR@_LDADD = $(GST_OBJ_LIBS)
|
||||
endif
|
||||
|
||||
if !GST_DISABLE_PARSE
|
||||
gst_launch_@GST_MAJORMINOR@_SOURCES = gst-launch.c tools.h
|
||||
gst_launch_@GST_MAJORMINOR@_CFLAGS = $(GST_OBJ_CFLAGS)
|
||||
gst_launch_@GST_MAJORMINOR@_CFLAGS = $(GST_OBJ_CFLAGS) -UGST_DISABLE_DEPRECATED
|
||||
gst_launch_@GST_MAJORMINOR@_LDADD = $(GST_OBJ_LIBS)
|
||||
endif
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ static gboolean waiting_eos = FALSE;
|
|||
/* convenience macro so we don't have to litter the code with if(!quiet) */
|
||||
#define PRINT if(!quiet)g_print
|
||||
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
static GstElement *
|
||||
xmllaunch_parse_cmdline (const gchar ** argv)
|
||||
{
|
||||
|
@ -703,7 +703,7 @@ main (int argc, char *argv[])
|
|||
N_("Output messages"), NULL},
|
||||
{"exclude", 'X', 0, G_OPTION_ARG_NONE, &exclude_args,
|
||||
N_("Do not output status information of TYPE"), N_("TYPE1,TYPE2,...")},
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
{"output", 'o', 0, G_OPTION_ARG_STRING, &savefile,
|
||||
N_("Save xml representation of pipeline to FILE and exit"), N_("FILE")},
|
||||
#endif
|
||||
|
@ -777,7 +777,7 @@ main (int argc, char *argv[])
|
|||
/* make a null-terminated version of argv */
|
||||
argvn = g_new0 (char *, argc);
|
||||
memcpy (argvn, argv + 1, sizeof (char *) * (argc - 1));
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
if (strstr (argv[0], "gst-xmllaunch")) {
|
||||
/* FIXME 0.11: remove xmllaunch entirely */
|
||||
g_warning ("gst-xmllaunch is deprecated and broken for all but the most "
|
||||
|
@ -814,7 +814,7 @@ main (int argc, char *argv[])
|
|||
g_signal_connect (pipeline, "deep-notify",
|
||||
G_CALLBACK (gst_object_default_deep_notify), exclude_list);
|
||||
}
|
||||
#ifndef GST_DISABLE_LOADSAVE
|
||||
#if !defined(GST_DISABLE_LOADSAVE) && !defined(GST_REMOVE_DEPRECATED)
|
||||
if (savefile) {
|
||||
g_warning ("Pipeline serialization to XML is deprecated and broken for "
|
||||
"all but the most simple pipelines. It will most likely be removed "
|
||||
|
|
Loading…
Reference in a new issue