VLC  4.0.0-dev
Modules | Files | Macros | Enumerations | Functions

VLC object variables and callbacks. More...

Collaboration diagram for Variables:

Modules

 Variable types
 These are the different types a vlc variable can have.
 
 Additive flags
 These flags are added to the type field of the variable.
 
 Variable actions
 These are the different actions that can be used with var_Change().
 

Files

file  vlc_variables.h
 VLC object variables and callbacks interface.
 

Macros

#define VLC_VAR_TYPE   0x00ff
 
#define VLC_VAR_CLASS   0x00f0
 
#define VLC_VAR_FLAGS   0xff00
 

Enumerations

enum  vlc_var_atomic_op { VLC_VAR_BOOL_TOGGLE, VLC_VAR_INTEGER_ADD, VLC_VAR_INTEGER_OR, VLC_VAR_INTEGER_NAND }
 Variable actions. More...
 

Functions

int var_Create (vlc_object_t *obj, const char *name, int type)
 Creates a VLC object variable. More...
 
void var_Destroy (vlc_object_t *obj, const char *name)
 Destroys a VLC object variable. More...
 
int var_Change (vlc_object_t *obj, const char *name, int action, vlc_value_t *val, vlc_value_t *val2)
 Performs a special action on a variable. More...
 
int var_Type (vlc_object_t *obj, const char *name)
 Get the type of a variable. More...
 
int var_Set (vlc_object_t *obj, const char *name, vlc_value_t val)
 Sets a variable value. More...
 
int var_Get (vlc_object_t *obj, const char *name, vlc_value_t *valp)
 Gets a variable value. More...
 
int var_SetChecked (vlc_object_t *, const char *, int, vlc_value_t)
 
int var_GetChecked (vlc_object_t *, const char *, int, vlc_value_t *)
 
int var_GetAndSet (vlc_object_t *obj, const char *name, int op, vlc_value_t *value)
 Perform an atomic read-modify-write of a variable. More...
 
int var_Inherit (vlc_object_t *, const char *, int, vlc_value_t *)
 Finds the value of a variable. More...
 
void var_FreeList (vlc_value_t *, vlc_value_t *)
 Frees a list and the associated strings. More...
 
void var_AddCallback (vlc_object_t *obj, const char *name, vlc_callback_t callback, void *opaque)
 Registers a callback for a variable. More...
 
void var_DelCallback (vlc_object_t *obj, const char *name, vlc_callback_t callback, void *opaque)
 Deregisters a callback from a variable. More...
 
void var_TriggerCallback (vlc_object_t *obj, const char *name)
 Triggers callbacks on a variable. More...
 
void var_AddListCallback (vlc_object_t *, const char *, vlc_list_callback_t, void *)
 Register a callback for a list variable. More...
 
void var_DelListCallback (vlc_object_t *, const char *, vlc_list_callback_t, void *)
 Remove a callback from a list variable. More...
 
static int var_SetInteger (vlc_object_t *p_obj, const char *psz_name, int64_t i)
 Set the value of an integer variable. More...
 
static int var_SetBool (vlc_object_t *p_obj, const char *psz_name, bool b)
 Set the value of an boolean variable. More...
 
static int var_SetCoords (vlc_object_t *obj, const char *name, int32_t x, int32_t y)
 
static int var_SetFloat (vlc_object_t *p_obj, const char *psz_name, float f)
 Set the value of a float variable. More...
 
static int var_SetString (vlc_object_t *p_obj, const char *psz_name, const char *psz_string)
 Set the value of a string variable. More...
 
static int var_SetAddress (vlc_object_t *p_obj, const char *psz_name, void *ptr)
 Set the value of a pointer variable. More...
 
static int64_t var_GetInteger (vlc_object_t *p_obj, const char *psz_name)
 Get an integer value. More...
 
static bool var_GetBool (vlc_object_t *p_obj, const char *psz_name)
 Get a boolean value. More...
 
static void var_GetCoords (vlc_object_t *obj, const char *name, int32_t *px, int32_t *py)
 
