[vlc-commits] [Git][videolan/libvlcpp][master] 6 commits: tests: regression: Assert that at least one track is found

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Wed Nov 5 08:33:33 UTC 2025



Jean-Baptiste Kempf pushed to branch master at VideoLAN / libvlcpp


Commits:
c225e599 by Alaric Senat at 2025-09-22T18:17:45+02:00
tests: regression: Assert that at least one track is found

- - - - -
5745a6ee by Alaric Senat at 2025-09-22T18:17:45+02:00
build: Set minimal C++ standard to c++11

- - - - -
3bb0994b by Alaric Senat at 2025-09-23T09:33:20+02:00
build: pkg-conf: Hardcode `requires` field

As it does not work with internall built wrap dependencies until meson
1.9. [^1]

[^1]: <https://github.com/mesonbuild/meson/pull/14750>

- - - - -
f2d830bf by Alaric Senat at 2025-09-23T09:33:20+02:00
build: Add a libvlc .wrap fallback

This is simpler for the CI than having docker images built for each
vlc.git versions. This will allow adapting faster to upstream changes
ABI modifications

- - - - -
af09f281 by Alaric Senat at 2025-09-23T09:33:20+02:00
ci: Force a 4.0 wrap build

By using the official vlc container image. This allows easier tracking
of the 4.0 hash version built by the CI.

- - - - -
7e5eaae1 by Alaric Senat at 2025-09-23T09:33:20+02:00
ci: Include meson test logs in artifacts

- - - - -


8 changed files:

- .gitlab-ci.yml
- meson.build
- + subprojects/libvlc.wrap
- + subprojects/packagefiles/libvlc/0e4be111590da80c4a695e4efc4a007eae604bc8.patch
- + subprojects/packagefiles/libvlc/af374ba7224ea342fe43443b306eac0a856f8784.patch
- + subprojects/packagefiles/libvlc/declare-libvlc-dependency.patch
- + subprojects/packagefiles/libvlc/libvlc-minimal.ini
- test/main.cpp


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -1,6 +1,6 @@
 variables:
   VLC30_IMAGE: registry.videolan.org/medialibrary-3.0:20231017192545
-  VLC40_IMAGE: registry.videolan.org/medialibrary-4.0:20231017192545
+  VLC40_IMAGE: registry.videolan.org/vlc-debian-unstable:20230705133021
 
 .common_build:
   rules:
@@ -11,9 +11,17 @@ variables:
     - amd64
   script:
     - export CXXFLAGS="-Werror" # Mainly to fail on deprecation errors.
-    - meson setup build -Dexamples=enabled -Dtests=enabled
+    - export VLC_PLUGIN_PATH="${CI_PROJECT_DIR}/build/subprojects/libvlc/modules/"
+    - meson setup build -Dexamples=enabled -Dtests=enabled --native-file subprojects/packagefiles/libvlc/libvlc-minimal.ini
     - meson compile -C build
-    - meson test -C build
+    - meson test -C build "libvlcpp:"
+  artifacts:
+    reports:
+      junit: build/meson-logs/testlog.junit.xml
+    paths:
+      - ${CI_PROJECT_DIR}/build/meson-logs/testlog.txt
+    when: always
+
 
 continuous_build_4.0:
   extends: .common_build


=====================================
meson.build
=====================================
@@ -7,6 +7,7 @@ project(
     license_files: ['COPYING'],
     version: '0.1.0',
     meson_version: '>=1.1.0',
+    default_options: ['cpp_std=c++11'],
 )
 
 subdir('vlcpp')
@@ -21,7 +22,7 @@ libvlc_dep = dependency('libvlc', version: '>=3.0')
 pkg = import('pkgconfig')
 pkg.generate(
     version: meson.project_version(),
-    requires: libvlc_dep,
+    requires: ['libvlc>=3.0'],
     name: 'libvlcpp',
     description: 'libvlc C++ bindings',
 )


=====================================
subprojects/libvlc.wrap
=====================================
@@ -0,0 +1,10 @@
+[wrap-git]
+url = https://code.videolan.org/videolan/vlc.git
+depth = 1
+diff_files = libvlc/af374ba7224ea342fe43443b306eac0a856f8784.patch, libvlc/0e4be111590da80c4a695e4efc4a007eae604bc8.patch, libvlc/declare-libvlc-dependency.patch
+
+# Oct 13 2023
+revision = 2706a5a5c77a86987143999a08f6988626299477
+
+[provide]
+libvlc = libvlc_dep


