VLC 4.0.0-dev
|
Data Structures | |
struct | callback_entry_t |
struct | variable_ops_t |
struct | variable_t |
The structure describing a variable. More... | |
Typedefs | |
typedef struct callback_entry_t | callback_entry_t |
typedef struct variable_ops_t | variable_ops_t |
Enumerations | |
enum | vlc_callback_type_t { vlc_value_callback , vlc_list_callback } |
Functions | |
static int | CmpBool (vlc_value_t v, vlc_value_t w) |
static int | CmpInt (vlc_value_t v, vlc_value_t w) |
static int | CmpString (vlc_value_t v, vlc_value_t w) |
static int | CmpFloat (vlc_value_t v, vlc_value_t w) |
static int | CmpAddress (vlc_value_t v, vlc_value_t w) |
static void | DupDummy (vlc_value_t *p_val) |
static void | DupString (vlc_value_t *p_val) |
static void | FreeDummy (vlc_value_t *p_val) |
static void | FreeString (vlc_value_t *p_val) |
static int | varcmp (const void *a, const void *b) |
static variable_t * | Lookup (vlc_object_t *obj, const char *psz_name) |
static void | Destroy (variable_t *p_var) |
static void | CheckValue (variable_t *var, vlc_value_t *val) |
Adjusts a value to fit the constraints for a certain variable: | |
static void | WaitUnused (vlc_object_t *obj, variable_t *var) |
Waits until the variable is inactive (i.e. | |
static void | TriggerCallback (vlc_object_t *obj, variable_t *var, const char *name, vlc_value_t prev) |
static void | TriggerListCallback (vlc_object_t *obj, variable_t *var, const char *name, int action, vlc_value_t *val) |
int() | var_Create (vlc_object_t *p_this, const char *psz_name, int i_type) |
Creates a VLC object variable. | |
void() | var_Destroy (vlc_object_t *p_this, const char *psz_name) |
Destroys a VLC object variable. | |
static void | CleanupVar (void *var) |
void | var_DestroyAll (vlc_object_t *obj) |
int() | var_Change (vlc_object_t *p_this, const char *psz_name, int i_action,...) |
Performs a special action on a variable. | |
int() | var_GetAndSet (vlc_object_t *p_this, const char *psz_name, int i_action, vlc_value_t *p_val) |
Perform an atomic read-modify-write of a variable. | |
int() | var_Type (vlc_object_t *p_this, const char *psz_name) |
Get the type of a variable. | |
int() | var_SetChecked (vlc_object_t *p_this, const char *psz_name, int expected_type, vlc_value_t val) |
int() | var_Set (vlc_object_t *p_this, const char *psz_name, vlc_value_t val) |
Sets a variable value. | |
int() | var_GetChecked (vlc_object_t *p_this, const char *psz_name, int expected_type, vlc_value_t *p_val) |
int() | var_Get (vlc_object_t *p_this, const char *psz_name, vlc_value_t *p_val) |
Gets a variable value. | |
static void | AddCallback (vlc_object_t *p_this, const char *psz_name, callback_entry_t *restrict entry, vlc_callback_type_t i_type) |
void() | var_AddCallback (vlc_object_t *p_this, const char *psz_name, vlc_callback_t pf_callback, void *p_data) |
Registers a callback for a variable. | |
static void | DelCallback (vlc_object_t *p_this, const char *psz_name, const callback_entry_t *restrict match, vlc_callback_type_t i_type) |
void() | var_DelCallback (vlc_object_t *p_this, const char *psz_name, vlc_callback_t pf_callback, void *p_data) |
Deregisters a callback from a variable. | |
void() | var_TriggerCallback (vlc_object_t *p_this, const char *psz_name) |
Triggers callbacks on a variable. | |
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. | |
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. | |
void | var_OptionParse (vlc_object_t *p_obj, const char *psz_option, bool trusted) |
Parse a stringified option This function parse a string option and create the associated object variable The option must be of the form "[no[-]]foo[=bar]" where foo is the option name and bar is the value of the option. | |
int() | var_LocationParse (vlc_object_t *obj, const char *mrl, const char *pref) |
Parses a string with multiple options. | |
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. | |
int() | var_InheritURational (vlc_object_t *object, unsigned *num, unsigned *den, const char *var) |
Inherit a string as a fractional value. | |
static void | TwalkGetNames (const void *data, const VISIT which, const int depth) |
char ** | var_GetAllNames (vlc_object_t *obj) |
Return a list of all variable names. | |
Variables | |
static const struct variable_ops_t | void_ops = { NULL, DupDummy, FreeDummy, } |
static const struct variable_ops_t | addr_ops = { CmpAddress, DupDummy, FreeDummy, } |
static const struct variable_ops_t | bool_ops = { CmpBool, DupDummy, FreeDummy, } |
static const struct variable_ops_t | float_ops = { CmpFloat, DupDummy, FreeDummy, } |
static const struct variable_ops_t | int_ops = { CmpInt, DupDummy, FreeDummy, } |
static const struct variable_ops_t | string_ops = { CmpString, DupString, FreeString, } |
static const struct variable_ops_t | coords_ops = { NULL, DupDummy, FreeDummy, } |
static thread_local void * | twalk_ctx |
typedef struct callback_entry_t callback_entry_t |
typedef struct variable_ops_t variable_ops_t |
enum vlc_callback_type_t |
|
static |
References i_type, variable_t::list_callbacks, Lookup(), msg_Err, psz_name, variable_t::value_callbacks, vlc_object_internals::var_lock, vlc_internals, vlc_mutex_unlock(), vlc_value_callback, and WaitUnused().
Referenced by var_AddCallback(), and var_AddListCallback().
|
static |
Adjusts a value to fit the constraints for a certain variable:
References vlc_value_t::f_float, vlc_value_t::i_int, var, VLC_VAR_FLOAT, VLC_VAR_INTEGER, and VLC_VAR_TYPE.
Referenced by var_Change(), var_GetAndSet(), and var_SetChecked().
|
static |
References Destroy(), and var.
Referenced by var_DestroyAll().
|
static |
References vlc_value_t::p_address.
|
static |
References vlc_value_t::b_bool.
|
static |
References vlc_value_t::f_float.
|
static |
References vlc_value_t::i_int.
|
static |
References vlc_value_t::psz_string.
|
static |
References i_type, variable_t::list_callbacks, Lookup(), msg_Err, psz_name, variable_t::value_callbacks, vlc_object_internals::var_lock, vlc_internals, vlc_mutex_unlock(), vlc_value_callback, and WaitUnused().
Referenced by var_DelCallback(), and var_DelListCallback().
|
static |
References variable_t::choices, variable_t::choices_count, variable_t::choices_text, count, variable_t::list_callbacks, callback_entry_t::next, variable_t::ops, variable_ops_t::pf_free, variable_t::psz_name, variable_t::psz_text, unlikely, variable_t::val, and variable_t::value_callbacks.
Referenced by CleanupVar(), var_Create(), and var_Destroy().
|
static |
|
static |
References vlc_value_t::psz_string, and strdup().
|
static |
Referenced by var_Change().
|
static |
References vlc_value_t::psz_string.
|
static |
References psz_name, tfind(), vlc_object_internals::var_lock, vlc_object_internals::var_root, varcmp(), vlc_internals, and vlc_mutex_lock().
Referenced by AddCallback(), DelCallback(), var_Change(), var_Destroy(), var_GetAndSet(), var_GetChecked(), var_SetChecked(), var_TriggerCallback(), and var_Type().
|
static |
References name, var, vlc_object_internals::var_lock, vlc_cond_broadcast(), vlc_internals, vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by var_GetAndSet(), var_SetChecked(), and var_TriggerCallback().
|
static |
References name, var, vlc_object_internals::var_lock, vlc_cond_broadcast(), vlc_internals, vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by var_Change().
|
static |
References ARRAY_APPEND, DECL_ARRAY, leaf, postorder, strdup(), twalk_ctx, and var.
Referenced by var_GetAllNames().
void var_DestroyAll | ( | vlc_object_t * | obj | ) |
References CleanupVar(), tdestroy(), vlc_object_internals::var_root, and vlc_internals.
char ** var_GetAllNames | ( | vlc_object_t * | obj | ) |
Return a list of all variable names.
There is no warranty that the returned variables will be still alive after the return of this function.
References ARRAY_APPEND, ARRAY_INIT, DECL_ARRAY, twalk(), twalk_ctx, TwalkGetNames(), vlc_object_internals::var_lock, vlc_object_internals::var_root, vlc_internals, vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by filter_AddProxyCallbacks(), and filter_DelProxyCallbacks().
void var_OptionParse | ( | vlc_object_t * | p_obj, |
const char * | psz_option, | ||
bool | trusted | ||
) |
Parse a stringified option This function parse a string option and create the associated object variable The option must be of the form "[no[-]]foo[=bar]" where foo is the option name and bar is the value of the option.
p_obj | the object in which the variable must be created |
psz_option | the option to parse |
trusted | whether the option is set by a trusted input or not |
References vlc_value_t::b_bool, config_GetType(), config_IsSafe(), vlc_value_t::f_float, vlc_value_t::i_int, i_type, msg_Err, psz_name, vlc_value_t::psz_string, psz_value, strcasecmp(), strdup(), strtoll(), var_Create(), var_Set(), vlc_atof_c(), VLC_VAR_BOOL, VLC_VAR_FLOAT, VLC_VAR_INTEGER, and VLC_VAR_STRING.
Referenced by input_item_ApplyOptions(), and var_LocationParse().
|
static |
References variable_t::psz_name.
Referenced by Lookup(), var_Create(), and var_Destroy().
|
static |
Waits until the variable is inactive (i.e.
not executing a callback)
References var, vlc_object_internals::var_lock, vlc_cond_wait(), and vlc_internals.
Referenced by AddCallback(), DelCallback(), var_GetAndSet(), var_SetChecked(), and var_TriggerCallback().
|
static |
Referenced by var_Create().
|
static |
Referenced by var_Create().
|
static |
Referenced by var_Create().
|
static |
Referenced by var_Create().
|
static |
Referenced by var_Create().
|
static |
Referenced by var_Create().
|
static |
Referenced by TwalkGetNames(), and var_GetAllNames().
|
static |
Referenced by var_Create().