diff options
author | Dudemanguy <random342@airmail.cc> | 2023-09-29 16:07:54 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-10-10 19:10:55 +0000 |
commit | fcebee9080a113f3248d218e451345db3f965b47 (patch) | |
tree | 6bec3e71f7d50b7b91e0fbec189ae9265067f1e4 /libmpv | |
parent | 5d44cf93df47046c779fc4da68a09812a2ce4004 (diff) | |
download | mpv-fcebee9080a113f3248d218e451345db3f965b47.tar.bz2 mpv-fcebee9080a113f3248d218e451345db3f965b47.tar.xz |
libmpv: add mpv_time_ns()
9606c3fca9d568dc43711017dcb35a408c0d2883 added mp_time_ns(). Since we
apparently expose the mp_time_us() to clients already, there's no reason
to not also expose the new nanosecond one.
Diffstat (limited to 'libmpv')
-rw-r--r-- | libmpv/client.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libmpv/client.h b/libmpv/client.h index 4199744ba7..0a548a58eb 100644 --- a/libmpv/client.h +++ b/libmpv/client.h @@ -248,7 +248,7 @@ extern "C" { * relational operators (<, >, <=, >=). */ #define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL) -#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(2, 1) +#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(2, 2) /** * The API user is allowed to "#define MPV_ENABLE_DEPRECATED 0" before @@ -602,7 +602,7 @@ MPV_EXPORT mpv_handle *mpv_create_weak_client(mpv_handle *ctx, const char *name) MPV_EXPORT int mpv_load_config_file(mpv_handle *ctx, const char *filename); /** - * Return the internal time in microseconds. This has an arbitrary start offset, + * Return the internal time in nanoseconds. This has an arbitrary start offset, * but will never wrap or go backwards. * * Note that this is always the real time, and doesn't necessarily have to do @@ -615,6 +615,11 @@ MPV_EXPORT int mpv_load_config_file(mpv_handle *ctx, const char *filename); * * Safe to be called from mpv render API threads. */ +MPV_EXPORT int64_t mpv_get_time_ns(mpv_handle *ctx); + +/** + * Same as mpv_get_time_ns but in microseconds. + */ MPV_EXPORT int64_t mpv_get_time_us(mpv_handle *ctx); /** @@ -1951,6 +1956,8 @@ MPV_DEFINE_SYM_PTR(mpv_create_weak_client) #define mpv_create_weak_client pfn_mpv_create_weak_client MPV_DEFINE_SYM_PTR(mpv_load_config_file) #define mpv_load_config_file pfn_mpv_load_config_file +MPV_DEFINE_SYM_PTR(mpv_get_time_ns) +#define mpv_get_time_ns pfn_mpv_get_time_ns MPV_DEFINE_SYM_PTR(mpv_get_time_us) #define mpv_get_time_us pfn_mpv_get_time_us MPV_DEFINE_SYM_PTR(mpv_free_node_contents) |