VLC
3.0.15
|
Functions | |
static void | PrintObject (vlc_object_t *obj, const char *prefix) |
static void | DumpStructure (vlc_object_t *obj, unsigned level, char *psz_foo) |
static int | TreeCommand (vlc_object_t *obj, char const *cmd, vlc_value_t oldval, vlc_value_t newval, void *data) |
Prints the VLC object tree. More... | |
static vlc_object_t * | ObjectExists (vlc_object_t *root, void *obj) |
static int | VarsCommand (vlc_object_t *obj, char const *cmd, vlc_value_t oldval, vlc_value_t newval, void *data) |
void * | vlc_custom_create (vlc_object_t *parent, size_t length, const char *typename) |
Creates a VLC object. More... | |
void * | vlc_object_create (vlc_object_t *p_this, size_t i_size) |
Allocates and initializes a vlc object. More... | |
void | vlc_object_set_destructor (vlc_object_t *p_this, vlc_destructor_t pf_destructor) |
Set the destructor of a vlc object. More... | |
int | vlc_object_set_name (vlc_object_t *obj, const char *name) |
Assign a name to an object for vlc_object_find_name(). More... | |
char * | vlc_object_get_name (const vlc_object_t *obj) |
static void | vlc_object_destroy (vlc_object_t *p_this) |
Destroys a VLC object once it has no more references. More... | |
static vlc_object_t * | FindName (vlc_object_t *obj, const char *name) |
vlc_object_t * | vlc_object_find_name (vlc_object_t *p_this, const char *psz_name) |
Finds a named object and increment its reference count. More... | |
void * | vlc_object_hold (vlc_object_t *p_this) |
Increment an object reference counter. More... | |
void | vlc_object_release (vlc_object_t *obj) |
Drops a reference to an object (decrements the reference count). More... | |
vlc_list_t * | vlc_list_children (vlc_object_t *obj) |
Gets the list of children of an object, and increment their reference count. More... | |
void | vlc_list_release (vlc_list_t *p_list) |
Variables | |
static vlc_mutex_t | name_lock = PTHREAD_MUTEX_INITIALIZER |
This file contains the functions to handle the vlc_object_t type
Unless otherwise stated, functions in this file are not cancellation point. All functions in this file are safe w.r.t. deferred cancellation.
|
static |
Referenced by TreeCommand().
|
static |
Referenced by vlc_object_find_name().
|
static |
|
static |
|
static |
Prints the VLC object tree.
This function prints either an ASCII tree showing the connections between vlc objects, and additional information such as their refcount, thread ID, etc. (command "tree"), or the same data as a simple list (command "list").
< No error
References DumpStructure(), MAX_DUMPSTRUCTURE_DEPTH, and VLC_SUCCESS.
Referenced by vlc_custom_create(), and vlc_object_destroy().
|
static |
void* vlc_custom_create | ( | vlc_object_t * | p_this, |
size_t | i_size, | ||
const char * | psz_type | ||
) |
Creates a VLC object.
Note that because the object name pointer must remain valid, potentially even after the destruction of the object (through the message queues), this function CANNOT be exported to plugins as is. In this case, the old vlc_object_create() must be used instead.
p_this | an existing VLC object |
i_size | byte size of the object structure |
psz_type | object type name |
References vlc_object_internals::first, vlc_common_members::flags, vlc_common_members::force, vlc_common_members::header, vlc_common_members::libvlc, likely, vlc_object_internals::next, vlc_object_t::obj, vlc_common_members::object_type, vlc_common_members::parent, vlc_object_internals::pf_destructor, vlc_object_internals::prev, vlc_object_internals::psz_name, vlc_object_internals::refs, vlc_object_internals::resources, vlc_object_internals::tree_lock, TreeCommand(), unlikely, var_AddCallback, var_Create, vlc_object_internals::var_lock, vlc_object_internals::var_root, vlc_object_internals::var_wait, VarsCommand(), vlc_cond_init(), vlc_internals, vlc_mutex_init(), vlc_mutex_lock(), vlc_mutex_unlock(), vlc_object_hold(), vlc_restorecancel(), vlc_savecancel(), VLC_VAR_ISCOMMAND, and VLC_VAR_STRING.
Referenced by vlc_object_create().
|
static |
Destroys a VLC object once it has no more references.
This function must be called with cancellation disabled (currently).
References vlc_common_members::header, vlc_object_t::obj, vlc_common_members::parent, vlc_object_internals::pf_destructor, vlc_object_internals::psz_name, vlc_object_internals::resources, vlc_object_internals::tree_lock, TreeCommand(), unlikely, var_DelCallback, var_DestroyAll(), vlc_object_internals::var_lock, vlc_object_internals::var_wait, VarsCommand(), vlc_cond_destroy(), vlc_internals, and vlc_mutex_destroy().
Referenced by vlc_object_release().
void vlc_object_set_destructor | ( | vlc_object_t * | p_this, |
vlc_destructor_t | pf_destructor | ||
) |
Set the destructor of a vlc object.
This function sets the destructor of the vlc object. It will be called when the object is destroyed when the its refcount reaches 0. (It is called by the internal function vlc_object_destroy())
References vlc_object_internals::pf_destructor, and vlc_internals.
int vlc_object_set_name | ( | vlc_object_t * | obj, |
const char * | name | ||
) |
Assign a name to an object for vlc_object_find_name().
< No error
< Not enough memory
References name, name_lock, vlc_object_internals::psz_name, strdup(), VLC_ENOMEM, vlc_internals, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_SUCCESS.
|
static |
Referenced by vlc_object_find_name(), vlc_object_get_name(), and vlc_object_set_name().