mpv_get_property method

int mpv_get_property(
  1. Pointer<mpv_handle> ctx,
  2. Pointer<Int8> name,
  3. int format,
  4. Pointer<Void> data,
)

Read the value of the given property.

If the format doesn't match with the internal format of the property, access usually will fail with MPV_ERROR_PROPERTY_FORMAT. In some cases, the data is automatically converted and access succeeds. For example, MPV_FORMAT_INT64 is always converted to MPV_FORMAT_DOUBLE, and access using MPV_FORMAT_STRING usually invokes a string formatter.

@param name The property name. @param format see enum mpv_format. @paramout data Pointer to the variable holding the option value. On success, the variable will be set to a copy of the option value. For formats that require dynamic memory allocation, you can free the value with mpv_free() (strings) or mpv_free_node_contents() (MPV_FORMAT_NODE). @return error code

Implementation

int mpv_get_property(
  ffi.Pointer<mpv_handle> ctx,
  ffi.Pointer<ffi.Int8> name,
  int format,
  ffi.Pointer<ffi.Void> data,
) {
  return _mpv_get_property(
    ctx,
    name,
    format,
    data,
  );
}