static float var_GetFloat (vlc_object_t *p_obj, const char *psz_name)
 Get a float value. More...
 
static char * var_GetString (vlc_object_t *p_obj, const char *psz_name)
 Get a string value. More...
 
static char * var_GetNonEmptyString (vlc_object_t *p_obj, const char *psz_name)
 
static void * var_GetAddress (vlc_object_t *p_obj, const char *psz_name)
 
static int64_t var_IncInteger (vlc_object_t *p_obj, const char *psz_name)
 Increment an integer variable. More...
 
static int64_t var_DecInteger (vlc_object_t *p_obj, const char *psz_name)
 Decrement an integer variable. More...
 
static uint64_t var_OrInteger (vlc_object_t *obj, const char *name, unsigned v)
 
static uint64_t var_NAndInteger (vlc_object_t *obj, const char *name, unsigned v)
 
static int64_t var_CreateGetInteger (vlc_object_t *p_obj, const char *psz_name)
 Create a integer variable with inherit and get its value. More...
 
static bool var_CreateGetBool (vlc_object_t *p_obj, const char *psz_name)
 Create a boolean variable with inherit and get its value. More...
 
static float var_CreateGetFloat (vlc_object_t *p_obj, const char *psz_name)
 Create a float variable with inherit and get its value. More...
 
static char * var_CreateGetString (vlc_object_t *p_obj, const char *psz_name)
 Create a string variable with inherit and get its value. More...
 
static char * var_CreateGetNonEmptyString (vlc_object_t *p_obj, const char *psz_name)
 
static void * var_CreateGetAddress (vlc_object_t *p_obj, const char *psz_name)
 Create an address variable with inherit and get its value. More...
 
static int64_t var_CreateGetIntegerCommand (vlc_object_t *p_obj, const char *psz_name)
 Create a integer command variable with inherit and get its value. More...
 
static bool var_CreateGetBoolCommand (vlc_object_t *p_obj, const char *psz_name)
 Create a boolean command variable with inherit and get its value. More...
 
static float var_CreateGetFloatCommand (vlc_object_t *p_obj, const char *psz_name)
 Create a float command variable with inherit and get its value. More...
 
static char * var_CreateGetStringCommand (vlc_object_t *p_obj, const char *psz_name)
 Create a string command variable with inherit and get its value. More...
 
static char * var_CreateGetNonEmptyStringCommand (vlc_object_t *p_obj, const char *psz_name)
 
static int var_CountChoices (vlc_object_t *p_obj, const char *psz_name)
 
static bool var_ToggleBool (vlc_object_t *p_obj, const char *psz_name)
 
static bool var_InheritBool (vlc_object_t *obj, const char *name)
 
static int64_t var_InheritInteger (vlc_object_t *obj, const char *name)
 
static float var_InheritFloat (vlc_object_t *obj, const char *name)
 
static char * var_InheritString (vlc_object_t *obj, const char *name)
 
static void * var_InheritAddress (vlc_object_t *obj, const char *name)
 
int var_InheritURational (vlc_object_t *obj, unsigned *num, unsigned *den, const char *name)
 Inherit a string as a fractional value. More...
 
int var_LocationParse (vlc_object_t *, const char *mrl, const char *prefix)
 Parses a string with multiple options. More...
 

Detailed Description

VLC object variables and callbacks.

Macro Definition Documentation

◆ VLC_VAR_CLASS

#define VLC_VAR_CLASS   0x00f0

◆ VLC_VAR_FLAGS

#define VLC_VAR_FLAGS   0xff00

◆ VLC_VAR_TYPE

#define VLC_VAR_TYPE   0x00ff

Enumeration Type Documentation

◆ vlc_var_atomic_op

Variable actions.

These are the different actions that can be used with var_GetAndSet().

Enumerator
VLC_VAR_BOOL_TOGGLE 

Invert a boolean value (param ignored)

VLC_VAR_INTEGER_ADD 

