diff options
Diffstat (limited to 'libmpv')
-rw-r--r-- | libmpv/client.h | 2 | ||||
-rw-r--r-- | libmpv/stream_cb.h | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/libmpv/client.h b/libmpv/client.h index 670f45c626..8ee7d87f17 100644 --- a/libmpv/client.h +++ b/libmpv/client.h @@ -223,7 +223,7 @@ extern "C" { * relational operators (<, >, <=, >=). */ #define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL) -#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 105) +#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 106) /** * The API user is allowed to "#define MPV_ENABLE_DEPRECATED 0" before diff --git a/libmpv/stream_cb.h b/libmpv/stream_cb.h index 45e81b8e38..63593d7228 100644 --- a/libmpv/stream_cb.h +++ b/libmpv/stream_cb.h @@ -148,6 +148,22 @@ typedef int64_t (*mpv_stream_cb_size_fn)(void *cookie); typedef void (*mpv_stream_cb_close_fn)(void *cookie); /** + * Cancel callback used to implement a custom stream. + * + * This callback is used to interrupt any current or future read and seek + * operations. It will be called from a separate thread than the demux + * thread, and should not block. + * + * This callback can be NULL. + * + * Available since API 1.106. + * + * @param cookie opaque cookie identifying the stream, + * returned from mpv_stream_cb_open_fn + */ +typedef void (*mpv_stream_cb_cancel_fn)(void *cookie); + +/** * See mpv_stream_cb_open_ro_fn callback. */ typedef struct mpv_stream_cb_info { @@ -170,6 +186,7 @@ typedef struct mpv_stream_cb_info { mpv_stream_cb_seek_fn seek_fn; mpv_stream_cb_size_fn size_fn; mpv_stream_cb_close_fn close_fn; + mpv_stream_cb_cancel_fn cancel_fn; /* since API 1.106 */ } mpv_stream_cb_info; /** |