mirror of https://github.com/mpv-player/mpv
libmpv: add mpv_del_property() convenience function
This commit is contained in:
parent
04241ab731
commit
2cfaa820e5
|
@ -33,6 +33,7 @@ API changes
|
||||||
::
|
::
|
||||||
|
|
||||||
--- mpv 0.35.0 ---
|
--- mpv 0.35.0 ---
|
||||||
|
2.1 - add mpv_del_property()
|
||||||
2.0 - remove headers/functions of the obsolete opengl_cb API
|
2.0 - remove headers/functions of the obsolete opengl_cb API
|
||||||
- remove mpv_opengl_init_params.extra_exts field
|
- remove mpv_opengl_init_params.extra_exts field
|
||||||
- remove deprecated mpv_detach_destroy. Use mpv_destroy instead.
|
- remove deprecated mpv_detach_destroy. Use mpv_destroy instead.
|
||||||
|
|
|
@ -240,7 +240,7 @@ extern "C" {
|
||||||
* relational operators (<, >, <=, >=).
|
* relational operators (<, >, <=, >=).
|
||||||
*/
|
*/
|
||||||
#define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL)
|
#define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL)
|
||||||
#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(2, 0)
|
#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(2, 1)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The API user is allowed to "#define MPV_ENABLE_DEPRECATED 0" before
|
* The API user is allowed to "#define MPV_ENABLE_DEPRECATED 0" before
|
||||||
|
@ -1068,6 +1068,16 @@ MPV_EXPORT int mpv_set_property(mpv_handle *ctx, const char *name, mpv_format fo
|
||||||
*/
|
*/
|
||||||
MPV_EXPORT int mpv_set_property_string(mpv_handle *ctx, const char *name, const char *data);
|
MPV_EXPORT int mpv_set_property_string(mpv_handle *ctx, const char *name, const char *data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convenience function to delete a property.
|
||||||
|
*
|
||||||
|
* This is equivalent to running the command "del [name]".
|
||||||
|
*
|
||||||
|
* @param name The property name. See input.rst for a list of properties.
|
||||||
|
* @return error code
|
||||||
|
*/
|
||||||
|
MPV_EXPORT int mpv_del_property(mpv_handle *ctx, const char *name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a property asynchronously. You will receive the result of the operation
|
* Set a property asynchronously. You will receive the result of the operation
|
||||||
* as MPV_EVENT_SET_PROPERTY_REPLY event. The mpv_event.error field will contain
|
* as MPV_EVENT_SET_PROPERTY_REPLY event. The mpv_event.error field will contain
|
||||||
|
|
|
@ -1337,6 +1337,12 @@ int mpv_set_property(mpv_handle *ctx, const char *name, mpv_format format,
|
||||||
return req.status;
|
return req.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int mpv_del_property(mpv_handle *ctx, const char *name)
|
||||||
|
{
|
||||||
|
const char* args[] = { "del", name, NULL };
|
||||||
|
return mpv_command(ctx, args);
|
||||||
|
}
|
||||||
|
|
||||||
int mpv_set_property_string(mpv_handle *ctx, const char *name, const char *data)
|
int mpv_set_property_string(mpv_handle *ctx, const char *name, const char *data)
|
||||||
{
|
{
|
||||||
return mpv_set_property(ctx, name, MPV_FORMAT_STRING, &data);
|
return mpv_set_property(ctx, name, MPV_FORMAT_STRING, &data);
|
||||||
|
|
Loading…
Reference in New Issue