Add parameter to an integer value.

VLC_VAR_INTEGER_OR 

Binary OR over an integer bits field.

VLC_VAR_INTEGER_NAND 

Binary NAND over an integer bits field.

Function Documentation

◆ var_AddCallback()

void var_AddCallback ( vlc_object_t obj,
const char *  name,
vlc_callback_t  callback,
void *  opaque 
)

Registers a callback for a variable.

We store a function pointer that will be called upon variable modification.

Parameters
objObject holding the variable
nameVariable name
callbackCallback function pointer
opaqueOpaque data pointer for use by the callback.
Warning
The callback function is run in the thread that calls var_Set() on the variable. Use proper locking. This thread may not have much time to spare, so keep callback functions short.
Bug:
It is not possible to atomically retrieve the current value and register a callback. As a consequence, extreme care must be taken to ensure that the variable value cannot change before the callback is registered. Failure to do so will result in intractable race conditions.

References AddCallback(), callback_entry_t::p_data, callback_entry_t::pf_value_callback, psz_name, vlc_value_callback, and xmalloc().

Referenced by aout_FiltersNew(), aout_New(), aout_volume_New(), filter_AddProxyCallbacks(), input_ControlVarNavigation(), input_ControlVarTitle(), InputAddCallbacks(), intf_Create(), libvlc_InternalActionsInit(), PlayItem(), PreparserOpenInput(), spu_Attach(), VariablesInit(), vlc_custom_create(), vlm_ControlMediaInstanceStart(), vlm_OnMediaUpdate(), vout_InitInterlacingSupport(), vout_IntfInit(), and vout_OpenWrapper().

◆ var_AddListCallback()

void var_AddListCallback ( vlc_object_t ,
const char *  ,
vlc_list_callback_t  ,
void *   
)

Register a callback for a list variable.

The callback is triggered when an element is added/removed from the list or when the list is cleared.

See var_AddCallback().

References AddCallback(), callback_entry_t::p_data, callback_entry_t::pf_list_callback, psz_name, vlc_list_callback, and xmalloc().

◆ var_Change()

int var_Change ( vlc_object_t obj,
const char *  name,
int  action,
vlc_value_t val,
vlc_value_t val2 
)

Performs a special action on a variable.

Parameters
objObject holding the variable
nameVariable name
actionAction to perform. Must be one of Variable actions
valFirst action parameter
val2Second action parameter

< No error

< Variable not found

< Unspecified error

< Unspecified error

< Unspecified error

< No error

< Unspecified error

References CheckValue(), variable_t::choices, variable_t::choices_text, vlc_value_t::f_float, FreeDummy(), vlc_list_t::i_count, vlc_value_t::i_int, variable_t::i_type, Lookup(), variable_t::max, variable_t::min, variable_t::ops, vlc_list_t::p_values, variable_ops_t::pf_cmp, variable_ops_t::pf_dup, variable_ops_t::pf_free, psz_name, vlc_value_t::psz_string, variable_t::psz_text, variable_t::step, strdup(), TAB_APPEND, TAB_ERASE, TriggerListCallback(), variable_t::val, vlc_object_internals::var_lock, VLC_EGENERIC, VLC_ENOVAR, vlc_internals, vlc_mutex_unlock(), VLC_SUCCESS, VLC_VAR_ADDCHOICE, VLC_VAR_CHOICESCOUNT, VLC_VAR_CLEARCHOICES, VLC_VAR_DELCHOICE, VLC_VAR_FLOAT, VLC_VAR_GETCHOICES, VLC_VAR_GETMAX, VLC_VAR_GETMIN, VLC_VAR_GETSTEP, VLC_VAR_GETTEXT, VLC_VAR_INTEGER, VLC_VAR_SETMINMAX, VLC_VAR_SETSTEP, VLC_VAR_SETTEXT, VLC_VAR_SETVALUE, VLC_VAR_STRING, VLC_VAR_TYPE, and xmalloc().

