[vlc-commits] [Git][videolan/vlc][master] 6 commits: test/src: meson.build: use define for zvbi support

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Wed Sep 2 09:47:30 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
ecffc044 by Alexandre Janniaux at 2026-09-02T11:26:58+02:00
test/src: meson.build: use define for zvbi support

- - - - -
a9dfa5e4 by Alexandre Janniaux at 2026-09-02T11:26:58+02:00
config.h.meson: drop ZVBI_COMPILED

The define wasn't set by meson and we'll provide it through CPPFLAGS for
the specific targets needing it directly. It will prevent recompiling
all the targets when enabling or disabling zvbi support.

- - - - -
3b5961f0 by Alexandre Janniaux at 2026-09-02T11:26:58+02:00
meson: access: add v4l2 access

- - - - -
53a4202c by Alexandre Janniaux at 2026-09-02T11:26:58+02:00
access: Makefile.am: define ZVBI_COMPILED in CPPFLAGS

- - - - -
06779472 by Alexandre Janniaux at 2026-09-02T11:26:58+02:00
test: Makefile.am: define ZVBI_COMPILED in CPPFLAGS

- - - - -
9d0a6c38 by Alexandre Janniaux at 2026-09-02T11:26:58+02:00
configure.ac: remove ZVBI_COMPILED from config.h

Now -DZVBI_COMPILED is directly provided to the targets that might use
it so we don't need to export it to config.h. Modifying config.h for
such dependency would trigger the rebuild of the whole project just for
a few target that would have been modified.

- - - - -


8 changed files:

- config.h.meson
- configure.ac
- meson.build
- meson_options.txt
- modules/access/Makefile.am
- modules/access/meson.build
- test/Makefile.am
- test/src/meson.build


Changes:

=====================================
config.h.meson
=====================================
@@ -224,6 +224,9 @@
 /* Define to 1 if you have the <linux/magic.h> header file. */
 #mesondefine HAVE_LINUX_MAGIC_H
 
+/* Define to 1 if you have the <linux/videodev2.h> header file. */
+#mesondefine HAVE_LINUX_VIDEODEV2_H
+
 /* Define to 1 if you have the `lldiv' function. */
 #mesondefine HAVE_LLDIV
 
@@ -400,6 +403,9 @@
 /* Define to 1 if you have the <sys/uio.h> header file. */
 #mesondefine HAVE_SYS_UIO_H
 
+/* Define to 1 if you have the <sys/videoio.h> header file. */
+#mesondefine HAVE_SYS_VIDEOIO_H
+
 /* Define to 1 if you have the `tdestroy' function. */
 #mesondefine HAVE_TDESTROY
 
@@ -573,9 +579,6 @@
 /* Define to 1 if the X Window System is missing or not being used. */
 #mesondefine X_DISPLAY_MISSING
 
-/* Define if the zvbi module is built */
-// #undef ZVBI_COMPILED
-
 /* Define to 64 for large files support. */
 #define _FILE_OFFSET_BITS 64
 


=====================================
configure.ac
=====================================
@@ -3348,7 +3348,6 @@ AS_IF( [test "${enable_zvbi}" != "no"],[
     PKG_CHECK_MODULES(ZVBI, [zvbi-0.2 >= 0.2.28],
         [
           VLC_ADD_PLUGIN([zvbi])
-          AC_DEFINE(ZVBI_COMPILED, 1, [Define if the zvbi module is built])
           have_zvbi="yes"
           AS_IF( [test "${enable_telx}" = "yes"],[
                   AC_MSG_WARN([The zvbi and telx modules are incompatible. Using zvbi.])


=====================================
meson.build
=====================================
@@ -263,6 +263,7 @@ check_c_headers = [
     ['getopt.h'],
     ['linux/dccp.h'],
     ['linux/magic.h'],
+    ['linux/videodev2.h'],
     ['pthread.h'],
     ['poll.h'],
     ['sys/auxv.h'],
@@ -272,6 +273,7 @@ check_c_headers = [
     # Bionic >= 26 source code also says it's not useful because of SELinux.
     ['sys/shm.h', { 'exclude_host': ['android'] }],
     ['sys/soundcard.h'],
+    ['sys/videoio.h', { 'prefix' : ['#include <sys/ioccom.h>'] }],
     ['valgrind/valgrind.h'],
     ['X11/Xlib.h'],
     ['xlocale.h'],


=====================================
meson_options.txt
=====================================
@@ -815,7 +815,11 @@ option('ndi',
        value: 'auto',
        description: 'Build with NDI module (requires libnoidea)')
 
-# TODO: Missing v4l2
+option('v4l2',
+       type: 'feature',
+       value: 'auto',
+       description: 'Video4Linux2 support')
+
 # TODO: Missing rpi-omxil
 # TODO: Missing gst-decode
 # TODO: Missing libva


=====================================
modules/access/Makefile.am
=====================================
@@ -176,8 +176,13 @@ libv4l2_plugin_la_SOURCES = \
 	access/v4l2/lib.c \
 	access/v4l2/v4l2.h
 libv4l2_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/access/v4l2
-libv4l2_plugin_la_CFLAGS = $(AM_CFLAGS) $(ZVBI_CFLAGS)
-libv4l2_plugin_la_LIBADD = $(LIBDL) $(LIBM) $(ZVBI_LIBS)
+libv4l2_plugin_la_CFLAGS = $(AM_CFLAGS)
+libv4l2_plugin_la_LIBADD = $(LIBDL) $(LIBM)
+if HAVE_ZVBI
+libv4l2_plugin_la_CPPFLAGS += -DZVBI_COMPILED=1
+libv4l2_plugin_la_CFLAGS += $(ZVBI_CFLAGS)
+libv4l2_plugin_la_LIBADD += $(ZVBI_LIBS)
+endif
 if HAVE_V4L2
 access_PLUGINS += libv4l2_plugin.la
 endif


=====================================
modules/access/meson.build
=====================================
@@ -189,6 +189,37 @@ if libraw1394_dep.found() and libavc1394_dep.found()
     }
 endif
 
+# Video4Linux2
+if use_zvbi
+    v4l2_zvbi_dep = declare_dependency(dependencies: zvbi_dep,
+                                       compile_args: '-DZVBI_COMPILED=1')
+else
+    v4l2_zvbi_dep = declare_dependency()
+endif
+vlc_modules += {
+    'name' : 'v4l2',
+    'sources' : files('v4l2/v4l2.c',
+                      'v4l2/buffers.c',
+                      'v4l2/video.c',
+                      'v4l2/vbi.c',
+                      'v4l2/demux.c',
+                      'v4l2/access.c',
+                      'v4l2/radio.c',
+                      'v4l2/controls.c',
+                      'v4l2/lib.c',
+                      'v4l2/v4l2.h',
+                      'v4l2/linux/videodev2.h',
+                      'v4l2/linux/v4l2-common.h',
+                      'v4l2/linux/v4l2-controls.h'),
+    'include_directories' : include_directories('v4l2'),
+    'dependencies' : [dl_lib, m_lib, v4l2_zvbi_dep],
+    'enabled' : get_option('v4l2')
+        .require(cdata.has('HAVE_LINUX_VIDEODEV2_H') or cdata.has('HAVE_SYS_VIDEOIO_H'),
+                 error_message: 'Video4Linux2 headers not found')
+        .allowed()
+
+}
+
 # Linsys
 if (get_option('linsys')
     .require(host_system == 'linux', error_message: 'Linsys requires Linux')


=====================================
test/Makefile.am
=====================================
@@ -286,6 +286,10 @@ test_src_player_seeks_SOURCES = src/player/common.h src/player/modules.c \
 test_src_player_seeks_LDADD = $(LIBVLCCORE) $(LIBVLC) $(LIBM)
 test_src_player_teletext_SOURCES = src/player/common.h src/player/modules.c \
 	src/player/teletext.c
+test_src_player_teletext_CPPFLAGS = $(AM_CPPFLAGS)
+if HAVE_ZVBI
+test_src_player_teletext_CPPFLAGS += -DZVBI_COMPILED=1
+endif
 test_src_player_teletext_LDADD = $(LIBVLCCORE) $(LIBVLC) $(LIBM)
 test_src_player_timers_SOURCES = src/player/common.h src/player/modules.c \
 	src/player/timers.c src/player/timers.h


=====================================
test/src/meson.build
=====================================
@@ -279,6 +279,7 @@ vlc_tests += {
         'player/teletext.c'),
     'suite' : ['src', 'test_src'],
     'link_with' : [libvlc, libvlccore],
+    'c_args' : use_zvbi ? ['-DZVBI_COMPILED=1'] : [],
     'module_depends' : vlc_plugins_targets.keys()
 }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/33f6724f781105adf78330d468dd5a45bf2cc0cc...9d0a6c387de11834fd879365d386e10fb15c3af9

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/33f6724f781105adf78330d468dd5a45bf2cc0cc...9d0a6c387de11834fd879365d386e10fb15c3af9
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list