Data Structures | Defines | Typedefs | Enumerations | Functions | Variables

libvlc.h File Reference

Go to the source code of this file.

Data Structures

struct  vlc_exit
struct  vlc_object_internals
struct  libvlc_priv_t
 Private LibVLC instance data. More...
struct  counter_sample_t
struct  counter_t

Defines

#define vlc_backtrace()   vlc_trace(__func__, __FILE__, __LINE__)
#define vlc_assert_locked(m)   (void)m
#define vlc_custom_create(o, s, n)   vlc_custom_create(VLC_OBJECT(o), s, n)
#define vlc_object_set_name(o, n)   vlc_object_set_name(VLC_OBJECT(o), n)
#define vlc_object_set_destructor(a, b)   vlc_object_set_destructor (VLC_OBJECT(a), b)
#define ZOOM_SECTION   N_("Zoom")
#define ZOOM_QUARTER_KEY_TEXT   N_("1:4 Quarter")
#define ZOOM_HALF_KEY_TEXT   N_("1:2 Half")
#define ZOOM_ORIGINAL_KEY_TEXT   N_("1:1 Original")
#define ZOOM_DOUBLE_KEY_TEXT   N_("2:1 Double")
#define vlc_internals(obj)   (((vlc_object_internals_t*)(VLC_OBJECT(obj)))-1)
#define vlc_externals(priv)   ((vlc_object_t *)((priv) + 1))
#define libvlc_stats(o)   (libvlc_priv((VLC_OBJECT(o))->p_libvlc)->b_stats)

Typedefs

typedef struct variable_t variable_t
typedef struct vlc_exit vlc_exit_t
typedef void(* vlc_destructor_t )(struct vlc_object_t *)
typedef struct vlc_object_internals vlc_object_internals_t
 Private LibVLC data for each object.
typedef struct sap_handler_t sap_handler_t
typedef struct libvlc_priv_t libvlc_priv_t
 Private LibVLC instance data.
typedef struct counter_sample_t counter_sample_t
typedef struct counter_t counter_t

Enumerations

enum  { STATS_COUNTER, STATS_DERIVATIVE }
enum  {
  STATS_INPUT_BITRATE, STATS_READ_BYTES, STATS_READ_PACKETS, STATS_DEMUX_READ,
  STATS_DEMUX_BITRATE, STATS_DEMUX_CORRUPTED, STATS_DEMUX_DISCONTINUITY, STATS_PLAYED_ABUFFERS,
  STATS_LOST_ABUFFERS, STATS_DECODED_AUDIO, STATS_DECODED_VIDEO, STATS_DECODED_SUB,
  STATS_CLIENT_CONNECTIONS, STATS_ACTIVE_CONNECTIONS, STATS_SOUT_SENT_PACKETS, STATS_SOUT_SENT_BYTES,
  STATS_SOUT_SEND_BITRATE, STATS_DISPLAYED_PICTURES, STATS_LOST_PICTURES
}

Functions

struct vlc_actionsvlc_InitActions (libvlc_int_t *)
 Initializes the key map from configuration.
void vlc_DeinitActions (libvlc_int_t *, struct vlc_actions *)
 Destroys the key map.
size_t vlc_towc (const char *str, uint32_t *restrict pwc)
 Converts the first character from a UTF-8 sequence into a code point.
void system_Init (void)
void system_Configure (libvlc_int_t *, int, const char *const [])
void system_End (void)
void vlc_CPU_init (void)
 Determines the CPU capabilities and stores them in cpu_flags.
void vlc_CPU_dump (vlc_object_t *)
int vlc_clone_detach (vlc_thread_t *, void *(*)(void *), void *, int)
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()).
int vlc_set_priority (vlc_thread_t, int)
void vlc_threads_setup (libvlc_int_t *)
void vlc_trace (const char *fn, const char *file, unsigned line)
 Print a backtrace to the standard error for debugging purpose.
void vlc_ExitInit (vlc_exit_t *)
void vlc_ExitDestroy (vlc_exit_t *)
void * vlc_custom_create (vlc_object_t *p_this, size_t i_size, const char *psz_type)
 Creates a VLC object.
int vlc_object_set_name (vlc_object_t *, const char *)
 Assign a name to an object for vlc_object_find_name().
void vlc_object_set_destructor (vlc_object_t *, vlc_destructor_t)
 Set the destructor of a vlc object.
module_tmodule_find_by_shortcut (const char *psz_shortcut)
 Get a pointer to a module_t that matches a shortcut.
static libvlc_priv_tlibvlc_priv (libvlc_int_t *libvlc)
void playlist_ServicesDiscoveryKillAll (playlist_t *p_playlist)
void intf_DestroyAll (libvlc_int_t *)
 Stops and destroys all interfaces.
void var_OptionParse (vlc_object_t *, const char *, bool trusted)
 Parse a stringified option This function parse a string option and create the associated object variable The option must be of the form "[no[-]]foo[=bar]" where foo is the option name and bar is the value of the option.