Referenced by AddCustomRatios(), aout_New(), aout_PrepareStereoMode(), config_ChainParse(), config_LoadCmdLine(), EsOutESVarUpdateGeneric(), input_ControlVarInit(), input_ControlVarNavigation(), input_ControlVarTitle(), input_SendEventAudioDelay(), input_SendEventCache(), input_SendEventLength(), input_SendEventPosition(), input_SendEventRate(), input_SendEventRecord(), input_SendEventSeekpoint(), input_SendEventSignal(), input_SendEventState(), input_SendEventSubtitleDelay(), input_SendEventTitle(), input_SlaveSourceAdd(), intf_Create(), NavigationCallback(), PositionCallback(), SeekpointCallback(), TimeCallback(), TitleCallback(), UpdateBookmarksOption(), var_CountChoices(), VarListAdd(), VarListDel(), VarListSelect(), ViewpointApply(), vout_InitInterlacingSupport(), vout_IntfInit(), vout_SendEventViewpointChangeable(), and vout_SendEventViewpointMoved().

◆ var_CountChoices()

static int var_CountChoices ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

◆ var_Create()

int var_Create ( vlc_object_t obj,
const char *  name,
int  type 
)

Creates a VLC object variable.

This function creates a named variable within a VLC object. If a variable already exists with the same name within the same object, its reference count is incremented instead.

Parameters
objObject to hold the variable
nameVariable name
typeVariable type. Must be one of Variable types combined with zero or more Additive flags

< Not enough memory

< No error

< Not enough memory

References addr_ops, vlc_value_t::b_bool, variable_t::b_incallback, bool_ops, variable_t::choices, variable_t::choices_text, vlc_value_t::coords, coords_ops, Destroy(), vlc_value_t::f_float, float_ops, vlc_list_t::i_count, vlc_value_t::i_int, variable_t::i_type, i_type, variable_t::i_usage, int_ops, variable_t::max, variable_t::min, variable_t::ops, vlc_value_t::p_address, vlc_list_t::p_values, variable_t::psz_name, psz_name, vlc_value_t::psz_string, variable_t::psz_text, strdup(), string_ops, tsearch(), unlikely, variable_t::val, variable_t::value_callbacks, var_Inherit(), vlc_object_internals::var_lock, vlc_object_internals::var_root, varcmp(), vlc_assert_unreachable, VLC_ENOMEM, vlc_internals, vlc_mutex_lock(), vlc_mutex_unlock(), VLC_SUCCESS, VLC_VAR_ADDRESS, VLC_VAR_BOOL, VLC_VAR_CLASS, VLC_VAR_COORDS, VLC_VAR_DOINHERIT, VLC_VAR_FLOAT, VLC_VAR_INTEGER, VLC_VAR_ISCOMMAND, VLC_VAR_STRING, VLC_VAR_VOID, void_ops, vlc_value_t::x, and vlc_value_t::y.

Referenced by aout_New(), config_ChainParse(), config_LoadCmdLine(), config_PrintHelp(), filter_AddProxyCallbacks(), input_ConfigVarInit(), input_ControlVarInit(), input_ControlVarNavigation(), input_ControlVarTitle(), input_item_ApplyOptions(), InputSourceNew(), intf_Create(), libvlc_InternalActionsInit(), libvlc_InternalInit(), LoadSlaves(), playlist_Create(), playlist_Import(), playlist_MLLoad(), SetSubtitlesOptions(), sout_NewInstance(), spu_Attach(), SpuRenderCreateAndLoadText(), system_Configure(), var_CreateGetAddress(), var_CreateGetBool(), var_CreateGetBoolCommand(), var_CreateGetFloat(), var_CreateGetFloatCommand(), var_CreateGetInteger(), var_CreateGetIntegerCommand(), var_CreateGetNonEmptyString(), var_CreateGetNonEmptyStringCommand(), var_CreateGetString(), var_CreateGetStringCommand(), var_OptionParse(), VariablesInit(), VisualizationCallback(), vlc_custom_create(), vlm_ControlMediaInstanceStart(), vlm_New(), vlm_OnMediaUpdate(), vout_display_window_New(), vout_InitInterlacingSupport(), vout_IntfInit(), and vout_OpenWrapper().

