/*****************************************************************************
* motion_blur.c : motion blur filter for vlc
*****************************************************************************
- * Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
- * $Id: motionblur.c,v 1.9 2003/03/18 23:30:28 gbazin Exp $
+ * Copyright (C) 2000, 2001, 2002, 2003 the VideoLAN team
+ * $Id$
*
- * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
+ * Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*****************************************************************************
* Module descriptor
*****************************************************************************/
-#define MODE_TEXT N_("blur factor")
-#define MODE_LONGTEXT N_("The degree of blurring from 1 to 127")
+#define MODE_TEXT N_("Blur factor (1-127)")
+#define MODE_LONGTEXT N_("The degree of blurring from 1 to 127.")
vlc_module_begin();
- add_category_hint( N_("Miscellaneous"), NULL, VLC_FALSE );
- add_integer( "blur-factor", 80, NULL, MODE_TEXT, MODE_LONGTEXT, VLC_FALSE );
+ set_shortname( _("Motion blur") );
set_description( _("Motion blur filter") );
set_capability( "video filter", 0 );
+ set_category( CAT_VIDEO );
+ set_subcategory( SUBCAT_VIDEO_VFILTER );
+
+ add_integer_with_range( "blur-factor", 80, 1, 127, NULL,
+ MODE_TEXT, MODE_LONGTEXT, VLC_FALSE );
+
set_callbacks( Create, Destroy );
vlc_module_end();
picture_t *p_lastpic;
};
+/*****************************************************************************
+ * Control: control facility for the vout (forwards to child vout)
+ *****************************************************************************/
+static int Control( vout_thread_t *p_vout, int i_query, va_list args )
+{
+ return vout_vaControl( p_vout->p_sys->p_vout, i_query, args );
+}
+
/*****************************************************************************
* Create: allocates Deinterlace video thread output method
*****************************************************************************
p_vout->pf_manage = NULL;
p_vout->pf_render = Render;
p_vout->pf_display = NULL;
+ p_vout->pf_control = Control;
p_vout->p_sys->i_factor = config_GetInt( p_vout, "blur-factor" );
p_vout->p_sys->b_double_rate = 0;
{
int i_index;
picture_t *p_pic;
+ video_format_t fmt = {0};
I_OUTPUTPICTURES = 0;
p_vout->output.i_width = p_vout->render.i_width;
p_vout->output.i_height = p_vout->render.i_height;
p_vout->output.i_aspect = p_vout->render.i_aspect;
+ p_vout->fmt_out = p_vout->fmt_in;
+ fmt = p_vout->fmt_out;
break;
default:
case VLC_FOURCC('I','4','2','0'):
case VLC_FOURCC('I','Y','U','V'):
case VLC_FOURCC('Y','V','1','2'):
- p_vout->p_sys->p_vout = vout_Create( p_vout,
- p_vout->output.i_width, p_vout->output.i_height,
- p_vout->output.i_chroma, p_vout->output.i_aspect );
+ p_vout->p_sys->p_vout = vout_Create( p_vout, &fmt );
break;
default:
break;
ADD_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
+ ADD_PARENT_CALLBACKS( SendEventsToChild );
+
return VLC_SUCCESS;
}
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
- DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
- vlc_object_detach( p_vout->p_sys->p_vout );
- vout_Destroy( p_vout->p_sys->p_vout );
+ if( p_vout->p_sys->p_vout )
+ {
+ DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
+ vlc_object_detach( p_vout->p_sys->p_vout );
+ vout_Destroy( p_vout->p_sys->p_vout );
+ }
+
+ DEL_PARENT_CALLBACKS( SendEventsToChild );
free( p_vout->p_sys );
}
/* There are margins, but with the same width : perfect ! */
p_vout->p_vlc->pf_memcpy(
p_dest->p[i].p_pixels, p_src->p[i].p_pixels,
- p_src->p[i].i_pitch * p_src->p[i].i_lines );
+ p_src->p[i].i_pitch * p_src->p[i].i_visible_lines );
}
else
{
uint8_t *p_out = p_dest->p[i].p_pixels;
int i_line;
- for( i_line = p_src->p[i].i_lines; i_line--; )
+ for( i_line = p_src->p[i].i_visible_lines; i_line--; )
{
p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_src->p[i].i_visible_pitch );
p_new = p_newpic->p[i_plane].p_pixels;
p_old = p_oldpic->p[i_plane].p_pixels;
p_out_end = p_out + p_outpic->p[i_plane].i_pitch *
- p_outpic->p[i_plane].i_lines;
+ p_outpic->p[i_plane].i_visible_lines;
while ( p_out < p_out_end )
{
p_out_line_end = p_out + p_outpic->p[i_plane].i_visible_pitch;
return VLC_SUCCESS;
}
+/*****************************************************************************
+ * SendEventsToChild: forward events to the child/children vout
+ *****************************************************************************/
+static int SendEventsToChild( vlc_object_t *p_this, char const *psz_var,
+ vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+ var_Set( p_vout->p_sys->p_vout, psz_var, newval );
+ return VLC_SUCCESS;
+}