vlc_common.h File Reference

This file is a collection of common definitions and types. More...

Include dependency graph for vlc_common.h:

Go to the source code of this file.

Data Structures

union  vlc_value_t
 VLC value structure. More...
struct  vlc_list_t
 VLC list structure. More...
struct  gc_object_t

Defines

#define VLC_COMMON_H   1
#define VLC_FOURCC(a, b, c, d)
#define VLC_TWOCC(a, b)   ( (uint16_t)(a) | ( (uint16_t)(b) << 8 ) )
#define vlc_fourcc_to_char(a, b)   __vlc_fourcc_to_char( (vlc_fourcc_t)(a), (char *)(b) )
#define VLC_VAR_VOID   0x0010
#define VLC_VAR_BOOL   0x0020
#define VLC_VAR_INTEGER   0x0030
#define VLC_VAR_HOTKEY   0x0031
#define VLC_VAR_STRING   0x0040
#define VLC_VAR_MODULE   0x0041
#define VLC_VAR_FILE   0x0042
#define VLC_VAR_DIRECTORY   0x0043
#define VLC_VAR_VARIABLE   0x0044
#define VLC_VAR_FLOAT   0x0050
#define VLC_VAR_TIME   0x0060
#define VLC_VAR_ADDRESS   0x0070
#define VLC_VAR_MUTEX   0x0080
#define VLC_VAR_LIST   0x0090
#define VLC_SUCCESS   -0
#define VLC_ENOMEM   -1
#define VLC_ETHREAD   -2
#define VLC_ETIMEOUT   -3
#define VLC_ENOMOD   -10
#define VLC_ENOOBJ   -20
#define VLC_ENOVAR   -30
#define VLC_EBADVAR   -31
#define VLC_ENOITEM   -40
 Item not found.
#define VLC_EEXIT   -255
#define VLC_EEXITSUCCESS   -999
#define VLC_EGENERIC   -666
#define LIBVLC_EXTERN   extern
#define LIBVLC_EXPORT
#define VLC_EXPORT(type, name, args)   LIBVLC_EXTERN LIBVLC_EXPORT type name args
#define VLC_COMMON_MEMBERS
#define VLC_OBJECT(x)   (((vlc_object_t *)(x))+0*(x)->be_sure_to_add_VLC_COMMON_MEMBERS_to_struct)
#define VLC_GC_MEMBERS
#define vlc_gc_incref(a)   __vlc_gc_incref( (gc_object_t *)a )
#define vlc_gc_decref(a)   __vlc_gc_decref( (gc_object_t *)a )
#define vlc_gc_init(a, b, c)   __vlc_gc_init( (gc_object_t *)a,b,c )
#define CEIL(n, d)   ( ((n) / (d)) + ( ((n) % (d)) ? 1 : 0) )
#define PAD(n, d)   ( ((n) % (d)) ? ((((n) / (d)) + 1) * (d)) : (n) )
#define __MAX(a, b)   ( ((a) > (b)) ? (a) : (b) )
#define __MIN(a, b)   ( ((a) < (b)) ? (a) : (b) )
#define MALLOC_VOID(var, type)
#define MALLOC_NULL(var, type)
#define MALLOC_ERR(var, type)
#define MALLOC_GOTOERR(var, type)
#define DECMALLOC_VOID(var, type)
#define DECMALLOC_ERR(var, type)
#define DECMALLOC_NULL(var, type)
#define FREENULL(a)   do { free( a ); a = NULL; } while(0)
#define EMPTY_STR(str)   (!str || !*str)
#define GetWBE(p)   U16_AT( p )
#define GetDWBE(p)   U32_AT( p )
#define GetQWBE(p)   U64_AT( p )
#define SetWLE(p, v)   _SetWLE( (uint8_t*)(p), v)
#define SetDWLE(p, v)   _SetDWLE( (uint8_t*)(p), v)
#define SetQWLE(p, v)   _SetQWLE( (uint8_t*)(p), v)
#define SetWBE(p, v)   _SetWBE( (uint8_t*)(p), v)
#define SetDWBE(p, v)   _SetDWBE( (uint8_t*)(p), v)
#define SetQWBE(p, v)   _SetQWBE( (uint8_t*)(p), v)
#define hton16(i)   htons(i)
#define hton32(i)   htonl(i)
#define ntoh16(i)   ntohs(i)
#define ntoh32(i)   ntohl(i)
#define hton64(i)   ntoh64(i)
#define LIBVLC_FORMAT(x, y)
#define VLC_UNUSED(x)   (void)(x)
#define wraptext   vlc_wraptext
#define vlc_execve(a, b, c, d, e, f, g, h, i)   __vlc_execve(VLC_OBJECT(a),b,c,d,e,f,g,h,i)
#define CPU_CAPABILITY_NONE   0
#define CPU_CAPABILITY_486   (1<<0)
#define CPU_CAPABILITY_586   (1<<1)
#define CPU_CAPABILITY_PPRO   (1<<2)
#define CPU_CAPABILITY_MMX   (1<<3)
#define CPU_CAPABILITY_3DNOW   (1<<4)
#define CPU_CAPABILITY_MMXEXT   (1<<5)
#define CPU_CAPABILITY_SSE   (1<<6)
#define CPU_CAPABILITY_SSE2   (1<<7)
#define CPU_CAPABILITY_ALTIVEC   (1<<16)
#define CPU_CAPABILITY_FPU   (1<<31)
#define DIR_SEP_CHAR   '/'
#define DIR_SEP   "/"
#define PATH_SEP_CHAR   ':'
#define PATH_SEP   ":"
#define LICENSE_MSG