=====================================
subprojects/packagefiles/libvlc/0e4be111590da80c4a695e4efc4a007eae604bc8.patch
=====================================
@@ -0,0 +1,55 @@
+From 0e4be111590da80c4a695e4efc4a007eae604bc8 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Fri, 18 Oct 2024 10:01:55 +0200
+Subject: [PATCH] meson: allow disabling building test executables
+
+They should not be built when cross-compiling and we don't have an exe_wrapper.
+They can't be run directly. They may be used on another machine, so it should be
+possible to force it.
+
+Disabled on Windows for now as we can't run them because they rely on alarm().
+---
+ meson.build       | 10 +++++++---
+ meson_options.txt |  5 +++++
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 1f4acaa50b..0b3980c5a2 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1064,9 +1064,13 @@ subdir('bin')
+ # VLC plugins
+ subdir('modules')
+ 
+-# Integration and non-regression tests, some unittest are there too but the
+-# modules/, src/ and lib/ folders should be favoured for those.
+-subdir('test')
++if (get_option('tests')
++    .disable_auto_if(host_system in ['windows'])
++    .allowed())
++    # Integration and non-regression tests, some unittest are there too but the
++    # modules/, src/ and lib/ folders should be favoured for those.
++    subdir('test')
++endif
+ 
+ if get_option('rust').allowed()
+     warning('''
+diff --git a/meson_options.txt b/meson_options.txt
+index 608117b6d1..dfebc028c1 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -5,6 +5,11 @@ option('vlc',
+     value : true,
+     description : 'Build the VLC executable program.')
+ 
++option('tests',
++    type : 'feature',
++    value : 'auto',
++    description : 'Build the VLC test executables.')
++
+ option('nls',
+     type : 'feature',
+     value : 'auto',
+-- 
+2.48.1
+


=====================================
subprojects/packagefiles/libvlc/af374ba7224ea342fe43443b306eac0a856f8784.patch
=====================================
@@ -0,0 +1,56 @@
+From af374ba7224ea342fe43443b306eac0a856f8784 Mon Sep 17 00:00:00 2001
+From: Alexandre Janniaux <ajanni at videolabs.io>
+Date: Fri, 19 Jan 2024 16:10:32 +0100
+Subject: [PATCH] meson: refactor link_language usage
+
+Refactor the way link_language is specified to ensure a correct value
+(the default one or the one provided by the module) is always used.
+Before, [] was allowed as a default value to fallback to meson
+autodetection but it has been removed when link_language and other
+kwargs have been typed[^1] in the interpreter, leading to the followin
+error in meson 1.3.1
+
+    ../modules/meson.build:295:17: ERROR: library keyword argument 'link_language' was of type array[] but should have been one of: str, NoneType
+
+[^1]: https://github.com/mesonbuild/meson/commit/0f23dc5b03fda2e8958903eb25587a7e4e2daa67
+---
+ modules/meson.build | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/modules/meson.build b/modules/meson.build
+index 6262fa94e1e..e19ab35529e 100644
+--- a/modules/meson.build
++++ b/modules/meson.build
+@@ -292,13 +292,18 @@ foreach module : vlc_modules
+         '-DVLC_DYNAMIC_PLUGIN'
+     ]
+ 
++    kwargs = {}
++
++    if module.has_key('link_language')
++      kwargs += { link_language: module.get('link_language') }
++    endif
++
+     vlc_plugin = library(
+         module['name'] + '_plugin',
+         module['sources'],
+         link_with: [module.get('link_with', []), vlc_libcompat],
+         link_args: module.get('link_args', []),
+         link_depends: module.get('link_depends', []),
+-        link_language: module.get('link_language', []),
+         include_directories: [module.get('include_directories', []), vlc_include_dirs],
+         dependencies: [module.get('dependencies', []), libvlccore_dep],
+         c_args: [module.get('c_args', []), common_args],
+@@ -306,7 +311,8 @@ foreach module : vlc_modules
+         objc_args: [module.get('objc_args', []), common_args],
+         build_by_default: true,
+         install: true,
+-        install_dir: get_option('libdir') / 'vlc/plugins'
++        install_dir: get_option('libdir') / 'vlc/plugins',
++        kwargs: kwargs
+     )
+     vlc_plugins_targets += {
+         module['name']: vlc_plugin
+-- 
+GitLab
+


=====================================
subprojects/packagefiles/libvlc/declare-libvlc-dependency.patch
=====================================
@@ -0,0 +1,26 @@
+From a1fc1372df9f08e6f49d0c6aaf67b1b8e35ef959 Mon Sep 17 00:00:00 2001
+From: Alaric Senat <dev.asenat at posteo.net>
+Date: Mon, 22 Sep 2025 11:55:24 +0200
+Subject: [PATCH] meson: libvlc: declare dependency
+
+---
+ lib/meson.build | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/lib/meson.build b/lib/meson.build
+index e7b9de3..40f6073 100644
+--- a/lib/meson.build
++++ b/lib/meson.build
+@@ -31,3 +31,9 @@ libvlc = library('vlc',
+     dependencies: [libvlccore_dep, m_lib, threads_dep],
+     install: true
+ )
++
++libvlc_dep = declare_dependency(
++    link_with: libvlc,
++    include_directories: vlc_include_dirs,
++    dependencies: [libvlccore_dep, m_lib, threads_dep]
++)
+-- 
+2.48.1
+


=====================================
subprojects/packagefiles/libvlc/libvlc-minimal.ini
=====================================
@@ -0,0 +1,20 @@
+[built-in options]
+auto_features = 'disabled'
+
+[libvlc:built-in options]
+default_library = 'shared'
+auto_features = 'disabled'
+
+[libvlc:project options]
+avcodec = 'enabled'
+avformat = 'enabled'
+stream_outputs = true
+
+addon_manager = false
+lua = 'disabled'
+png = 'disabled'
+screen = 'disabled'
+tests = 'disabled'
+vcd_module = false
+videolan_manager = false
+vlc = false


=====================================
test/main.cpp
=====================================
@@ -148,6 +148,7 @@ int main(int ac, char** av)
 #if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
     auto tracks = mp.tracks( VLC::MediaTrack::Type::Video, false );
     std::cout << "Got " << tracks.size() << " tracks" << std::endl;
+    assert(!tracks.empty());
     mp.selectTracks( VLC::MediaTrack::Type::Video, tracks );
     std::this_thread::sleep_for( std::chrono::milliseconds(1000) );
 #endif



View it on GitLab: https://code.videolan.org/videolan/libvlcpp/-/compare/e317b34b9f87a0b55c65e8a47b607505bdd31ccb...7e5eaae11395af88fafb947535771c41388e12d6

-- 
View it on GitLab: https://code.videolan.org/videolan/libvlcpp/-/compare/e317b34b9f87a0b55c65e8a47b607505bdd31ccb...7e5eaae11395af88fafb947535771c41388e12d6
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