1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-04 09:11:33 +02:00

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.
This commit is contained in:
Rémi Denis-Courmont 2010-01-14 22:30:42 +02:00
parent ade985f6dc
commit d9a43b404d
6 changed files with 1 additions and 24 deletions

View File

@ -195,11 +195,6 @@ enum vlc_module_properties
if (vlc_plugin_set (p_module, NULL, VLC_SUBMODULE_CREATE, &p_submodule)) \ if (vlc_plugin_set (p_module, NULL, VLC_SUBMODULE_CREATE, &p_submodule)) \
goto error; 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 ) \ #define add_shortcut( shortcut ) \
if (vlc_module_set (p_submodule, VLC_MODULE_SHORTCUT, \ if (vlc_module_set (p_submodule, VLC_MODULE_SHORTCUT, \
(const char *)(shortcut))) \ (const char *)(shortcut))) \

View File

@ -33,7 +33,6 @@ vlc_module_begin ()
set_description (N_("ARM NEON video chroma conversions")) set_description (N_("ARM NEON video chroma conversions"))
set_capability ("video filter2", 250) set_capability ("video filter2", 250)
set_callbacks (Open, NULL) set_callbacks (Open, NULL)
add_requirement (NEON)
vlc_module_end () vlc_module_end ()
void i420_yuyv_neon (uint8_t *out, const uint8_t **in, void i420_yuyv_neon (uint8_t *out, const uint8_t **in,

View File

@ -85,7 +85,7 @@ static int CacheSaveConfig ( module_t *, FILE * );
/* Sub-version number /* Sub-version number
* (only used to avoid breakage in dev version when cache structure changes) */ * (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 */ /* Format string for the cache filename */
#define CACHENAME_FORMAT \ #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_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_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_unloadable );
LOAD_IMMEDIATE( pp_cache[i]->p_module->b_submodule ); 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_STRING( p_module->psz_capability );
LOAD_IMMEDIATE( p_module->i_score ); LOAD_IMMEDIATE( p_module->i_score );
LOAD_IMMEDIATE( p_module->i_cpu );
LOAD_IMMEDIATE( p_module->b_unloadable ); 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_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_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_unloadable );
SAVE_IMMEDIATE( pp_cache[i]->p_module->b_submodule ); 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_STRING( p_module->psz_capability );
SAVE_IMMEDIATE( p_module->i_score ); SAVE_IMMEDIATE( p_module->i_score );
SAVE_IMMEDIATE( p_module->i_cpu );
SAVE_IMMEDIATE( p_module->b_unloadable ); SAVE_IMMEDIATE( p_module->b_unloadable );
return 0; return 0;

View File

@ -65,7 +65,6 @@ module_t *vlc_module_create (vlc_object_t *obj)
module->pp_shortcuts[i] = NULL; module->pp_shortcuts[i] = NULL;
module->psz_capability = (char*)""; module->psz_capability = (char*)"";
module->i_score = 1; module->i_score = 1;
module->i_cpu = 0;
module->b_unloadable = true; module->b_unloadable = true;
module->b_submodule = false; module->b_submodule = false;
module->pf_activate = NULL; module->pf_activate = NULL;
@ -116,7 +115,6 @@ module_t *vlc_submodule_create (module_t *module)
submodule->psz_longname = module->psz_longname; submodule->psz_longname = module->psz_longname;
submodule->psz_capability = module->psz_capability; submodule->psz_capability = module->psz_capability;
submodule->i_score = module->i_score; submodule->i_score = module->i_score;
submodule->i_cpu = module->i_cpu;
submodule->b_submodule = true; submodule->b_submodule = true;
return submodule; return submodule;
} }
@ -178,11 +176,6 @@ int vlc_plugin_set (module_t *module, module_config_t *item, int propid, ...)
break; break;
} }
case VLC_MODULE_CPU_REQUIREMENT:
assert (!module->b_submodule);
module->i_cpu |= va_arg (ap, int);
break;
case VLC_MODULE_SHORTCUT: case VLC_MODULE_SHORTCUT:
{ {
unsigned i; unsigned i;

View File

@ -81,7 +81,6 @@
#include "vlc_charset.h" #include "vlc_charset.h"
#include "vlc_arrays.h" #include "vlc_arrays.h"
#include <vlc_cpu.h>
#include "modules/modules.h" #include "modules/modules.h"
@ -466,7 +465,6 @@ module_t * __module_need( vlc_object_t *p_this, const char *psz_capability,
size_t count; size_t count;
module_t **p_all = module_list_get (&count); module_t **p_all = module_list_get (&count);
p_list = malloc( count * sizeof( module_list_t ) ); p_list = malloc( count * sizeof( module_list_t ) );
unsigned i_cpu = vlc_CPU();
/* Parse the module list for capabilities and probe each of them */ /* Parse the module list for capabilities and probe each of them */
count = 0; 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 */ /* Test that this module can do what we need */
if( !module_provides( p_module, psz_capability ) ) if( !module_provides( p_module, psz_capability ) )
continue; 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 we required a shortcut, check this plugin provides it. */
if( i_shortcuts > 0 ) if( i_shortcuts > 0 )

View File

@ -116,7 +116,6 @@ struct module_t
char *psz_capability; /**< Capability */ char *psz_capability; /**< Capability */
int i_score; /**< Score for the capability */ int i_score; /**< Score for the capability */
uint32_t i_cpu; /**< Required CPU capabilities */
bool b_unloadable; /**< Can we be dlclosed? */ bool b_unloadable; /**< Can we be dlclosed? */
bool b_submodule; /**< Is this a submodule? */ bool b_submodule; /**< Is this a submodule? */