counter_tstats_CounterCreate (int)
 Create a statistics counter.
void stats_Update (counter_t *, uint64_t, uint64_t *)
 Update a counter element with new values.
void stats_CounterClean (counter_t *)
void stats_ComputeInputStats (input_thread_t *, input_stats_t *)
void stats_ReinitInputStats (input_stats_t *)

Variables

const char psz_vlc_changeset []

Define Documentation

#define libvlc_stats (   o  )     (libvlc_priv((VLC_OBJECT(o))->p_libvlc)->b_stats)
#define vlc_assert_locked (   m  )     (void)m
#define vlc_backtrace (  )     vlc_trace(__func__, __FILE__, __LINE__)
#define vlc_custom_create (   o,
  s,
  n 
)    vlc_custom_create(VLC_OBJECT(o), s, n)
#define vlc_externals (   priv  )     ((vlc_object_t *)((priv) + 1))
#define vlc_internals (   obj  )     (((vlc_object_internals_t*)(VLC_OBJECT(obj)))-1)
#define vlc_object_set_destructor (   a,
  b 
)    vlc_object_set_destructor (VLC_OBJECT(a), b)
#define vlc_object_set_name (   o,
  n 
)    vlc_object_set_name(VLC_OBJECT(o), n)
#define ZOOM_DOUBLE_KEY_TEXT   N_("2:1 Double")
#define ZOOM_HALF_KEY_TEXT   N_("1:2 Half")
#define ZOOM_ORIGINAL_KEY_TEXT   N_("1:1 Original")
#define ZOOM_QUARTER_KEY_TEXT   N_("1:4 Quarter")
#define ZOOM_SECTION   N_("Zoom")

Typedef Documentation

typedef struct counter_t counter_t
typedef struct libvlc_priv_t libvlc_priv_t

Private LibVLC instance data.

typedef struct sap_handler_t sap_handler_t
typedef struct variable_t variable_t
typedef void(* vlc_destructor_t)(struct vlc_object_t *)
typedef struct vlc_exit vlc_exit_t

Private LibVLC data for each object.


Enumeration Type Documentation

anonymous enum
Enumerator:
STATS_COUNTER 
STATS_DERIVATIVE 
anonymous enum
Enumerator:
STATS_INPUT_BITRATE 
STATS_READ_BYTES 
STATS_READ_PACKETS 
STATS_DEMUX_READ 
STATS_DEMUX_BITRATE 
STATS_DEMUX_CORRUPTED 
STATS_DEMUX_DISCONTINUITY 
STATS_PLAYED_ABUFFERS 
STATS_LOST_ABUFFERS 
STATS_DECODED_AUDIO 
STATS_DECODED_VIDEO 
STATS_DECODED_SUB 
STATS_CLIENT_CONNECTIONS 
STATS_ACTIVE_CONNECTIONS 
STATS_SOUT_SENT_PACKETS 
STATS_SOUT_SENT_BYTES 
STATS_SOUT_SEND_BITRATE 
STATS_DISPLAYED_PICTURES 
STATS_LOST_PICTURES 

Function Documentation

void intf_DestroyAll ( libvlc_int_t p_libvlc  ) 
static libvlc_priv_t* libvlc_priv ( libvlc_int_t libvlc  )  [inline, static]
module_t* module_find_by_shortcut ( const char *  psz_shortcut  ) 

Get a pointer to a module_t that matches a shortcut.

This is a temporary hack for SD. Do not re-use (generally multiple modules can have the same shortcut, so this is *broken* - use module_need()!).

Parameters:
psz_shortcut shortcut of the module
psz_cap capability of the module
Returns:
a pointer to the module or NULL in case of a failure

References module_t::i_shortcuts, list, module_list_free(), module_list_get(), and module_t::pp_shortcuts.

void playlist_ServicesDiscoveryKillAll ( playlist_t p_playlist  ) 
void stats_ComputeInputStats ( input_thread_t ,
input_stats_t  
)
void stats_CounterClean ( counter_t  ) 
counter_t* stats_CounterCreate ( int  i_compute_type  ) 

Create a statistics counter.

Parameters:
i_compute_type the aggregation type. One of STATS_LAST (always keep the last value), STATS_COUNTER (increment by the passed value), STATS_MAX (keep the maximum passed value), STATS_MIN, or STATS_DERIVATIVE (keep a time derivative of the value)

References counter_t::i_compute_type, counter_t::i_samples, counter_t::last_update, and counter_t::pp_samples.

void stats_ReinitInputStats ( input_stats_t  ) 
void stats_Update ( counter_t p_counter,
uint64_t  val,
uint64_t *  new_val 
)

Update a counter element with new values.

Parameters:
p_counter the counter to update
val the vlc_value union containing the new value to aggregate. For more information on how data is aggregated,
See also:
stats_Create
Parameters:
val_new a pointer that will be filled with new data