◆ var_CreateGetAddress()

static void* var_CreateGetAddress ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

Create an address variable with inherit and get its value.

Parameters
p_objThe object that holds the variable
psz_nameThe name of the variable

References var_Create(), var_GetAddress(), VLC_USED, VLC_VAR_ADDRESS, and VLC_VAR_DOINHERIT.

Referenced by vlc_mta_acquire().

◆ var_CreateGetBool()

static bool var_CreateGetBool ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

Create a boolean variable with inherit and get its value.

Parameters
p_objThe object that holds the variable
psz_nameThe name of the variable

References var_Create(), var_GetBool(), VLC_USED, VLC_VAR_BOOL, and VLC_VAR_DOINHERIT.

Referenced by vout_update_format().

◆ var_CreateGetBoolCommand()

static bool var_CreateGetBoolCommand ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

Create a boolean command variable with inherit and get its value.

Parameters
p_objThe object that holds the variable
psz_nameThe name of the variable

References var_Create(), var_GetBool(), VLC_USED, VLC_VAR_BOOL, VLC_VAR_DOINHERIT, and VLC_VAR_ISCOMMAND.

◆ var_CreateGetFloat()

static float var_CreateGetFloat ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

Create a float variable with inherit and get its value.

Parameters
p_objThe object that holds the variable
psz_nameThe name of the variable

References var_Create(), var_GetFloat(), VLC_MALLOC, VLC_USED, VLC_VAR_DOINHERIT, and VLC_VAR_FLOAT.

Referenced by SetSubtitlesOptions().

◆ var_CreateGetFloatCommand()

static float var_CreateGetFloatCommand ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

Create a float command variable with inherit and get its value.

Parameters
p_objThe object that holds the variable
psz_nameThe name of the variable

References var_Create(), var_GetFloat(), VLC_MALLOC, VLC_USED, VLC_VAR_DOINHERIT, VLC_VAR_FLOAT, and VLC_VAR_ISCOMMAND.

◆ var_CreateGetInteger()

static int64_t var_CreateGetInteger ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

Create a integer variable with inherit and get its value.

Parameters
p_objThe object that holds the variable
psz_nameThe name of the variable

References var_Create(), var_GetInteger(), VLC_USED, VLC_VAR_DOINHERIT, and VLC_VAR_INTEGER.

Referenced by AddressCreate(), input_EsOutTimeshiftNew(), and SetSubtitlesOptions().

◆ var_CreateGetIntegerCommand()

static int64_t var_CreateGetIntegerCommand ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

Create a integer command variable with inherit and get its value.

Parameters
p_objThe object that holds the variable
psz_nameThe name of the variable

References var_Create(), var_GetInteger(), VLC_USED, VLC_VAR_DOINHERIT, VLC_VAR_INTEGER, and VLC_VAR_ISCOMMAND.

◆ var_CreateGetNonEmptyString()

static char* var_CreateGetNonEmptyString ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

◆ var_CreateGetNonEmptyStringCommand()

static char* var_CreateGetNonEmptyStringCommand ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

◆ var_CreateGetString()

static char* var_CreateGetString ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

Create a string variable with inherit and get its value.

Parameters
p_objThe object that holds the variable
psz_nameThe name of the variable

References var_Create(), var_GetString(), VLC_MALLOC, VLC_USED, VLC_VAR_DOINHERIT, and VLC_VAR_STRING.

Referenced by DeinterlaceCallback(), and vlm_New().

◆ var_CreateGetStringCommand()

static char* var_CreateGetStringCommand ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

Create a string command variable with inherit and get its value.

Parameters
p_objThe object that holds the variable
psz_nameThe name of the variable

References var_Create(), var_GetString(), VLC_MALLOC, VLC_USED, VLC_VAR_DOINHERIT, VLC_VAR_ISCOMMAND, and VLC_VAR_STRING.

