mpv.stream_cb

Undocumented in source.

Members

Aliases

mpv_stream_cb_cancel_fn
alias mpv_stream_cb_cancel_fn = void function(void* cookie)

Cancel callback used to implement a custom stream.

mpv_stream_cb_close_fn
alias mpv_stream_cb_close_fn = void function(void* cookie)

Close callback used to implement a custom stream.

mpv_stream_cb_open_ro_fn
alias mpv_stream_cb_open_ro_fn = int function(void* user_data, char* uri, mpv_stream_cb_info* info)

Open callback used to implement a custom read-only (ro) stream. The user must set the callback fields in the passed info struct. The cookie field also can be set to store state associated to the stream instance.

mpv_stream_cb_read_fn
alias mpv_stream_cb_read_fn = c_long function(void* cookie, char* buf, ulong nbytes)

Read callback used to implement a custom stream. The semantics of the callback match read(2) in blocking mode. Short reads are allowed (you can return less bytes than requested, and libmpv will retry reading the rest with another call). If no data can be immediately read, the callback must block until there is new data. A return of 0 will be interpreted as final EOF, although libmpv might retry the read, or seek to a different position.

mpv_stream_cb_seek_fn
alias mpv_stream_cb_seek_fn = c_long function(void* cookie, long offset)

Seek callback used to implement a custom stream.

mpv_stream_cb_size_fn
alias mpv_stream_cb_size_fn = c_long function(void* cookie)

Size callback used to implement a custom stream.

Functions

mpv_stream_cb_add_ro
int mpv_stream_cb_add_ro(mpv_handle* ctx, const(char)* protocol, void* user_data, mpv_stream_cb_open_ro_fn open_fn)

Add a custom stream protocol. This will register a protocol handler under the given protocol prefix, and invoke the given callbacks if an URI with the matching protocol prefix is opened.

Structs

mpv_stream_cb_info
struct mpv_stream_cb_info

See mpv_stream_cb_open_ro_fn callback.

Meta