References CLOCK_FREQ, counter_sample_t::date, counter_t::i_compute_type, counter_t::i_samples, INSERT_ELEM, counter_t::last_update, mdate(), counter_t::pp_samples, REMOVE_ELEM, STATS_COUNTER, STATS_DERIVATIVE, and counter_sample_t::value.

Referenced by AReadBlock(), AReadStream(), DecoderDecodeAudio(), DecoderDecodeVideo(), DecoderProcessSpu(), EsOutSend(), and input_UpdateStatistic().

void system_Configure ( libvlc_int_t ,
int  ,
const char *  const[] 
)
void system_End ( void   ) 
void system_Init ( void   ) 
void var_OptionParse ( vlc_object_t p_obj,
const char *  psz_option,
bool  trusted 
)

Parse a stringified option This function parse a string option and create the associated object variable The option must be of the form "[no[-]]foo[=bar]" where foo is the option name and bar is the value of the option.

Parameters:
p_obj the object in which the variable must be created
psz_option the option to parse
trusted whether the option is set by a trusted input or not
Returns:
nothing

References vlc_value_t::b_bool, config_GetType, config_IsSafe(), vlc_value_t::f_float, vlc_value_t::i_int, i_type, msg_Err, psz_name, vlc_value_t::psz_string, psz_value, strdup(), strtoll(), us_atof(), var_Create, var_Set, VLC_VAR_BOOL, VLC_VAR_FLOAT, VLC_VAR_INTEGER, and VLC_VAR_STRING.

Referenced by Create(), and var_LocationParse().

int vlc_clone_detach ( vlc_thread_t ,
void *  *)(void *,
void *  ,
int   
)
void vlc_CPU_dump ( vlc_object_t  ) 
void vlc_CPU_init ( void   ) 

Determines the CPU capabilities and stores them in cpu_flags.

The result can be retrieved with vlc_CPU().

References CPU_CAPABILITY_MMXEXT, and cpu_flags.

Referenced by _DLL_InitTerm(), DllMain(), and vlc_CPU().

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.

Parameters:
p_this an existing VLC object
i_size byte size of the object structure
psz_type object type name
Returns:
the created object, or NULL.

References DumpCommand(), vlc_object_internals::first, vlc_object_internals::i_refcount, libvlc_lock(), libvlc_priv(), libvlc_unlock(), likely, vlc_object_internals::next, vlc_object_internals::pf_destructor, vlc_object_internals::pipes, vlc_object_internals::prev, vlc_object_internals::psz_name, vlc_object_internals::ref_spin, unlikely, var_AddCallback, var_Create, vlc_object_internals::var_lock, vlc_object_internals::var_root, vlc_object_internals::var_wait, vlc_cond_init(), vlc_internals, vlc_mutex_init(), vlc_object_hold, vlc_restorecancel(), vlc_savecancel(), vlc_spin_init(), VLC_VAR_ISCOMMAND, and VLC_VAR_STRING.

void vlc_DeinitActions ( libvlc_int_t ,
struct vlc_actions  
)
void vlc_ExitDestroy ( vlc_exit_t  ) 
void vlc_ExitInit ( vlc_exit_t  ) 
struct vlc_actions* vlc_InitActions ( libvlc_int_t  )  [read]
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, vlc_object_internals::ref_spin, vlc_internals, vlc_spin_lock, and vlc_spin_unlock.

int vlc_object_set_name ( vlc_object_t ,
const char *   
)
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.

Parameters:
obj object that would be "killed"
Returns:
a readable pipe descriptor, or -1 on error.

References msg_Dbg, vlc_object_internals::pipes, vlc_internals, vlc_mutex_lock(), vlc_pipe(), vlc_restorecancel(), and vlc_savecancel().

Referenced by httpd_HostCreate(), httpd_HostThread(), net_Accept(), net_Connect(), net_Read(), and net_Write().

int vlc_set_priority ( vlc_thread_t  ,
int   
)

References rt_offset, and rt_priorities.

Referenced by Init().

void vlc_threads_setup ( libvlc_int_t  ) 
size_t vlc_towc ( const char *  str,
uint32_t *restrict  pwc 
)

Converts the first character from a UTF-8 sequence into a code point.

Parameters:
str an UTF-8 bytes sequence
Returns:
0 if str points to an empty string, i.e. the first character is NUL; number of bytes that the first character occupies (from 1 to 4) otherwise; -1 if the byte sequence was not a valid UTF-8 sequence.

References clz8, and unlikely.

Referenced by convert_xml_special_chars(), EnsureUTF8(), IsUTF8(), vlc_str2keycode(), and vlc_strcasestr().

void vlc_trace ( const char *  fn,
const char *  file,
unsigned  line 
)

Print a backtrace to the standard error for debugging purpose.

References fsync().

Referenced by vlc_thread_fatal().


Variable Documentation

const char psz_vlc_changeset[]

Referenced by libvlc_InternalInit(), and Version().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines