24#ifndef LIBVLC_MODULES_MACROS_H
25# define LIBVLC_MODULES_MACROS_H 1
114#define CONFIG_HINT_CATEGORY 0x02
116#define CONFIG_SUBCATEGORY 0x07
117#define CONFIG_SECTION 0x08
120#define CONFIG_ITEM_FLOAT 0x20
121#define CONFIG_ITEM_INTEGER 0x40
122#define CONFIG_ITEM_RGB 0x41
123#define CONFIG_ITEM_BOOL 0x60
124#define CONFIG_ITEM_STRING 0x80
125#define CONFIG_ITEM_PASSWORD 0x81
126#define CONFIG_ITEM_KEY 0x82
127#define CONFIG_ITEM_MODULE 0x84
128#define CONFIG_ITEM_MODULE_CAT 0x85
129#define CONFIG_ITEM_MODULE_LIST 0x86
130#define CONFIG_ITEM_MODULE_LIST_CAT 0x87
131#define CONFIG_ITEM_LOADFILE 0x8C
132#define CONFIG_ITEM_SAVEFILE 0x8D
133#define CONFIG_ITEM_DIRECTORY 0x8E
134#define CONFIG_ITEM_FONT 0x8F
137#define CONFIG_CLASS(x) ((x) & ~0x1F)
140#define CONFIG_ITEM(x) (((x) & ~0xF) != 0)
142#define IsConfigStringType(type) \
143 (((type) & CONFIG_ITEM_STRING) != 0)
144#define IsConfigIntegerType(type) \
145 (((type) & CONFIG_ITEM_INTEGER) != 0)
146#define IsConfigFloatType(type) \
147 ((type) == CONFIG_ITEM_FLOAT)
222#define VLC_API_VERSION_STRING "4.0.6"
237#define CONCATENATE( y, z ) CRUDE_HACK( y, z )
238#define CRUDE_HACK( y, z ) y##__##z
239#define STRINGIFY_NAME_( z ) #z
240#define STRINGIFY_NAME( z ) STRINGIFY_NAME_( z )
242#if defined(__cplusplus)
243#define EXTERN_SYMBOL extern "C"
248#if !defined(MODULE_STRING) && defined(MODULE_NAME)
249# define MODULE_STRING STRINGIFY_NAME(MODULE_NAME)
253#define VLC_ENTRY_FUNC(name) int (name)(vlc_set_cb, void *)
255#define VLC_MODULE_ENTRY(name) CONCATENATE(vlc_entry, name)
257#define VLC_DECL_MODULE_ENTRY(name) VLC_ENTRY_FUNC(VLC_MODULE_ENTRY(name))
261#ifdef VLC_DYNAMIC_PLUGIN
262# define VLC_SYMBOL(symbol) symbol
263# define VLC_MODULE_NAME_HIDDEN_SYMBOL \
264 EXTERN_SYMBOL const char vlc_module_name[] = MODULE_STRING;
266# define VLC_SYMBOL(symbol) CONCATENATE(symbol, MODULE_NAME)
267# define VLC_MODULE_NAME_HIDDEN_SYMBOL
271#if defined (VLC_DYNAMIC_PLUGIN)
273# define DLL_SYMBOL __declspec(dllexport)
275# define CDECL_SYMBOL __cdecl
276# elif defined (__GNUC__)
277# define DLL_SYMBOL __attribute__((visibility("default")))
292#define vlc_plugin_set(...) vlc_set (opaque, NULL, __VA_ARGS__)
293#define vlc_module_set(...) vlc_set (opaque, module, __VA_ARGS__)
294#define vlc_config_set(...) vlc_set (opaque, config, __VA_ARGS__)
300 int64_t **values,
char ***descs);
303 char ***values,
char ***descs);
307# define VLC_CHECKED_TYPE(type, value) [](type v){ return v; }(value)
309# define VLC_CHECKED_TYPE(type, value) (type){ value }
318#define vlc_module_begin() \
319EXTERN_SYMBOL DLL_SYMBOL \
320int CDECL_SYMBOL VLC_SYMBOL(vlc_entry)(vlc_set_cb vlc_set, void *opaque) \
323 struct vlc_param *config = NULL; \
324 if (vlc_plugin_set (VLC_MODULE_CREATE, &module)) \
326 if (vlc_module_set (VLC_MODULE_NAME, (MODULE_STRING))) \
329#define vlc_module_end() \
335VLC_MODULE_NAME_HIDDEN_SYMBOL \
338#define add_submodule( ) \
339 if (vlc_plugin_set (VLC_MODULE_CREATE, &module)) \
342#define add_shortcut( ... ) \
344 const char *shortcuts[] = { __VA_ARGS__ }; \
345 if (vlc_module_set (VLC_MODULE_SHORTCUT, \
346 sizeof(shortcuts)/sizeof(shortcuts[0]), shortcuts)) \
350#define set_shortname( shortname ) \
351 if (vlc_module_set (VLC_MODULE_SHORTNAME, VLC_CHECKED_TYPE(const char *, shortname))) \
354#define set_description( desc ) \
355 if (vlc_module_set (VLC_MODULE_DESCRIPTION, VLC_CHECKED_TYPE(const char *, desc))) \
358#define set_help( help ) \
359 if (vlc_module_set (VLC_MODULE_HELP, VLC_CHECKED_TYPE(const char *, help))) \
362#define set_help_html( help_html ) \
363 if (vlc_module_set (VLC_MODULE_HELP_HTML, VLC_CHECKED_TYPE(const char *, help_html))) \
366#define set_capability( cap, score ) \
367 if (vlc_module_set (VLC_MODULE_CAPABILITY, VLC_CHECKED_TYPE(const char *, cap)) \
368 || vlc_module_set (VLC_MODULE_SCORE, VLC_CHECKED_TYPE(int, score))) \
371#define set_callback(activate) \
372 if (vlc_module_set(VLC_MODULE_CB_OPEN, #activate, (void *)(activate))) \
375#define set_callbacks( activate, deactivate ) \
376 set_callback(activate) \
377 if (vlc_module_set(VLC_MODULE_CB_CLOSE, #deactivate, \
378 (void (*)(vlc_object_t *))( deactivate ))) \
381#define cannot_unload_broken_library( ) \
382 if (vlc_module_set (VLC_MODULE_NO_UNLOAD)) \
385#define set_text_domain( dom ) \
386 if (vlc_plugin_set (VLC_MODULE_TEXTDOMAIN, VLC_CHECKED_TYPE(const char *, dom))) \
402#define add_type_inner( type ) \
403 vlc_plugin_set (VLC_CONFIG_CREATE, (type), &config);
405#define add_typedesc_inner( type, text, longtext ) \
406 add_type_inner( type ) \
407 vlc_config_set (VLC_CONFIG_DESC, VLC_CHECKED_TYPE(const char *, text), \
408 VLC_CHECKED_TYPE(const char *, longtext));
410#define add_typename_inner(type, name, text, longtext) \
411 add_typedesc_inner(type, text, longtext) \
412 vlc_config_set (VLC_CONFIG_NAME, VLC_CHECKED_TYPE(const char *, name));
414#define add_string_inner(type, name, text, longtext, v) \
415 add_typename_inner(type, name, text, longtext) \
416 vlc_config_set (VLC_CONFIG_VALUE, VLC_CHECKED_TYPE(const char *, v));
418#define add_int_inner(type, name, text, longtext, v) \
419 add_typename_inner(type, name, text, longtext) \
420 vlc_config_set (VLC_CONFIG_VALUE, VLC_CHECKED_TYPE(int64_t, v));
423#define set_subcategory( id ) \
424 add_type_inner( CONFIG_SUBCATEGORY ) \
425 vlc_config_set (VLC_CONFIG_VALUE, VLC_CHECKED_TYPE(int64_t, id));
427#define set_section( text, longtext ) \
428 add_typedesc_inner( CONFIG_SECTION, text, longtext )
430#ifndef VLC_DYNAMIC_PLUGIN
431#define add_category_hint(text, longtext) \
432 add_typedesc_inner( CONFIG_HINT_CATEGORY, text, longtext )
435#define add_string( name, value, text, longtext ) \
436 add_string_inner(CONFIG_ITEM_STRING, name, text, longtext, value)
438#define add_password(name, value, text, longtext) \
439 add_string_inner(CONFIG_ITEM_PASSWORD, name, text, longtext, value)
441#define add_loadfile(name, value, text, longtext) \
442 add_string_inner(CONFIG_ITEM_LOADFILE, name, text, longtext, value)
444#define add_savefile(name, value, text, longtext) \
445 add_string_inner(CONFIG_ITEM_SAVEFILE, name, text, longtext, value)
447#define add_directory(name, value, text, longtext) \
448 add_string_inner(CONFIG_ITEM_DIRECTORY, name, text, longtext, value)
450#define add_font(name, value, text, longtext) \
451 add_string_inner(CONFIG_ITEM_FONT, name, text, longtext, value)
453#define add_module(name, cap, value, text, longtext) \
454 add_string_inner(CONFIG_ITEM_MODULE, name, text, longtext, value) \
455 vlc_config_set (VLC_CONFIG_CAPABILITY, VLC_CHECKED_TYPE(const char *, cap));
457#define add_module_list(name, cap, value, text, longtext) \
458 add_string_inner(CONFIG_ITEM_MODULE_LIST, name, text, longtext, value) \
459 vlc_config_set (VLC_CONFIG_CAPABILITY, VLC_CHECKED_TYPE(const char *, cap));
461#ifndef VLC_DYNAMIC_PLUGIN
462#define add_module_cat(name, subcategory, value, text, longtext) \
463 add_string_inner(CONFIG_ITEM_MODULE_CAT, name, text, longtext, value) \
464 change_integer_range (subcategory , 0)
466#define add_module_list_cat(name, subcategory, value, text, longtext) \
467 add_string_inner(CONFIG_ITEM_MODULE_LIST_CAT, name, text, longtext, \
469 change_integer_range (subcategory , 0)
472#define add_integer( name, value, text, longtext ) \
473 add_int_inner(CONFIG_ITEM_INTEGER, name, text, longtext, value)
475#define add_rgb(name, value, text, longtext) \
476 add_int_inner(CONFIG_ITEM_RGB, name, text, longtext, value) \
477 change_integer_range( 0, 0xFFFFFF )
479#define add_key(name, value, text, longtext) \
480 add_string_inner(CONFIG_ITEM_KEY, "global-" name, text, longtext, \
482 add_string_inner(CONFIG_ITEM_KEY, name, text, longtext, value)
484#define add_integer_with_range( name, value, min, max, text, longtext ) \
485 add_integer( name, value, text, longtext ) \
486 change_integer_range( min, max )
488#define add_float( name, v, text, longtext ) \
489 add_typename_inner(CONFIG_ITEM_FLOAT, name, text, longtext) \
490 vlc_config_set (VLC_CONFIG_VALUE, VLC_CHECKED_TYPE(double, v));
492#define add_float_with_range( name, value, min, max, text, longtext ) \
493 add_float( name, value, text, longtext ) \
494 change_float_range( min, max )
496#define add_bool( name, v, text, longtext ) \
497 add_typename_inner(CONFIG_ITEM_BOOL, name, text, longtext) \
498 if (v) vlc_config_set (VLC_CONFIG_VALUE, (int64_t)true);
501#define add_obsolete_inner( name, type ) \
502 add_type_inner( type ) \
503 vlc_config_set (VLC_CONFIG_NAME, VLC_CHECKED_TYPE(const char *, name)); \
504 vlc_config_set (VLC_CONFIG_REMOVED);
506#define add_obsolete_bool( name ) \
507 add_obsolete_inner( name, CONFIG_ITEM_BOOL )
509#define add_obsolete_integer( name ) \
510 add_obsolete_inner( name, CONFIG_ITEM_INTEGER )
512#define add_obsolete_float( name ) \
513 add_obsolete_inner( name, CONFIG_ITEM_FLOAT )
515#define add_obsolete_string( name ) \
516 add_obsolete_inner( name, CONFIG_ITEM_STRING )
520#define change_short( ch ) \
521 vlc_config_set (VLC_CONFIG_SHORTCUT, VLC_CHECKED_TYPE(char, ch));
523#define change_string_list( list, list_text ) \
524 vlc_config_set (VLC_CONFIG_LIST, \
526 VLC_CHECKED_TYPE(const char *const *, list), \
527 VLC_CHECKED_TYPE(const char *const *, list_text));
529#define change_integer_list( list, list_text ) \
530 vlc_config_set (VLC_CONFIG_LIST, \
532 VLC_CHECKED_TYPE(const int *, list), \
533 VLC_CHECKED_TYPE(const char *const *, list_text));
535#define change_integer_range( minv, maxv ) \
536 vlc_config_set (VLC_CONFIG_RANGE, VLC_CHECKED_TYPE(int64_t, minv), \
537 VLC_CHECKED_TYPE(int64_t, maxv));
539#define change_float_range( minv, maxv ) \
540 vlc_config_set (VLC_CONFIG_RANGE, VLC_CHECKED_TYPE(double, minv), \
541 VLC_CHECKED_TYPE(double, maxv));
544#define change_private() \
545 vlc_config_set (VLC_CONFIG_PRIVATE);
548#define change_volatile() \
550 vlc_config_set (VLC_CONFIG_VOLATILE);
552#define change_safe() \
553 vlc_config_set (VLC_CONFIG_SAFE);
556#define VLC_CONFIG_INTEGER_ENUM(cb) \
557EXTERN_SYMBOL DLL_SYMBOL \
558int CDECL_SYMBOL VLC_SYMBOL(vlc_entry_cfg_int_enum)(const char *name, \
559 int64_t **values, char ***descs) \
561 return (cb)(name, values, descs); \
564#define VLC_CONFIG_STRING_ENUM(cb) \
565EXTERN_SYMBOL DLL_SYMBOL \
566int CDECL_SYMBOL VLC_SYMBOL(vlc_entry_cfg_str_enum)(const char *name, \
567 char ***values, char ***descs) \
569 return (cb)(name, values, descs); \
573#define VLC_META_EXPORT( name, value ) \
574 EXTERN_SYMBOL DLL_SYMBOL const char * CDECL_SYMBOL \
575 VLC_SYMBOL(vlc_entry_ ## name)(void); \
576 EXTERN_SYMBOL DLL_SYMBOL const char * CDECL_SYMBOL \
577 VLC_SYMBOL(vlc_entry_ ## name)(void) \
582#define VLC_API_VERSION_EXPORT \
583 VLC_META_EXPORT(api_version, VLC_API_VERSION_STRING)
585#define VLC_COPYRIGHT_VIDEOLAN \
586 "\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x20\x28\x43\x29\x20\x74\x68" \
587 "\x65\x20\x56\x69\x64\x65\x6f\x4c\x41\x4e\x20\x56\x4c\x43\x20\x6d" \
588 "\x65\x64\x69\x61\x20\x70\x6c\x61\x79\x65\x72\x20\x64\x65\x76\x65" \
589 "\x6c\x6f\x70\x65\x72\x73"
590#define VLC_LICENSE_LGPL_2_1_PLUS \
591 "\x4c\x69\x63\x65\x6e\x73\x65\x64\x20\x75\x6e\x64\x65\x72\x20\x74" \
592 "\x68\x65\x20\x74\x65\x72\x6d\x73\x20\x6f\x66\x20\x74\x68\x65\x20" \
593 "\x47\x4e\x55\x20\x4c\x65\x73\x73\x65\x72\x20\x47\x65\x6e\x65\x72" \
594 "\x61\x6c\x20\x50\x75\x62\x6c\x69\x63\x20\x4c\x69\x63\x65\x6e\x73" \
595 "\x65\x2c\x20\x76\x65\x72\x73\x69\x6f\x6e\x20\x32\x2e\x31\x20\x6f" \
596 "\x72\x20\x6c\x61\x74\x65\x72\x2e"
597#define VLC_LICENSE_GPL_2_PLUS \
598 "\x4c\x69\x63\x65\x6e\x73\x65\x64\x20\x75\x6e\x64\x65\x72\x20\x74" \
599 "\x68\x65\x20\x74\x65\x72\x6d\x73\x20\x6f\x66\x20\x74\x68\x65\x20" \
600 "\x47\x4e\x55\x20\x47\x65\x6e\x65\x72\x61\x6c\x20\x50\x75\x62\x6c" \
601 "\x69\x63\x20\x4c\x69\x63\x65\x6e\x73\x65\x2c\x20\x76\x65\x72\x73" \
602 "\x69\x6f\x6e\x20\x32\x20\x6f\x72\x20\x6c\x61\x74\x65\x72\x2e"
603#if defined (LIBVLC_INTERNAL_)
604# define VLC_MODULE_COPYRIGHT VLC_COPYRIGHT_VIDEOLAN
605# ifndef VLC_MODULE_LICENSE
606# define VLC_MODULE_LICENSE VLC_LICENSE_LGPL_2_1_PLUS
610#ifdef VLC_MODULE_COPYRIGHT
611# define VLC_COPYRIGHT_EXPORT VLC_META_EXPORT(copyright, VLC_MODULE_COPYRIGHT)
613# define VLC_COPYRIGHT_EXPORT
615#ifdef VLC_MODULE_LICENSE
616# define VLC_LICENSE_EXPORT VLC_META_EXPORT(license, VLC_MODULE_LICENSE)
618# define VLC_LICENSE_EXPORT
621#define VLC_METADATA_EXPORTS \
622 VLC_API_VERSION_EXPORT \
623 VLC_COPYRIGHT_EXPORT \
const char name[16]
Definition: httpd.c:1281
static void vlc_entry(void *p)
Definition: thread.c:436
Definition: configuration.h:30
This file is a collection of common definitions and types.
vlc_config_cat
Definition: vlc_plugin.h:152
@ CAT_SOUT
Definition: vlc_plugin.h:164
@ CAT_AUDIO
Definition: vlc_plugin.h:161
@ CAT_HIDDEN
Definition: vlc_plugin.h:156
@ CAT_PLAYLIST
Definition: vlc_plugin.h:166
@ CAT_VIDEO
Definition: vlc_plugin.h:162
@ CAT_INPUT
Definition: vlc_plugin.h:163
@ CAT_ADVANCED
Definition: vlc_plugin.h:165
@ CAT_UNKNOWN
Definition: vlc_plugin.h:158
@ CAT_INTERFACE
Definition: vlc_plugin.h:160
#define VLC_SYMBOL(symbol)
Definition: vlc_plugin.h:267
#define DLL_SYMBOL
Definition: vlc_plugin.h:283
vlc_module_properties
Definition: vlc_plugin.h:36
@ VLC_MODULE_NO_UNLOAD
Definition: vlc_plugin.h:48
@ VLC_CONFIG_OLDNAME_OBSOLETE
Definition: vlc_plugin.h:89
@ VLC_CONFIG_RANGE
Definition: vlc_plugin.h:65
@ VLC_CONFIG_DESC
Definition: vlc_plugin.h:95
@ VLC_CONFIG_ADD_ACTION_OBSOLETE
Definition: vlc_plugin.h:101
@ VLC_MODULE_CB_OPEN
Definition: vlc_plugin.h:46
@ VLC_CONFIG_VALUE
Definition: vlc_plugin.h:62
@ VLC_MODULE_HELP
Definition: vlc_plugin.h:52
@ VLC_CONFIG_ADVANCED_RESERVED
Definition: vlc_plugin.h:68
@ VLC_CONFIG_LIST
Definition: vlc_plugin.h:104
@ VLC_MODULE_CPU_REQUIREMENT
Definition: vlc_plugin.h:42
@ VLC_MODULE_DESCRIPTION
Definition: vlc_plugin.h:51
@ VLC_MODULE_CB_CLOSE
Definition: vlc_plugin.h:47
@ VLC_MODULE_SHORTCUT
Definition: vlc_plugin.h:43
@ VLC_CONFIG_LIST_OBSOLETE
Definition: vlc_plugin.h:98
@ VLC_CONFIG_NAME
Definition: vlc_plugin.h:59
@ VLC_MODULE_SCORE
Definition: vlc_plugin.h:45
@ VLC_MODULE_NAME
Definition: vlc_plugin.h:49
@ VLC_CONFIG_VOLATILE
Definition: vlc_plugin.h:71
@ VLC_CONFIG_SAFE
Definition: vlc_plugin.h:92
@ VLC_MODULE_CAPABILITY
Definition: vlc_plugin.h:44
@ VLC_MODULE_CREATE
Definition: vlc_plugin.h:37
@ VLC_CONFIG_SHORTCUT
Definition: vlc_plugin.h:86
@ VLC_CONFIG_CAPABILITY
Definition: vlc_plugin.h:83
@ VLC_CONFIG_REMOVED
Definition: vlc_plugin.h:80
@ VLC_MODULE_TEXTDOMAIN
Definition: vlc_plugin.h:53
@ VLC_CONFIG_PERSISTENT_OBSOLETE
Definition: vlc_plugin.h:74
@ VLC_MODULE_SHORTNAME
Definition: vlc_plugin.h:50
@ VLC_CONFIG_PRIVATE
Definition: vlc_plugin.h:77
@ VLC_CONFIG_LIST_CB_OBSOLETE
Definition: vlc_plugin.h:108
@ VLC_MODULE_HELP_HTML
Definition: vlc_plugin.h:54
@ VLC_CONFIG_CREATE
Definition: vlc_plugin.h:38
#define CDECL_SYMBOL
Definition: vlc_plugin.h:271
int(* vlc_plugin_cb)(vlc_set_cb, void *)
Plugin entry point prototype.
Definition: vlc_plugin.h:291
int(* vlc_set_cb)(void *, void *, int,...)
Definition: vlc_plugin.h:288
#define EXTERN_SYMBOL
Definition: vlc_plugin.h:246
vlc_config_subcat
Definition: vlc_plugin.h:171
@ SUBCAT_VIDEO_GENERAL
Definition: vlc_plugin.h:190
@ SUBCAT_PLAYLIST_SD
Definition: vlc_plugin.h:216
@ SUBCAT_SOUT_GENERAL
Definition: vlc_plugin.h:204
@ SUBCAT_INTERFACE_HOTKEYS
Definition: vlc_plugin.h:182
@ SUBCAT_INTERFACE_MAIN
Definition: vlc_plugin.h:180
@ SUBCAT_SOUT_PACKETIZER
Definition: vlc_plugin.h:208
@ SUBCAT_INPUT_STREAM_FILTER
Definition: vlc_plugin.h:202
@ SUBCAT_SOUT_STREAM
Definition: vlc_plugin.h:205
@ SUBCAT_INPUT_ACODEC
Definition: vlc_plugin.h:200
@ SUBCAT_SOUT_VOD
Definition: vlc_plugin.h:209
@ SUBCAT_INPUT_GENERAL
Definition: vlc_plugin.h:196
@ SUBCAT_VIDEO_VFILTER
Definition: vlc_plugin.h:192
@ SUBCAT_VIDEO_SPLITTER
Definition: vlc_plugin.h:194
@ SUBCAT_INTERFACE_GENERAL
Definition: vlc_plugin.h:179
@ SUBCAT_SOUT_MUX
Definition: vlc_plugin.h:206
@ SUBCAT_AUDIO_RESAMPLER
Definition: vlc_plugin.h:188
@ SUBCAT_HIDDEN
Definition: vlc_plugin.h:175
@ SUBCAT_SOUT_RENDERER
Definition: vlc_plugin.h:210
@ SUBCAT_PLAYLIST_GENERAL
Definition: vlc_plugin.h:215
@ SUBCAT_AUDIO_AFILTER
Definition: vlc_plugin.h:186
@ SUBCAT_INPUT_VCODEC
Definition: vlc_plugin.h:199
@ SUBCAT_INPUT_DEMUX
Definition: vlc_plugin.h:198
@ SUBCAT_INTERFACE_CONTROL
Definition: vlc_plugin.h:181
@ SUBCAT_AUDIO_VISUAL
Definition: vlc_plugin.h:187
@ SUBCAT_SOUT_ACO
Definition: vlc_plugin.h:207
@ SUBCAT_UNKNOWN
Definition: vlc_plugin.h:177
@ SUBCAT_ADVANCED_MISC
Definition: vlc_plugin.h:212
@ SUBCAT_AUDIO_AOUT
Definition: vlc_plugin.h:185
@ SUBCAT_INPUT_ACCESS
Definition: vlc_plugin.h:197
@ SUBCAT_ADVANCED_NETWORK
Definition: vlc_plugin.h:213
@ SUBCAT_VIDEO_SUBPIC
Definition: vlc_plugin.h:193
@ SUBCAT_PLAYLIST_EXPORT
Definition: vlc_plugin.h:217
@ SUBCAT_INPUT_SCODEC
Definition: vlc_plugin.h:201
@ SUBCAT_AUDIO_GENERAL
Definition: vlc_plugin.h:184
@ SUBCAT_VIDEO_VOUT
Definition: vlc_plugin.h:191