◆ var_DecInteger()

static int64_t var_DecInteger ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

Decrement an integer variable.

Parameters
p_objthe object that holds the variable
psz_namethe name of the variable

References vlc_value_t::i_int, var_GetAndSet(), and VLC_VAR_INTEGER_ADD.

Referenced by aout_PolicyNotify().

◆ var_DelCallback()

void var_DelCallback ( vlc_object_t obj,
const char *  name,
vlc_callback_t  callback,
void *  opaque 
)

◆ var_DelListCallback()

void var_DelListCallback ( vlc_object_t ,
const char *  ,
vlc_list_callback_t  ,
void *   
)

◆ var_Destroy()

void var_Destroy ( vlc_object_t obj,
const char *  name 
)

Destroys a VLC object variable.

This function decrements the reference count of a named variable within a VLC object. If the reference count reaches zero, the variable is destroyed.

Parameters
objObject holding the variable
nameVariable name

References variable_t::b_incallback, Destroy(), variable_t::i_usage, Lookup(), msg_Dbg, psz_name, tdelete(), vlc_object_internals::var_lock, vlc_object_internals::var_root, varcmp(), vlc_internals, and vlc_mutex_unlock().

Referenced by config_GetConfigFile(), filter_DelProxyCallbacks(), input_ControlVarNavigation(), input_ControlVarStop(), input_ControlVarTitle(), LoadSlaves(), playlist_Destroy(), spu_Attach(), and vout_display_window_Delete().

◆ var_FreeList()

void var_FreeList ( vlc_value_t ,
vlc_value_t  
)

Frees a list and the associated strings.

Parameters
p_valthe list variable
p_val2the variable associated or NULL

References vlc_list_t::i_count, vlc_list_t::i_type, vlc_value_t::p_list, vlc_list_t::p_values, vlc_value_t::psz_string, VLC_VAR_CLASS, and VLC_VAR_STRING.

Referenced by aout_PrepareStereoMode(), and input_SlaveSourceAdd().

◆ var_Get()

int var_Get ( vlc_object_t obj,
const char *  name,
vlc_value_t valp 
)

Gets a variable value.

Parameters
objObject holding the variable
nameVariable name
valpPointer to a vlc_value_t object to hold the value [OUT]

References psz_name, and var_GetChecked().

Referenced by config_ChainParse(), input_ControlVarInit(), and UpdateSPU().

◆ var_GetAddress()

static void* var_GetAddress ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

◆ var_GetAndSet()

int var_GetAndSet ( vlc_object_t obj,
const char *  name,
int  op,
vlc_value_t value 
)

Perform an atomic read-modify-write of a variable.

Parameters
objobject holding the variable
namevariable name
opread-modify-write operation to perform (see vlc_var_atomic_op)
valuevalue of the variable after the modification
Return values
VLC_SUCCESSOperation successful
VLC_ENOVARVariable not found
Bug:
The modified value is returned rather than the original value. As such, the original value cannot be known in the case of non-reversible operation such as VLC_VAR_INTEGER_OR and VLC_VAR_INTEGER_NAND.

< Variable not found

< Unspecified error

< No error

References vlc_value_t::b_bool, CheckValue(), vlc_value_t::i_int, variable_t::i_type, Lookup(), psz_name, TriggerCallback(), variable_t::val, vlc_object_internals::var_lock, VLC_EGENERIC, VLC_ENOVAR, vlc_internals, vlc_mutex_unlock(), VLC_SUCCESS, VLC_VAR_BOOL, VLC_VAR_BOOL_TOGGLE, VLC_VAR_INTEGER, VLC_VAR_INTEGER_ADD, VLC_VAR_INTEGER_NAND, VLC_VAR_INTEGER_OR, and WaitUnused().

Referenced by var_DecInteger(), var_IncInteger(), var_NAndInteger(), var_OrInteger(), and var_ToggleBool().

◆ var_GetBool()

static bool var_GetBool ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

