VLC 4.0.0-dev
Loading...
Searching...
No Matches

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.
 

Data Structures

union  vlc_value_t
 VLC value structure. More...
 

Macros

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

Typedefs

typedef int(* vlc_callback_t) (vlc_object_t *, char const *, vlc_value_t, vlc_value_t, void *)
 
typedef int(* vlc_list_callback_t) (vlc_object_t *, char const *, int, vlc_value_t *, void *)
 

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.
 
void var_Destroy (vlc_object_t *obj, const char *name)
 Destroys a VLC object variable.
 
int var_Change (vlc_object_t *obj, const char *name, int action,...)
 Performs a special action on a variable.
 
int var_Type (vlc_object_t *obj, const char *name)
 Get the type of a variable.
 
int var_Set (vlc_object_t *obj, const char *name, vlc_value_t val)
 Sets a variable value.
 
int var_Get (vlc_object_t *obj, const char *name, vlc_value_t *valp)
 Gets a variable value.
 
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.
 
int var_Inherit (vlc_object_t *, const char *, int, vlc_value_t *)
 Finds the value of a variable.
 
void var_AddCallback (vlc_object_t *obj, const char *name, vlc_callback_t callback, void *opaque)
 Registers a callback for a variable.
 
void var_DelCallback (vlc_object_t *obj, const char *name, vlc_callback_t callback, void *opaque)
 Deregisters a callback from a variable.
 
void var_TriggerCallback (vlc_object_t *obj, const char *name)
 Triggers callbacks on a variable.
 
void var_AddListCallback (vlc_object_t *, const char *, vlc_list_callback_t, void *)
 Register a callback for a list variable.
 
void var_DelListCallback (vlc_object_t *, const char *, vlc_list_callback_t, void *)
 Remove a callback from a list variable.
 
static int var_SetInteger (vlc_object_t *p_obj, const char *psz_name, int64_t i)
 Set the value of an integer variable.
 
static int var_SetBool (vlc_object_t *p_obj, const char *psz_name, bool b)
 Set the value of an boolean variable.
 
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.
 
static int var_SetString (vlc_object_t *p_obj, const char *psz_name, const char *psz_string)
 Set the value of a string variable.
 
static int var_SetAddress (vlc_object_t *p_obj, const char *psz_name, void *ptr)
 Set the value of a pointer variable.
 
static int64_t var_GetInteger (vlc_object_t *p_obj, const char *psz_name)
 Get an integer value.
 
static bool var_GetBool (vlc_object_t *p_obj, const char *psz_name)
 Get a boolean value.
 
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.
 
static char * var_GetString (vlc_object_t *p_obj, const char *psz_name)
 Get a string value.
 
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.
 
static int64_t var_DecInteger (vlc_object_t *p_obj, const char *psz_name)
 Decrement an integer variable.
 
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.
 
static bool var_CreateGetBool (vlc_object_t *p_obj, const char *psz_name)
 Create a boolean variable with inherit and get its value.
 
static float var_CreateGetFloat (vlc_object_t *p_obj, const char *psz_name)
 Create a float variable with inherit and get its value.
 
static char * var_CreateGetString (vlc_object_t *p_obj, const char *psz_name)
 Create a string variable with inherit and get its value.
 
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.
 
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.
 
static bool var_CreateGetBoolCommand (vlc_object_t *p_obj, const char *psz_name)
 Create a boolean command variable with inherit and get its value.
 
static float var_CreateGetFloatCommand (vlc_object_t *p_obj, const char *psz_name)
 Create a float command variable with inherit and get its value.
 
static char * var_CreateGetStringCommand (vlc_object_t *p_obj, const char *psz_name)
 Create a string command variable with inherit and get its value.
 
static char * var_CreateGetNonEmptyStringCommand (vlc_object_t *p_obj, const char *psz_name)
 
static size_t 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.
 
int var_LocationParse (vlc_object_t *obj, const char *mrl, const char *prefix)
 Parses a string with multiple options.
 

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

Typedef Documentation

◆ vlc_callback_t

typedef int(* vlc_callback_t) (vlc_object_t *, char const *, vlc_value_t, vlc_value_t, void *)

◆ vlc_list_callback_t

typedef int(* vlc_list_callback_t) (vlc_object_t *, char const *, int, vlc_value_t *, void *)

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(), psz_name, vlc_value_callback, and xmalloc().

Referenced by aout_FiltersNewWithClock(), aout_New(), aout_volume_New(), filter_AddProxyCallbacks(), intf_Create(), libvlc_InternalActionsInit(), vlc_player_aout_AddCallbacks(), vlc_player_New(), vlc_player_vout_AddCallbacks(), vout_CreateVars(), vout_InitInterlacingSupport(), vout_IntfInit(), and vout_OpenWrapper().

◆ var_AddListCallback()

void var_AddListCallback ( vlc_object_t p_this,
const char *  psz_name,
vlc_list_callback_t  pf_callback,
void *  p_data 
)

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(), psz_name, vlc_list_callback, and xmalloc().

◆ var_Change()

◆ var_CountChoices()

static size_t 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

References addr_ops, vlc_value_t::b_bool, variable_t::b_incallback, bool_ops, variable_t::choices, variable_t::choices_count, variable_t::choices_text, vlc_value_t::coords, coords_ops, Destroy(), vlc_value_t::f_float, float_ops, 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, psz_name, variable_t::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_cond_init(), 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, variable_t::wait, vlc_value_t::x, and vlc_value_t::y.

Referenced by aout_New(), config_ChainParse(), config_LoadCmdLine(), config_PrintHelp(), demux_NewAdvanced(), filter_AddProxyCallbacks(), input_ConfigVarInit(), input_item_ApplyOptions(), InputSourceInit(), intf_Create(), libvlc_InternalActionsInit(), libvlc_InternalInit(), LoadSlaves(), module_need(), OpenURL(), 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(), VisualizationCallback(), vlc_filter_LoadModule(), vlc_player_Start(), vlm_New(), vout_Create(), vout_CreateVars(), vout_display_window_New(), vout_InitInterlacingSupport(), 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 psz_name, var_Create(), var_GetAddress(), 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 psz_name, var_Create(), var_GetBool(), VLC_VAR_BOOL, and VLC_VAR_DOINHERIT.

Referenced by decoder_UpdateVideoOutput().

◆ 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 psz_name, var_Create(), var_GetBool(), 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 psz_name, var_Create(), var_GetFloat(), VLC_VAR_DOINHERIT, and VLC_VAR_FLOAT.

◆ 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 psz_name, var_Create(), var_GetFloat(), 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 psz_name, var_Create(), var_GetInteger(), VLC_VAR_DOINHERIT, and VLC_VAR_INTEGER.

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

◆ 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 psz_name, var_Create(), var_GetInteger(), 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 psz_name, var_Create(), var_GetString(), VLC_VAR_DOINHERIT, and VLC_VAR_STRING.

◆ 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 psz_name, var_Create(), var_GetString(), 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, psz_name, 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 
)

Deregisters a callback from a variable.

The callback and opaque pointer must be supplied again, as the same callback function might have been registered more than once.

References DelCallback(), psz_name, and vlc_value_callback.

Referenced by aout_Destroy(), aout_FiltersDelete(), aout_FiltersNewWithClock(), aout_volume_Delete(), filter_DelProxyCallbacks(), intf_DestroyAll(), libvlc_InternalActionsClean(), vlc_player_aout_DelCallbacks(), vlc_player_Delete(), vlc_player_New(), vlc_player_vout_DelCallbacks(), vout_CloseWrapper(), and vout_IntfDeinit().

◆ var_DelListCallback()

