From d9a43b404dd9fcfb1df775b5ffbe975e3508a752 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Thu, 14 Jan 2010 22:30:42 +0200 Subject: [PATCH] Remove CPU capability from modules This is not needed anymore. Modules are not in the bank at all anymore if they require an incompatible CPU feature. --- include/vlc_plugin.h | 5 ----- modules/arm_neon/i420_yuy2.c | 1 - src/modules/cache.c | 6 +----- src/modules/entry.c | 7 ------- src/modules/modules.c | 5 ----- src/modules/modules.h | 1 - 6 files changed, 1 insertion(+), 24 deletions(-) diff --git a/include/vlc_plugin.h b/include/vlc_plugin.h index 824ac6c282..8161b12609 100644 --- a/include/vlc_plugin.h +++ b/include/vlc_plugin.h @@ -195,11 +195,6 @@ enum vlc_module_properties if (vlc_plugin_set (p_module, NULL, VLC_SUBMODULE_CREATE, &p_submodule)) \ goto error; -#define add_requirement( cap ) \ - if (vlc_module_set (p_module, VLC_MODULE_CPU_REQUIREMENT, \ - (int)(CPU_CAPABILITY_##cap))) \ - goto error; - #define add_shortcut( shortcut ) \ if (vlc_module_set (p_submodule, VLC_MODULE_SHORTCUT, \ (const char *)(shortcut))) \ diff --git a/modules/arm_neon/i420_yuy2.c b/modules/arm_neon/i420_yuy2.c index ae5d60be73..608903beb1 100644 --- a/modules/arm_neon/i420_yuy2.c +++ b/modules/arm_neon/i420_yuy2.c @@ -33,7 +33,6 @@ vlc_module_begin () set_description (N_("ARM NEON video chroma conversions")) set_capability ("video filter2", 250) set_callbacks (Open, NULL) - add_requirement (NEON) vlc_module_end () void i420_yuyv_neon (uint8_t *out, const uint8_t **in, diff --git a/src/modules/cache.c b/src/modules/cache.c index dbb7f9dfd1..1477f97e90 100644 --- a/src/modules/cache.c +++ b/src/modules/cache.c @@ -85,7 +85,7 @@ static int CacheSaveConfig ( module_t *, FILE * ); /* Sub-version number * (only used to avoid breakage in dev version when cache structure changes) */ -#define CACHE_SUBVERSION_NUM 6 +#define CACHE_SUBVERSION_NUM 7 /* Format string for the cache filename */ #define CACHENAME_FORMAT \ @@ -285,7 +285,6 @@ void CacheLoad( vlc_object_t *p_this, module_bank_t *p_bank, bool b_delete ) } LOAD_STRING( pp_cache[i]->p_module->psz_capability ); LOAD_IMMEDIATE( pp_cache[i]->p_module->i_score ); - LOAD_IMMEDIATE( pp_cache[i]->p_module->i_cpu ); LOAD_IMMEDIATE( pp_cache[i]->p_module->b_unloadable ); LOAD_IMMEDIATE( pp_cache[i]->p_module->b_submodule ); @@ -311,7 +310,6 @@ void CacheLoad( vlc_object_t *p_this, module_bank_t *p_bank, bool b_delete ) } LOAD_STRING( p_module->psz_capability ); LOAD_IMMEDIATE( p_module->i_score ); - LOAD_IMMEDIATE( p_module->i_cpu ); LOAD_IMMEDIATE( p_module->b_unloadable ); } } @@ -563,7 +561,6 @@ void CacheSave( vlc_object_t *p_this, module_bank_t *p_bank ) } SAVE_STRING( pp_cache[i]->p_module->psz_capability ); SAVE_IMMEDIATE( pp_cache[i]->p_module->i_score ); - SAVE_IMMEDIATE( pp_cache[i]->p_module->i_cpu ); SAVE_IMMEDIATE( pp_cache[i]->p_module->b_unloadable ); SAVE_IMMEDIATE( pp_cache[i]->p_module->b_submodule ); @@ -622,7 +619,6 @@ static int CacheSaveSubmodule( FILE *file, module_t *p_module ) SAVE_STRING( p_module->psz_capability ); SAVE_IMMEDIATE( p_module->i_score ); - SAVE_IMMEDIATE( p_module->i_cpu ); SAVE_IMMEDIATE( p_module->b_unloadable ); return 0; diff --git a/src/modules/entry.c b/src/modules/entry.c index 68dff9f0e5..1b5dba6f4f 100644 --- a/src/modules/entry.c +++ b/src/modules/entry.c @@ -65,7 +65,6 @@ module_t *vlc_module_create (vlc_object_t *obj) module->pp_shortcuts[i] = NULL; module->psz_capability = (char*)""; module->i_score = 1; - module->i_cpu = 0; module->b_unloadable = true; module->b_submodule = false; module->pf_activate = NULL; @@ -116,7 +115,6 @@ module_t *vlc_submodule_create (module_t *module) submodule->psz_longname = module->psz_longname; submodule->psz_capability = module->psz_capability; submodule->i_score = module->i_score; - submodule->i_cpu = module->i_cpu; submodule->b_submodule = true; return submodule; } @@ -178,11 +176,6 @@ int vlc_plugin_set (module_t *module, module_config_t *item, int propid, ...) break; } - case VLC_MODULE_CPU_REQUIREMENT: - assert (!module->b_submodule); - module->i_cpu |= va_arg (ap, int); - break; - case VLC_MODULE_SHORTCUT: { unsigned i; diff --git a/src/modules/modules.c b/src/modules/modules.c index ec4fa311cd..f2fd4179a1 100644 --- a/src/modules/modules.c +++ b/src/modules/modules.c @@ -81,7 +81,6 @@ #include "vlc_charset.h" #include "vlc_arrays.h" -#include #include "modules/modules.h" @@ -466,7 +465,6 @@ module_t * __module_need( vlc_object_t *p_this, const char *psz_capability, size_t count; module_t **p_all = module_list_get (&count); p_list = malloc( count * sizeof( module_list_t ) ); - unsigned i_cpu = vlc_CPU(); /* Parse the module list for capabilities and probe each of them */ count = 0; @@ -477,9 +475,6 @@ module_t * __module_need( vlc_object_t *p_this, const char *psz_capability, /* Test that this module can do what we need */ if( !module_provides( p_module, psz_capability ) ) continue; - /* Test if we have the required CPU */ - if( (p_module->i_cpu & i_cpu) != p_module->i_cpu ) - continue; /* If we required a shortcut, check this plugin provides it. */ if( i_shortcuts > 0 ) diff --git a/src/modules/modules.h b/src/modules/modules.h index 830cb9c9db..c4a5eeebd7 100644 --- a/src/modules/modules.h +++ b/src/modules/modules.h @@ -116,7 +116,6 @@ struct module_t char *psz_capability; /**< Capability */ int i_score; /**< Score for the capability */ - uint32_t i_cpu; /**< Required CPU capabilities */ bool b_unloadable; /**< Can we be dlclosed? */ bool b_submodule; /**< Is this a submodule? */ -- 2.39.5