◆ var_GetChecked()

int var_GetChecked ( vlc_object_t ,
const char *  ,
int  ,
vlc_value_t  
)

◆ var_GetCoords()

static void var_GetCoords ( vlc_object_t obj,
const char *  name,
int32_t *  px,
int32_t *  py 
)
inlinestatic

◆ var_GetFloat()

static float var_GetFloat ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

◆ var_GetInteger()

static int64_t var_GetInteger ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

◆ var_GetNonEmptyString()

static char* var_GetNonEmptyString ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

◆ var_GetString()

static char* var_GetString ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

Get a string value.

Parameters
p_objThe object that holds the variable
psz_nameThe name of the variable

References vlc_value_t::psz_string, var_GetChecked(), VLC_MALLOC, VLC_USED, and VLC_VAR_STRING.

Referenced by aout_ChangeFilterString(), DeinterlaceCallback(), EsOutPropsInit(), system_ConfigureDbus(), var_CreateGetString(), and var_CreateGetStringCommand().

◆ var_IncInteger()

static int64_t var_IncInteger ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

Increment an integer variable.

Parameters
p_objthe object that holds the variable
psz_namethe name of the variable

References vlc_value_t::i_int, var_GetAndSet(), and VLC_VAR_INTEGER_ADD.

Referenced by aout_PolicyNotify().

◆ var_Inherit()

int var_Inherit ( vlc_object_t ,
const char *  ,
int  ,
vlc_value_t  
)

Finds the value of a variable.

If the specified object does not hold a variable with the specified name, try the parent object, and iterate until the top of the objects tree. If no match is found, the value is read from the configuration.

< No error

< No error

< Object not found

< No error

References vlc_value_t::b_bool, config_GetFloat(), config_GetInt(), config_GetPsz(), vlc_value_t::f_float, vlc_value_t::i_int, vlc_object_t::obj, vlc_common_members::parent, vlc_value_t::psz_string, strdup(), var_GetChecked(), vlc_assert_unreachable, VLC_ENOOBJ, VLC_SUCCESS, VLC_VAR_ADDRESS, VLC_VAR_BOOL, VLC_VAR_CLASS, VLC_VAR_FLOAT, VLC_VAR_INTEGER, and VLC_VAR_STRING.

Referenced by var_Create(), var_InheritAddress(), var_InheritBool(), var_InheritFloat(), var_InheritInteger(), and var_InheritString().

◆ var_InheritAddress()

static void* var_InheritAddress ( vlc_object_t obj,
const char *  name 
)
inlinestatic

◆ var_InheritBool()

static bool var_InheritBool ( vlc_object_t obj,
const char *  name 
)
inlinestatic

◆ var_InheritFloat()

static float var_InheritFloat ( vlc_object_t obj,
const char *  name 
)
inlinestatic

◆ var_InheritInteger()

static int64_t var_InheritInteger ( vlc_object_t obj,
const char *  name 
)
inlinestatic

◆ var_InheritString()

static char* var_InheritString ( vlc_object_t obj,
const char *  name 
)
inlinestatic

◆ var_InheritURational()

int var_InheritURational ( vlc_object_t obj,
unsigned *  num,
unsigned *  den,
const char *  name 
)

Inherit a string as a fractional value.

This function inherits a string, and interprets it as an unsigned rational number, i.e. a fraction. It also accepts a normally formatted floating point number.

Warning
The caller shall perform any and all necessary boundary checks.
Note
The rational number is always reduced, i.e. the returned numerator and denominator are always co-prime numbers.
Fraction with zero as denominator are considered valid, including the undefined form zero-by-zero.
Returns
Zero on success, an error if parsing fails.

< No error

< Unspecified error

References var_InheritString(), VLC_EGENERIC, VLC_SUCCESS, and vlc_ureduce().

Referenced by var_InheritAddress(), and VoutGetDisplayCfg().

◆ var_LocationParse()

int var_LocationParse ( vlc_object_t ,
const char *  mrl,
const char *  prefix 
)

