Modules | Defines | Functions

Variables

Functions for using the object variables in vlc. 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().


Defines

#define VLC_VAR_TYPE   0x00ff
#define VLC_VAR_CLASS   0x00f0
#define VLC_VAR_FLAGS   0xff00
#define var_Create(a, b, c)   var_Create( VLC_OBJECT(a), b, c )
#define var_Destroy(a, b)   var_Destroy( VLC_OBJECT(a), b )
#define var_Change(a, b, c, d, e)   var_Change( VLC_OBJECT(a), b, c, d, e )
#define var_Type(a, b)   var_Type( VLC_OBJECT(a), b )
#define var_Set(a, b, c)   var_Set( VLC_OBJECT(a), b, c )
#define var_Get(a, b, c)   var_Get( VLC_OBJECT(a), b, c )
#define var_SetChecked(o, n, t, v)   var_SetChecked(VLC_OBJECT(o),n,t,v)
#define var_GetChecked(o, n, t, v)   var_GetChecked(VLC_OBJECT(o),n,t,v)
#define var_Command(a, b, c, d, e)   var_Command( VLC_OBJECT( a ), b, c, d, e )
#define var_AddCallback(a, b, c, d)   var_AddCallback( VLC_OBJECT(a), b, c, d )
#define var_DelCallback(a, b, c, d)   var_DelCallback( VLC_OBJECT(a), b, c, d )
#define var_TriggerCallback(a, b)   var_TriggerCallback( VLC_OBJECT(a), b )
#define var_SetCoords(o, n, x, y)   var_SetCoords(VLC_OBJECT(o),n,x,y)
#define var_SetInteger(a, b, c)   var_SetInteger( VLC_OBJECT(a),b,c)
#define var_SetBool(a, b, c)   var_SetBool( VLC_OBJECT(a),b,c)
#define var_SetTime(a, b, c)   var_SetTime( VLC_OBJECT(a),b,c)
#define var_SetFloat(a, b, c)   var_SetFloat( VLC_OBJECT(a),b,c)
#define var_SetString(a, b, c)   var_SetString( VLC_OBJECT(a),b,c)
#define var_SetAddress(o, n, p)   var_SetAddress(VLC_OBJECT(o), n, p)
#define var_GetCoords(o, n, x, y)   var_GetCoords(VLC_OBJECT(o),n,x,y)
#define var_IncInteger(a, b)   var_IncInteger( VLC_OBJECT(a), b )
#define var_DecInteger(a, b)   var_DecInteger( VLC_OBJECT(a), b )
#define var_OrInteger(a, b, c)   var_OrInteger(VLC_OBJECT(a),b,c)
#define var_NAndInteger(a, b, c)   var_NAndInteger(VLC_OBJECT(a),b,c)
#define var_CreateGetInteger(a, b)   var_CreateGetInteger( VLC_OBJECT(a),b)
#define var_CreateGetBool(a, b)   var_CreateGetBool( VLC_OBJECT(a),b)
#define var_CreateGetTime(a, b)   var_CreateGetTime( VLC_OBJECT(a),b)
#define var_CreateGetFloat(a, b)   var_CreateGetFloat( VLC_OBJECT(a),b)
#define var_CreateGetString(a, b)   var_CreateGetString( VLC_OBJECT(a),b)
#define var_CreateGetNonEmptyString(a, b)   var_CreateGetNonEmptyString( VLC_OBJECT(a),b)
#define var_CreateGetAddress(a, b)   var_CreateGetAddress( VLC_OBJECT(a),b)
#define var_CreateGetIntegerCommand(a, b)   var_CreateGetIntegerCommand( VLC_OBJECT(a),b)
#define var_CreateGetBoolCommand(a, b)   var_CreateGetBoolCommand( VLC_OBJECT(a),b)
#define var_CreateGetTimeCommand(a, b)   var_CreateGetTimeCommand( VLC_OBJECT(a),b)
#define var_CreateGetFloatCommand(a, b)   var_CreateGetFloatCommand( VLC_OBJECT(a),b)
#define var_CreateGetStringCommand(a, b)   var_CreateGetStringCommand( VLC_OBJECT(a),b)
#define var_CreateGetNonEmptyStringCommand(a, b)   var_CreateGetNonEmptyStringCommand( VLC_OBJECT(a),b)
#define var_CountChoices(a, b)   var_CountChoices( VLC_OBJECT(a),b)
#define var_ToggleBool(a, b)   var_ToggleBool( VLC_OBJECT(a),b )
#define var_InheritBool(o, n)   var_InheritBool(VLC_OBJECT(o), n)
#define var_InheritInteger(o, n)   var_InheritInteger(VLC_OBJECT(o), n)
#define var_InheritFloat(o, n)   var_InheritFloat(VLC_OBJECT(o), n)
#define var_InheritString(o, n)   var_InheritString(VLC_OBJECT(o), n)
#define var_InheritTime(o, n)   var_InheritTime(VLC_OBJECT(o), n)
#define var_InheritAddress(o, n)   var_InheritAddress(VLC_OBJECT(o), n)
#define var_InheritURational(a, b, c, d)   var_InheritURational(VLC_OBJECT(a), b, c, d)
#define var_GetInteger(a, b)   var_GetInteger( VLC_OBJECT(a),b)
#define var_GetBool(a, b)   var_GetBool( VLC_OBJECT(a),b)
#define var_GetTime(a, b)   var_GetTime( VLC_OBJECT(a),b)
#define var_GetFloat(a, b)   var_GetFloat( VLC_OBJECT(a),b)
#define var_GetString(a, b)   var_GetString( VLC_OBJECT(a),b)
#define var_GetNonEmptyString(a, b)   var_GetNonEmptyString( VLC_OBJECT(a),b)
#define var_GetAddress(a, b)   var_GetAddress( VLC_OBJECT(a),b)
#define var_LocationParse(o, m, p)   var_LocationParse(VLC_OBJECT(o), m, p)

Functions

int var_Create (vlc_object_t *, const char *, int)
 Initialize a vlc variable.
int var_Destroy (vlc_object_t *, const char *)
 Destroy a vlc variable.
int var_Change (vlc_object_t *, const char *, int, vlc_value_t *, vlc_value_t *)
 Perform an action on a variable.
int var_Type (vlc_object_t *, const char *)
 Request a variable's type.
int var_Set (vlc_object_t *, const char *, vlc_value_t)
 Set a variable's value.
int var_Get (vlc_object_t *, const char *, vlc_value_t *)
 Get a variable's 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 *, const char *, int, vlc_value_t *)
 Perform a Get and Set on a variable.
int var_Inherit (vlc_object_t *, const char *, int, vlc_value_t *)
 Finds the value of a variable.
int var_Command (vlc_object_t *, const char *, const char *, const char *, char **)
void var_FreeList (vlc_value_t *, vlc_value_t *)
 Free a list and the associated strings.
int var_AddCallback (vlc_object_t *, const char *, vlc_callback_t, void *)
 Register a callback in a variable.
int var_DelCallback (vlc_object_t *, const char *, vlc_callback_t, void *)
 Remove a callback from a variable.
int var_TriggerCallback (vlc_object_t *, const char *)
 Trigger callback on a 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_SetTime (vlc_object_t *p_obj, const char *psz_name, int64_t i)
 Set the value of a time 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 int64_t var_GetTime (vlc_object_t *p_obj, const char *psz_name)
 Get a time 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 int64_t var_CreateGetTime (vlc_object_t *p_obj, const char *psz_name)
 Create a time 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 int64_t var_CreateGetTimeCommand (vlc_object_t *p_obj, const char *psz_name)
 Create a time 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 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 mtime_t var_InheritTime (vlc_object_t *obj, const char *name)
