]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/invert.c
* backport of [11356]
[vlc] / modules / video_filter / invert.c
index 64fa0a2f681cbff05c0851d599aa381b7ad85f68..3cb78c5d067ed7889db75aeccf8b8aee46f018f6 100644 (file)
@@ -50,6 +50,9 @@ static int  SendEvents( vlc_object_t *, char const *,
  *****************************************************************************/
 vlc_module_begin();
     set_description( _("Invert video filter") );
+    set_shortname( N_("Color inversion" ));
+    set_category( CAT_VIDEO );
+    set_subcategory( SUBCAT_VIDEO_VFILTER );
     set_capability( "video filter", 0 );
     add_shortcut( "invert" );
     set_callbacks( Create, Destroy );
@@ -108,6 +111,7 @@ static int Init( vout_thread_t *p_vout )
 {
     int i_index;
     picture_t *p_pic;
+    video_format_t fmt = {0};
 
     I_OUTPUTPICTURES = 0;
 
@@ -117,12 +121,18 @@ static int Init( vout_thread_t *p_vout )
     p_vout->output.i_height = p_vout->render.i_height;
     p_vout->output.i_aspect = p_vout->render.i_aspect;
 
+    fmt.i_width = fmt.i_visible_width = p_vout->render.i_width;
+    fmt.i_height = fmt.i_visible_height = p_vout->render.i_height;
+    fmt.i_x_offset = fmt.i_y_offset = 0;
+    fmt.i_chroma = p_vout->render.i_chroma;
+    fmt.i_aspect = p_vout->render.i_aspect;
+    fmt.i_sar_num = p_vout->render.i_aspect * fmt.i_height / fmt.i_width;
+    fmt.i_sar_den = VOUT_ASPECT_FACTOR;
+
     /* 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 )
@@ -208,7 +218,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
         uint8_t *p_in, *p_in_end, *p_line_end, *p_out;
 
         p_in = p_pic->p[i_index].p_pixels;
-        p_in_end = p_in + p_pic->p[i_index].i_lines
+        p_in_end = p_in + p_pic->p[i_index].i_visible_lines
                            * p_pic->p[i_index].i_pitch;
 
         p_out = p_outpic->p[i_index].p_pixels;