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


Commits:
baa12bbe by Alaric Senat at 2025-09-17T09:56:10+02:00
ci: Fully switch to medialibrary container images

We have the same requirements as the medialibrary, let's follow their
images baseline.

- - - - -
f4c98837 by Alaric Senat at 2025-09-17T09:56:10+02:00
build: Switch to meson

As part of the global Videolan effort to move from libtool to meson.

- - - - -
e317b34b by Alaric Senat at 2025-09-17T10:02:36+02:00
build: Automate regression test

- - - - -


15 changed files:

- .gitlab-ci.yml
- − Makefile.am
- − bootstrap
- − configure.ac
- + examples/helloworld/meson.build
- + examples/imem/meson.build
- + examples/meson.build
- + examples/renderers/meson.build
- − libvlcpp.pc.in
- − m4/stdcxx_11.m4
- + meson.build
- + meson.options
- + test/meson.build
- + test/sample.mp4
- + vlcpp/meson.build


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -1,6 +1,6 @@
 variables:
-  VLC30_IMAGE: registry.videolan.org/medialibrary:20201009131431
-  VLC40_IMAGE: registry.videolan.org/libvlcpp-unstable:20221213095400
+  VLC30_IMAGE: registry.videolan.org/medialibrary-3.0:20231017192545
+  VLC40_IMAGE: registry.videolan.org/medialibrary-4.0:20231017192545
 
 .common_build:
   rules:
@@ -10,10 +10,10 @@ variables:
     - docker
     - amd64
   script:
-    - ./bootstrap
-    - ./configure --enable-examples --enable-werror
-    - make -j4
-    - make -j4 distcheck
+    - export CXXFLAGS="-Werror" # Mainly to fail on deprecation errors.
+    - meson setup build -Dexamples=enabled -Dtests=enabled
+    - meson compile -C build
+    - meson test -C build
 
 continuous_build_4.0:
   extends: .common_build


=====================================
Makefile.am deleted
=====================================
@@ -1,48 +0,0 @@
-ACLOCAL_AMFLAGS = -I m4
-
-MEDIALIB_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/src
-
-libvlcppdir = $(includedir)/vlcpp
-
-libvlcpp_HEADERS =          \
-       vlcpp/common.hpp              \
-       vlcpp/Equalizer.hpp           \
-       vlcpp/EventManager.hpp        \
-       vlcpp/Instance.hpp            \
-       vlcpp/Internal.hpp            \
-       vlcpp/MediaDiscoverer.hpp     \
-       vlcpp/Media.hpp               \
-       vlcpp/MediaLibrary.hpp        \
-       vlcpp/MediaList.hpp           \
-       vlcpp/MediaListPlayer.hpp     \
-       vlcpp/MediaPlayer.hpp         \
-       vlcpp/Dialog.hpp                          \
-       vlcpp/RendererDiscoverer.hpp  \
-       vlcpp/Picture.hpp                         \
-       vlcpp/structures.hpp          \
-       vlcpp/vlc.hpp                 \
-       $(NULL)
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libvlcpp.pc
-
-if HAVE_EXAMPLES
-noinst_PROGRAMS = helloworld tests imem discovery
-
-AM_CPPFLAGS = $(vlc_CFLAGS) -Wextra -Wall
-
-if HAVE_WERROR
-# This is meant to make our builds fail if a deprecated method is present
-AM_CPPFLAGS += -Werror
-endif
-
-helloworld_SOURCES = examples/helloworld/main.cpp
-helloworld_LDADD = $(vlc_LIBS)
-imem_SOURCES = examples/imem/imem.cpp
-imem_LDADD = $(vlc_LIBS)
-tests_SOURCES = test/main.cpp
-tests_LDADD = $(vlc_LIBS)
-discovery_SOURCES = examples/renderers/discovery.cpp
-discovery_LDADD = $(vlc_LIBS)
-
-endif


=====================================
bootstrap deleted
=====================================
@@ -1,6 +0,0 @@
-#! /bin/sh
-set -x
-
-cd "$(dirname "$0")"
-
-autoreconf -fis