void var_DelListCallback ( vlc_object_t p_this,
const char *  psz_name,
vlc_list_callback_t  pf_callback,
void *  p_data 
)

Remove a callback from a list variable.

See var_DelCallback().

References DelCallback(), psz_name, and vlc_list_callback.

◆ 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 LoadSlaves(), module_unneed(), vlc_filter_UnloadModule(), vlc_player_Delete(), vout_Create(), and vout_display_window_Delete().

◆ 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().

◆ 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_ENOENTVariable 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.

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_ENOENT, 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()

◆ var_GetChecked()

◆ 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

Get a float value.

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

References vlc_value_t::f_float, psz_name, var_GetChecked(), and VLC_VAR_FLOAT.

Referenced by aout_VolumeGet(), Init(), SetStopStart(), var_CreateGetFloat(), var_CreateGetFloatCommand(), vlc_player_GetAssociatedSubsFPS(), vlc_player_GetRate(), vlc_player_UpdateMLStates(), and VoutGetDisplayCfg().

◆ var_GetInteger()

◆ var_GetNonEmptyString()

◆ var_GetString()

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

◆ 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, psz_name, var_GetAndSet(), and VLC_VAR_INTEGER_ADD.

Referenced by aout_PolicyNotify().

◆ var_Inherit()

int var_Inherit ( vlc_object_t p_this,
const char *  psz_name,
int  i_type,
vlc_value_t p_val 
)

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.

References vlc_value_t::b_bool, config_GetFloat(), config_GetInt(), config_GetPsz(), vlc_value_t::f_float, vlc_value_t::i_int, i_type, psz_name, vlc_value_t::psz_string, var_GetChecked(), vlc_assert_unreachable, VLC_ENOENT, vlc_object_parent, 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()

◆ var_InheritFloat()

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

◆ var_InheritInteger()

◆ var_InheritString()

◆ 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.

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

Referenced by VoutGetDisplayCfg().

◆ var_LocationParse()

int var_LocationParse ( vlc_object_t obj,
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
prefixprefix to prepend to option names in the string
Returns
VLC_ENOMEM on error, VLC_SUCCESS on success.

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

◆ 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(), and var_OptionParse().

◆ var_SetAddress()

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

Set the value of a pointer variable.

Parameters
p_objThe object that holds the variable
psz_nameThe name of the variable
ptrThe new pointer value of this variable

References vlc_value_t::p_address, psz_name, var_SetChecked(), and VLC_VAR_ADDRESS.

Referenced by extension_DialogCommand(), input_item_ApplyOptions(), system_Configure(), Trigger(), TriggerInstanceState(), ViewpointApply(), vlc_mta_acquire(), vlc_mta_release(), and VoutViewpointMoved().

◆ var_SetBool()

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

◆ var_SetChecked()

◆ 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, psz_name, var_SetChecked(), and VLC_VAR_FLOAT.

Referenced by aout_Destroy(), aout_VolumeNotify(), config_LoadCmdLine(), SetSubtitlesOptions(), vlc_player_ChangeRate(), vlc_player_input_RestoreMlStates(), and vlc_player_SetAssociatedSubsFPS().

◆ 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_volume_New(), ModuleThread_UpdateAudioFormat(), vlc_player_vout_TriggerOption(), vout_IntfReinit(), and WallPaperCallback().

◆ var_Type()

int var_Type ( vlc_object_t obj,
const char *  name 
)

Get the type of a variable.

See also
Variable types
Returns
The variable type if it exists or 0 if the variable could not be found.

References variable_t::choices_count, variable_t::i_type, i_type, Lookup(), psz_name, vlc_object_internals::var_lock, vlc_internals, vlc_mutex_unlock(), and VLC_VAR_HASCHOICE.

Referenced by DecoderHasVbi(), filter_AddProxyCallbacks(), filter_DelProxyCallbacks(), Init(), and vlc_player_GetV4l2Object().