[][src]Function libmpv_sys::mpv_set_option

pub unsafe extern "C" fn mpv_set_option(
    ctx: *mut mpv_handle,
    name: *const c_char,
    format: mpv_format,
    data: *mut c_void
) -> c_int

Set an option. Note that you can't normally set options during runtime. It works in uninitialized state (see mpv_create()), and in some cases in at runtime.

Using a format other than MPV_FORMAT_NODE is equivalent to constructing a mpv_node with the given format and data, and passing the mpv_node to this function.

Note: this is semi-deprecated. For most purposes, this is not needed anymore. Starting with mpv version 0.21.0 (version 1.23) most options can be set with mpv_set_property() (and related functions), and even before mpv_initialize(). In some obscure corner cases, using this function to set options might still be required (see below, and also section "Inconsistencies between options and properties" on the manpage). Once these are resolved, the option setting functions might be fully deprecated.

  The following options still need to be set either _before_
  mpv_initialize() with mpv_set_property() (or related functions), or
  with mpv_set_option() (or related functions) at any time:
         - options shadowed by deprecated properties:
           - demuxer (property deprecated in 0.21.0)
           - idle (property deprecated in 0.21.0)
           - fps (property deprecated in 0.21.0)
           - cache (property deprecated in 0.21.0)
           - length (property deprecated in 0.10.0)
           - audio-samplerate (property deprecated in 0.10.0)
           - audio-channels (property deprecated in 0.10.0)
           - audio-format (property deprecated in 0.10.0)
         - deprecated options shadowed by properties:
           - chapter (option deprecated in 0.21.0)
           - playlist-pos (option deprecated in 0.21.0)
  The deprecated properties were removed in mpv 0.23.0.

@param name Option name. This is the same as on the mpv command line, but without the leading "--". @param format see enum mpv_format. @param[in] data Option value (according to the format). @return error code