mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-18 04:05:34 +00:00
preset: add gst_preset_is_editable()
Add a function to check if the preset iface implementation is editable and document this from the implementers perspective. API: gst_preset_is_editable()
This commit is contained in:
parent
e1fd8d2964
commit
a35094f1b3
2 changed files with 22 additions and 0 deletions
|
@ -34,6 +34,9 @@
|
||||||
* native preset format of those wrapped plugins.
|
* native preset format of those wrapped plugins.
|
||||||
* One method that is useful to be overridden is gst_preset_get_property_names().
|
* One method that is useful to be overridden is gst_preset_get_property_names().
|
||||||
* With that one can control which properties are saved and in which order.
|
* With that one can control which properties are saved and in which order.
|
||||||
|
* When implementing support for read-only presets, one should set the vmethods
|
||||||
|
* for gst_preset_save_preset() and gst_preset_delete_preset() to %NULL.
|
||||||
|
* Applications can use gst_preset_is_editable() to check for that.
|
||||||
*
|
*
|
||||||
* The default implementation supports presets located in a system directory,
|
* The default implementation supports presets located in a system directory,
|
||||||
* application specific directory and in the users home directory. When getting
|
* application specific directory and in the users home directory. When getting
|
||||||
|
@ -1148,6 +1151,24 @@ gst_preset_get_app_dir (void)
|
||||||
return preset_app_dir;
|
return preset_app_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_preset_is_editable:
|
||||||
|
* @preset: a #GObject that implements #GstPreset
|
||||||
|
*
|
||||||
|
* Check if one can add new presets, change existing ones and remove presets.
|
||||||
|
*
|
||||||
|
* Returns: %TRUE if presets are editable or %FALSE if they are static
|
||||||
|
*
|
||||||
|
* Since: 1.6
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
gst_preset_is_editable (GstPreset * preset)
|
||||||
|
{
|
||||||
|
GstPresetInterface *iface = GST_PRESET_GET_INTERFACE (preset);
|
||||||
|
|
||||||
|
return iface->save_preset && iface->delete_preset;
|
||||||
|
}
|
||||||
|
|
||||||
/* class internals */
|
/* class internals */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -97,6 +97,7 @@ gboolean gst_preset_get_meta (GstPreset *preset, const gchar *name
|
||||||
gboolean gst_preset_set_app_dir (const gchar *app_dir);
|
gboolean gst_preset_set_app_dir (const gchar *app_dir);
|
||||||
const gchar *gst_preset_get_app_dir (void);
|
const gchar *gst_preset_get_app_dir (void);
|
||||||
|
|
||||||
|
gboolean gst_preset_is_editable (GstPreset *preset);
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GST_PRESET_H__ */
|
#endif /* __GST_PRESET_H__ */
|
||||||
|
|
Loading…
Reference in a new issue