Typedefs

typedef unsigned long count_t
typedef uint16_t audio_volume_t
typedef int64_t mtime_t
 High precision date or time interval.
typedef uint32_t vlc_fourcc_t
 The vlc_fourcc_t type.
typedef vlc_list_t vlc_list_t
typedef vlc_object_t vlc_object_t
typedef libvlc_int_t libvlc_int_t
typedef variable_t variable_t
typedef date_t date_t
typedef dict_entry_t dict_entry_t
typedef dict_t dict_t
typedef gc_object_t gc_object_t
typedef msg_subscription_t msg_subscription_t
typedef playlist_t playlist_t
typedef playlist_item_t playlist_item_t
typedef playlist_view_t playlist_view_t
typedef playlist_export_t playlist_export_t
typedef services_discovery_t services_discovery_t
typedef services_discovery_sys_t services_discovery_sys_t
typedef playlist_add_t playlist_add_t
typedef playlist_preparse_t playlist_preparse_t
typedef playlist_fetcher_t playlist_fetcher_t
typedef module_bank_t module_bank_t
typedef module_t module_t
typedef module_config_t module_config_t
typedef module_symbols_t module_symbols_t
typedef module_cache_t module_cache_t
typedef config_category_t config_category_t
typedef intf_thread_t intf_thread_t
typedef intf_sys_t intf_sys_t
typedef intf_console_t intf_console_t
typedef intf_msg_t intf_msg_t
typedef interaction_t interaction_t
typedef interaction_dialog_t interaction_dialog_t
typedef user_widget_t user_widget_t
typedef input_thread_t input_thread_t
typedef input_thread_sys_t input_thread_sys_t
typedef input_item_t input_item_t
typedef access_t access_t
typedef access_sys_t access_sys_t
typedef stream_t stream_t
typedef stream_sys_t stream_sys_t
typedef demux_t demux_t
typedef demux_meta_t demux_meta_t
typedef demux_sys_t demux_sys_t
typedef es_out_t es_out_t
typedef es_out_id_t es_out_id_t
typedef es_out_sys_t es_out_sys_t
typedef es_descriptor_t es_descriptor_t
typedef seekpoint_t seekpoint_t
typedef info_t info_t
typedef info_category_t info_category_t
typedef input_attachment_t input_attachment_t
typedef audio_format_t audio_format_t
typedef video_format_t video_format_t
typedef subs_format_t subs_format_t
typedef es_format_t es_format_t
typedef video_palette_t video_palette_t
typedef aout_instance_t aout_instance_t
typedef aout_sys_t aout_sys_t
typedef aout_fifo_t aout_fifo_t
typedef aout_input_t aout_input_t
typedef aout_buffer_t aout_buffer_t
typedef audio_format_t audio_sample_format_t
typedef audio_date_t audio_date_t
typedef aout_filter_t aout_filter_t
typedef vout_thread_t vout_thread_t
typedef vout_sys_t vout_sys_t
typedef video_format_t video_frame_format_t
typedef picture_t picture_t
typedef picture_sys_t picture_sys_t
typedef picture_heap_t picture_heap_t
typedef spu_t spu_t
typedef subpicture_t subpicture_t
typedef subpicture_sys_t subpicture_sys_t
typedef subpicture_region_t subpicture_region_t
typedef text_style_t text_style_t
typedef image_handler_t image_handler_t
typedef sout_instance_t sout_instance_t
typedef sout_instance_sys_t sout_instance_sys_t
typedef sout_input_t sout_input_t
typedef sout_packetizer_input_t sout_packetizer_input_t
typedef sout_access_out_t sout_access_out_t
typedef sout_access_out_sys_t sout_access_out_sys_t
typedef sout_mux_t sout_mux_t
typedef sout_mux_sys_t sout_mux_sys_t
typedef sout_stream_t sout_stream_t
typedef sout_stream_sys_t sout_stream_sys_t
typedef config_chain_t config_chain_t
typedef sap_session_t sap_session_t
typedef sap_address_t sap_address_t
typedef session_descriptor_t session_descriptor_t
typedef announce_method_t announce_method_t
typedef announce_handler_t announce_handler_t
typedef sap_handler_t sap_handler_t
typedef sout_param_t sout_param_t
typedef sout_pcat_t sout_pcat_t
typedef sout_std_t sout_std_t
typedef sout_display_t sout_display_t
typedef sout_duplicate_t sout_duplicate_t
typedef sout_transcode_t sout_transcode_t
typedef sout_chain_t sout_chain_t
typedef streaming_profile_t streaming_profile_t
typedef sout_module_t sout_module_t
typedef sout_gui_descr_t sout_gui_descr_t
typedef profile_parser_t profile_parser_t
typedef decoder_t decoder_t
typedef decoder_sys_t decoder_sys_t
typedef decoder_synchro_t decoder_synchro_t
typedef encoder_t encoder_t
typedef encoder_sys_t encoder_sys_t
typedef filter_t filter_t
typedef filter_sys_t filter_sys_t
typedef network_socket_t network_socket_t
typedef virtual_socket_t v_socket_t
typedef sockaddr sockaddr
typedef addrinfo addrinfo
typedef vlc_acl_t vlc_acl_t
typedef vlc_url_t vlc_url_t
typedef iso639_lang_t iso639_lang_t
typedef device_t device_t
typedef device_probe_t device_probe_t
typedef probe_sys_t probe_sys_t
typedef block_t block_t
typedef block_fifo_t block_fifo_t
typedef httpd_t httpd_t
typedef httpd_host_t httpd_host_t
typedef httpd_url_t httpd_url_t
typedef httpd_client_t httpd_client_t
typedef httpd_callback_sys_t httpd_callback_sys_t
typedef httpd_message_t httpd_message_t
typedef int(*) httpd_callback_t (httpd_callback_sys_t *, httpd_client_t *, httpd_message_t *answer, const httpd_message_t *query)
typedef httpd_file_t httpd_file_t
typedef httpd_file_sys_t httpd_file_sys_t
typedef int(*) httpd_file_callback_t (httpd_file_sys_t *, httpd_file_t *, uint8_t *psz_request, uint8_t **pp_data, int *pi_data)
typedef httpd_handler_t httpd_handler_t
typedef httpd_handler_sys_t httpd_handler_sys_t
typedef int(*) httpd_handler_callback_t (httpd_handler_sys_t *, httpd_handler_t *, char *psz_url, uint8_t *psz_request, int i_type, uint8_t *p_in, int i_in, char *psz_remote_addr, char *psz_remote_host, uint8_t **pp_data, int *pi_data)
typedef httpd_redirect_t httpd_redirect_t
typedef httpd_stream_t httpd_stream_t
typedef tls_server_t tls_server_t
typedef tls_session_t tls_session_t
typedef md5_s md5_t
typedef xml_t xml_t
typedef xml_sys_t xml_sys_t
typedef xml_reader_t xml_reader_t
typedef xml_reader_sys_t xml_reader_sys_t
typedef vod_t vod_t
typedef vod_sys_t vod_sys_t
typedef vod_media_t vod_media_t
typedef opengl_t opengl_t
typedef opengl_sys_t opengl_sys_t
typedef osd_menu_t osd_menu_t
typedef osd_state_t osd_state_t
typedef osd_event_t osd_event_t
typedef osd_button_t osd_button_t
typedef osd_menu_state_t osd_menu_state_t
typedef vlm_t vlm_t
typedef vlm_message_t vlm_message_t
typedef vlc_meta_t vlc_meta_t
typedef meta_export_t meta_export_t
typedef counter_t counter_t
typedef counter_sample_t counter_sample_t
typedef stats_handler_t stats_handler_t
typedef input_stats_t input_stats_t
typedef global_stats_t global_stats_t
typedef update_t update_t
typedef update_iterator_t update_iterator_t
typedef meta_engine_t meta_engine_t
typedef int(*) vlc_callback_t (vlc_object_t *, char const *, vlc_value_t, vlc_value_t, void *)
typedef vlc_object_internals_t vlc_object_internals_t
typedef void * vlc_iconv_t
typedef void *(*) vlc_memcpy_t (void *tgt, const void *src, size_t n)
typedef void *(*) vlc_memset_t (void *tgt, int c, size_t n)

