Commit 032bbe05 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

visual: reduce symbols count

parent 6c636f2c
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
/***************************************************************************** /*****************************************************************************
* dummy_Run * dummy_Run
*****************************************************************************/ *****************************************************************************/
int dummy_Run( visual_effect_t * p_effect, vlc_object_t *p_aout, static int dummy_Run( visual_effect_t * p_effect, vlc_object_t *p_aout,
const block_t * p_buffer , picture_t * p_picture) const block_t * p_buffer , picture_t * p_picture)
{ {
VLC_UNUSED(p_effect); VLC_UNUSED(p_aout); VLC_UNUSED(p_buffer); VLC_UNUSED(p_effect); VLC_UNUSED(p_aout); VLC_UNUSED(p_buffer);
VLC_UNUSED(p_picture); VLC_UNUSED(p_picture);
...@@ -59,8 +59,8 @@ int dummy_Run( visual_effect_t * p_effect, vlc_object_t *p_aout, ...@@ -59,8 +59,8 @@ int dummy_Run( visual_effect_t * p_effect, vlc_object_t *p_aout,
/***************************************************************************** /*****************************************************************************
* spectrum_Run: spectrum analyser * spectrum_Run: spectrum analyser
*****************************************************************************/ *****************************************************************************/
int spectrum_Run(visual_effect_t * p_effect, vlc_object_t *p_aout, static int spectrum_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
const block_t * p_buffer , picture_t * p_picture) const block_t * p_buffer , picture_t * p_picture)
{ {
spectrum_data *p_data = p_effect->p_data; spectrum_data *p_data = p_effect->p_data;
float p_output[FFT_BUFFER_SIZE]; /* Raw FFT Result */ float p_output[FFT_BUFFER_SIZE]; /* Raw FFT Result */
...@@ -336,8 +336,8 @@ int spectrum_Run(visual_effect_t * p_effect, vlc_object_t *p_aout, ...@@ -336,8 +336,8 @@ int spectrum_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
/***************************************************************************** /*****************************************************************************
* spectrometer_Run: derivative spectrum analysis * spectrometer_Run: derivative spectrum analysis
*****************************************************************************/ *****************************************************************************/
int spectrometer_Run(visual_effect_t * p_effect, vlc_object_t *p_aout, static int spectrometer_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
const block_t * p_buffer , picture_t * p_picture) const block_t * p_buffer , picture_t * p_picture)
{ {
#define Y(R,G,B) ((uint8_t)( (R * .299) + (G * .587) + (B * .114) )) #define Y(R,G,B) ((uint8_t)( (R * .299) + (G * .587) + (B * .114) ))
#define U(R,G,B) ((uint8_t)( (R * -.169) + (G * -.332) + (B * .500) + 128 )) #define U(R,G,B) ((uint8_t)( (R * -.169) + (G * -.332) + (B * .500) + 128 ))
...@@ -793,8 +793,8 @@ int spectrometer_Run(visual_effect_t * p_effect, vlc_object_t *p_aout, ...@@ -793,8 +793,8 @@ int spectrometer_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
/***************************************************************************** /*****************************************************************************
* scope_Run: scope effect * scope_Run: scope effect
*****************************************************************************/ *****************************************************************************/
int scope_Run(visual_effect_t * p_effect, vlc_object_t *p_aout, static int scope_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
const block_t * p_buffer , picture_t * p_picture) const block_t * p_buffer , picture_t * p_picture)
{ {
VLC_UNUSED(p_aout); VLC_UNUSED(p_aout);
...@@ -850,8 +850,8 @@ int scope_Run(visual_effect_t * p_effect, vlc_object_t *p_aout, ...@@ -850,8 +850,8 @@ int scope_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
/***************************************************************************** /*****************************************************************************
* vuMeter_Run: vu meter effect * vuMeter_Run: vu meter effect
*****************************************************************************/ *****************************************************************************/
int vuMeter_Run(visual_effect_t * p_effect, vlc_object_t *p_aout, static int vuMeter_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
const block_t * p_buffer , picture_t * p_picture) const block_t * p_buffer , picture_t * p_picture)
{ {
VLC_UNUSED(p_aout); VLC_UNUSED(p_aout);
float i_value_l = 0; float i_value_l = 0;
...@@ -985,3 +985,13 @@ int vuMeter_Run(visual_effect_t * p_effect, vlc_object_t *p_aout, ...@@ -985,3 +985,13 @@ int vuMeter_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
return 0; return 0;
} }
/* Table of effects */
const struct visual_cb_t effectv[] = {
{ "scope", scope_Run },
{ "vuMeter", vuMeter_Run },
{ "spectrum", spectrum_Run },
{ "spectrometer", spectrometer_Run },
{ "dummy", dummy_Run },
};
const unsigned effectc = sizeof (effectv) / sizeof (effectv[0]);
...@@ -156,20 +156,6 @@ vlc_module_end () ...@@ -156,20 +156,6 @@ vlc_module_end ()
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
static block_t *DoWork( filter_t *, block_t * ); static block_t *DoWork( filter_t *, block_t * );
static const struct
{
const char *psz_name;
int (*pf_run)( visual_effect_t *, vlc_object_t *,
const block_t *, picture_t *);
} pf_effect_run[]=
{
{ "scope", scope_Run },
{ "vuMeter", vuMeter_Run },
{ "spectrum", spectrum_Run },
{ "spectrometer", spectrometer_Run },
{ "dummy", dummy_Run},
{ NULL, dummy_Run}
};
struct filter_sys_t struct filter_sys_t
{ {
...@@ -227,14 +213,13 @@ static int Open( vlc_object_t *p_this ) ...@@ -227,14 +213,13 @@ static int Open( vlc_object_t *p_this )
p_effect->pf_run = NULL; p_effect->pf_run = NULL;
p_effect->psz_name = NULL; p_effect->psz_name = NULL;
for( int i = 0; pf_effect_run[i].psz_name != NULL; i++ ) for( unsigned i = 0; i < effectc; i++ )
{ {
if( !strncasecmp( psz_parser, if( !strncasecmp( psz_parser, effectv[i].name,
pf_effect_run[i].psz_name, strlen( effectv[i].name ) ) )
strlen( pf_effect_run[i].psz_name ) ) )
{ {
p_effect->pf_run = pf_effect_run[i].pf_run; p_effect->pf_run = effectv[i].run_cb;
p_effect->psz_name = pf_effect_run[i].psz_name; p_effect->psz_name = effectv[i].name;
break; break;
} }
} }
......
...@@ -54,16 +54,11 @@ typedef struct ...@@ -54,16 +54,11 @@ typedef struct
int16_t *p_prev_s16_buff; int16_t *p_prev_s16_buff;
} spectrometer_data; } spectrometer_data;
/* Prototypes */ typedef int (*visual_run_t)(visual_effect_t *, vlc_object_t *,
int scope_Run const block_t *, picture_t *);
(visual_effect_t * , vlc_object_t *, const block_t *, picture_t *); extern const struct visual_cb_t
int vuMeter_Run {
(visual_effect_t * , vlc_object_t *, const block_t *, picture_t *); char name[16];
int dummy_Run visual_run_t run_cb;
(visual_effect_t * , vlc_object_t *, const block_t *, picture_t *); } effectv[];
int random_Run extern const unsigned effectc;
(visual_effect_t * , vlc_object_t *, const block_t *, picture_t *);
int spectrum_Run
(visual_effect_t * , vlc_object_t *, const block_t *, picture_t *);
int spectrometer_Run
(visual_effect_t * , vlc_object_t *, const block_t *, picture_t *);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment