
Defines | |
| #define | MYCASE(type, nice) |
Functions | |
| static int | DumpCommand (vlc_object_t *, char const *, vlc_value_t, vlc_value_t, void *) |
| static vlc_object_t * | FindParent (vlc_object_t *, int) |
| static vlc_object_t * | FindChild (vlc_object_internals_t *, int) |
| static vlc_object_t * | FindParentName (vlc_object_t *, const char *) |
| static vlc_object_t * | FindChildName (vlc_object_internals_t *, const char *) |
| static void | PrintObject (vlc_object_internals_t *, const char *) |
| static void | DumpStructure (vlc_object_internals_t *, unsigned, char *) |
| static vlc_list_t * | NewList (int) |
| static void | vlc_object_destroy (vlc_object_t *p_this) |
| Destroy a vlc object (Internal). | |
| static void | vlc_object_detach_unlocked (vlc_object_t *p_this) |
| static void | libvlc_lock (libvlc_int_t *p_libvlc) |
| static void | libvlc_unlock (libvlc_int_t *p_libvlc) |
| void * | vlc_custom_create (vlc_object_t *p_this, size_t i_size, int i_type, const char *psz_type) |
| Creates a VLC object. | |
| void * | vlc_object_create (vlc_object_t *p_this, size_t i_size) |
| Allocates and initializes a vlc object. | |
| void | vlc_object_set_destructor (vlc_object_t *p_this, vlc_destructor_t pf_destructor) |
| Set the destructor of a vlc object. | |
| int | vlc_object_set_name (vlc_object_t *obj, const char *name) |
| Assign a name to an object for vlc_object_find_name(). | |
| char * | vlc_object_get_name (const vlc_object_t *obj) |
| int | vlc_object_waitpipe (vlc_object_t *obj) |
| Returns the readable end of a pipe that becomes readable once termination of the object is requested (vlc_object_kill()). | |
| void | vlc_object_kill (vlc_object_t *p_this) |
| Requests termination of an object, cancels the object thread, and make the object wait pipe (if it exists) readable. | |
| void * | vlc_object_find (vlc_object_t *p_this, int i_type, int i_mode) |
| static int | objnamecmp (const vlc_object_t *obj, const char *name) |
| vlc_object_t * | vlc_object_find_name (vlc_object_t *p_this, const char *psz_name, int i_mode) |
| Finds a named object and increment its reference count. | |
| void * | vlc_object_hold (vlc_object_t *p_this) |
| Increment an object reference counter. | |
| void | vlc_object_release (vlc_object_t *p_this) |
| void | vlc_object_attach (vlc_object_t *p_this, vlc_object_t *p_parent) |
| attach object to a parent object | |
| void | vlc_object_detach (vlc_object_t *p_this) |
| detach object from its parent | |
| vlc_list_t * | vlc_list_children (vlc_object_t *obj) |
| Gets the list of children of an objects, and increment their reference count. | |
| static void | DumpVariable (const void *data, const VISIT which, const int depth) |
| void | vlc_list_release (vlc_list_t *p_list) |
Variables | |
| static vlc_mutex_t | name_lock = PTHREAD_MUTEX_INITIALIZER |
| static vlc_mutex_t | pipe_lock = PTHREAD_MUTEX_INITIALIZER |
Unless otherwise stated, functions in this file are not cancellation point. All functions in this file are safe w.r.t. deferred cancellation.
| #define MYCASE | ( | type, | |||
| nice | ) |
| static int DumpCommand | ( | vlc_object_t * | p_this, | |
| char const * | psz_cmd, | |||
| vlc_value_t | oldval, | |||
| vlc_value_t | newval, | |||
| void * | p_data | |||
| ) | [static] |
References DumpStructure(), DumpVariable(), FIND_ANYWHERE, libvlc_lock(), libvlc_unlock(), MAX_DUMPSTRUCTURE_DEPTH, vlc_object_t::p_libvlc, PrintObject(), vlc_value_t::psz_string, VLC_ENOOBJ, vlc_internals, vlc_mutex_lock(), vlc_mutex_unlock(), VLC_OBJECT, vlc_object_find_name, vlc_object_release, and VLC_SUCCESS.
Referenced by vlc_custom_create().
| static void DumpStructure | ( | vlc_object_internals_t * | priv, | |
| unsigned | i_level, | |||
| char * | psz_foo | |||
| ) | [static] |
References vlc_object_internals::first, MAX_DUMPSTRUCTURE_DEPTH, msg_Warn, vlc_object_internals::next, PrintObject(), and vlc_externals.
Referenced by DumpCommand().
| static void DumpVariable | ( | const void * | data, | |
| const VISIT | which, | |||
| const int | depth | |||
| ) | [static] |
References vlc_value_t::b_bool, vlc_value_t::coords, vlc_value_t::f_float, variable_t::i_entries, vlc_value_t::i_int, vlc_value_t::i_time, variable_t::i_type, MYCASE, vlc_value_t::p_address, variable_t::psz_name, vlc_value_t::psz_string, variable_t::psz_text, psz_type, variable_t::val, VLC_VAR_ADDRESS, VLC_VAR_BOOL, VLC_VAR_CLASS, VLC_VAR_COORDS, VLC_VAR_FLOAT, VLC_VAR_HASCHOICE, VLC_VAR_INTEGER, VLC_VAR_ISCOMMAND, VLC_VAR_LIST, VLC_VAR_MUTEX, VLC_VAR_STRING, VLC_VAR_TIME, VLC_VAR_TYPE, VLC_VAR_VOID, vlc_value_t::x, and vlc_value_t::y.
Referenced by DumpCommand().
| static vlc_object_t * FindChild | ( | vlc_object_internals_t * | priv, | |
| int | i_type | |||
| ) | [static] |
References vlc_object_internals::first, vlc_object_internals::i_object_type, vlc_object_internals::next, vlc_externals, and vlc_object_hold.
Referenced by vlc_object_find().
| static vlc_object_t * FindChildName | ( | vlc_object_internals_t * | priv, | |
| const char * | name | |||
| ) | [static] |
References vlc_object_internals::first, vlc_object_internals::next, vlc_object_internals::psz_name, vlc_externals, and vlc_object_hold.
Referenced by vlc_object_find_name().
| static vlc_object_t * FindParent | ( | vlc_object_t * | p_this, | |
| int | i_type | |||
| ) | [static] |
References vlc_object_t::p_parent, vlc_internals, and vlc_object_hold.
Referenced by vlc_object_find().
| static vlc_object_t * FindParentName | ( | vlc_object_t * | p_this, | |
| const char * | name | |||
| ) | [static] |
References vlc_object_t::p_parent, vlc_internals, and vlc_object_hold.
Referenced by vlc_object_find_name().
| static void libvlc_lock | ( | libvlc_int_t * | p_libvlc | ) | [static] |
References libvlc_priv(), and vlc_mutex_lock().
Referenced by DumpCommand(), vlc_list_children(), vlc_object_attach(), vlc_object_detach(), vlc_object_find(), vlc_object_find_name(), and vlc_object_release().
| static void libvlc_unlock | ( | libvlc_int_t * | p_libvlc | ) | [static] |
References libvlc_priv(), and vlc_mutex_unlock().
Referenced by DumpCommand(), vlc_list_children(), vlc_object_attach(), vlc_object_detach(), vlc_object_find(), vlc_object_find_name(), and vlc_object_release().
| static vlc_list_t * NewList | ( | int | i_count | ) | [static] |
| static int objnamecmp | ( | const vlc_object_t * | obj, | |
| const char * | name | |||
| ) | [static] |
| static void PrintObject | ( | vlc_object_internals_t * | priv, | |
| const char * | psz_prefix | |||
| ) | [static] |
References vlc_object_internals::b_thread, vlc_object_internals::i_refcount, name_lock, vlc_object_internals::psz_name, psz_name, psz_object_type, vlc_object_internals::thread_id, vlc_externals, vlc_mutex_lock(), vlc_mutex_unlock(), vlc_restorecancel(), and vlc_savecancel().
Referenced by DumpCommand(), and DumpStructure().
| void* vlc_custom_create | ( | vlc_object_t * | p_this, | |
| size_t | i_size, | |||
| int | i_type, | |||
| 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 | |
| i_type | object type, usually VLC_OBJECT_CUSTOM | |
| psz_type | object type name |
References vlc_object_t::b_die, vlc_object_t::b_force, vlc_object_internals::b_thread, DumpCommand(), vlc_object_internals::first, vlc_object_t::i_flags, vlc_object_internals::i_object_type, vlc_object_internals::i_refcount, libvlc_priv(), OBJECT_FLAGS_NODBG, OBJECT_FLAGS_NOINTERACT, OBJECT_FLAGS_QUIET, vlc_object_internals::old_parent, vlc_object_t::p_libvlc, vlc_object_t::p_parent, vlc_object_internals::pf_destructor, vlc_object_internals::pipes, vlc_object_t::psz_header, vlc_object_internals::psz_name, vlc_object_t::psz_object_type, vlc_object_internals::ref_spin, var_AddCallback, var_Create, vlc_object_internals::var_lock, vlc_object_internals::var_root, vlc_object_internals::var_wait, vlc_cond_init(), vlc_mutex_init(), VLC_OBJECT, vlc_restorecancel(), vlc_savecancel(), vlc_spin_init(), VLC_VAR_ISCOMMAND, and VLC_VAR_STRING.
| static void vlc_object_destroy | ( | vlc_object_t * | p_this | ) | [static] |
Destroy a vlc object (Internal).
This function destroys an object that has been previously allocated with vlc_object_create. The object's refcount must be zero and it must not be attached to other objects in any way.
This function must be called with cancellation disabled (currently).
References vlc_object_internals::b_thread, libvlc_priv(), vlc_object_t::p_libvlc, vlc_object_t::p_parent, vlc_object_internals::pf_destructor, vlc_object_internals::pipes, vlc_object_t::psz_header, vlc_object_internals::psz_name, vlc_object_internals::ref_spin, var_DestroyAll(), vlc_object_internals::var_lock, vlc_object_internals::var_wait, vlc_cond_destroy(), vlc_internals, vlc_mutex_destroy(), VLC_OBJECT, vlc_object_kill, and vlc_spin_destroy.
Referenced by vlc_object_release().
| void vlc_object_detach | ( | vlc_object_t * | p_this | ) |
detach object from its parent
This function removes all links between an object and its parent.
References libvlc_lock(), libvlc_unlock(), vlc_object_t::p_libvlc, vlc_object_t::p_parent, vlc_object_detach_unlocked(), and vlc_object_release.
| static void vlc_object_detach_unlocked | ( | vlc_object_t * | p_this | ) | [static] |
| int vlc_object_set_name | ( | vlc_object_t * | obj, | |
| const char * | name | |||
| ) |
Assign a name to an object for vlc_object_find_name().
References name_lock, vlc_object_internals::psz_name, strdup(), VLC_ENOMEM, vlc_internals, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_SUCCESS.
| int vlc_object_waitpipe | ( | vlc_object_t * | obj | ) |
Returns the readable end of a pipe that becomes readable once termination of the object is requested (vlc_object_kill()).
This can be used to wake-up out of a select() or poll() event loop, such typically when doing network I/O.
Note that the pipe will remain the same for the lifetime of the object. DO NOT read the pipe nor close it yourself. Ever.
| obj | object that would be "killed" |
References vlc_object_t::b_die, msg_Dbg, vlc_object_internals::pipes, vlc_internals, vlc_mutex_lock(), vlc_restorecancel(), and vlc_savecancel().
Referenced by httpd_TLSHostNew(), net_Accept(), net_Connect(), net_Read(), and net_Write().
vlc_mutex_t name_lock = PTHREAD_MUTEX_INITIALIZER [static] |
Referenced by PrintObject(), vlc_object_find_name(), vlc_object_get_name(), and vlc_object_set_name().
vlc_mutex_t pipe_lock = PTHREAD_MUTEX_INITIALIZER [static] |
Referenced by vlc_object_kill().
1.5.6