Enumerations

enum  playlist_command_t {
  PLAYLIST_PLAY, PLAYLIST_VIEWPLAY, PLAYLIST_PAUSE, PLAYLIST_STOP,
  PLAYLIST_SKIP
}
 Playlist commands. More...

Functions

static void __vlc_fourcc_to_char (vlc_fourcc_t fcc, char *psz_fourcc)
void __vlc_gc_incref (gc_object_t *p_gc)
void __vlc_gc_decref (gc_object_t *p_gc)
void __vlc_gc_init (gc_object_t *p_gc, void(*pf_destructor)(gc_object_t *), void *arg)
static int64_t GCD (int64_t a, int64_t b)
static uint8_t clip_uint8_vlc (int32_t a)
char const * vlc_error (int)
static uint16_t U16_AT (const void *_p)
static uint32_t U32_AT (const void *_p)
static uint64_t U64_AT (const void *_p)
static uint16_t GetWLE (const void *_p)
static uint32_t GetDWLE (const void *_p)
static uint64_t GetQWLE (const void *_p)
static void _SetWLE (uint8_t *p, uint16_t i_dw)
static void _SetDWLE (uint8_t *p, uint32_t i_dw)
static void _SetQWLE (uint8_t *p, uint64_t i_qw)
static void _SetWBE (uint8_t *p, uint16_t i_dw)
static void _SetDWBE (uint8_t *p, uint32_t i_dw)
static void _SetQWBE (uint8_t *p, uint64_t i_qw)
static uint64_t ntoh64 (uint64_t ll)
size_t vlc_strlcpy (char *, const char *, size_t)
long long vlc_strtoll (const char *nptr, char **endptr, int base)
char * vlc_strcasestr (const char *s1, const char *s2)
bool vlc_ureduce (unsigned *, unsigned *, uint64_t, uint64_t, uint64_t)
char * vlc_wraptext (const char *, int)
vlc_iconv_t vlc_iconv_open (const char *, const char *)
size_t vlc_iconv (vlc_iconv_t, const char **, size_t *, char **, size_t *)
int vlc_iconv_close (vlc_iconv_t)
int __vlc_execve (vlc_object_t *p_object, int i_argc, char *const *pp_argv, char *const *pp_env, const char *psz_cwd, const char *p_in, size_t i_in, char **pp_data, size_t *pi_data)
int vlc_wclosedir (void *_p_dir)
unsigned vlc_CPU (void)
void vlc_fastmem_register (vlc_memcpy_t cpy, vlc_memset_t set)
void * vlc_memcpy (void *, const void *, size_t)
 vlc_memcpy: fast CPU-dependent memcpy
