VLC  2.1.0-git
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
libvlc.h File Reference

Go to the source code of this file.

Data Structures

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

Macros

#define vlc_object_kill(o)   vlc_object_kill(VLC_OBJECT(o))
#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 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 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)
 Initializes MME timer, Winsock.
void system_Configure (libvlc_int_t *, int, const char *const [])
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()).
void vlc_object_kill (vlc_object_t *) VLC_DEPRECATED
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)
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 []

Macro Definition 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,
 
)    vlc_custom_create(VLC_OBJECT(o), s, n)
#define vlc_object_kill (   o)    vlc_object_kill(VLC_OBJECT(o))
#define vlc_object_set_destructor (   a,
 
)    vlc_object_set_destructor (VLC_OBJECT(a), b)
#define vlc_object_set_name (   o,
 
)    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

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)

Stops and destroys all interfaces.

Parameters
p_libvlcthe LibVLC instance

References config_ChainDestroy(), libvlc_priv(), lock, module_unneed, libvlc_priv_t::p_intf, intf_thread_t::p_next, vlc_mutex_lock(), vlc_mutex_unlock(), vlc_object_kill, and vlc_object_release.

Referenced by libvlc_InternalCleanup().

static libvlc_priv_t* libvlc_priv ( libvlc_int_t libvlc)
inlinestatic
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_shortcutshortcut of the module
psz_capcapability of the module
Returns
a pointer to the module or NULL in case of a failure

References count, 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_typethe 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_counterthe counter to update
valthe vlc_value union containing the new value to aggregate. For more information on how data is aggregated,
See Also
stats_Create
Parameters
val_newa 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_Init ( void  )

Initializes MME timer, Winsock.

References _fmode_bin, getenv(), setenv(), and system_InitWSA().

Referenced by config_GetLibDir(), config_GetLibPath(), and libvlc_InternalInit().

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_objthe object in which the variable must be created
psz_optionthe option to parse
trustedwhether 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 )

References msg_Dbg.

Referenced by libvlc_InternalInit().

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_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_thisan existing VLC object
i_sizebyte size of the object structure
psz_typeobject type name
Returns
the created object, or NULL.
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_kill ( vlc_object_t )
void vlc_object_set_destructor ( vlc_object_t ,
vlc_destructor_t   
)
int vlc_object_set_name ( vlc_object_t ,
const char *   
)

Assign a name to an object for vlc_object_find_name().

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
objobject that would be "killed"
Returns
a readable pipe descriptor, or -1 on error.

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

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

int vlc_set_priority ( vlc_thread_t  ,
int   
)

< No error

< Unspecified error

< No error

< No error

< Unspecified error

< No error

References rt_offset, rt_priorities, VLC_EGENERIC, and VLC_SUCCESS.

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
stran 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().