static void * var_InheritAddress (vlc_object_t *obj, const char *name)
int var_InheritURational (vlc_object_t *, unsigned *num, unsigned *den, const char *var)
 It inherits a string as an unsigned rational number (it also accepts basic float number).
int var_LocationParse (vlc_object_t *, const char *mrl, const char *prefix)
 Parses a set of colon-separated or semicolon-separated <variable name>="">=pairs.

Detailed Description

Functions for using the object variables in vlc.

Vlc have a very powerful "object variable" infrastructure useful for many things.


Define Documentation

#define var_AddCallback (   a,
  b,
  c,
  d 
)    var_AddCallback( VLC_OBJECT(a), b, c, d )
#define var_Change (   a,
  b,
  c,
  d,
  e 
)    var_Change( VLC_OBJECT(a), b, c, d, e )
#define var_Command (   a,
  b,
  c,
  d,
  e 
)    var_Command( VLC_OBJECT( a ), b, c, d, e )
#define var_CountChoices (   a,
  b 
)    var_CountChoices( VLC_OBJECT(a),b)

Referenced by EsOutSetRecord().

#define var_Create (   a,
  b,
  c 
)    var_Create( VLC_OBJECT(a), b, c )
#define var_CreateGetAddress (   a,
  b 
)    var_CreateGetAddress( VLC_OBJECT(a),b)
#define var_CreateGetBool (   a,
  b 
)    var_CreateGetBool( VLC_OBJECT(a),b)
#define var_CreateGetBoolCommand (   a,
  b 
)    var_CreateGetBoolCommand( VLC_OBJECT(a),b)
#define var_CreateGetFloat (   a,
  b 
)    var_CreateGetFloat( VLC_OBJECT(a),b)

Referenced by LoadSubtitles(), and VoutGetDisplayCfg().

#define var_CreateGetFloatCommand (   a,
  b 
)    var_CreateGetFloatCommand( VLC_OBJECT(a),b)
#define var_CreateGetInteger (   a,
  b 
)    var_CreateGetInteger( VLC_OBJECT(a),b)
#define var_CreateGetIntegerCommand (   a,
  b 
)    var_CreateGetIntegerCommand( VLC_OBJECT(a),b)
#define var_CreateGetNonEmptyString (   a,
  b 
)    var_CreateGetNonEmptyString( VLC_OBJECT(a),b)
#define var_CreateGetNonEmptyStringCommand (   a,
  b 
)    var_CreateGetNonEmptyStringCommand( VLC_OBJECT(a),b)
#define var_CreateGetString (   a,
  b 
)    var_CreateGetString( VLC_OBJECT(a),b)
#define var_CreateGetStringCommand (   a,
  b 
)    var_CreateGetStringCommand( VLC_OBJECT(a),b)
#define var_CreateGetTime (   a,
  b 
)    var_CreateGetTime( VLC_OBJECT(a),b)
#define var_CreateGetTimeCommand (   a,
  b 
)    var_CreateGetTimeCommand( VLC_OBJECT(a),b)
#define var_DecInteger (   a,
  b 
)    var_DecInteger( VLC_OBJECT(a), b )
#define var_DelCallback (   a,
  b,
  c,
  d 
)    var_DelCallback( VLC_OBJECT(a), b, c, d )
#define var_Destroy (   a,
  b 
)    var_Destroy( VLC_OBJECT(a), b )
#define var_Get (   a,
  b,
  c 
)    var_Get( VLC_OBJECT(a), b, c )
#define var_GetAddress (   a,
  b 
)    var_GetAddress( VLC_OBJECT(a),b)

Referenced by var_CreateGetAddress().

#define var_GetBool (   a,
  b 
)    var_GetBool( VLC_OBJECT(a),b)
#define var_GetChecked (   o,
  n,
  t,
  v 
)    var_GetChecked(VLC_OBJECT(o),n,t,v)
#define var_GetCoords (   o,
  n,
  x,
  y 
)    var_GetCoords(VLC_OBJECT(o),n,x,y)
#define var_GetFloat (   a,
  b 
)    var_GetFloat( VLC_OBJECT(a),b)
#define var_GetInteger (   a,
  b 
)    var_GetInteger( VLC_OBJECT(a),b)
#define var_GetNonEmptyString (   a,
  b 
)    var_GetNonEmptyString( VLC_OBJECT(a),b)
#define var_GetString (   a,
  b 
)    var_GetString( VLC_OBJECT(a),b)
#define var_GetTime (   a,
  b 
)    var_GetTime( VLC_OBJECT(a),b)
#define var_IncInteger (   a,
  b 
)    var_IncInteger( VLC_OBJECT(a), b )

Referenced by aout_PolicyNotify().

#define var_InheritAddress (   o,
  n 
)    var_InheritAddress(VLC_OBJECT(o), n)
#define var_InheritBool (   o,
  n 
)    var_InheritBool(VLC_OBJECT(o), n)
#define var_InheritFloat (   o,
  n 
)    var_InheritFloat(VLC_OBJECT(o), n)

Referenced by aout_ReplayGainSelect(), and Init().

#define var_InheritInteger (   o,
  n 
)    var_InheritInteger(VLC_OBJECT(o), n)
#define var_InheritString (   o,
  n 
)    var_InheritString(VLC_OBJECT(o), n)
#define var_InheritTime (   o,
  n 
)    var_InheritTime(VLC_OBJECT(o), n)
#define var_InheritURational (   a,
  b,
  c,
  d 
)    var_InheritURational(VLC_OBJECT(a), b, c, d)

Referenced by VoutGetDisplayCfg().

#define var_LocationParse (   o,
  m,
  p 
)    var_LocationParse(VLC_OBJECT(o), m, p)
#define var_NAndInteger (   a,
  b,
  c 
)    var_NAndInteger(VLC_OBJECT(a),b,c)
#define var_OrInteger (   a,
  b,
  c 
)    var_OrInteger(VLC_OBJECT(a),b,c)
#define var_Set (   a,
  b,
  c 
)    var_Set( VLC_OBJECT(a), b, c )
#define var_SetAddress (   o,
  n,
  p 
)    var_SetAddress(VLC_OBJECT(o), n, p)
#define var_SetBool (   a,
  b,
  c 
)    var_SetBool( VLC_OBJECT(a),b,c)
#define var_SetChecked (   o,
  n,
  t,
  v 
)    var_SetChecked(VLC_OBJECT(o),n,t,v)
#define var_SetCoords (   o,
  n,
  x,
  y 
)    var_SetCoords(VLC_OBJECT(o),n,x,y)
#define var_SetFloat (   a,
  b,
  c 
)    var_SetFloat( VLC_OBJECT(a),b,c)
#define var_SetInteger (   a,
  b,
  c 
)    var_SetInteger( VLC_OBJECT(a),b,c)
#define var_SetString (   a,
  b,
  c 
)    var_SetString( VLC_OBJECT(a),b,c)
#define var_SetTime (   a,
  b,
  c 
)    var_SetTime( VLC_OBJECT(a),b,c)
#define var_ToggleBool (   a,
  b 
)    var_ToggleBool( VLC_OBJECT(a),b )
#define var_TriggerCallback (   a,
  b 
)    var_TriggerCallback( VLC_OBJECT(a), b )
#define var_Type (   a,
  b 
)    var_Type( VLC_OBJECT(a), b )
#define VLC_VAR_CLASS   0x00f0
#define VLC_VAR_FLAGS   0xff00
#define VLC_VAR_TYPE   0x00ff

Referenced by CheckValue(), and DumpVariable().


Function Documentation

int var_AddCallback ( vlc_object_t p_this,
const char *  psz_name,
vlc_callback_t  pf_callback,
void *  p_data 
)

Register a callback in a variable.

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

Parameters:
p_this The object that holds the variable
psz_name The name of the variable
pf_callback The function pointer
p_data A generic pointer that will be passed as the last argument to the callback function.
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.

< Variable not found

< No error

References variable_t::i_entries, INSERT_ELEM, Lookup(), msg_Err, callback_entry_t::p_data, variable_t::p_entries, callback_entry_t::pf_callback, vlc_object_internals::var_lock, vlc_internals, vlc_mutex_lock(), vlc_mutex_unlock(), and WaitUnused().

int var_Change ( vlc_object_t p_this,
const char *  psz_name,
int  i_action,
vlc_value_t p_val,
vlc_value_t p_val2 
)
int var_Command ( vlc_object_t ,
const char *  ,
const char *  ,
const char *  ,
char **   
)
static int var_CountChoices ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]
int var_Create ( vlc_object_t p_this,
const char *  psz_name,
int  i_type 
)
static void* var_CreateGetAddress ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

Create an address variable with inherit and get its value.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable

References var_Create, var_GetAddress, VLC_VAR_ADDRESS, and VLC_VAR_DOINHERIT.

static bool var_CreateGetBool ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

Create a boolean variable with inherit and get its value.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable

References var_Create, var_GetBool, VLC_VAR_BOOL, and VLC_VAR_DOINHERIT.

static bool var_CreateGetBoolCommand ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

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

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable

References var_Create, var_GetBool, VLC_VAR_BOOL, VLC_VAR_DOINHERIT, and VLC_VAR_ISCOMMAND.

static float var_CreateGetFloat ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

Create a float variable with inherit and get its value.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable

References var_Create, var_GetFloat, VLC_VAR_DOINHERIT, and VLC_VAR_FLOAT.

static float var_CreateGetFloatCommand ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

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

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable

References var_Create, var_GetFloat, VLC_VAR_DOINHERIT, VLC_VAR_FLOAT, and VLC_VAR_ISCOMMAND.

static int64_t var_CreateGetInteger ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

Create a integer variable with inherit and get its value.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable

References var_Create, var_GetInteger, VLC_VAR_DOINHERIT, and VLC_VAR_INTEGER.

static int64_t var_CreateGetIntegerCommand ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

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

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable

References var_Create, var_GetInteger, VLC_VAR_DOINHERIT, VLC_VAR_INTEGER, and VLC_VAR_ISCOMMAND.

static char* var_CreateGetNonEmptyString ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]
static char* var_CreateGetNonEmptyStringCommand ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]
static char* var_CreateGetString ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

Create a string variable with inherit and get its value.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable

References var_Create, var_GetString, VLC_VAR_DOINHERIT, and VLC_VAR_STRING.

static char* var_CreateGetStringCommand ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

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

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable

References var_Create, var_GetString, VLC_VAR_DOINHERIT, VLC_VAR_ISCOMMAND, and VLC_VAR_STRING.

static int64_t var_CreateGetTime ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

Create a time variable with inherit and get its value.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable

References var_Create, var_GetTime, VLC_VAR_DOINHERIT, and VLC_VAR_TIME.

static int64_t var_CreateGetTimeCommand ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

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

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable

References var_Create, var_GetTime, VLC_VAR_DOINHERIT, VLC_VAR_ISCOMMAND, and VLC_VAR_TIME.

static int64_t var_DecInteger ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

Decrement an integer variable.

Parameters:
p_obj the object that holds the variable
psz_name the name of the variable

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

int var_DelCallback ( vlc_object_t p_this,
const char *  psz_name,
vlc_callback_t  pf_callback,
void *  p_data 
)

Remove a callback from a variable.

pf_callback and p_data have to be given again, because different objects might have registered the same callback function.

< Variable not found

< Unspecified error

< No error

References variable_t::i_entries, Lookup(), callback_entry_t::p_data, variable_t::p_entries, callback_entry_t::pf_callback, REMOVE_ELEM, vlc_object_internals::var_lock, vlc_internals, vlc_mutex_lock(), vlc_mutex_unlock(), and WaitUnused().

