]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/motiondetect.c
* modules/video_filter/*: use p_vout->fmt_in/out.
[vlc] / modules / video_filter / motiondetect.c
index 01869db86a5d27222342183a28b56750311aae55..b744333e5cc10d58a5575e7393192f2f1871ab5d 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * motiondetect.c : Motion detect video effect plugin for vlc
  *****************************************************************************
- * Copyright (C) 2005 VideoLAN
- * $Id$
+ * Copyright (C) 2005 the VideoLAN team
+ * $Id$
  *
  * Authors: Jérôme Decoodt <djc@videolan.org>
  *
@@ -59,9 +59,9 @@ static int  SendEvents   ( vlc_object_t *, char const *,
 vlc_module_begin();
     set_description( _("Motion detect video filter") );
     set_shortname( N_( "Motion detect" ));
-    set_capability( "video filter", 0 );
     set_category( CAT_VIDEO );
     set_subcategory( SUBCAT_VIDEO_VFILTER );
+    set_capability( "video filter", 0 );
 
     add_integer( "motiondetect-history", 1, NULL, HISTORY_TEXT,
                                 HISTORY_LONGTEXT, VLC_FALSE );
@@ -116,6 +116,10 @@ static int Create( vlc_object_t *p_this )
 {
     vout_thread_t *p_vout = (vout_thread_t *)p_this;
     char *psz_descfilename;
+    char buffer[256];
+    int x1, x2, y1, y2, i_level, i_downspeed, i_upspeed, i;
+    area_t *p_area;
+    FILE * p_file;
 
     /* Allocate structure */
     p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
@@ -154,10 +158,7 @@ static int Create( vlc_object_t *p_this )
     }
 
     /* Parse description file and allocate areas */
-    char buffer[256];
-    int x1, x2, y1, y2, i_level, i_downspeed, i_upspeed, i;
-    area_t *p_area;
-    FILE * p_file = fopen( psz_descfilename, "r" );
+    p_file = fopen( psz_descfilename, "r" );
     if( !p_file )
     {
         msg_Err( p_this, "Failed to open descritpion file %s",
@@ -212,6 +213,7 @@ static int Init( vout_thread_t *p_vout )
 {
     int i_index;
     picture_t *p_pic;
+    video_format_t fmt = {0};
 
     I_OUTPUTPICTURES = 0;
 
@@ -220,13 +222,13 @@ static int Init( vout_thread_t *p_vout )
     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;
 
     /* Try to open the real video output */
     msg_Dbg( p_vout, "spawning the real video output" );
 
-    p_vout->p_sys->p_vout = vout_Create( p_vout,
-                           p_vout->render.i_width, p_vout->render.i_height,
-                           p_vout->render.i_chroma, p_vout->render.i_aspect );
+    p_vout->p_sys->p_vout = vout_Create( p_vout, &fmt );
 
     /* Everything failed */
     if( p_vout->p_sys->p_vout == NULL )