Parses a string with multiple options.

Parses a set of colon-separated or semicolon-separated name=value pairs. Some access (or access_demux) plugins uses this scheme in media resource location.

Note
Only trusted/safe variables are allowed. This is intended.
Warning
Only use this for plugins implementing VLC-specific resource location schemes. This would not make any sense for standardized ones.
Parameters
objVLC object on which to set variables (and emit error messages)
mrlstring to parse
prefprefix to prepend to option names in the string
Returns
VLC_ENOMEM on error, VLC_SUCCESS on success.

< No error

< Not enough memory

References likely, var_OptionParse(), VLC_ENOMEM, and VLC_SUCCESS.

Referenced by var_InheritAddress().

◆ var_NAndInteger()

static uint64_t var_NAndInteger ( vlc_object_t obj,
const char *  name,
unsigned  v 
)
inlinestatic

◆ var_OrInteger()

static uint64_t var_OrInteger ( vlc_object_t obj,
const char *  name,
unsigned  v 
)
inlinestatic

◆ var_Set()

int var_Set ( vlc_object_t obj,
const char *  name,
vlc_value_t  val 
)

Sets a variable value.

Parameters
objObject holding the variable
nameVariable name
valVariable value to set

References psz_name, and var_SetChecked().

Referenced by config_ChainParse(), TriggerFilterCallback(), var_Copy(), var_CopyDevice(), var_OptionParse(), and vout_ManageWrapper().

◆ var_SetAddress()

static int var_SetAddress ( vlc_object_t p_obj,
const char *  psz_name,
void *  ptr 
)
inlinestatic

◆ var_SetBool()

static int var_SetBool ( vlc_object_t p_obj,
const char *  psz_name,
bool  b 
)
inlinestatic

◆ var_SetChecked()

int var_SetChecked ( vlc_object_t ,
const char *  ,
int  ,
vlc_value_t   
)

◆ var_SetCoords()

static int var_SetCoords ( vlc_object_t obj,
const char *  name,
int32_t  x,
int32_t  y 
)
inlinestatic

◆ var_SetFloat()

static int var_SetFloat ( vlc_object_t p_obj,
const char *  psz_name,
float  f 
)
inlinestatic

Set the value of a float variable.

Parameters
p_objThe object that holds the variable
psz_nameThe name of the variable
fThe new float value of this variable

References vlc_value_t::f_float, var_SetChecked(), and VLC_VAR_FLOAT.

Referenced by aout_Destroy(), aout_VolumeNotify(), config_LoadCmdLine(), input_ConfigVarInit(), input_vaControl(), RateCallback(), RateOffsetCallback(), SetSubtitlesOptions(), VariablesInit(), VideoSplitterCallback(), and vlm_ControlMediaInstanceSetTimePosition().

◆ var_SetInteger()

static int var_SetInteger ( vlc_object_t p_obj,
const char *  psz_name,
int64_t  i 
)
inlinestatic

◆ var_SetString()

static int var_SetString ( vlc_object_t p_obj,
const char *  psz_name,
const char *  psz_string 
)
inlinestatic

◆ var_ToggleBool()

static bool var_ToggleBool ( vlc_object_t p_obj,
const char *  psz_name 
)
inlinestatic

◆ var_TriggerCallback()

void var_TriggerCallback ( vlc_object_t obj,
const char *  name 
)

Triggers callbacks on a variable.

This triggers any callbacks registered on the named variable without actually modifying the variable value. This is primarily useful for variables with VLC_VAR_VOID type (which do not have a value).

Parameters
objObject holding the variable
nameVariable name

References Lookup(), psz_name, TriggerCallback(), variable_t::val, vlc_object_internals::var_lock, vlc_internals, vlc_mutex_unlock(), and WaitUnused().

Referenced by aout_update_format(), aout_volume_New(), vout_IntfReinit(), and WallPaperCallback().

◆ var_Type()

int var_Type ( vlc_object_t obj,
const char *  name 
)