int var_Destroy ( vlc_object_t p_this,
const char *  psz_name 
)

Destroy a vlc variable.

Look for the variable and destroy it if it is found. As in var_Create we do a call to memmove() but we have performance counterparts elsewhere.

Parameters:
p_this The object that holds the variable
psz_name The name of the variable

< Variable not found

< No error

References Destroy(), variable_t::i_usage, Lookup(), tdelete(), vlc_object_internals::var_lock, vlc_object_internals::var_root, varcmp(), vlc_internals, vlc_mutex_lock(), vlc_mutex_unlock(), and WaitUnused().

void var_FreeList ( vlc_value_t p_val,
vlc_value_t p_val2 
)

Free a list and the associated strings.

Parameters:
p_val,: the list variable
p_val2,: the variable associated or NULL

References FreeList(), vlc_list_t::i_count, vlc_value_t::p_list, vlc_list_t::p_values, vlc_list_t::pi_types, and vlc_value_t::psz_string.

Referenced by SubtitleAdd().

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

Get a variable's value.

Parameters:
p_this The object that holds the variable
psz_name The name of the variable
p_val Pointer to a vlc_value_t that will hold the variable's value after the function is finished

References var_GetChecked.

static void* var_GetAddress ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]
int var_GetAndSet ( vlc_object_t p_this,
const char *  psz_name,
int  i_action,
vlc_value_t p_val 
)

Perform a Get and Set on a variable.

Parameters:
p_this,: The object that hold the variable
psz_name,: the name of the variable
i_action,: the action to perform
p_val,: The action parameter
Returns:
vlc error codes

< Variable not found

< Unspecified error

References vlc_value_t::b_bool, CheckValue(), vlc_value_t::i_int, variable_t::i_type, Lookup(), TriggerCallback(), variable_t::val, vlc_object_internals::var_lock, vlc_internals, vlc_mutex_lock(), vlc_mutex_unlock(), 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().

static bool var_GetBool ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

Get a boolean value.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable

References vlc_value_t::b_bool, var_GetChecked, and VLC_VAR_BOOL.

int var_GetChecked ( vlc_object_t ,
const char *  ,
int  ,
vlc_value_t  
)
static void var_GetCoords ( vlc_object_t obj,
const char *  name,
int32_t *  px,
int32_t *  py 
) [inline, static]
static float var_GetFloat ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

Get a float value.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable

References vlc_value_t::f_float, var_GetChecked, and VLC_VAR_FLOAT.

static int64_t var_GetInteger ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

Get an integer value.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable

References vlc_value_t::i_int, var_GetChecked, and VLC_VAR_INTEGER.

static char* var_GetNonEmptyString ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]
static char* var_GetString ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

Get a string value.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable

References vlc_value_t::psz_string, var_GetChecked, and VLC_VAR_STRING.

static int64_t var_GetTime ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

Get a time value.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable

References vlc_value_t::i_time, var_GetChecked, and VLC_VAR_TIME.

static int64_t var_IncInteger ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]

Increment an integer variable.

Parameters:
p_obj the object that holds the variable
psz_name the name of the variable

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

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 tree. If no match is found, the value is read from the configuration.

< No error

< No error

< Object not found

< 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, msg_Warn, vlc_object_t::p_parent, vlc_value_t::psz_string, strdup(), var_GetChecked, 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(), var_InheritString(), and var_InheritTime().

static void* var_InheritAddress ( vlc_object_t obj,
const char *  name 
) [inline, static]
static bool var_InheritBool ( vlc_object_t obj,
const char *  name 
) [inline, static]
static float var_InheritFloat ( vlc_object_t obj,
const char *  name 
) [inline, static]
static int64_t var_InheritInteger ( vlc_object_t obj,
const char *  name 
) [inline, static]
static char* var_InheritString ( vlc_object_t obj,
const char *  name 
) [inline, static]
static mtime_t var_InheritTime ( vlc_object_t obj,
const char *  name 
) [inline, static]
int var_InheritURational ( vlc_object_t object,
unsigned *  num,
unsigned *  den,
const char *  var 
)

