VLC  4.0.0-dev
Modules | Files | Data Structures | Macros | Functions
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 defintions.
 

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. More...
 
#define vlc_object_cast(t)
 
#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. More...
 
#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))
 

Functions

void * vlc_object_create (_Generic((vlc_object_t *) ->obj, struct vlc_object_marker *:(vlc_object_t *), default:(&((vlc_object_t *) ->obj))), size_t i_size)
 Allocates and initializes a vlc object. More...
 
void vlc_object_delete (_Generic((vlc_object_t *obj) ->obj, struct vlc_object_marker *:(vlc_object_t *obj), default:(&((vlc_object_t *obj) ->obj))))
 Drops the strong reference to an object. More...
 
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. More...
 
vlc_object_tvlc_object_parent (_Generic((vlc_object_t *obj) ->obj, struct vlc_object_marker *:(vlc_object_t *obj), default:(&((vlc_object_t *obj) ->obj))))
 Gets the parent of an object. More...
 
static struct vlc_loggervlc_object_logger (_Generic((vlc_object_t *obj) ->obj, struct vlc_object_marker *:(vlc_object_t *obj), default:(&((vlc_object_t *obj) ->obj))))
 
struct vlc_tracervlc_object_get_tracer (vlc_object_t *obj)
 Get tracer of a vlc instance from an object. More...
 
static libvlc_int_tvlc_object_instance (_Generic((vlc_object_t *obj) ->obj, struct vlc_object_marker *:(vlc_object_t *obj), default:(&((vlc_object_t *obj) ->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), \
default: (&((x)->obj)) \
)

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_cast

#define vlc_object_cast (   t)

◆ 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))

Function Documentation

◆ aout_Hold()

audio_output_t* aout_Hold ( audio_output_t aout)

◆ aout_Release()

void aout_Release ( audio_output_t aout)

◆ vlc_list_children()

size_t vlc_list_children ( vlc_object_t ,
vlc_object_t **  ,
size_t   
)

◆ vlc_object_create()

void* vlc_object_create ( _Generic((vlc_object_t *) ->obj, struct vlc_object_marker *:(vlc_object_t *), default:(&((vlc_object_t *) ->obj)))  ,
size_t  i_size 
)

Allocates and initializes a vlc object.

Parameters
i_sizeobject byte size
Returns
the new object, or NULL on error.

◆ vlc_object_delete()

void vlc_object_delete ( _Generic((vlc_object_t *obj) ->obj, struct vlc_object_marker *:(vlc_object_t *obj), default:(&((vlc_object_t *obj) ->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().

◆ 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 DecoderThread_DecodeBlock(), EsOutProgramAdd(), EsOutSend(), EsOutVaControlLocked(), ModuleThread_QueueAudio(), ModuleThread_QueueSpu(), and ModuleThread_QueueVideo().

◆ vlc_object_hold()

static void* vlc_object_hold ( vlc_object_t o)
inlinestatic

◆ vlc_object_instance()

static libvlc_int_t* vlc_object_instance ( _Generic((vlc_object_t *obj) ->obj, struct vlc_object_marker *:(vlc_object_t *obj), default:(&((vlc_object_t *obj) ->obj)))  )
inlinestatic

References vlc_object_parent.

◆ vlc_object_logger()

static struct vlc_logger* vlc_object_logger ( _Generic((vlc_object_t *obj) ->obj, struct vlc_object_marker *:(vlc_object_t *obj), default:(&((vlc_object_t *obj) ->obj)))  )
inlinestatic

References vlc_object_t::logger.

◆ vlc_object_parent()

vlc_object_t* vlc_object_parent ( _Generic((vlc_object_t *obj) ->obj, struct vlc_object_marker *:(vlc_object_t *obj), default:(&((vlc_object_t *obj) ->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.

◆ 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_thread_t* vout_Hold ( vout_thread_t vout)

◆ vout_Release()

void vout_Release ( vout_thread_t vout)