/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <string.h>
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_vout.h>
#include "vlc_filter.h"
+#include "filter_picture.h"
/*****************************************************************************
* Local prototypes
* Module descriptor
*****************************************************************************/
vlc_module_begin();
- set_description( _("Noise video filter") );
- set_shortname( _( "Noise" ));
+ set_description( N_("Noise video filter") );
+ set_shortname( N_( "Noise" ));
set_capability( "video filter2", 0 );
set_category( CAT_VIDEO );
set_subcategory( SUBCAT_VIDEO_VFILTER );
set_callbacks( Create, Destroy );
vlc_module_end();
-static const char *ppsz_filter_options[] = {
- NULL
-};
-
/*****************************************************************************
* vout_sys_t: Distort video output method descriptor
*****************************************************************************
/* Allocate structure */
p_filter->p_sys = malloc( sizeof( filter_sys_t ) );
if( p_filter->p_sys == NULL )
- {
- msg_Err( p_filter, "out of memory" );
return VLC_ENOMEM;
- }
-
- config_ChainParse( p_filter, FILTER_PREFIX, ppsz_filter_options,
- p_filter->p_cfg );
p_filter->pf_video_filter = Filter;
if( !p_pic ) return NULL;
- p_outpic = p_filter->pf_vout_buffer_new( p_filter );
+ p_outpic = filter_NewPicture( p_filter );
if( !p_outpic )
{
msg_Warn( p_filter, "can't get output picture" );
- if( p_pic->pf_release )
- p_pic->pf_release( p_pic );
+ picture_Release( p_pic );
return NULL;
}
if( rand()%8 )
{
/* line isn't noisy */
- p_filter->p_libvlc->pf_memcpy( p_out+i_line*i_pitch,
- p_in+i_line*i_pitch,
- i_num_cols );
+ vlc_memcpy( p_out+i_line*i_pitch, p_in+i_line*i_pitch,
+ i_num_cols );
}
else
{
}
}
- p_outpic->date = p_pic->date;
- p_outpic->b_force = p_pic->b_force;
- p_outpic->i_nb_fields = p_pic->i_nb_fields;
- p_outpic->b_progressive = p_pic->b_progressive;
- p_outpic->b_top_field_first = p_pic->b_top_field_first;
-
- if( p_pic->pf_release )
- p_pic->pf_release( p_pic );
-
- return p_outpic;
+ return CopyInfoAndRelease( p_outpic, p_pic );
}