| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
#if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__) |
|---|
| 25 |
# error This header file can only be included from LibVLC. |
|---|
| 26 |
#endif |
|---|
| 27 |
|
|---|
| 28 |
#ifndef __LIBVLC_MODULES_H |
|---|
| 29 |
# define __LIBVLC_MODULES_H 1 |
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
#define MODULE_HIDE_DELAY 50 |
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
struct module_bank_t |
|---|
| 41 |
{ |
|---|
| 42 |
unsigned i_usage; |
|---|
| 43 |
|
|---|
| 44 |
bool b_builtins; |
|---|
| 45 |
bool b_plugins; |
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
bool b_cache; |
|---|
| 49 |
bool b_cache_dirty; |
|---|
| 50 |
bool b_cache_delete; |
|---|
| 51 |
|
|---|
| 52 |
int i_cache; |
|---|
| 53 |
module_cache_t **pp_cache; |
|---|
| 54 |
|
|---|
| 55 |
int i_loaded_cache; |
|---|
| 56 |
module_cache_t **pp_loaded_cache; |
|---|
| 57 |
|
|---|
| 58 |
module_t *head; |
|---|
| 59 |
}; |
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
struct module_cache_t |
|---|
| 65 |
{ |
|---|
| 66 |
|
|---|
| 67 |
char *psz_file; |
|---|
| 68 |
int64_t i_time; |
|---|
| 69 |
int64_t i_size; |
|---|
| 70 |
bool b_junk; |
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 |
module_t *p_module; |
|---|
| 74 |
bool b_used; |
|---|
| 75 |
}; |
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
#define MODULE_SHORTCUT_MAX 50 |
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
#if defined(HAVE_DL_DYLD) |
|---|
| 82 |
# if defined (HAVE_MACH_O_DYLD_H) |
|---|
| 83 |
# include <mach-o/dyld.h> |
|---|
| 84 |
# endif |
|---|
| 85 |
typedef NSModule module_handle_t; |
|---|
| 86 |
#elif defined(HAVE_IMAGE_H) |
|---|
| 87 |
typedef int module_handle_t; |
|---|
| 88 |
#elif defined(WIN32) || defined(UNDER_CE) |
|---|
| 89 |
typedef void * module_handle_t; |
|---|
| 90 |
#elif defined(HAVE_DL_DLOPEN) |
|---|
| 91 |
typedef void * module_handle_t; |
|---|
| 92 |
#elif defined(HAVE_DL_SHL_LOAD) |
|---|
| 93 |
typedef shl_t module_handle_t; |
|---|
| 94 |
#endif |
|---|
| 95 |
|
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 |
struct module_t |
|---|
| 100 |
{ |
|---|
| 101 |
char *psz_object_name; |
|---|
| 102 |
module_t *next; |
|---|
| 103 |
module_t *submodule; |
|---|
| 104 |
module_t *parent; |
|---|
| 105 |
unsigned submodule_count; |
|---|
| 106 |
gc_object_t vlc_gc_data; |
|---|
| 107 |
vlc_mutex_t lock; |
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 |
char *psz_shortname; |
|---|
| 113 |
char *psz_longname; |
|---|
| 114 |
char *psz_help; |
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 |
char *pp_shortcuts[ MODULE_SHORTCUT_MAX ]; |
|---|
| 118 |
|
|---|
| 119 |
char *psz_capability; |
|---|
| 120 |
int i_score; |
|---|
| 121 |
uint32_t i_cpu; |
|---|
| 122 |
|
|---|
| 123 |
bool b_unloadable; |
|---|
| 124 |
bool b_reentrant; |
|---|
| 125 |
bool b_submodule; |
|---|
| 126 |
|
|---|
| 127 |
|
|---|
| 128 |
int ( * pf_activate ) ( vlc_object_t * ); |
|---|
| 129 |
void ( * pf_deactivate ) ( vlc_object_t * ); |
|---|
| 130 |
|
|---|
| 131 |
|
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 |
module_config_t *p_config; |
|---|
| 135 |
size_t confsize; |
|---|
| 136 |
unsigned int i_config_items; |
|---|
| 137 |
unsigned int i_bool_items; |
|---|
| 138 |
|
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 |
|
|---|
| 142 |
|
|---|
| 143 |
module_handle_t handle; |
|---|
| 144 |
char * psz_filename; |
|---|
| 145 |
|
|---|
| 146 |
bool b_builtin; |
|---|
| 147 |
bool b_loaded; |
|---|
| 148 |
}; |
|---|
| 149 |
|
|---|
| 150 |
#define module_InitBank(a) __module_InitBank(VLC_OBJECT(a)) |
|---|
| 151 |
void __module_InitBank ( vlc_object_t * ); |
|---|
| 152 |
#define module_LoadBuiltins(a) __module_LoadBuiltins(VLC_OBJECT(a)) |
|---|
| 153 |
void __module_LoadBuiltins ( vlc_object_t * ); |
|---|
| 154 |
#define module_LoadPlugins(a) __module_LoadPlugins(VLC_OBJECT(a)) |
|---|
| 155 |
void __module_LoadPlugins ( vlc_object_t * ); |
|---|
| 156 |
#define module_EndBank(a) __module_EndBank(VLC_OBJECT(a)) |
|---|
| 157 |
void __module_EndBank ( vlc_object_t * ); |
|---|
| 158 |
#define module_ResetBank(a) __module_ResetBank(VLC_OBJECT(a)) |
|---|
| 159 |
void __module_ResetBank ( vlc_object_t * ); |
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 |
int module_Load (vlc_object_t *, const char *, module_handle_t *); |
|---|
| 163 |
int module_Call (vlc_object_t *obj, module_t *); |
|---|
| 164 |
void module_Unload (module_handle_t); |
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 |
void CacheMerge (vlc_object_t *, module_t *, module_t *); |
|---|
| 168 |
void CacheLoad (vlc_object_t * ); |
|---|
| 169 |
void CacheSave (vlc_object_t * ); |
|---|
| 170 |
module_cache_t * CacheFind (const char *, int64_t, int64_t); |
|---|
| 171 |
|
|---|
| 172 |
#endif |
|---|