=====================================
configure.ac deleted
=====================================
@@ -1,30 +0,0 @@
-m4_define([VLCPP_MAJOR], [0])
-m4_define([VLCPP_MINOR], [1])
-m4_define([VLCPP_MICRO], [0])
-
-AC_COPYRIGHT([Copyright 2014-2016 VideoLAN - VideoLabs])
-
-AC_INIT([libvlcpp], [VLCPP_MAJOR.VLCPP_MINOR.VLCPP_MICRO])
-
-AM_INIT_AUTOMAKE([foreign subdir-objects])
-m4_ifdef([AM_SILENT_RULES], [
-  AM_SILENT_RULES([yes])
-])
-
-AC_CONFIG_MACRO_DIR([m4])
-AC_PROG_CXX
-AX_CXX_COMPILE_STDCXX_11([noext])
-
-AC_ARG_ENABLE(examples, AS_HELP_STRING([--enable-examples], [build examples 
programs]))
-AM_CONDITIONAL([HAVE_EXAMPLES], [test "${enable_examples}" = "yes"])
-AS_IF([test "${enable_examples}" = "yes"], [PKG_CHECK_MODULES(vlc, libvlc)])
-
-AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror], [build examples with 
-Werror]))
-AM_CONDITIONAL([HAVE_WERROR], [test "${enable_werror}" = "yes"])
-
-AC_CONFIG_FILES([
-Makefile
-libvlcpp.pc
-])
-
-AC_OUTPUT


=====================================
examples/helloworld/meson.build
=====================================
@@ -0,0 +1,10 @@
+# Copyright (C) 2014-2025 VideoLAN - VideoLabs
+
+helloworld_sources = files('main.cpp')
+
+executable(
+    'helloworld',
+    sources: helloworld_sources,
+    dependencies: [libvlc_dep],
+    include_directories: [vlcpp_includes],
+)


=====================================
examples/imem/meson.build
=====================================
@@ -0,0 +1,10 @@
+# Copyright (C) 2014-2025 VideoLAN - VideoLabs
+
+imem_sources = files('imem.cpp')
+
+executable(
+    'imem',
+    sources: imem_sources,
+    dependencies: [libvlc_dep],
+    include_directories: [vlcpp_includes],
+)


=====================================
examples/meson.build
=====================================
@@ -0,0 +1,7 @@
+# Copyright (C) 2014-2025 VideoLAN - VideoLabs
+
+vlcpp_includes = include_directories('..')
+
+subdir('helloworld')
+subdir('imem')
+subdir('renderers')


=====================================
examples/renderers/meson.build
=====================================
@@ -0,0 +1,10 @@
+# Copyright (C) 2014-2025 VideoLAN - VideoLabs
+
+discovery_sources = files('discovery.cpp')
+
+executable(
+    'discovery',
+    sources: discovery_sources,
+    dependencies: [libvlc_dep],
+    include_directories: [vlcpp_includes],
+)


=====================================
libvlcpp.pc.in deleted
=====================================
@@ -1,10 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=${prefix}/lib
-includedir=${prefix}/include
-
-Name: libvlcpp
-Description: libvlc C++ bindings
-Version: @PACKAGE_VERSION@
-Cflags: -I${includedir}
-Requires: libvlc >= 3


