mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-14 05:12:09 +00:00
paramspecs: Add a GParamSpecFlag to indicate the property might not always exists
Add new flag for users to notice that the property is not guaranteed to exist depending on environment. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/283>
This commit is contained in:
parent
58859c8ee9
commit
1769187328
2 changed files with 17 additions and 1 deletions
|
@ -69,6 +69,16 @@ G_BEGIN_DECLS
|
|||
*/
|
||||
#define GST_PARAM_DOC_SHOW_DEFAULT (1 << (G_PARAM_USER_SHIFT + 5))
|
||||
|
||||
/**
|
||||
* GST_PARAM_CONDITIONALLY_AVAILABLE: (value 16384)
|
||||
*
|
||||
* Use this flag on GObject properties of GstObject to indicate that
|
||||
* they might not be available depending on environment such as OS, device, etc,
|
||||
* so such properties will be installed conditionally only if the GstObject is
|
||||
* able to support it.
|
||||
*/
|
||||
#define GST_PARAM_CONDITIONALLY_AVAILABLE (1 << (G_PARAM_USER_SHIFT + 6))
|
||||
|
||||
/**
|
||||
* GST_PARAM_USER_SHIFT: (value 65536)
|
||||
*
|
||||
|
|
|
@ -340,7 +340,8 @@ flags_to_string (GFlagsValue * vals, guint flags)
|
|||
G_PARAM_LAX_VALIDATION | G_PARAM_STATIC_STRINGS | \
|
||||
G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_DEPRECATED | \
|
||||
GST_PARAM_CONTROLLABLE | GST_PARAM_MUTABLE_PLAYING | \
|
||||
GST_PARAM_MUTABLE_PAUSED | GST_PARAM_MUTABLE_READY)
|
||||
GST_PARAM_MUTABLE_PAUSED | GST_PARAM_MUTABLE_READY | \
|
||||
GST_PARAM_CONDITIONALLY_AVAILABLE)
|
||||
|
||||
static int
|
||||
sort_gparamspecs (GParamSpec ** a, GParamSpec ** b)
|
||||
|
@ -415,6 +416,11 @@ print_object_properties_info (GObject * obj, GObjectClass * obj_class,
|
|||
RESET_COLOR);
|
||||
first_flag = FALSE;
|
||||
}
|
||||
if (param->flags & GST_PARAM_CONDITIONALLY_AVAILABLE) {
|
||||
g_print (", %s%s%s", PROP_ATTR_VALUE_COLOR, _("conditionally available"),
|
||||
RESET_COLOR);
|
||||
first_flag = FALSE;
|
||||
}
|
||||
if (param->flags & GST_PARAM_MUTABLE_PLAYING) {
|
||||
g_print (", %s%s%s", PROP_ATTR_VALUE_COLOR,
|
||||
_("changeable in NULL, READY, PAUSED or PLAYING state"), RESET_COLOR);
|
||||
|
|
Loading…
Reference in a new issue