From 3d5dbfb457d18445a4dbdaa9fcee639ff36f1e5b Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Sat, 11 Aug 2018 10:12:27 -0400 Subject: [PATCH] gst: Add a GParamSpecFlag to force gst-inspect to use pspec default value Instead of the object value, this should be used every time a random value will be returned by g_object_get This is also useful to make the values returned by inspecting element stable accross runs. --- gst/gstobject.c | 6 ++++-- gst/gstparamspecs.h | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gst/gstobject.c b/gst/gstobject.c index 3aa20c4..4a4dc42 100644 --- a/gst/gstobject.c +++ b/gst/gstobject.c @@ -153,7 +153,8 @@ gst_object_class_init (GstObjectClass * klass) properties[PROP_NAME] = g_param_spec_string ("name", "Name", "The name of the object", NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS | + GST_PARAM_DOC_SHOW_DEFAULT); /** * GstObject:parent: @@ -166,7 +167,8 @@ gst_object_class_init (GstObjectClass * klass) */ properties[PROP_PARENT] = g_param_spec_object ("parent", "Parent", "The parent of the object", - GST_TYPE_OBJECT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + GST_TYPE_OBJECT, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_DOC_SHOW_DEFAULT); g_object_class_install_properties (gobject_class, PROP_LAST, properties); diff --git a/gst/gstparamspecs.h b/gst/gstparamspecs.h index 4f5d8e3..39c60ed 100644 --- a/gst/gstparamspecs.h +++ b/gst/gstparamspecs.h @@ -61,6 +61,15 @@ G_BEGIN_DECLS #define GST_PARAM_MUTABLE_PLAYING (1 << (G_PARAM_USER_SHIFT + 4)) /** + * GST_PARAM_DOC_SHOW_DEFAULT: (value 8192) + * + * Use this flag on GObject properties of GstObject to indicate that + * during `gst-inspect` and friends, the default value should be used + * as default instead of the current value. + */ +#define GST_PARAM_DOC_SHOW_DEFAULT (1 << (G_PARAM_USER_SHIFT + 5)) + +/** * GST_PARAM_USER_SHIFT: (value 65536) * * Bits based on GST_PARAM_USER_SHIFT can be used by 3rd party applications. -- 2.7.4