[vlc-commits] splitter: use same alignment definitions as vout

Rémi Denis-Courmont git at videolan.org
Tue Dec 11 18:11:14 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Dec 10 23:07:42 2018 +0200| [442883ab9718002409c0665dfa2d0554cefaa2d4] | committer: Rémi Denis-Courmont

splitter: use same alignment definitions as vout

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=442883ab9718002409c0665dfa2d0554cefaa2d4
---

 include/vlc_video_splitter.h       |  3 ++-
 modules/video_splitter/clone.c     |  3 ++-
 modules/video_splitter/panoramix.c | 24 +++++++++++-------------
 modules/video_splitter/wall.c      | 22 ++++++++++------------
 4 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/include/vlc_video_splitter.h b/include/vlc_video_splitter.h
index 6e25c1e05a..9d2a603249 100644
--- a/include/vlc_video_splitter.h
+++ b/include/vlc_video_splitter.h
@@ -27,6 +27,7 @@
 #include <vlc_es.h>
 #include <vlc_picture.h>
 #include <vlc_mouse.h>
+#include <vlc_vout_display.h>
 
 /**
  * \file
@@ -55,7 +56,7 @@ typedef struct
 
         /* Alignment inside the window
          */
-        int i_align;
+        vlc_video_align_t align;
     } window;
 
     /* Video output module
diff --git a/modules/video_splitter/clone.c b/modules/video_splitter/clone.c
index 0fb649c0fd..5f1ab93fe9 100644
--- a/modules/video_splitter/clone.c
+++ b/modules/video_splitter/clone.c
@@ -149,7 +149,8 @@ static int Open( vlc_object_t *p_this )
         video_format_Copy( &p_cfg->fmt, &p_splitter->fmt );
         p_cfg->window.i_x = 0;
         p_cfg->window.i_y = 0;
-        p_cfg->window.i_align = 0;
+        p_cfg->window.align.horizontal = VLC_VIDEO_ALIGN_CENTER;
+        p_cfg->window.align.vertical   = VLC_VIDEO_ALIGN_CENTER;
     }
 
     /* */
diff --git a/modules/video_splitter/panoramix.c b/modules/video_splitter/panoramix.c
index 9079c02824..e4d77b5423 100644
--- a/modules/video_splitter/panoramix.c
+++ b/modules/video_splitter/panoramix.c
@@ -36,9 +36,6 @@
 #include <vlc_plugin.h>
 #include <vlc_video_splitter.h>
 
-/* FIXME it is needed for VOUT_ALIGN_* only */
-#include <vlc_vout.h>
-
 #define OVERLAP
 
 #ifdef OVERLAP
@@ -248,7 +245,7 @@ typedef struct
     int i_y;
     int i_width;
     int i_height;
-    int i_align;
+    vlc_video_align_t align;
 
     /* Source position and size */
     int  i_src_x;
@@ -685,9 +682,9 @@ static int Open( vlc_object_t *p_this )
             p_cfg->fmt.i_visible_height =
             p_cfg->fmt.i_height         = p_output->i_height;
 
-            p_cfg->window.i_x     = p_output->i_x;
-            p_cfg->window.i_y     = p_output->i_y;
-            p_cfg->window.i_align = p_output->i_align;
+            p_cfg->window.i_x   = p_output->i_x;
+            p_cfg->window.i_y   = p_output->i_y;
+            p_cfg->window.align = p_output->align;
 
             p_cfg->psz_module = NULL;
         }
@@ -906,20 +903,20 @@ static int Configuration( panoramix_output_t pp_output[ROW_MAX][COL_MAX],
             }
 
             /* Compute alignment */
-            int i_align = 0;
+            char halign = 0, valign = 0;
             if( i_col > 1 )
             {
                 if( b_col_first )
-                    i_align |= VOUT_ALIGN_RIGHT;
+                    halign = VLC_VIDEO_ALIGN_RIGHT;
                 if( b_col_last )
-                    i_align |= VOUT_ALIGN_LEFT;
+                    halign = VLC_VIDEO_ALIGN_LEFT;
             }
             if( i_row > 1 )
             {
                 if( b_row_first )
-                    i_align |= VOUT_ALIGN_BOTTOM;
+                    valign = VLC_VIDEO_ALIGN_BOTTOM;
                 if( b_row_last )
-                    i_align |= VOUT_ALIGN_TOP;
+                    valign = VLC_VIDEO_ALIGN_TOP;
             }
 
             /* */
@@ -935,7 +932,8 @@ static int Configuration( panoramix_output_t pp_output[ROW_MAX][COL_MAX],
             p_output->filter = cfg;
 
             /* */
-            p_output->i_align = i_align;
+            p_output->align.horizontal = halign;
+            p_output->align.vertical = valign;
             p_output->i_x = i_dst_x;
             p_output->i_y = i_dst_y;
 
diff --git a/modules/video_splitter/wall.c b/modules/video_splitter/wall.c
index 6ec29a0778..a73cbca706 100644
--- a/modules/video_splitter/wall.c
+++ b/modules/video_splitter/wall.c
@@ -34,9 +34,6 @@
 #include <vlc_plugin.h>
 #include <vlc_video_splitter.h>
 
-/* FIXME it is needed for VOUT_ALIGN_* only */
-#include <vlc_vout.h>
-
 #define ROW_MAX (15)
 #define COL_MAX (15)
 
@@ -97,7 +94,7 @@ typedef struct
     int  i_output;
     int  i_width;
     int  i_height;
-    int  i_align;
+    vlc_video_align_t align;
     int  i_left;
     int  i_top;
 } wall_output_t;
@@ -265,12 +262,12 @@ static int Open( vlc_object_t *p_this )
                          i_vstart%i_target_height );
             if(  y >= ( p_sys->i_row / 2 ) )
             {
-                i_halign = VOUT_ALIGN_TOP;
+                i_halign = VLC_VIDEO_ALIGN_TOP;
                 i_height -= b_vstart_rounded ? 2: 0;
             }
             else
             {
-                i_halign = VOUT_ALIGN_BOTTOM;
+                i_halign = VLC_VIDEO_ALIGN_BOTTOM;
             }
         }
 
@@ -297,12 +294,12 @@ static int Open( vlc_object_t *p_this )
                 i_width = ( i_target_width - i_hstart % i_target_width );
                 if( x >= ( p_sys->i_col / 2 ) )
                 {
-                    i_valign = VOUT_ALIGN_LEFT;
+                    i_valign = VLC_VIDEO_ALIGN_LEFT;
                     i_width -= b_hstart_rounded ? 2: 0;
                 }
                 else
                 {
-                    i_valign = VOUT_ALIGN_RIGHT;
+                    i_valign = VLC_VIDEO_ALIGN_RIGHT;
                 }
             }
 
@@ -310,7 +307,8 @@ static int Open( vlc_object_t *p_this )
             p_output->b_active = pb_active[y * p_sys->i_col + x] &&
                                  i_height > 0 && i_width > 0;
             p_output->i_output = -1;
-            p_output->i_align = i_valign | i_halign;
+            p_output->align.vertical = i_valign;
+            p_output->align.horizontal = i_halign;
             p_output->i_width = i_width;
             p_output->i_height = i_height;
             p_output->i_left = i_left;
@@ -361,9 +359,9 @@ static int Open( vlc_object_t *p_this )
             p_cfg->fmt.i_height         = p_output->i_height;
             p_cfg->fmt.i_sar_num        = p_splitter->fmt.i_sar_num;
             p_cfg->fmt.i_sar_den        = p_splitter->fmt.i_sar_den;
-            p_cfg->window.i_x     = p_output->i_left;
-            p_cfg->window.i_y     = p_output->i_top;
-            p_cfg->window.i_align = p_output->i_align;
+            p_cfg->window.i_x   = p_output->i_left;
+            p_cfg->window.i_y   = p_output->i_top;
+            p_cfg->window.align = p_output->align;
             p_cfg->psz_module = NULL;
         }
     }



More information about the vlc-commits mailing list