]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/wall.c
raop: handle VLC_ADD_LIBS
[vlc] / modules / video_filter / wall.c
index d6a73a3d4e64eb901cc3825a24cafbd3aaebc700..6b207cd1c8cf9aca8cfbc9ba3651400781bd0b97 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
-#include "vlc_video_splitter.h"
+#include <vlc_video_splitter.h>
 
 /* FIXME it is needed for VOUT_ALIGN_* only */
 #include <vlc_vout.h>
@@ -68,11 +68,11 @@ vlc_module_begin()
     set_category( CAT_VIDEO )
     set_subcategory( SUBCAT_VIDEO_VFILTER )
 
-    add_integer( CFG_PREFIX "cols", 3, NULL, COLS_TEXT, COLS_LONGTEXT, false )
-    add_integer( CFG_PREFIX "rows", 3, NULL, ROWS_TEXT, ROWS_LONGTEXT, false )
-    add_string( CFG_PREFIX "active", NULL, NULL, ACTIVE_TEXT, ACTIVE_LONGTEXT,
+    add_integer( CFG_PREFIX "cols", 3, COLS_TEXT, COLS_LONGTEXT, false )
+    add_integer( CFG_PREFIX "rows", 3, ROWS_TEXT, ROWS_LONGTEXT, false )
+    add_string( CFG_PREFIX "active", NULL, ACTIVE_TEXT, ACTIVE_LONGTEXT,
                  true )
-    add_string( CFG_PREFIX "element-aspect", "4:3", NULL, ASPECT_TEXT, ASPECT_LONGTEXT, false )
+    add_string( CFG_PREFIX "element-aspect", "16:9", ASPECT_TEXT, ASPECT_LONGTEXT, false )
 
     add_shortcut( "wall" )
     set_callbacks( Open, Close )
@@ -129,10 +129,10 @@ static int Open( vlc_object_t *p_this )
 
     /* */
     p_sys->i_col = var_CreateGetInteger( p_splitter, CFG_PREFIX "cols" );
-    p_sys->i_col = __MAX( 1, __MIN( COL_MAX, p_sys->i_col ) );
+    p_sys->i_col = VLC_CLIP( COL_MAX, 1, p_sys->i_col );
 
     p_sys->i_row = var_CreateGetInteger( p_splitter, CFG_PREFIX "rows" );
-    p_sys->i_row = __MAX( 1, __MIN( ROW_MAX, p_sys->i_row ) );
+    p_sys->i_row = VLC_CLIP( ROW_MAX, 1, p_sys->i_row );
 
     msg_Dbg( p_splitter, "opening a %i x %i wall",
              p_sys->i_col, p_sys->i_row );
@@ -351,8 +351,8 @@ static int Open( vlc_object_t *p_this )
             p_cfg->fmt.i_width          = p_output->i_width;
             p_cfg->fmt.i_visible_height =
             p_cfg->fmt.i_height         = p_output->i_height;
-            p_cfg->fmt.i_aspect         = (int64_t)i_aspect * i_target_height * p_output->i_width / i_target_width / p_output->i_height;
-
+            p_cfg->fmt.i_sar_num        = (int64_t)i_aspect * i_target_height;
+            p_cfg->fmt.i_sar_den        = VOUT_ASPECT_FACTOR * i_target_width;
             p_cfg->window.i_x     = p_output->i_left; /* FIXME relative to video-x/y (TODO in wrapper.c) ? */
             p_cfg->window.i_y     = p_output->i_top;
             p_cfg->window.i_align = p_output->i_align;
@@ -384,7 +384,10 @@ static int Filter( video_splitter_t *p_splitter, picture_t *pp_dst[], picture_t
     video_splitter_sys_t *p_sys = p_splitter->p_sys;
 
     if( video_splitter_NewPicture( p_splitter, pp_dst ) )
+    {
+        picture_Release( p_src );
         return VLC_EGENERIC;
+    }
 
     for( int y = 0; y < p_sys->i_row; y++ )
     {
@@ -394,7 +397,6 @@ static int Filter( video_splitter_t *p_splitter, picture_t *pp_dst[], picture_t
             if( !p_output->b_active )
                 continue;
 
-            video_splitter_output_t *p_cfg = &p_splitter->p_output[p_output->i_output];
             picture_t *p_dst = pp_dst[p_output->i_output];
 
             /* */
@@ -419,13 +421,14 @@ static int Mouse( video_splitter_t *p_splitter, vlc_mouse_t *p_mouse,
                   int i_index,
                   const vlc_mouse_t *p_old, const vlc_mouse_t *p_new )
 {
+    VLC_UNUSED(p_old);
     video_splitter_sys_t *p_sys = p_splitter->p_sys;
 
     for( int y = 0; y < p_sys->i_row; y++ )
     {
         for( int x = 0; x < p_sys->i_col; x++ )
         {
-            wall_output_t *p_output = p_output = &p_sys->pp_output[x][y];
+            wall_output_t *p_output = &p_sys->pp_output[x][y];
             if( p_output->b_active && p_output->i_output == i_index )
             {
                 *p_mouse = *p_new;