It inherits a string as an unsigned rational number (it also accepts basic float number).

It returns an error if the rational number cannot be parsed (0/0 is valid). The rational is already reduced.

< No error

< Unspecified error

References us_atof(), var_InheritString, and vlc_ureduce().

int var_LocationParse ( vlc_object_t obj,
const char *  mrl,
const char *  pref 
)

Parses a set of colon-separated or semicolon-separated <variable name>="">=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:
obj VLC object on which to set variables (and emit error messages)
mrl string to parse
pref prefix to prepend to option names in the string
Returns:
VLC_ENOMEM on error, VLC_SUCCESS on success.

< No error

< Not enough memory

References likely, and var_OptionParse().

static uint64_t var_NAndInteger ( vlc_object_t obj,
const char *  name,
unsigned  v 
) [inline, static]
static uint64_t var_OrInteger ( vlc_object_t obj,
const char *  name,
unsigned  v 
) [inline, static]
int var_Set ( vlc_object_t p_this,
const char *  psz_name,
vlc_value_t  val 
)

Set a variable's value.

Parameters:
p_this The object that hold the variable
psz_name The name of the variable
val the value to set

References var_SetChecked.

static int var_SetAddress ( vlc_object_t p_obj,
const char *  psz_name,
void *  ptr 
) [inline, static]

Set the value of a pointer variable.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable
ptr The new pointer value of this variable

References vlc_value_t::p_address, var_SetChecked, and VLC_VAR_ADDRESS.

static int var_SetBool ( vlc_object_t p_obj,
const char *  psz_name,
bool  b 
) [inline, static]

Set the value of an boolean variable.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable
b The new boolean value of this variable

References vlc_value_t::b_bool, var_SetChecked, and VLC_VAR_BOOL.

int var_SetChecked ( vlc_object_t ,
const char *  ,
int  ,
vlc_value_t   
)
static int var_SetCoords ( vlc_object_t obj,
const char *  name,
int32_t  x,
int32_t  y 
) [inline, static]
static int var_SetFloat ( vlc_object_t p_obj,
const char *  psz_name,
float  f 
) [inline, static]

Set the value of a float variable.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable
f The new float value of this variable

References vlc_value_t::f_float, var_SetChecked, and VLC_VAR_FLOAT.

static int var_SetInteger ( vlc_object_t p_obj,
const char *  psz_name,
int64_t  i 
) [inline, static]

Set the value of an integer variable.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable
i The new integer value of this variable

References vlc_value_t::i_int, var_SetChecked, and VLC_VAR_INTEGER.

static int var_SetString ( vlc_object_t p_obj,
const char *  psz_name,
const char *  psz_string 
) [inline, static]

Set the value of a string variable.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable
psz_string The new string value of this variable

References vlc_value_t::psz_string, var_SetChecked, and VLC_VAR_STRING.

static int var_SetTime ( vlc_object_t p_obj,
const char *  psz_name,
int64_t  i 
) [inline, static]

Set the value of a time variable.

Parameters:
p_obj The object that holds the variable
psz_name The name of the variable
i The new time value of this variable

References vlc_value_t::i_time, var_SetChecked, and VLC_VAR_TIME.

static bool var_ToggleBool ( vlc_object_t p_obj,
const char *  psz_name 
) [inline, static]
int var_TriggerCallback ( vlc_object_t p_this,
const char *  psz_name 
)

Trigger callback on a variable.

Parameters:
p_this The object that hold the variable
psz_name The name of the variable

< Variable not found

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

int var_Type ( vlc_object_t p_this,
const char *  psz_name 
)

Request a variable's type.

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

References variable_t::i_type, i_type, Lookup(), vlc_object_internals::var_lock, vlc_internals, vlc_mutex_lock(), and vlc_mutex_unlock().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines