]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/motionblur.c
* ALL: minor spelling fixes
[vlc] / modules / video_filter / motionblur.c
index 2b5c00e3fb8cfb67a64613b415c90ae96795e88d..273eba97a229a3e30a2c46b4fea4ece850990d58 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * motion_blur.c : motion blur filter for vlc
  *****************************************************************************
- * Copyright (C) 2000, 2001 VideoLAN
- * $Id: motionblur.c,v 1.5 2003/01/09 17:47:05 sam Exp $
+ * Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
+ * $Id$
  *
  * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
  *
@@ -45,17 +45,22 @@ static void Render    ( vout_thread_t *, picture_t * );
 static void RenderBlur    ( vout_thread_t *, picture_t *, picture_t *, picture_t * );
 static void CopyPicture ( vout_thread_t*, picture_t *, picture_t * );
 
+static int  SendEvents( vlc_object_t *, char const *,
+                        vlc_value_t, vlc_value_t, void * );
+
 /*****************************************************************************
  * 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 );
-    add_integer( "blur-factor", 80, NULL, MODE_TEXT, MODE_LONGTEXT );
     set_description( _("Motion blur filter") );
     set_capability( "video filter", 0 );
+
+    add_integer_with_range( "blur-factor", 80, 1, 127, NULL,
+        MODE_TEXT, MODE_LONGTEXT, VLC_FALSE );
+    
     set_callbacks( Create, Destroy );
 vlc_module_end();
 
@@ -77,6 +82,14 @@ struct vout_sys_t
     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
  *****************************************************************************
@@ -99,6 +112,7 @@ static int Create( vlc_object_t *p_this )
     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;
@@ -162,6 +176,10 @@ static int Init( vout_thread_t *p_vout )
 
     ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
 
+    ADD_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
+
+    ADD_PARENT_CALLBACKS( SendEventsToChild );
+
     return VLC_SUCCESS;
 }
 
@@ -189,8 +207,12 @@ static void Destroy( vlc_object_t *p_this )
 {
     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 );
 
+    DEL_PARENT_CALLBACKS( SendEventsToChild );
+
     free( p_vout->p_sys );
 }
 
@@ -327,3 +349,24 @@ static void RenderBlur( vout_thread_t *p_vout, picture_t *p_oldpic,
     }
 }
 
+/*****************************************************************************
+ * SendEvents: forward mouse and keyboard events to the parent p_vout
+ *****************************************************************************/
+static int SendEvents( vlc_object_t *p_this, char const *psz_var,
+                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+    var_Set( (vlc_object_t *)p_data, psz_var, newval );
+
+    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;
+}