[vlc-commits] [Git][videolan/vlc][master] libvlc: use SUBPICTURE_ALIGN_xxx for "video-title-position"

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Mar 1 16:21:48 UTC 2025


Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
46cacbe0 by Steve Lhomme at 2025-03-01T15:58:14+00:00
libvlc: use SUBPICTURE_ALIGN_xxx for "video-title-position"

We already use flags to fill some arrays like AOUT_MIX_MODE_xxx
or VOUT_ALIGN_xxx.

The downside is that we cannot change the defines without breaking
the libvlc API. But SUBPICTURE_ALIGN_xxx defines are also used by
many module as source for parameters, so these would break as well.

- - - - -


1 changed file:

- src/libvlc-module.c


Changes:

=====================================
src/libvlc-module.c
=====================================
@@ -36,6 +36,7 @@
 #include <vlc_plugin.h>
 #include <vlc_cpu.h>
 #include <vlc_vout_display.h>
+#include <vlc_subpicture.h>
 #include "libvlc.h"
 #include "modules/modules.h"
 
@@ -403,7 +404,17 @@ static const char *const video_stereo_formats_text[] = {
     N_("Side-by-Side"),
 };
 
-static const int pi_pos_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 };
+static const int pi_pos_values[] = {
+    0,
+    SUBPICTURE_ALIGN_LEFT,
+    SUBPICTURE_ALIGN_RIGHT,
+    SUBPICTURE_ALIGN_TOP,
+    SUBPICTURE_ALIGN_BOTTOM,
+    SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_LEFT,
+    SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_RIGHT,
+    SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_LEFT,
+    SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_RIGHT,
+};
 static const char *const ppsz_pos_descriptions[] =
 { N_("Center"), N_("Left"), N_("Right"), N_("Top"), N_("Bottom"),
   N_("Top-Left"), N_("Top-Right"), N_("Bottom-Left"), N_("Bottom-Right") };
@@ -1698,7 +1709,7 @@ vlc_module_begin ()
     add_integer( "video-title-timeout", 5000, VIDEO_TITLE_TIMEOUT_TEXT,
                  VIDEO_TITLE_TIMEOUT_LONGTEXT )
         change_safe()
-    add_integer( "video-title-position", 8, VIDEO_TITLE_POSITION_TEXT,
+    add_integer( "video-title-position", SUBPICTURE_ALIGN_BOTTOM, VIDEO_TITLE_POSITION_TEXT,
                  VIDEO_TITLE_POSITION_LONGTEXT )
         change_safe()
         change_integer_list( pi_pos_values, ppsz_pos_descriptions )



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/46cacbe08e804ce82a1396114ea611d61d7ef0bb

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/46cacbe08e804ce82a1396114ea611d61d7ef0bb
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list