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

visual: reduce symbols count

parent 6c636f2c
......@@ -48,8 +48,8 @@
/*****************************************************************************
* dummy_Run
*****************************************************************************/
int dummy_Run( visual_effect_t * p_effect, vlc_object_t *p_aout,
const block_t * p_buffer , picture_t * p_picture)
static int dummy_Run( visual_effect_t * p_effect, vlc_object_t *p_aout,
const block_t * p_buffer , picture_t * p_picture)
{
VLC_UNUSED(p_effect); VLC_UNUSED(p_aout); VLC_UNUSED(p_buffer);
VLC_UNUSED(p_picture);
......@@ -59,8 +59,8 @@ int dummy_Run( visual_effect_t * p_effect, vlc_object_t *p_aout,
/*****************************************************************************
* spectrum_Run: spectrum analyser
*****************************************************************************/
int spectrum_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
const block_t * p_buffer , picture_t * p_picture)
static int spectrum_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
const block_t * p_buffer , picture_t * p_picture)
{
spectrum_data *p_data = p_effect->p_data;
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,
/*****************************************************************************
* spectrometer_Run: derivative spectrum analysis
*****************************************************************************/
int spectrometer_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
const block_t * p_buffer , picture_t * p_picture)
static int spectrometer_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
const block_t * p_buffer , picture_t * p_picture)
{
#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 ))
......@@ -793,8 +793,8 @@ int spectrometer_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
/*****************************************************************************
* scope_Run: scope effect
*****************************************************************************/
int scope_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
const block_t * p_buffer , picture_t * p_picture)
static int scope_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
const block_t * p_buffer , picture_t * p_picture)
{
VLC_UNUSED(p_aout);
......@@ -850,8 +850,8 @@ int scope_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
/*****************************************************************************
* vuMeter_Run: vu meter effect
*****************************************************************************/
int vuMeter_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
const block_t * p_buffer , picture_t * p_picture)
static int vuMeter_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
const block_t * p_buffer , picture_t * p_picture)
{
VLC_UNUSED(p_aout);
float i_value_l = 0;
......@@ -985,3 +985,13 @@ int vuMeter_Run(visual_effect_t * p_effect, vlc_object_t *p_aout,
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 ()
* Local prototypes
*****************************************************************************/
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
{
......@@ -227,14 +213,13 @@ static int Open( vlc_object_t *p_this )
p_effect->pf_run = 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,
pf_effect_run[i].psz_name,
strlen( pf_effect_run[i].psz_name ) ) )
if( !strncasecmp( psz_parser, effectv[i].name,
strlen( effectv[i].name ) ) )
{
p_effect->pf_run = pf_effect_run[i].pf_run;
p_effect->psz_name = pf_effect_run[i].psz_name;
p_effect->pf_run = effectv[i].run_cb;
p_effect->psz_name = effectv[i].name;
break;
}
}
......
......@@ -54,16 +54,11 @@ typedef struct
int16_t *p_prev_s16_buff;
} spectrometer_data;
/* Prototypes */
int scope_Run
(visual_effect_t * , vlc_object_t *, const block_t *, picture_t *);
int vuMeter_Run
(visual_effect_t * , vlc_object_t *, const block_t *, picture_t *);
int dummy_Run
(visual_effect_t * , vlc_object_t *, const block_t *, picture_t *);
int random_Run
(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 *);
typedef int (*visual_run_t)(visual_effect_t *, vlc_object_t *,
const block_t *, picture_t *);
extern const struct visual_cb_t
{
char name[16];
visual_run_t run_cb;
} effectv[];
extern const unsigned effectc;
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