libmpv  20200718-git-96cdf53
development library for the MPV media player
Looking for a C++ dev?
I'm looking for work. Hire me!
mpv_node Struct Reference

Generic data storage. More...

#include <client.h>

Collaboration diagram for mpv_node:

Public Attributes

union {
   char *   string
 
   int   flag
 valid if format==MPV_FORMAT_STRING More...
 
   int64_t   int64
 valid if format==MPV_FORMAT_FLAG
More...
 
   double   double_
 valid if format==MPV_FORMAT_INT64
More...
 
   struct mpv_node_list *   list
 valid if format==MPV_FORMAT_DOUBLE More...
 
   struct mpv_byte_array *   ba
 valid if format==MPV_FORMAT_BYTE_ARRAY More...
 
u
 
mpv_format format
 Type of the data stored in this struct. More...
 

Detailed Description

Generic data storage.

If mpv writes this struct (e.g. via mpv_get_property()), you must not change the data. In some cases (mpv_get_property()), you have to free it with mpv_free_node_contents(). If you fill this struct yourself, you're also responsible for freeing it, and you must not call mpv_free_node_contents().

Definition at line 801 of file client.h.

Member Data Documentation

◆ ba

struct mpv_byte_array* mpv_node::ba

valid if format==MPV_FORMAT_BYTE_ARRAY

Definition at line 815 of file client.h.

◆ double_

double mpv_node::double_

valid if format==MPV_FORMAT_INT64

Definition at line 806 of file client.h.

◆ flag

int mpv_node::flag

valid if format==MPV_FORMAT_STRING

Definition at line 804 of file client.h.

◆ format

mpv_format mpv_node::format

Type of the data stored in this struct.

This value rules what members in the given union can be accessed. The following formats are currently defined to be allowed in mpv_node:

MPV_FORMAT_STRING (u.string) MPV_FORMAT_FLAG (u.flag) MPV_FORMAT_INT64 (u.int64) MPV_FORMAT_DOUBLE (u.double_) MPV_FORMAT_NODE_ARRAY (u.list) MPV_FORMAT_NODE_MAP (u.list) MPV_FORMAT_BYTE_ARRAY (u.ba) MPV_FORMAT_NONE (no member)

If you encounter a value you don't know, you must not make any assumptions about the contents of union u.

Definition at line 834 of file client.h.

◆ int64

int64_t mpv_node::int64

valid if format==MPV_FORMAT_FLAG

Definition at line 805 of file client.h.

◆ list

struct mpv_node_list* mpv_node::list

valid if format==MPV_FORMAT_DOUBLE

valid if format==MPV_FORMAT_NODE_ARRAY or if format==MPV_FORMAT_NODE_MAP

Definition at line 811 of file client.h.

◆ string

char* mpv_node::string

Definition at line 803 of file client.h.

◆ u

union { ... } mpv_node::u

The documentation for this struct was generated from the following file: