# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_sout.h>
#include <vlc_vout.h>
#include <vlc_filter.h>
+#include "filter_picture.h"
/*****************************************************************************
* Local protypes
#define FILTER_PREFIX "blur-"
vlc_module_begin();
- set_shortname( _("Motion blur") );
- set_description( _("Motion blur filter") );
+ set_shortname( N_("Motion blur") );
+ set_description( N_("Motion blur filter") );
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[] = {
+static const char *const ppsz_filter_options[] = {
"factor", NULL
};
/* 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;
- }
p_filter->pf_video_filter = Filter;
free( p_filter->p_sys );
}
-#define RELEASE( pic ) \
- if( pic ->pf_release ) \
- pic ->pf_release( pic );
-
-#define INITPIC( dst, src ) \
- dst ->date = src ->date; \
- dst ->b_force = src ->b_force; \
- dst ->i_nb_fields = src ->i_nb_fields; \
- dst ->b_progressive = src->b_progressive; \
- dst ->b_top_field_first = src ->b_top_field_first;
-
/*****************************************************************************
* Filter
*****************************************************************************/
if( !p_outpic )
{
msg_Warn( p_filter, "can't get output picture" );
- RELEASE( p_pic );
+ if( p_pic->pf_release )
+ p_pic->pf_release( p_pic );
return NULL;
}
- INITPIC( p_outpic, p_pic );
if( !p_sys->pp_planes )
{
RenderBlur( p_sys, p_pic, p_outpic );
Copy( p_filter, p_outpic );
- RELEASE( p_pic );
- return p_outpic;
+ return CopyInfoAndRelease( p_outpic, p_pic );
}
/*****************************************************************************