=====================================
m4/stdcxx_11.m4 deleted
=====================================
@@ -1,166 +0,0 @@
-# ============================================================================
-#  http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
-# ============================================================================
-#
-# SYNOPSIS
-#
-#   AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional])
-#
-# DESCRIPTION
-#
-#   Check for baseline language coverage in the compiler for the C++11
-#   standard; if necessary, add switches to CXXFLAGS to enable support.
-#
-#   The first argument, if specified, indicates whether you insist on an
-#   extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
-#   -std=c++11).  If neither is specified, you get whatever works, with
-#   preference for an extended mode.
-#
-#   The second argument, if specified 'mandatory' or if left unspecified,
-#   indicates that baseline C++11 support is required and that the macro
-#   should error out if no mode with that support is found.  If specified
-#   'optional', then configuration proceeds regardless, after defining
-#   HAVE_CXX11 if and only if a supporting mode is found.
-#
-# LICENSE
-#
-#   Copyright (c) 2008 Benjamin Kosnik <b...@redhat.com>
-#   Copyright (c) 2012 Zack Weinberg <za...@panix.com>
-#   Copyright (c) 2013 Roy Stogner <royst...@ices.utexas.edu>
-#   Copyright (c) 2014 Alexey Sokolov <soko...@google.com>
-#   Copyright (c) 2014, 2015 Google Inc.
-#   Copyright (c) 2015 VLC authors and VideoLAN
-#
-#   Copying and distribution of this file, with or without modification, are
-#   permitted in any medium without royalty provided the copyright notice
-#   and this notice are preserved. This file is offered as-is, without any
-#   warranty.
-
-#serial 7
-
-m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[
-  template <typename T>
-    struct check
-    {
-      static_assert(sizeof(int) <= sizeof(T), "not big enough");
-    };
-
-    struct Base {
-    virtual void f() {}
-    };
-    struct Child : public Base {
-    virtual void f() override {}
-    };
-
-    typedef check<check<bool>> right_angle_brackets;
-
-    int a;
-    decltype(a) b;
-
-    typedef check<int> check_type;
-    check_type c;
-    check_type&& cr = static_cast<check_type&&>(c);
-
-    auto d = a;
-    auto l = [](){};
-
-    // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
-    // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function 
because of this
-    namespace test_template_alias_sfinae {
-        struct foo {};
-
-        template<typename T>
-        using member = typename T::member_type;
-
-        template<typename T>
-        void func(...) {}
-
-        template<typename T>
-        void func(member<T>*) {}
-
-        void test() {
-            func<foo>(0);
-        }
-    }
-
-    #include <cinttypes>
-    constexpr uint64_t constantname = UINT64_C(0x100000000);
-]])
-
-AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
-  m4_if([$1], [], [],
-        [$1], [ext], [],
-        [$1], [noext], [],
-        [m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl
-  m4_if([$2], [], [ax_cxx_compile_cxx11_required=true],
-        [$2], [mandatory], [ax_cxx_compile_cxx11_required=true],
-        [$2], [optional], [ax_cxx_compile_cxx11_required=false],
-        [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_11])])
-  AC_LANG_PUSH([C++])dnl
-  ac_success=no
-  AC_CACHE_CHECK(whether $CXX supports C++11 features by default,
-  ax_cv_cxx_compile_cxx11,
-  [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
-    [ax_cv_cxx_compile_cxx11=yes],
-    [ax_cv_cxx_compile_cxx11=no])])
-  if test x$ax_cv_cxx_compile_cxx11 = xyes; then
-    ac_success=yes
-  fi
-
-  m4_if([$1], [noext], [], [dnl
-  if test x$ac_success = xno; then
-    for switch in -std=gnu++11 -std=gnu++0x; do
-      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
-      AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
-                     $cachevar,
-        [ac_save_CXXFLAGS="$CXXFLAGS"
-         CXXFLAGS="$CXXFLAGS $switch"
-         
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
-          [eval $cachevar=yes],
-          [eval $cachevar=no])
-         CXXFLAGS="$ac_save_CXXFLAGS"])
-      if eval test x\$$cachevar = xyes; then
-        CXXFLAGS="$CXXFLAGS $switch"
-        ac_success=yes
-        break
-      fi
-    done
-  fi])
-
-  m4_if([$1], [ext], [], [dnl
-  if test x$ac_success = xno; then
-    for switch in -std=c++11 -std=c++0x; do
-      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
-      AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
-                     $cachevar,
-        [ac_save_CXXFLAGS="$CXXFLAGS"
-         CXXFLAGS="$CXXFLAGS $switch"
-         
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
-          [eval $cachevar=yes],
-          [eval $cachevar=no])
-         CXXFLAGS="$ac_save_CXXFLAGS"])
-      if eval test x\$$cachevar = xyes; then
-        CXXFLAGS="$CXXFLAGS $switch"
-        ac_success=yes
-        break
-      fi
-    done
-  fi])
-  AC_LANG_POP([C++])
-  if test x$ax_cxx_compile_cxx11_required = xtrue; then
-    if test x$ac_success = xno; then
-      AC_MSG_ERROR([*** A compiler with support for C++11 language features is 
required.])
-    fi
-  else
-    if test x$ac_success = xno; then
-      HAVE_CXX11=0
-      AC_MSG_NOTICE([No compiler with C++11 support was found])
-    else
-      HAVE_CXX11=1
-      AC_DEFINE(HAVE_CXX11,1,
-                [define if the compiler supports basic C++11 syntax])
-    fi
-
-    AC_SUBST(HAVE_CXX11)
-  fi
-])


=====================================
meson.build
=====================================
@@ -0,0 +1,35 @@
+# Copyright (C) 2014-2025 VideoLAN - VideoLabs
+
+project(
+    'libvlcpp',
+    ['cpp'],
+    license: 'LGPL-2.1-or-later',
+    license_files: ['COPYING'],
+    version: '0.1.0',
+    meson_version: '>=1.1.0',
+)
+
+subdir('vlcpp')
+
+install_headers(
+    libvlcpp_headers,
+    subdir: 'vlcpp',
+)
+
+libvlc_dep = dependency('libvlc', version: '>=3.0')
+
+pkg = import('pkgconfig')
+pkg.generate(
+    version: meson.project_version(),
+    requires: libvlc_dep,
+    name: 'libvlcpp',
+    description: 'libvlc C++ bindings',
+)
+
+if get_option('examples').enabled()
+    subdir('examples')
+endif
+
+if get_option('tests').enabled()
+    subdir('test')
+endif


=====================================
meson.options
=====================================
@@ -0,0 +1,4 @@
+# Copyright (C) 2014-2025 VideoLAN - VideoLabs
+
+option('examples', type: 'feature', value: 'auto')
+option('tests', type: 'feature', value: 'auto')


=====================================
test/meson.build
=====================================
@@ -0,0 +1,14 @@
+# Copyright (C) 2014-2025 VideoLAN - VideoLabs
+
+regression_test_sources = files('main.cpp')
+
+regression_test_exe = executable(
+    'regression-test',
+    sources: regression_test_sources,
+    dependencies: [libvlc_dep],
+    include_directories: [vlcpp_includes],
+)
+
+regression_test_sample = files('sample.mp4')
+
+test('regression-test', regression_test_exe, args: regression_test_sample)


=====================================
test/sample.mp4
=====================================
Binary files /dev/null and b/test/sample.mp4 differ


=====================================
vlcpp/meson.build
=====================================
@@ -0,0 +1,20 @@
+# Copyright (C) 2014-2025 VideoLAN - VideoLabs
+
+libvlcpp_headers = files(
+    'Dialog.hpp',
+    'Equalizer.hpp',
+    'EventManager.hpp',
+    'Instance.hpp',
+    'Internal.hpp',
+    'Media.hpp',
+    'MediaDiscoverer.hpp',
+    'MediaLibrary.hpp',
+    'MediaList.hpp',
+    'MediaListPlayer.hpp',
+    'MediaPlayer.hpp',
+    'Picture.hpp',
+    'RendererDiscoverer.hpp',
+    'common.hpp',
+    'structures.hpp',
+    'vlc.hpp',
+)



View it on GitLab: 
https://code.videolan.org/videolan/libvlcpp/-/compare/44c1f48e56a66c3f418175af1e1ef3fd1ab1b118...e317b34b9f87a0b55c65e8a47b607505bdd31ccb

-- 
View it on GitLab: 
https://code.videolan.org/videolan/libvlcpp/-/compare/44c1f48e56a66c3f418175af1e1ef3fd1ab1b118...e317b34b9f87a0b55c65e8a47b607505bdd31ccb
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to