[][src]Function libmpv_sys::mpv_stream_cb_add_ro

pub unsafe extern "C" fn mpv_stream_cb_add_ro(
    ctx: *mut mpv_handle,
    protocol: *const c_char,
    user_data: *mut c_void,
    open_fn: mpv_stream_cb_open_ro_fn
) -> c_int

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.

The "ro" is for read-only - only read-only streams can be registered with this function.

The callback remains registered until the mpv core is registered.

If a custom stream with the same name is already registered, then the MPV_ERROR_INVALID_PARAMETER error is returned.

@param protocol protocol prefix, for example "foo" for "foo://" URIs @param user_data opaque pointer passed into the mpv_stream_cb_open_fn callback. @return error code