VLC 4.0.0-dev
Loading...
Searching...
No Matches
Collaboration diagram for VLC objects:

Modules

 Object resources
 The object resource functions tie resource allocation to an instance of a module through a VLC object.
 
 Variables
 VLC object variables and callbacks.
 

Files

file  vlc_objects.h
 Common VLC object definitions.
 

Data Structures

struct  vlc_object_t
 VLC object common members. More...
 
struct  libvlc_int_t
 

Macros

#define VLC_OBJECT(x)
 Type-safe vlc_object_t cast.
 
#define vlc_object_delete(obj)   vlc_object_delete(VLC_OBJECT(obj))
 
#define vlc_object_parent(o)   vlc_object_parent(VLC_OBJECT(o))
 
#define vlc_object_logger(o)   vlc_object_logger(VLC_OBJECT(o))
 
#define vlc_object_get_name(obj)   var_GetString(obj, "module-name")
 Tries to get the name of module bound to an object.
 
#define vlc_object_create(a, b)   vlc_object_create( VLC_OBJECT(a), b )
 
#define vlc_object_find_name(a, b)    vlc_object_find_name( VLC_OBJECT(a),b)
 
#define vlc_object_instance(o)   vlc_object_instance(VLC_OBJECT(o))
 
#define vlc_object_release(o)   vlc_object_release(VLC_OBJECT(o))
 

Functions

void * vlc_object_create (vlc_object_t *parent, size_t i_size)
 Allocates and initializes a vlc object.
 
void vlc_object_delete (vlc_object_t *obj)
 Drops the strong reference to an object.
 
size_t vlc_list_children (vlc_object_t *, vlc_object_t **, size_t)
 
const char * vlc_object_typename (const vlc_object_t *obj)
 Returns the object type name.
 
vlc_object_tvlc_object_parent (vlc_object_t *obj)
 Gets the parent of an object.
 
static struct vlc_loggervlc_object_logger (vlc_object_t *obj)
 
struct vlc_tracervlc_object_get_tracer (vlc_object_t *obj)
 Get tracer of a vlc instance from an object.
 
static libvlc_int_tvlc_object_instance (vlc_object_t *obj)
 
vout_thread_tvout_Hold (vout_thread_t *vout)
 
void vout_Release (vout_thread_t *vout)
 
audio_output_taout_Hold (audio_output_t *aout)
 
void aout_Release (audio_output_t *aout)
 
static void * vlc_object_hold (vlc_object_t *o)
 
static void vlc_object_release (vlc_object_t *o)
 

Detailed Description

Macro Definition Documentation

◆ VLC_OBJECT

#define VLC_OBJECT (   x)
Value:
_Generic((x)->obj, \
struct vlc_object_marker *: (x), \
struct vlc_object_t: (&((x)->obj)) \
)
VLC object common members.
Definition vlc_objects.h:53

Type-safe vlc_object_t cast.

This macro attempts to cast a pointer to a compound type to a vlc_object_t pointer in a type-safe manner. It checks if the compound type actually starts with an embedded vlc_object_t structure.

◆ vlc_object_create

#define vlc_object_create (   a,
 
)    vlc_object_create( VLC_OBJECT(a), b )

◆ vlc_object_delete

#define vlc_object_delete (   obj)    vlc_object_delete(VLC_OBJECT(obj))

◆ vlc_object_find_name

#define vlc_object_find_name (   a,
 
)     vlc_object_find_name( VLC_OBJECT(a),b)

◆ vlc_object_get_name

#define vlc_object_get_name (   obj)    var_GetString(obj, "module-name")

Tries to get the name of module bound to an object.

Warning
This function is intrinsically race-prone, as a module may be bound or unbound asynchronously by another thread. Do not trust the result for any purpose other than debugging/tracing.
Returns
Normally, this returns a heap-allocated nul-terminated string which is the name of the module. If no module are bound to the object, it returns NULL. It also returns NULL on error.

◆ vlc_object_instance

#define vlc_object_instance (   o)    vlc_object_instance(VLC_OBJECT(o))

◆ vlc_object_logger

#define vlc_object_logger (   o)    vlc_object_logger(VLC_OBJECT(o))

◆ vlc_object_parent

#define vlc_object_parent (   o)    vlc_object_parent(VLC_OBJECT(o))

◆ vlc_object_release

#define vlc_object_release (   o)    vlc_object_release(VLC_OBJECT(o))

Function Documentation

◆ aout_Hold()

◆ aout_Release()

◆ vlc_list_children()

size_t vlc_list_children ( vlc_object_t ,
vlc_object_t **  ,
size_t   
)

◆ vlc_object_create()

void * vlc_object_create ( vlc_object_t parent,
size_t  i_size 
)

Allocates and initializes a vlc object.

The object will need to be released with vlc_object_release() before parent is released.

Parameters
parentA parent object to create the new object from
i_sizeobject byte size
Returns
the new object, or NULL on error.

References vlc_custom_create.

◆ vlc_object_delete()

void vlc_object_delete ( vlc_object_t obj)

Drops the strong reference to an object.

This removes the initial strong reference to a given object. This must be called exactly once per allocated object after it is no longer needed, matching vlc_object_create() or vlc_custom_create().

References vlc_object_deinit().

◆ vlc_object_get_tracer()

struct vlc_tracer * vlc_object_get_tracer ( vlc_object_t obj)

Get tracer of a vlc instance from an object.

Returns
the tracer of a vlc instance from an object (NULL if none).

References libvlc_priv(), libvlc_priv_t::tracer, and vlc_object_instance.

Referenced by aout_stream_tracer(), DecoderThread_DecodeBlock(), EsOutProgramAdd(), EsOutSend(), EsOutVaControlLocked(), GetTracer(), ModuleThread_QueueAudio(), ModuleThread_QueueSpu(), ModuleThread_QueueVideo(), and sout_ClockMainCreate().

◆ vlc_object_hold()

static void * vlc_object_hold ( vlc_object_t o)
inlinestatic

◆ vlc_object_instance()

static libvlc_int_t * vlc_object_instance ( vlc_object_t obj)
inlinestatic

References vlc_object_parent.

◆ vlc_object_logger()

static struct vlc_logger * vlc_object_logger ( vlc_object_t obj)
inlinestatic

References vlc_object_t::logger.

◆ vlc_object_parent()

vlc_object_t * vlc_object_parent ( vlc_object_t obj)

Gets the parent of an object.

Returns
the parent object (NULL if none)
Note
The returned parent object pointer is valid as long as the child is.

References vlc_internals.

◆ vlc_object_release()

static void vlc_object_release ( vlc_object_t o)
inlinestatic

◆ vlc_object_typename()

const char * vlc_object_typename ( const vlc_object_t obj)

Returns the object type name.

This returns a nul-terminated string identifying the object type. The string is valid for at least as long as the object reference.

Parameters
objobject whose type name to get

References vlc_internals.

Referenced by vlc_object_hold(), vlc_object_release(), and vlc_object_vaLog().

◆ vout_Hold()

◆ vout_Release()