void * vlc_memset (void *, int, size_t)
 vlc_memset: fast CPU-dependent memset
char * vlc_gettext (const char *msgid)
const char * VLC_Version (void)
const char * VLC_CompileBy (void)
const char * VLC_CompileHost (void)
const char * VLC_CompileDomain (void)
const char * VLC_Compiler (void)
const char * VLC_Error (int)
const char * VLC_Changeset (void)


Detailed Description

This file is a collection of common definitions and types.


Define Documentation

#define __MAX ( a,
 )     ( ((a) > (b)) ? (a) : (b) )

#define __MIN ( a,
 )     ( ((a) < (b)) ? (a) : (b) )

#define CEIL ( n,
 )     ( ((n) / (d)) + ( ((n) % (d)) ? 1 : 0) )

#define CPU_CAPABILITY_3DNOW   (1<<4)

#define CPU_CAPABILITY_486   (1<<0)

#define CPU_CAPABILITY_586   (1<<1)

#define CPU_CAPABILITY_ALTIVEC   (1<<16)

#define CPU_CAPABILITY_FPU   (1<<31)

#define CPU_CAPABILITY_MMX   (1<<3)

#define CPU_CAPABILITY_MMXEXT   (1<<5)

#define CPU_CAPABILITY_NONE   0

#define CPU_CAPABILITY_PPRO   (1<<2)

#define CPU_CAPABILITY_SSE   (1<<6)

#define CPU_CAPABILITY_SSE2   (1<<7)

#define DECMALLOC_ERR ( var,
type   ) 

Value:

type* var = (type*)malloc( sizeof(type) );\
                                    if( !var ) return VLC_ENOMEM;

#define DECMALLOC_NULL ( var,
type   ) 

Value:

type* var = (type*)malloc( sizeof(type) );\
                                    if( !var ) return NULL;

#define DECMALLOC_VOID ( var,
type   ) 

Value:

type* var = (type*)malloc( sizeof(type) );\
                                    if( !var ) return;

#define DIR_SEP   "/"

#define DIR_SEP_CHAR   '/'

#define EMPTY_STR ( str   )     (!str || !*str)

#define FREENULL (  )     do { free( a ); a = NULL; } while(0)

#define GetDWBE (  )     U32_AT( p )

#define GetQWBE (  )     U64_AT( p )

#define GetWBE (  )     U16_AT( p )

#define hton16 (  )     htons(i)

#define hton32 (  )     htonl(i)

#define hton64 (  )     ntoh64(i)

#define LIBVLC_EXPORT

#define LIBVLC_EXTERN   extern

#define LIBVLC_FORMAT ( x,
 ) 

#define LICENSE_MSG

Value:

_("This program comes with NO WARRANTY, to the extent permitted by " \
    "law.\nYou may redistribute it under the terms of the GNU General " \
    "Public License;\nsee the file named COPYING for details.\n" \
    "Written by the VideoLAN team; see the AUTHORS file.\n")

#define MALLOC_ERR ( var,
type   ) 

Value:

do { var = (type*)malloc( sizeof( type) ); \
                                   if( !var ) return VLC_ENOMEM; } while(0)

#define MALLOC_GOTOERR ( var,
type   ) 

Value:

do { var = (type*)malloc( sizeof( type) ); \
                                      if( !var ) goto error; } while(0)

#define MALLOC_NULL ( var,
type   ) 

Value:

do { var = (type*)malloc( sizeof( type) ); \
                                   if( !var ) return NULL; } while(0)

#define MALLOC_VOID ( var,
type   ) 

Value:

do { var = (type*)malloc( sizeof( type) ); \
                                   if( !var ) return; } while(0)

#define ntoh16 (  )     ntohs(i)

#define ntoh32 (  )     ntohl(i)

#define PAD ( n,
 )     ( ((n) % (d)) ? ((((n) / (d)) + 1) * (d)) : (n) )

#define PATH_SEP   ":"

#define PATH_SEP_CHAR   ':'

#define SetDWBE ( p,
 )     _SetDWBE( (uint8_t*)(p), v)

#define SetDWLE ( p,
 )     _SetDWLE( (uint8_t*)(p), v)

#define SetQWBE ( p,
 )     _SetQWBE( (uint8_t*)(p), v)

#define SetQWLE ( p,
 )     _SetQWLE( (uint8_t*)(p), v)

#define SetWBE ( p,
 )     _SetWBE( (uint8_t*)(p), v)

#define SetWLE ( p,
 )     _SetWLE( (uint8_t*)(p), v)

#define VLC_COMMON_H   1

#define VLC_COMMON_MEMBERS

Value:

/** \name VLC_COMMON_MEMBERS                                                \
 * these members are common for all vlc objects                             \
 */                                                                         \
/**@{*/                                                                     \
    int   i_object_id;                                                      \
    int   i_object_type;                                                    \
    const char *psz_object_type;                                            \
    char *psz_object_name;                                                  \
                                                                            \
    /* Messages header */                                                   \
    char *psz_header;                                                       \
    int  i_flags;                                                           \
                                                                            \
    /* Object properties */                                                 \
    volatile bool b_error;                  /**< set by the object */ \
    volatile bool b_die;                   /**< set by the outside */ \
    volatile bool b_dead;                   /**< set by the object */ \
    bool b_force;      /**< set by the outside (eg. module_Need()) */ \
                                                                            \
    /* Stuff related to the libvlc structure */                             \
    libvlc_int_t *p_libvlc;                  /**< (root of all evil) - 1 */ \
                                                                            \
    vlc_object_t *  p_parent;                            /**< our parent */ \
                                                                            \
    /* Private data */                                                      \
    void *          p_private;                                              \
                                                                            \
    /** Just a reminder so that people don't cast garbage */                \
    int be_sure_to_add_VLC_COMMON_MEMBERS_to_struct;                        \

#define VLC_EBADVAR   -31

#define VLC_EEXIT   -255

#define VLC_EEXITSUCCESS   -999

#define VLC_EGENERIC   -666

#define VLC_ENOITEM   -40

Item not found.

#define VLC_ENOMEM   -1

#define VLC_ENOMOD   -10

#define VLC_ENOOBJ   -20

#define VLC_ENOVAR   -30

#define VLC_ETHREAD   -2

#define VLC_ETIMEOUT   -3