VLC  3.0.15
Functions | Variables
objects.c File Reference
Include dependency graph for objects.c:

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_tObjectExists (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_tFindName (vlc_object_t *obj, const char *name)
 
vlc_object_tvlc_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_tvlc_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
 

Detailed Description

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.

Function Documentation

◆ DumpStructure()

static void DumpStructure ( vlc_object_t obj,
unsigned  level,
char *  psz_foo 
)
static

Referenced by TreeCommand().

◆ FindName()

static vlc_object_t* FindName ( vlc_object_t obj,
const char *  name 
)
static

Referenced by vlc_object_find_name().

◆ ObjectExists()

static vlc_object_t* ObjectExists ( vlc_object_t root,
void *  obj 
)
static

◆ PrintObject()

static void PrintObject ( vlc_object_t obj,
const char *  prefix 
)
static

◆ TreeCommand()

static int TreeCommand ( vlc_object_t obj,
char const *  cmd,
vlc_value_t  oldval,
vlc_value_t  newval,
void *  data 
)
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().

◆ VarsCommand()

static int VarsCommand ( vlc_object_t obj,
char const *  cmd,
vlc_value_t  oldval,
vlc_value_t  newval,
void *  data 
)
static

< Object not found

< No error

Referenced by vlc_custom_create(), and vlc_object_destroy().

◆ vlc_custom_create()

void* vlc_custom_create ( vlc_object_t p_this,
size_t  i_size,
const char *  psz_type 
)

◆ vlc_object_destroy()

static void vlc_object_destroy ( vlc_object_t p_this)
static

◆ vlc_object_set_destructor()

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.

◆ vlc_object_set_name()

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.

Variable Documentation

◆ name_lock

vlc_mutex_t name_lock = PTHREAD_MUTEX_INITIALIZER
static