From 073a450677b7dd37ff7d0a31ee4fcd064789d76e Mon Sep 17 00:00:00 2001 From: moi15moi Date: Wed, 28 Jan 2026 20:33:23 -0500 Subject: [PATCH 1/9] Add meson support --- .github/workflows/ci-meson.yml | 137 ++++++++++++++++++++++++++ .gitignore | 4 + doc/ffms2-api.md | 8 +- doc/ffms2-changelog.md | 1 + meson.build | 170 +++++++++++++++++++++++++++++++++ meson.options | 2 + subprojects/AviSynth+.wrap | 4 + subprojects/gtest.wrap | 15 +++ test/download_samples.py | 63 ++++++++++++ test/meson.build | 46 +++++++++ 10 files changed, 446 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci-meson.yml create mode 100644 meson.build create mode 100644 meson.options create mode 100644 subprojects/AviSynth+.wrap create mode 100644 subprojects/gtest.wrap create mode 100644 test/download_samples.py create mode 100644 test/meson.build diff --git a/.github/workflows/ci-meson.yml b/.github/workflows/ci-meson.yml new file mode 100644 index 0000000000..0d0e541e35 --- /dev/null +++ b/.github/workflows/ci-meson.yml @@ -0,0 +1,137 @@ +name: Meson Build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build-meson: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + cc: gcc + cxx: g++ + - os: ubuntu-latest + cc: clang + cxx: clang++ + - os: macos-latest + cc: clang + cxx: clang++ + - os: windows-latest + cc: gcc + cxx: g++ + + name: "Test (${{ matrix.os }}, ${{ matrix.cc }})" + runs-on: ${{ matrix.os }} + env: + CC: ${{ matrix.cc }} + CXX: ${{ matrix.cxx }} + defaults: + run: + shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }} + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Install deps (ubuntu) + if: matrix.os == 'ubuntu-latest' + run: | + sudo add-apt-repository ppa:ubuntuhandbook1/ffmpeg7 -y + sudo apt-get update + sudo apt-get install autoconf automake wget ffmpeg libavformat-dev libavcodec-dev libswscale-dev libavutil-dev libswresample-dev meson + + - name: Install deps (macOS) + if: matrix.os == 'macos-latest' + run: | + brew update + brew install autoconf automake libtool wget ffmpeg meson + + - name: Setup MSYS2 (MINGW64) + if: matrix.os == 'windows-latest' + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + install: >- + mingw-w64-x86_64-ca-certificates + mingw-w64-x86_64-ffmpeg + mingw-w64-x86_64-meson + mingw-w64-x86_64-toolchain + + - name: Configure with Meson + run: > + meson setup builddir -Dtest=enabled + + - name: Build + run: meson compile -C builddir --verbose + + - name: Run tests + run: meson test -C builddir --verbose + + build-win: + strategy: + fail-fast: false + matrix: + arch: [x86, x64] + + name: "Test Windows MSVC (${{ matrix.arch }})" + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Install Meson + run: pip install meson + + - name: Install ffmpeg + run: vcpkg install ffmpeg[avcodec,avdevice,avfilter,avformat,swresample,swscale,zlib,bzip2,core,dav1d,gpl,version3,lzma,openssl,xml2]:${{ matrix.arch }}-windows-static + + - name: Set VCPKG_PATH environment variable + run: | + $vcpkg_path = Split-Path (Get-Command vcpkg).Source -Parent + echo "VCPKG_PATH=$vcpkg_path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Install pkgconf + uses: msys2/setup-msys2@v2 + id: msys2 + with: + msystem: MINGW64 + install: mingw-w64-x86_64-pkgconf + + - name: Setup MSVC Developer Command Prompt + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.arch }} + + - name: Configure with Meson + env: + PKG_CONFIG: "${{ steps.msys2.outputs.msys2-location }}\\mingw64\\bin\\pkg-config.EXE" + run: > + meson setup builddir + --buildtype=release + --vsenv + -Dtest=enabled + -Davisynth=enabled + --pkg-config-path="$env:VCPKG_PATH\installed\${{ matrix.arch }}-windows-static\lib\pkgconfig" + -Db_vscrt=mt + # Use "-Db_vscrt=mt" to avoid this warning: LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library + + - name: Build + run: meson compile -C builddir --verbose + + - name: Run tests + run: meson test -C builddir --verbose + + - name: Install + run: meson install -C builddir --destdir install + + - name: Upload Build + uses: actions/upload-artifact@v6 + with: + name: ffms2_windows_${{ matrix.arch }} + path: builddir/install diff --git a/.gitignore b/.gitignore index f344dc0309..9e3d080b4e 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,7 @@ m4/lt~obsolete.m4 # Generated Makefile Makefile + +# Meson +/subprojects/* +!/subprojects/*.wrap diff --git a/doc/ffms2-api.md b/doc/ffms2-api.md index cdbdac4882..e72ff44699 100644 --- a/doc/ffms2-api.md +++ b/doc/ffms2-api.md @@ -21,17 +21,17 @@ FFMS2 has the following dependencies: - Further recommended configuration options: `--disable-debug --disable-muxers --disable-encoders --disable-filters --disable-hwaccels --disable-network --disable-devices - **[zlib][zlib]** -Compiling the library on non-Windows is trivial; the usual `./configure && make && make install` will suffice if FFmpeg and zlib are installed to the default locations. +Compiling the library is trivial; the usual `meson setup builddir && meson install -C builddir` will suffice if FFmpeg and zlib are installed to the default locations. ### Windows-specific compilation notes You have several options on how to build FFMS2 on Windows. -You can build both FFmpeg and FFMS2 with MinGW-w64, FFmpeg with clang-cl and FFMS2 with VC++ (shared only), or both with VC++. -The standard Avisynth 2.5 plugin requires building FFMS2 with VC++, while the Avisynth C plugin (which supports Avisynth 2.6) requires building with MinGW (and using the `c_plugin`branch). VapouSynth works as-is with MinGW-w64. +You can build both FFmpeg and FFMS2 with MinGW-w64, FFmpeg with clang-cl and FFMS2 with VC++ or both with VC++. These days building everything with MinGW works without doing anything unusual. -You'll have to manually add the location which you installed the headers and libraries to to VC++'s search paths (and if you're building both 32-bit and 64-bit, be sure to add the correct ones). +If you wanna use clang-cl or VC++, you will need to install pkgconf, so meson can found where you installed ffmpeg. +The easiest way is to download the latest pkgconf `.msi` from their [CI](https://github.com/pkgconf/pkgconf/actions?query=branch:master). [ffmpeg]: http://www.ffmpeg.org [zlib]: http://www.zlib.net diff --git a/doc/ffms2-changelog.md b/doc/ffms2-changelog.md index 9d065aa947..48834bc529 100644 --- a/doc/ffms2-changelog.md +++ b/doc/ffms2-changelog.md @@ -4,6 +4,7 @@ - Added layered decoding support, for e.g. spatial MV-HEVC. - Added LastEndPTS to FFMS_VideoProperties. This field is the equivalent of LastEndTime, but it is expressed in the video timebase. - Added FFMS_GetTrackMetadataI. + - Added meson build system. It has replaced autotools and MSBuild. - 5.0 - Fixed all issues with FFmpeg 6.1 which is now the minimum requirement diff --git a/meson.build b/meson.build new file mode 100644 index 0000000000..d922cee53c --- /dev/null +++ b/meson.build @@ -0,0 +1,170 @@ +project( + 'ffms2', + 'cpp', + default_options : [ + 'buildtype=release', + 'warning_level=2', + 'b_ndebug=if-release', + 'cpp_std=c++11' + ], + license : 'MIT', + license_files : 'COPYING', + meson_version : '>=1.3.0', + version : '5.1.2' +) + +cpp_compiler = meson.get_compiler('cpp') + +global_cpp_private_args = [ + '-DFFMS_EXPORTS', + '-D__STDC_CONSTANT_MACROS', +] + +if get_option('buildtype') == 'debug' and host_machine.system() == 'windows' + global_cpp_private_args += ['-DFFMS_WIN_DEBUG'] +endif + +ffms2_cpp_static_args = [ + '-DFFMS_STATIC', +] + +ffms2_link_args = [] +if cpp_compiler.has_link_argument('-Wl,-Bsymbolic') + # The -Wl,-Bsymbolic flag is required only when building ffms2 as a shared library against a static build of FFmpeg. + # Unfortunately, there is no reliable way to detect whether FFmpeg is static at configure time (especially when using *-uninstalled.pc files). + # To avoid unexpected link errors, always use this linker flag. + # For details, see FFmpeg's advanced linking notes:https://ffmpeg.org/platform.html#Advanced-linking-configuration + ffms2_link_args += ['-Wl,-Bsymbolic'] +endif + +ffmsindex_link_args = [] +if host_machine.system() == 'windows' and cpp_compiler.has_argument('-municode') + ffmsindex_link_args += ['-municode'] +endif + +libavutil_dep = dependency('libavutil', version : '>=59.39.0') + +ffms2_deps = [ + dependency('libavformat', version : '>=61.7.0'), + dependency('libavcodec', version : '>=61.19.0'), + dependency('libswscale', version : '>=8.3.0'), + libavutil_dep, + dependency('libswresample', version : '>=5.3.0'), + dependency('zlib') +] + +ffmsindex_deps = [ + libavutil_dep +] + +ffms2_src = [ + 'src/core/audiosource.cpp', + 'src/core/audiosource.h', + 'src/core/ffms.cpp', + 'src/core/filehandle.cpp', + 'src/core/filehandle.h', + 'src/core/indexing.cpp', + 'src/core/indexing.h', + 'src/core/track.cpp', + 'src/core/track.h', + 'src/core/utils.cpp', + 'src/core/utils.h', + 'src/core/videosource.cpp', + 'src/core/videosource.h', + 'src/core/videoutils.cpp', + 'src/core/videoutils.h', + 'src/core/zipfile.cpp', + 'src/core/zipfile.h', + 'src/vapoursynth/VapourSynth4.h', + 'src/vapoursynth/VSHelper4.h', + 'src/vapoursynth/vapoursource4.cpp', + 'src/vapoursynth/vapoursource4.h', + 'src/vapoursynth/vapoursynth4.cpp', +] + +if get_option('avisynth').enabled() + avisynth_dep = dependency('avisynth', required : false, version : '>=3.7.3') + + if avisynth_dep.found() + avisynth_dep = avisynth_dep.partial_dependency(compile_args: true, includes: true) + else + cmake = import('cmake') + opt_var = cmake.subproject_options() + opt_var.add_cmake_defines({'HEADERS_ONLY' : true}) + avisynth_subproject = cmake.subproject('AviSynth+', options : opt_var) + avisynth_dep = avisynth_subproject.dependency('AviSynth-Headers') + endif + + ffms2_deps += avisynth_dep + + ffms2_src += [ + 'src/avisynth/avssources.cpp', + 'src/avisynth/avssources.h', + 'src/avisynth/avisynth.cpp', + ] +endif + +ffmsindex_src = [ + 'src/index/ffmsindex.cpp', + 'src/index/vsutf16.h' +] + +includes = include_directories('include') + +ffms2_lib = library( + 'ffms2', + ffms2_src, + cpp_args : global_cpp_private_args, + cpp_static_args : ffms2_cpp_static_args, + dependencies : ffms2_deps, + gnu_symbol_visibility : 'hidden', + include_directories : includes, + install : true, + link_args : ffms2_link_args, +) + +executable( + 'ffmsindex', + ffmsindex_src, + cpp_args : global_cpp_private_args, + dependencies : ffmsindex_deps, + gnu_symbol_visibility : 'hidden', + include_directories : includes, + install : true, + link_args : ffmsindex_link_args, + link_with : ffms2_lib, +) + +static_cflags = [] +if get_option('default_library') == 'static' + static_cflags += '-DFFMS_STATIC' +endif + +# TODO - When meson implement a way to specify element in the field "Cflags.private", we will need to add the flag "-DFFMS_STATIC". +# See: https://github.com/mesonbuild/meson/issues/14749 +pkg_config = import('pkgconfig') +pkg_config.generate( + ffms2_lib, + description : 'The Fabulous FM Library 2', + extra_cflags : static_cflags, +) + +# TODO - When meson implement a way to specify a static compile args, we will need to add the flag "-DFFMS_STATIC". +# See: https://github.com/mesonbuild/meson/issues/5723 +ffms2_dep = declare_dependency( + link_with : ffms2_lib, + include_directories : includes, + compile_args : static_cflags, +) +meson.override_dependency('ffms2', ffms2_dep) + +install_data( + ['doc/ffms2-api.md', 'doc/ffms2-avisynth.md', 'doc/ffms2-changelog.md', 'doc/ffms2-vapoursynth.md'], + install_dir : join_paths(get_option('datadir'), 'doc', 'ffms2') +) + +install_headers(['include/ffms.h', 'include/ffmscompat.h']) + +if get_option('test').enabled() + subdir('test') +endif diff --git a/meson.options b/meson.options new file mode 100644 index 0000000000..349ef24343 --- /dev/null +++ b/meson.options @@ -0,0 +1,2 @@ +option('avisynth', type: 'feature', value : 'disabled', description: 'Enable avisynth') +option('test', type: 'feature', value : 'disabled', description: 'Enable test') diff --git a/subprojects/AviSynth+.wrap b/subprojects/AviSynth+.wrap new file mode 100644 index 0000000000..cb1026e2ec --- /dev/null +++ b/subprojects/AviSynth+.wrap @@ -0,0 +1,4 @@ +[wrap-git] +url = https://github.com/AviSynth/AviSynthPlus +revision = v3.7.5 +depth = 1 diff --git a/subprojects/gtest.wrap b/subprojects/gtest.wrap new file mode 100644 index 0000000000..6d463a7def --- /dev/null +++ b/subprojects/gtest.wrap @@ -0,0 +1,15 @@ +[wrap-file] +directory = googletest-release-1.12.1 +source_url = https://github.com/google/googletest/archive/release-1.12.1.tar.gz +source_filename = gtest-1.12.1.tar.gz +source_hash = 81964fe578e9bd7c94dfdb09c8e4d6e6759e19967e397dbea48d1c10e45d0df2 +patch_filename = gtest_1.12.1-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/gtest_1.12.1-1/get_patch +patch_hash = 75143f11e174952bc768699fde3176511fe8e33b25dc6f6347d89e41648e99cf +wrapdb_version = 1.12.1-1 + +[provide] +gtest = gtest_dep +gtest_main = gtest_main_dep +gmock = gmock_dep +gmock_main = gmock_main_dep diff --git a/test/download_samples.py b/test/download_samples.py new file mode 100644 index 0000000000..717860c2d4 --- /dev/null +++ b/test/download_samples.py @@ -0,0 +1,63 @@ +from argparse import ArgumentParser +from pathlib import Path +from urllib.parse import urljoin +from urllib.request import urlretrieve + + +def download(url: str, file: Path) -> None: + if file.is_file(): + print(f"[skip] {file.name}") + return + + print(f"[download] {url}") + urlretrieve(url, file) + + +def main() -> None: + parser = ArgumentParser( + description="Sample downloader." + ) + parser.add_argument( + "sample_path", + type=Path, + help=""" + Path where to save the samples. + """, + ) + + args = parser.parse_args() + + sample_path: Path = args.sample_path + + SAMPLES_URL = "https://storage.googleapis.com/ffms2tests/" + SAMPLES_FILE = [ + "test.mp4", + "hdr10tags-both.mkv", + "hdr10tags-container.mkv", + "hdr10tags-stream.mp4", + "qrvideo_hflip_90.mov", + "qrvideo_hflip_270.mov", + "qrvideo_vflip.mov", + "vp9_audfirst.webm", + "qrvideo_24fps_1elist_1ctts.mov", + "qrvideo_24fps_1elist_ends_last_bframe.mov", + "qrvideo_24fps_1elist_noctts.mov", + "qrvideo_24fps_2elist_elist1_dur_zero.mov", + "qrvideo_24fps_2elist_elist1_ends_bframe.mov", + "qrvideo_24fps_2s_3elist.mov", + "qrvideo_24fps_3elist_1ctts.mov", + "qrvideo_24fps_elist_starts_ctts_2ndsample.mov", + "qrvideo_stream_shorter_than_movie.mov", + ] + + if not sample_path.is_dir(): + sample_path.mkdir(parents=True) + + for sample in SAMPLES_FILE: + url = urljoin(SAMPLES_URL, sample) + file = sample_path.joinpath(sample) + download(url, file) + + +if __name__ == "__main__": + main() diff --git a/test/meson.build b/test/meson.build new file mode 100644 index 0000000000..a08325be5d --- /dev/null +++ b/test/meson.build @@ -0,0 +1,46 @@ +python = import('python').find_installation() +sample_dir = join_paths(meson.current_source_dir(), 'samples') +run_command( + python, join_paths(meson.current_source_dir(), 'download_samples.py'), sample_dir, + check : true +) + +gtest_dep = dependency('gtest', version : ['>=1.10.0', '<=1.12.1']) + +hdr = executable( + 'hdr', + files('hdr.cpp'), + cpp_args : ['-DSAMPLES_DIR=' + sample_dir + ''], + dependencies : [ + gtest_dep, + ffms2_dep, + libavutil_dep, + ], +) +test('hdr', hdr) + + +indexer = executable( + 'indexer', + files('indexer.cpp', 'tests.cpp'), + cpp_args : ['-DSAMPLES_DIR=' + sample_dir + ''], + dependencies : [ + gtest_dep, + ffms2_dep, + libavutil_dep, + ], +) +test('indexer', indexer, timeout : 120) + + +display_matrix = executable( + 'display_matrix', + files('display_matrix.cpp'), + cpp_args : ['-DSAMPLES_DIR=' + sample_dir + ''], + dependencies : [ + gtest_dep, + ffms2_dep, + libavutil_dep, + ], +) +test('display_matrix', display_matrix) From 477894cdd70f9d705f71c4164e1dad89955600aa Mon Sep 17 00:00:00 2001 From: moi15moi Date: Wed, 28 Jan 2026 20:41:28 -0500 Subject: [PATCH 2/9] When publishing a new release, build the project and add it to the release The workflow "Release Windows artifacts" will be runned when we create a new github release. It will automatically create the .7z file containing the x86 + x64 build and add it to the release. --- .github/workflows/ci-meson.yml | 64 ------------------------- .github/workflows/ci-on-release.yml | 51 ++++++++++++++++++++ .github/workflows/ci-windows.yml | 73 +++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/ci-on-release.yml create mode 100644 .github/workflows/ci-windows.yml diff --git a/.github/workflows/ci-meson.yml b/.github/workflows/ci-meson.yml index 0d0e541e35..881aa3e722 100644 --- a/.github/workflows/ci-meson.yml +++ b/.github/workflows/ci-meson.yml @@ -71,67 +71,3 @@ jobs: - name: Run tests run: meson test -C builddir --verbose - - build-win: - strategy: - fail-fast: false - matrix: - arch: [x86, x64] - - name: "Test Windows MSVC (${{ matrix.arch }})" - runs-on: windows-latest - - steps: - - name: Checkout code - uses: actions/checkout@v6 - - - name: Install Meson - run: pip install meson - - - name: Install ffmpeg - run: vcpkg install ffmpeg[avcodec,avdevice,avfilter,avformat,swresample,swscale,zlib,bzip2,core,dav1d,gpl,version3,lzma,openssl,xml2]:${{ matrix.arch }}-windows-static - - - name: Set VCPKG_PATH environment variable - run: | - $vcpkg_path = Split-Path (Get-Command vcpkg).Source -Parent - echo "VCPKG_PATH=$vcpkg_path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - - name: Install pkgconf - uses: msys2/setup-msys2@v2 - id: msys2 - with: - msystem: MINGW64 - install: mingw-w64-x86_64-pkgconf - - - name: Setup MSVC Developer Command Prompt - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: ${{ matrix.arch }} - - - name: Configure with Meson - env: - PKG_CONFIG: "${{ steps.msys2.outputs.msys2-location }}\\mingw64\\bin\\pkg-config.EXE" - run: > - meson setup builddir - --buildtype=release - --vsenv - -Dtest=enabled - -Davisynth=enabled - --pkg-config-path="$env:VCPKG_PATH\installed\${{ matrix.arch }}-windows-static\lib\pkgconfig" - -Db_vscrt=mt - # Use "-Db_vscrt=mt" to avoid this warning: LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library - - - name: Build - run: meson compile -C builddir --verbose - - - name: Run tests - run: meson test -C builddir --verbose - - - name: Install - run: meson install -C builddir --destdir install - - - name: Upload Build - uses: actions/upload-artifact@v6 - with: - name: ffms2_windows_${{ matrix.arch }} - path: builddir/install diff --git a/.github/workflows/ci-on-release.yml b/.github/workflows/ci-on-release.yml new file mode 100644 index 0000000000..0a7ff6b96d --- /dev/null +++ b/.github/workflows/ci-on-release.yml @@ -0,0 +1,51 @@ +name: On Release + +on: + release: + types: [published] + +jobs: + call-build-win: + uses: ./.github/workflows/ci-windows.yml + + release-win: + name: Release Windows artifacts + runs-on: windows-latest + needs: call-build-win + permissions: + contents: write + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Download wheel artifact + uses: actions/download-artifact@v7 + + - name: Set RELEASE_TAG environment variable + run: | + $release_tag = "ffms2-${{ github.event.release.tag_name }}-msvc" + echo "RELEASE_TAG=$release_tag" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Create package + run: | + mkdir $env:RELEASE_TAG + cd $env:RELEASE_TAG + Copy-Item -Path "..\ffms2_windows_x64\share\doc\ffms2" -Destination "doc" -Recurse + Copy-Item -Path "..\ffms2_windows_x64\include" -Destination "include" -Recurse + Copy-Item -Path "..\etc\*" -Destination "." + mkdir x86 + Copy-Item -Path "..\ffms2_windows_x86\bin\ffms2.dll" -Destination "x86" + Copy-Item -Path "..\ffms2_windows_x86\bin\ffmsindex.exe" -Destination "x86" + Copy-Item -Path "..\ffms2_windows_x86\lib\ffms2.lib" -Destination "x86" + mkdir x64 + Copy-Item -Path "..\ffms2_windows_x64\bin\ffms2.dll" -Destination "x64" + Copy-Item -Path "..\ffms2_windows_x64\bin\ffmsindex.exe" -Destination "x64" + Copy-Item -Path "..\ffms2_windows_x64\lib\ffms2.lib" -Destination "x64" + cd .. + 7z a "$env:RELEASE_TAG.7z" $env:RELEASE_TAG + + - name: Upload artifact to GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + run: gh release upload '${{ github.ref_name }}' "$env:RELEASE_TAG.7z" diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml new file mode 100644 index 0000000000..110afa516f --- /dev/null +++ b/.github/workflows/ci-windows.yml @@ -0,0 +1,73 @@ +name: Build on Windows + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_call: + +jobs: + build-win: + strategy: + fail-fast: false + matrix: + arch: [x86, x64] + + name: "Test Windows MSVC (${{ matrix.arch }})" + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Install Meson + run: pip install meson + + - name: Install ffmpeg + run: vcpkg install ffmpeg[avcodec,avdevice,avfilter,avformat,swresample,swscale,zlib,bzip2,core,dav1d,gpl,version3,lzma,openssl,xml2]:${{ matrix.arch }}-windows-static + + - name: Set VCPKG_PATH environment variable + run: | + $vcpkg_path = Split-Path (Get-Command vcpkg).Source -Parent + echo "VCPKG_PATH=$vcpkg_path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Install pkgconf + uses: msys2/setup-msys2@v2 + id: msys2 + with: + msystem: MINGW64 + install: mingw-w64-x86_64-pkgconf + + - name: Setup MSVC Developer Command Prompt + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.arch }} + + - name: Configure with Meson + env: + PKG_CONFIG: "${{ steps.msys2.outputs.msys2-location }}\\mingw64\\bin\\pkg-config.EXE" + run: > + meson setup builddir + --buildtype=release + --vsenv + -Dtest=enabled + -Davisynth=enabled + --pkg-config-path="$env:VCPKG_PATH\installed\${{ matrix.arch }}-windows-static\lib\pkgconfig" + -Db_vscrt=mt + # Use "-Db_vscrt=mt" to avoid this warning: LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library + + - name: Build + run: meson compile -C builddir --verbose + + - name: Run tests + run: meson test -C builddir --verbose + + - name: Install + run: meson install -C builddir --destdir install + + - name: Upload Build + uses: actions/upload-artifact@v6 + with: + name: ffms2_windows_${{ matrix.arch }} + path: builddir/install From 305be5e5350fed2683789c9166bfef40037d3802 Mon Sep 17 00:00:00 2001 From: moi15moi Date: Sat, 21 Mar 2026 22:08:28 -0400 Subject: [PATCH 3/9] [ci-meson] Add Cygwin We cannot use ffmpeg oackage available on cygwin repo because the build doesn't contain a HEVC decoder. See: https://cygwin.com/pipermail/cygwin/2026-March/259560.html --- .github/workflows/ci-meson.yml | 53 ++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-meson.yml b/.github/workflows/ci-meson.yml index 881aa3e722..f9ebb14954 100644 --- a/.github/workflows/ci-meson.yml +++ b/.github/workflows/ci-meson.yml @@ -24,15 +24,20 @@ jobs: - os: windows-latest cc: gcc cxx: g++ + windows_env: msys2 + - os: windows-latest + cc: gcc + cxx: g++ + windows_env: cygwin - name: "Test (${{ matrix.os }}, ${{ matrix.cc }})" + name: "Test (${{ matrix.os }}, ${{ matrix.cc }}${{ matrix.windows_env && format(', {0}', matrix.windows_env) || '' }})" runs-on: ${{ matrix.os }} env: CC: ${{ matrix.cc }} CXX: ${{ matrix.cxx }} defaults: run: - shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }} + shell: ${{ matrix.windows_env == 'cygwin' && 'bash -o igncr ''{0}''' || (matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash') }} steps: - name: Checkout code @@ -52,7 +57,7 @@ jobs: brew install autoconf automake libtool wget ffmpeg meson - name: Setup MSYS2 (MINGW64) - if: matrix.os == 'windows-latest' + if: matrix.windows_env == 'msys2' uses: msys2/setup-msys2@v2 with: msystem: MINGW64 @@ -62,9 +67,47 @@ jobs: mingw-w64-x86_64-meson mingw-w64-x86_64-toolchain + - name: Setup Cygwin + if: matrix.windows_env == 'cygwin' + uses: cygwin/cygwin-install-action@v6 + with: + packages: | + git + meson + pkg-config + gcc-g++ + make + ninja + zlib-devel + nasm + + # We need to build ffmpeg on Cygwin since the packaged version doesn't include an HEVC decoder + - name: Clone ffmpeg (Cygwin) + if: matrix.windows_env == 'cygwin' + run: git clone https://git.ffmpeg.org/ffmpeg.git --depth 1 + + - name: Configure ffmpeg (Cygwin) + if: matrix.windows_env == 'cygwin' + working-directory: ffmpeg + run: ./configure --disable-programs --disable-doc --disable-avdevice --disable-avfilter --disable-encoders --disable-muxers --disable-debug --disable-hwaccels --disable-network --disable-autodetect + + - name: Build ffmpeg (Cygwin) + if: matrix.windows_env == 'cygwin' + working-directory: ffmpeg + run: make + + - name: Install ffmpeg (Cygwin) + if: matrix.windows_env == 'cygwin' + working-directory: ffmpeg + run: make install + - name: Configure with Meson - run: > - meson setup builddir -Dtest=enabled + run: | + if [ "${{ matrix.windows_env }}" = "cygwin" ]; then + meson setup builddir -Dtest=enabled --pkg-config-path="/usr/local/lib/pkgconfig" + else + meson setup builddir -Dtest=enabled + fi - name: Build run: meson compile -C builddir --verbose From 5206c481de89c14a3d1e47b1e0e110d6040f7fa4 Mon Sep 17 00:00:00 2001 From: moi15moi Date: Sat, 21 Mar 2026 22:12:03 -0400 Subject: [PATCH 4/9] [meson.build] Try to use gnu++11 first and fallback to c++11 if not available to build the project This allow to fix these errors when compiling on cygwin: ``` ../src/vapoursynth/VSHelper4.h:76:9: error: there are no arguments to 'posix_memalign' that depend on a template parameter, so a declaration of 'posix_memalign' must be available [-fpermissive] 76 | if (posix_memalign(&tmp, alignment, size)) | ^~~~~~~~~~~~~~ ../src/index/ffmsindex.cpp:122:20: error: 'strdup' was not declared in this scope; did you mean 'strcmp'? 122 | pair.Key = strdup(en->key); | ^~~~~~ | strcmp ``` --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index d922cee53c..2efcc9b435 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project( 'buildtype=release', 'warning_level=2', 'b_ndebug=if-release', - 'cpp_std=c++11' + 'cpp_std=gnu++11,c++11' ], license : 'MIT', license_files : 'COPYING', From 083247d9e7119d3444b0123b0452328fa773ba64 Mon Sep 17 00:00:00 2001 From: moi15moi Date: Sun, 5 Apr 2026 16:06:32 -0400 Subject: [PATCH 5/9] [AviSynth+.wrap] Add small meson.build to replace cmake --- .gitignore | 1 + meson.build | 7 ++----- subprojects/AviSynth+.wrap | 1 + subprojects/packagefiles/AviSynth+/meson.build | 11 +++++++++++ 4 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 subprojects/packagefiles/AviSynth+/meson.build diff --git a/.gitignore b/.gitignore index 9e3d080b4e..e0b4ba8c39 100644 --- a/.gitignore +++ b/.gitignore @@ -96,3 +96,4 @@ Makefile # Meson /subprojects/* !/subprojects/*.wrap +!/subprojects/packagefiles diff --git a/meson.build b/meson.build index 2efcc9b435..dec59eba7f 100644 --- a/meson.build +++ b/meson.build @@ -88,11 +88,8 @@ if get_option('avisynth').enabled() if avisynth_dep.found() avisynth_dep = avisynth_dep.partial_dependency(compile_args: true, includes: true) else - cmake = import('cmake') - opt_var = cmake.subproject_options() - opt_var.add_cmake_defines({'HEADERS_ONLY' : true}) - avisynth_subproject = cmake.subproject('AviSynth+', options : opt_var) - avisynth_dep = avisynth_subproject.dependency('AviSynth-Headers') + avisynth_subproject = subproject('AviSynth+') + avisynth_dep = avisynth_subproject.get_variable('avisynth_headers_dep') endif ffms2_deps += avisynth_dep diff --git a/subprojects/AviSynth+.wrap b/subprojects/AviSynth+.wrap index cb1026e2ec..b141325d3d 100644 --- a/subprojects/AviSynth+.wrap +++ b/subprojects/AviSynth+.wrap @@ -2,3 +2,4 @@ url = https://github.com/AviSynth/AviSynthPlus revision = v3.7.5 depth = 1 +patch_directory = AviSynth+ diff --git a/subprojects/packagefiles/AviSynth+/meson.build b/subprojects/packagefiles/AviSynth+/meson.build new file mode 100644 index 0000000000..048d391451 --- /dev/null +++ b/subprojects/packagefiles/AviSynth+/meson.build @@ -0,0 +1,11 @@ +project( + 'AviSynth+', + 'c', + license : 'GPL-2.0-or-later', + meson_version : '>=1.3.0', + version : '3.7.5', +) + +# Header-only dependency for building AviSynth plugins +avisynth_inc = include_directories('avs_core/include') +avisynth_headers_dep = declare_dependency(include_directories : avisynth_inc) From 7f0f80d1a620b339eaadda360fe5549c32938776 Mon Sep 17 00:00:00 2001 From: moi15moi Date: Sun, 5 Apr 2026 16:11:01 -0400 Subject: [PATCH 6/9] Remove autotools and MSBuild support --- .github/workflows/ci.yml | 126 --------- .gitmodules | 4 - INSTALL | 365 --------------------------- Makefile.am | 92 ------- autogen.sh | 8 - build-msvc/Readme.txt | 9 - build-msvc/ffms2.sln | 41 --- build-msvc/ffms2.vcxproj | 189 -------------- build-msvc/ffms2.vcxproj.filters | 111 -------- build-msvc/ffmsindex.vcxproj | 177 ------------- build-msvc/ffmsindex.vcxproj.filters | 34 --- configure.ac | 163 ------------ ffms2.pc.in | 15 -- m4/check_zlib.m4 | 28 -- test/Makefile | 125 --------- test/googletest | 1 - 16 files changed, 1488 deletions(-) delete mode 100644 .github/workflows/ci.yml delete mode 100644 INSTALL delete mode 100644 Makefile.am delete mode 100755 autogen.sh delete mode 100644 build-msvc/Readme.txt delete mode 100644 build-msvc/ffms2.sln delete mode 100644 build-msvc/ffms2.vcxproj delete mode 100644 build-msvc/ffms2.vcxproj.filters delete mode 100644 build-msvc/ffmsindex.vcxproj delete mode 100644 build-msvc/ffmsindex.vcxproj.filters delete mode 100644 configure.ac delete mode 100644 ffms2.pc.in delete mode 100644 m4/check_zlib.m4 delete mode 100644 test/Makefile delete mode 160000 test/googletest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 6ee5bfcb13..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: Make Build - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -permissions: - contents: read - -jobs: - build: - strategy: - matrix: - include: - - os: ubuntu-latest - cc: gcc - cxx: g++ - - os: ubuntu-latest - cc: clang - cxx: clang++ - - os: macos-latest - cc: clang - cxx: clang++ - - os: windows-latest - cc: gcc - cxx: g++ - - name: "Test (${{ matrix.os }}, ${{ matrix.cc }})" - runs-on: ${{ matrix.os }} - env: - CC: ${{ matrix.cc }} - CXX: ${{ matrix.cxx }} - defaults: - run: - shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }} - - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: install deps (ubuntu) - if: matrix.os == 'ubuntu-latest' - run: | - sudo add-apt-repository ppa:ubuntuhandbook1/ffmpeg7 -y - sudo apt-get update - sudo apt-get install autoconf automake wget ffmpeg libavformat-dev libavcodec-dev libswscale-dev libavutil-dev libswresample-dev - - name: install deps (macOS) - if: matrix.os == 'macos-latest' - run: | - brew update - brew install autoconf automake libtool wget ffmpeg - - name: Setup msys2 - if: matrix.os == 'windows-latest' - uses: msys2/setup-msys2@v2 - with: - msystem: MINGW64 - install: >- - mingw-w64-x86_64-autotools - mingw-w64-x86_64-ffmpeg - mingw-w64-x86_64-toolchain - - name: configure - run: ./autogen.sh --enable-static --disable-shared - - name: make - run: make V=1 CXXFLAGS='-Werror -Wno-error=deprecated-declarations' -j2 -k - - name: make test - run: | - if [[ "$RUNNER_OS" == "macOS" ]]; then - export CPATH=/opt/homebrew/include - fi - make test-sync - make test -j2 -k - build-win: - runs-on: windows-latest - steps: - - name: Git checkout - uses: actions/checkout@v4 - with: - submodules: true - - name: Parse AviSynth+ release metadata - uses: actions/github-script@v7 - with: - script: | - const req = await github.request('https://api.github.com/repos/avisynth/avisynthplus/releases'); - const data = req.data; - let avstag = ''; - for(let rel of data){ - if(rel.prerelease||rel.draft){ - continue; - } - avstag = rel.tag_name; - if(avstag != ''){ - break; - } - } - core.exportVariable('AVS_TAG', avstag); - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 - with: - msbuild-architecture: x64 - - name: Make builds... - run: | - cd .. - git clone https://github.com/AviSynth/AviSynthPlus.git --branch "${{ env.AVS_TAG }}" --depth 1 - cd ffms2 - vcpkg install ffmpeg[avcodec,avdevice,avfilter,avformat,swresample,swscale,zlib,bzip2,core,dav1d,gpl,version3,lzma,openssl,xml2]:x86-windows-static - vcpkg install ffmpeg[avcodec,avdevice,avfilter,avformat,swresample,swscale,zlib,bzip2,core,dav1d,gpl,version3,lzma,openssl,xml2]:x64-windows-static - vcpkg integrate install - MSBuild.exe /t:Rebuild /p:PlatformToolset=v143 /m /p:Configuration=Release /p:Platform=x86 "./build-msvc/ffms2.sln" - MSBuild.exe /t:Rebuild /p:PlatformToolset=v143 /m /p:Configuration=Release /p:Platform=x64 "./build-msvc/ffms2.sln" - cmake -E copy "build-msvc\bin\Win32\Release\ffms2.dll" "dist\x86\ffms2.dll" - cmake -E copy "build-msvc\bin\Win32\Release\ffms2.lib" "dist\x86\ffms2.lib" - cmake -E copy "build-msvc\bin\Win32\Release\ffmsindex.exe" "dist\x86\ffmsindex.exe" - cmake -E copy "build-msvc\bin\x64\Release\ffms2.dll" "dist\x64\ffms2.dll" - cmake -E copy "build-msvc\bin\x64\Release\ffms2.lib" "dist\x64\ffms2.lib" - cmake -E copy "build-msvc\bin\x64\Release\ffmsindex.exe" "dist\x64\ffmsindex.exe" - cmake -E copy_directory "include" "dist\include" - cmake -E copy_directory "doc" "dist\doc" - cmake -E copy "etc\FFMS2.avsi" "dist\FFMS2.avsi" - cmake -E copy "COPYING" "dist\COPYING" - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: ffms2_build_win - path: dist diff --git a/.gitmodules b/.gitmodules index 842def338c..e69de29bb2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +0,0 @@ -[submodule "test/googletest"] - path = test/googletest - url = https://github.com/google/googletest - branch = master diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 7d1c323bea..0000000000 --- a/INSTALL +++ /dev/null @@ -1,365 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008, 2009 Free Software Foundation, Inc. - - 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 warranty of any kind. - -Basic Installation -================== - - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented -below. The lack of an optional feature in a given package is not -necessarily a bug. More recommendations for GNU packages can be found -in *note Makefile Conventions: (standards)Makefile Conventions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - - The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and - documentation. When installing into a prefix owned by root, it is - recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root - privileges. - - 5. Optionally, type `make installcheck' to repeat any self-tests, but - this time using the binaries in their final installed location. - This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required - root privileges, verifies that the installation completed - correctly. - - 6. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 7. Often, you can also type `make uninstall' to remove the installed - files again. In practice, not all packages have tested that - uninstallation works correctly, even though it is required by the - GNU Coding Standards. - - 8. Some packages, particularly those that use Automake, provide `make - distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. - This target is generally not run by end users. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. This -is known as a "VPATH" build. - - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. - -Installation Names -================== - - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX', where PREFIX must be an -absolute file name. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory -specifications that were not explicitly provided. - - The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or -both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without -having to reconfigure or recompile. - - The first method involves providing an override variable for each -affected directory. For example, `make install -prefix=/alternate/directory' will choose an alternate location for all -directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and -does not work on platforms that have drive letters. On the other hand, -it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. - -Optional Features -================= - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - - Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - - On Solaris, don't put `/usr/ucb' early in your `PATH'. This -directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. - - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: - - ./configure --prefix=/boot/common - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS - KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 644f3e14ca..0000000000 --- a/Makefile.am +++ /dev/null @@ -1,92 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 -AUTOMAKE_OPTIONS = foreign - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = ffms2.pc - -dist_doc_DATA = doc/ffms2-api.md doc/ffms2-changelog.md - -AM_CPPFLAGS = \ - -I. \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/config \ - -D_FILE_OFFSET_BITS=64 \ - -DFFMS_EXPORTS \ - -D__STDC_CONSTANT_MACROS \ - @FFMPEG_CFLAGS@ \ - @ZLIB_CPPFLAGS@ \ - -include config.h -AM_CXXFLAGS = -std=c++11 -fvisibility=hidden - -lib_LTLIBRARIES = src/core/libffms2.la -src_core_libffms2_la_LDFLAGS = @src_core_libffms2_la_LDFLAGS@ -src_core_libffms2_la_LIBADD = @FFMPEG_LIBS@ @ZLIB_LDFLAGS@ -lz @LTUNDEF@ -src_core_libffms2_la_SOURCES = \ - src/core/audiosource.cpp \ - src/core/audiosource.h \ - src/core/ffms.cpp \ - src/core/filehandle.cpp \ - src/core/filehandle.h \ - src/core/indexing.cpp \ - src/core/indexing.h \ - src/core/track.cpp \ - src/core/track.h \ - src/core/utils.cpp \ - src/core/utils.h \ - src/core/videosource.cpp \ - src/core/videosource.h \ - src/core/videoutils.cpp \ - src/core/videoutils.h \ - src/core/zipfile.cpp \ - src/core/zipfile.h \ - src/vapoursynth/VapourSynth4.h \ - src/vapoursynth/VSHelper4.h \ - src/vapoursynth/vapoursource4.cpp \ - src/vapoursynth/vapoursource4.h \ - src/vapoursynth/vapoursynth4.cpp - -if AVISYNTH -src_core_libffms2_la_SOURCES += \ - src/avisynth/avssources.cpp \ - src/avisynth/avssources.h \ - src/avisynth/avisynth.cpp -endif - -include_HEADERS = $(top_srcdir)/include/ffms.h $(top_srcdir)/include/ffmscompat.h - -bin_PROGRAMS = src/index/ffmsindex -src_index_ffmsindex_SOURCES = src/index/ffmsindex.cpp -if WINDOWS -src_index_ffmsindex_LDFLAGS = -municode -endif -src_index_ffmsindex_LDADD = -lavutil src/core/libffms2.la - -.PHONY: test test-build test-clean test-sync test-run -clean-local: test-clean - -SAMPLES_DIR = $(abs_top_builddir)/test/samples -SAMPLES_URL = https://storage.googleapis.com/ffms2tests - -test: test-setup test-build test-run - -test-setup: - @$(MKDIR_P) $(abs_top_builddir)/test - @$(MKDIR_P) $(SAMPLES_DIR) - @if [ ! -e "$(abs_top_builddir)/test/Makefile" ]; then \ - $(LN_S) $(abs_top_srcdir)/test/Makefile $(abs_top_builddir)/test/Makefile; \ - fi - -test-build: test-setup src/core/libffms2.la - @if [ ! -d "$(abs_top_srcdir)/test/googletest" ]; then \ - echo "googletest submodule not initalized."; \ - fi - @$(MAKE) -C test USER_DIR=$(abs_top_srcdir) SAMPLES_DIR=$(SAMPLES_DIR) CXX="$(CXX)" AR="$(AR)" - -test-sync: test-setup - @$(MAKE) -C test sync USER_DIR=$(abs_top_srcdir) SAMPLES_DIR=$(SAMPLES_DIR) SAMPLES_URL=$(SAMPLES_URL) CXX="$(CXX)" AR="$(AR)" - -test-run: test-build - @$(MAKE) -C test run USER_DIR=$(abs_top_srcdir) SAMPLES_DIR=$(SAMPLES_DIR) CXX="$(CXX)" AR="$(AR)" -k - -test-clean: - @$(MAKE) -C test clean USER_DIR=$(abs_top_srcdir) CXX="$(CXX)" AR="$(AR)" diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 3cb4bfd772..0000000000 --- a/autogen.sh +++ /dev/null @@ -1,8 +0,0 @@ -#! /bin/sh -mkdir -p src/config -echo Running autoreconf... -autoreconf -ivf -if [ -z "$NOCONFIGURE" ]; then - echo Running configure... - ./configure "$@" -fi diff --git a/build-msvc/Readme.txt b/build-msvc/Readme.txt deleted file mode 100644 index b663be9081..0000000000 --- a/build-msvc/Readme.txt +++ /dev/null @@ -1,9 +0,0 @@ -BUILD INSTRUCTIONS FOR WINDOWS - -The included projects require Visual Studio 2019 with an integrated vcpkg. - -Run `vcpkg install ffmpeg:x64-windows-static` or `vcpkg install ffmpeg:x86-windows-static` -depending on the configuration you want to build. - -In addition to this the Avisynth+ headers are also needed. The include path is set -to be relative to the FFMS2 directory by default. \ No newline at end of file diff --git a/build-msvc/ffms2.sln b/build-msvc/ffms2.sln deleted file mode 100644 index 9dc358a74d..0000000000 --- a/build-msvc/ffms2.sln +++ /dev/null @@ -1,41 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26228.9 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ffms2", "ffms2.vcxproj", "{2CF8C7D2-55E5-4861-A58A-A79B84D0D9EA}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ffmsindex", "ffmsindex.vcxproj", "{8665C229-CA77-4B41-ADC5-F3998F0C85A6}" - ProjectSection(ProjectDependencies) = postProject - {2CF8C7D2-55E5-4861-A58A-A79B84D0D9EA} = {2CF8C7D2-55E5-4861-A58A-A79B84D0D9EA} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2CF8C7D2-55E5-4861-A58A-A79B84D0D9EA}.Debug|x64.ActiveCfg = Debug|x64 - {2CF8C7D2-55E5-4861-A58A-A79B84D0D9EA}.Debug|x64.Build.0 = Debug|x64 - {2CF8C7D2-55E5-4861-A58A-A79B84D0D9EA}.Debug|x86.ActiveCfg = Debug|Win32 - {2CF8C7D2-55E5-4861-A58A-A79B84D0D9EA}.Debug|x86.Build.0 = Debug|Win32 - {2CF8C7D2-55E5-4861-A58A-A79B84D0D9EA}.Release|x64.ActiveCfg = Release|x64 - {2CF8C7D2-55E5-4861-A58A-A79B84D0D9EA}.Release|x64.Build.0 = Release|x64 - {2CF8C7D2-55E5-4861-A58A-A79B84D0D9EA}.Release|x86.ActiveCfg = Release|Win32 - {2CF8C7D2-55E5-4861-A58A-A79B84D0D9EA}.Release|x86.Build.0 = Release|Win32 - {8665C229-CA77-4B41-ADC5-F3998F0C85A6}.Debug|x64.ActiveCfg = Debug|x64 - {8665C229-CA77-4B41-ADC5-F3998F0C85A6}.Debug|x64.Build.0 = Debug|x64 - {8665C229-CA77-4B41-ADC5-F3998F0C85A6}.Debug|x86.ActiveCfg = Debug|Win32 - {8665C229-CA77-4B41-ADC5-F3998F0C85A6}.Debug|x86.Build.0 = Debug|Win32 - {8665C229-CA77-4B41-ADC5-F3998F0C85A6}.Release|x64.ActiveCfg = Release|x64 - {8665C229-CA77-4B41-ADC5-F3998F0C85A6}.Release|x64.Build.0 = Release|x64 - {8665C229-CA77-4B41-ADC5-F3998F0C85A6}.Release|x86.ActiveCfg = Release|Win32 - {8665C229-CA77-4B41-ADC5-F3998F0C85A6}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/build-msvc/ffms2.vcxproj b/build-msvc/ffms2.vcxproj deleted file mode 100644 index c6bbbb422a..0000000000 --- a/build-msvc/ffms2.vcxproj +++ /dev/null @@ -1,189 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {2CF8C7D2-55E5-4861-A58A-A79B84D0D9EA} - Win32Proj - ffms2 - 10.0 - x64-windows-static - x86-windows-static - - - - DynamicLibrary - true - v145 - Unicode - - - DynamicLibrary - false - v145 - true - Unicode - - - DynamicLibrary - true - v145 - Unicode - - - DynamicLibrary - false - v145 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - $(SolutionDir)obj\$(Platform)\$(Configuration)\ - ../include;../../AviSynthPlus/avs_core/include;$(IncludePath) - - - true - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - $(SolutionDir)obj\$(Platform)\$(Configuration)\ - ../include;../../AviSynthPlus/avs_core/include;$(IncludePath) - - - false - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - $(SolutionDir)obj\$(Platform)\$(Configuration)\ - ../include;../../AviSynthPlus/avs_core/include;$(IncludePath) - - - false - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - $(SolutionDir)obj\$(Platform)\$(Configuration)\ - ../include;../../AviSynthPlus/avs_core/include;$(IncludePath) - - - - Level3 - Disabled - FFMS_EXPORTS;_CRT_SECURE_NO_WARNINGS;__STDC_CONSTANT_MACROS;FFMS_WIN_DEBUG;WIN32;_DEBUG;_WINDOWS;_USRDLL;FFMS2_EXPORTS;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Windows - psapi.lib;uuid.lib;oleaut32.lib;shlwapi.lib;gdi32.lib;vfw32.lib;secur32.lib;ws2_32.lib;mfplat.lib;mfuuid.lib;strmiids.lib;ole32.lib;user32.lib;bcrypt.lib;crypt32.lib;%(AdditionalDependencies) - - - - - Level3 - Disabled - FFMS_EXPORTS;_CRT_SECURE_NO_WARNINGS;__STDC_CONSTANT_MACROS;FFMS_WIN_DEBUG;_DEBUG;_WINDOWS;_USRDLL;FFMS2_EXPORTS;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Windows - psapi.lib;uuid.lib;oleaut32.lib;shlwapi.lib;gdi32.lib;vfw32.lib;secur32.lib;ws2_32.lib;mfplat.lib;mfuuid.lib;strmiids.lib;ole32.lib;user32.lib;bcrypt.lib;crypt32.lib;%(AdditionalDependencies) - - - - - Level3 - MaxSpeed - true - true - FFMS_EXPORTS;_CRT_SECURE_NO_WARNINGS;__STDC_CONSTANT_MACROS;WIN32;NDEBUG;_WINDOWS;_USRDLL;FFMS2_EXPORTS;%(PreprocessorDefinitions) - MultiThreaded - - - Windows - true - true - psapi.lib;uuid.lib;oleaut32.lib;shlwapi.lib;gdi32.lib;vfw32.lib;secur32.lib;ws2_32.lib;mfplat.lib;mfuuid.lib;strmiids.lib;ole32.lib;user32.lib;bcrypt.lib;crypt32.lib;%(AdditionalDependencies) - - - - - Level3 - MaxSpeed - true - true - FFMS_EXPORTS;_CRT_SECURE_NO_WARNINGS;__STDC_CONSTANT_MACROS;NDEBUG;_WINDOWS;_USRDLL;FFMS2_EXPORTS;%(PreprocessorDefinitions) - MultiThreaded - - - Windows - true - true - psapi.lib;uuid.lib;oleaut32.lib;shlwapi.lib;gdi32.lib;vfw32.lib;secur32.lib;ws2_32.lib;mfplat.lib;mfuuid.lib;strmiids.lib;ole32.lib;user32.lib;bcrypt.lib;crypt32.lib;%(AdditionalDependencies) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build-msvc/ffms2.vcxproj.filters b/build-msvc/ffms2.vcxproj.filters deleted file mode 100644 index ef535cde01..0000000000 --- a/build-msvc/ffms2.vcxproj.filters +++ /dev/null @@ -1,111 +0,0 @@ - - - - - {5e4ea0a8-9b1a-49ee-8b02-e498d4d5cc80} - - - {94e424bf-1254-46b5-9282-7c6b99280638} - - - {e25264ca-e3fd-4fd6-a1d1-839ae9b2ade2} - - - {731b163b-dd24-4aba-8bef-86c3b364157e} - - - {a2513788-a12f-43c1-99aa-b9f20cd6a099} - - - {8cc15f2a-6612-4e85-96b3-d3abfe15ddab} - - - {95efeead-393a-4518-b1f2-9b8b6bb8c3d6} - - - - - API - - - Utils - - - Utils - - - Utils - - - Video - - - Video - - - Indexing - - - Indexing - - - Audio - - - Avisynth - - - Avisynth - - - Vapoursynth - - - Vapoursynth - - - - - API - - - Utils - - - Utils - - - Utils - - - Utils - - - Video - - - Video - - - Indexing - - - Indexing - - - Audio - - - Avisynth - - - Vapoursynth - - - Vapoursynth - - - Vapoursynth - - - \ No newline at end of file diff --git a/build-msvc/ffmsindex.vcxproj b/build-msvc/ffmsindex.vcxproj deleted file mode 100644 index d849a2ec96..0000000000 --- a/build-msvc/ffmsindex.vcxproj +++ /dev/null @@ -1,177 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {8665C229-CA77-4B41-ADC5-F3998F0C85A6} - Win32Proj - ffmsindex - 10.0 - x64-windows-static - x86-windows-static - - - - Application - true - v145 - Unicode - - - Application - false - v145 - true - Unicode - - - Application - true - v145 - Unicode - - - Application - false - v145 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - $(SolutionDir)ffmsindex\$(Platform)\$(Configuration)\ - ../include;$(IncludePath) - - - true - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - $(SolutionDir)ffmsindex\$(Platform)\$(Configuration)\ - ../include;$(IncludePath) - - - false - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - $(SolutionDir)ffmsindex\$(Platform)\$(Configuration)\ - ../include;$(IncludePath) - - - false - $(SolutionDir)bin\$(Platform)\$(Configuration)\ - $(SolutionDir)ffmsindex\$(Platform)\$(Configuration)\ - ../include;$(IncludePath) - - - - - - Level3 - Disabled - _CRT_SECURE_NO_WARNINGS;__STDC_CONSTANT_MACROS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Console - - - - - - - Level3 - Disabled - _CRT_SECURE_NO_WARNINGS;__STDC_CONSTANT_MACROS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Console - - - - - Level3 - - - MaxSpeed - true - true - _CRT_SECURE_NO_WARNINGS;__STDC_CONSTANT_MACROS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - Console - true - true - - - - - Level3 - - - MaxSpeed - true - true - _CRT_SECURE_NO_WARNINGS;__STDC_CONSTANT_MACROS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreaded - - - Console - true - true - - - - - - - - - - - - {2cf8c7d2-55e5-4861-a58a-a79b84d0d9ea} - - - - - - - - - \ No newline at end of file diff --git a/build-msvc/ffmsindex.vcxproj.filters b/build-msvc/ffmsindex.vcxproj.filters deleted file mode 100644 index 0b8020200b..0000000000 --- a/build-msvc/ffmsindex.vcxproj.filters +++ /dev/null @@ -1,34 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {25d75b48-9985-40fd-be86-bd4ca73d5209} - - - - - Source Files - - - - - Header Files - - - Header Files - - - - - Manifests - - - \ No newline at end of file diff --git a/configure.ac b/configure.ac deleted file mode 100644 index f3075f57a0..0000000000 --- a/configure.ac +++ /dev/null @@ -1,163 +0,0 @@ -AC_PREREQ([2.58]) -AC_INIT([ffms2],[esyscmd([sh version.sh])]) -AC_CONFIG_SRCDIR([src/core/ffms.cpp]) -AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE([1.11 subdir-objects]) -AM_SILENT_RULES([yes]) -AM_MAINTAINER_MODE([disable]) - -VERSION_INFO="5:1:2" - -AC_MSG_CHECKING([if debug build is enabled]) - -AC_ARG_ENABLE([debug], - [AC_HELP_STRING([--enable-debug], - [Enable debug build. [default=no]])], - [enable_debug=yes], - [enable_debug=no] - ) - -AC_MSG_RESULT([$enable_debug]) - -if test "$enable_debug" = yes; then - OPT_FLAGS="-O0 -g" -else - OPT_FLAGS="-O3" -fi - -if test -z "$CFLAGS"; then - CFLAGS="$OPT_FLAGS -Wall -Wextra" -fi - -if test -z "$CXXFLAGS"; then - CXXFLAGS="$OPT_FLAGS -Wall -Wextra" -fi - -AC_ARG_ENABLE([avisynth], - [AC_HELP_STRING([--enable-avisynth], - [Enable AviSynth+ plugin. [default=no]])], - [enable_avisynth=yes], - [enable_avisynth=no] - ) - -AC_MSG_RESULT([$enable_avisynth]) -AM_CONDITIONAL([AVISYNTH], [test "x$enable_avisynth" != "xno"]) - -AC_CONFIG_HEADERS([src/config/config.h]) -AC_PROG_CC -AC_PROG_CXX -AC_PROG_LN_S -AC_PROG_MKDIR_P - -AC_CANONICAL_HOST -AS_CASE([$host], - [*mingw* | *cygwin*], [ - AC_ENABLE_STATIC - AC_DISABLE_SHARED - ], [ - AC_ENABLE_SHARED - AC_DISABLE_STATIC]) - -AM_CONDITIONAL([WINDOWS], [case "$host_os" in mingw* | cygwin*) true ;; *) false ;; esac]) - -AC_PROG_LIBTOOL - -if echo "$host" | $GREP "cygwin" >/dev/null 2>&1 && test "$enable_shared" = "yes"; then - AC_MSG_ERROR([Shared build is broken on cygwin. - Please remove --enable-shared from your configure options or build with another --host.]) -fi - -dnl Workaround for a bug in libtool -dnl The windows libtool uses a file magic checking method that only accepts -dnl dynamic libraries. Change it for libtool's alternative checking method. -if test "$lt_cv_file_magic_cmd" = "func_win32_libid" ; then - deplibs_check_method='file_magic file format pei*-(i386|x86-64)|(.*architecture: i386)?' - file_magic_cmd='$OBJDUMP -f' -fi - -FFMS_VERSION="$(sh $(dirname -- "$0")/version.sh)" -AC_SUBST([FFMS_VERSION]) - -CHECK_ZLIB - -dnl Save CFLAGS and LIBS for later, as anything else we add will be from pkg-config -dnl and thus should be separate in our .pc file. -_CFLAGS="$CFLAGS" -_CPPFLAGS="$CPPFLAGS" -_LIBS="$LIBS" - -PKG_PROG_PKG_CONFIG([0.22]) -pkgconfigdir="\$(libdir)/pkgconfig" -AC_SUBST(pkgconfigdir) - -PKG_CHECK_MODULES(FFMPEG, [libavformat >= 61.7.0 libavcodec >= 61.19.0 libswscale >= 8.3.0 libavutil >= 59.39.0 libswresample >= 5.3.0]) - -dnl As of 0eec06ed8747923faa6a98e474f224d922dc487d ffmpeg only adds -lrt to lavc's -dnl LIBS, but lavu needs it, so move it to the end if it's present -FFMPEG_LIBS=$(echo $FFMPEG_LIBS | sed 's/\(.*\)-lrt \(.*\)/\1\2 -lrt/') - -AC_SUBST([FFMPEG_CFLAGS]) -AC_SUBST([FFMPEG_LIBS]) - -CPPFLAGS="$CPPFLAGS -D__STDC_CONSTANT_MACROS" -CFLAGS="$_CFLAGS $FFMPEG_CFLAGS" - -AC_DEFUN([TEST_FFMPEG], - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - #include - #include - ]],[[ - avformat_network_init(); - swscale_version(); - ]])], [eval $1=yes], [eval $1=no]) - ]) - -AC_MSG_CHECKING([whether FFmpeg works]) -LIBS="$_LIBS $FFMPEG_LIBS" -TEST_FFMPEG([FFMPEG_WORKS]) -AC_MSG_RESULT([$FFMPEG_WORKS]) -if test "$FFMPEG_WORKS" = no; then -AC_MSG_FAILURE([cannot link with FFmpeg]) -fi - -src_core_libffms2_la_LDFLAGS="" -AC_MSG_CHECKING([whether -Wl,-Bsymbolic is needed]) -if test "$enable_shared" = yes; then - _LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared $lt_prog_compiler_pic" - TEST_FFMPEG([no_bsymbolic]) - if test "$no_bsymbolic" = "no"; then - LDFLAGS="$LDFLAGS -Wl,-Bsymbolic" - TEST_FFMPEG([bsymbolic]) - if test "$bsymbolic" = "yes"; then - src_core_libffms2_la_LDFLAGS="$src_core_libffms2_la_LDFLAGS -Wl,-Bsymbolic" - else - AC_MSG_RESULT($bsymbolic) - AC_MSG_FAILURE([cannot build ffms2 as a shared library]) - fi - else - bsymbolic=no - fi - LDFLAGS="$_LDFLAGS" - src_core_libffms2_la_LDFLAGS="$src_core_libffms2_la_LDFLAGS -version-info $VERSION_INFO" -else - bsymbolic=no -fi -AC_SUBST([src_core_libffms2_la_LDFLAGS]) - -CFLAGS="$_CFLAGS" -CPPFLAGS="$_CPPFLAGS" -LIBS="$_LIBS" -AC_MSG_RESULT($bsymbolic) - -if echo "$host" | $GREP "mingw" >/dev/null 2>&1; then - LTUNDEF="-no-undefined" -fi -AC_SUBST([LTUNDEF]) - -AC_CONFIG_FILES([ -Makefile -ffms2.pc -]) -AC_OUTPUT - diff --git a/ffms2.pc.in b/ffms2.pc.in deleted file mode 100644 index 29a2386728..0000000000 --- a/ffms2.pc.in +++ /dev/null @@ -1,15 +0,0 @@ -# @configure_input@ - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: ffms2 -Description: The Fabulous FM Library 2 -Requires.private: libavformat libavcodec libswscale libavutil libswresample -Version: @FFMS_VERSION@ -Libs.private: @ZLIB_LDFLAGS@ -lz -Libs: -L${libdir} -lffms2 -Cflags: -I${includedir} -Cflags.private: -DFFMS_STATIC diff --git a/m4/check_zlib.m4 b/m4/check_zlib.m4 deleted file mode 100644 index 4e6ff50001..0000000000 --- a/m4/check_zlib.m4 +++ /dev/null @@ -1,28 +0,0 @@ -AC_DEFUN([CHECK_ZLIB],[ - AC_ARG_WITH(zlib,AS_HELP_STRING([--with-zlib=DIR],[specify zlib's root installation folder]), - [ZLIB_HOME="$with_zlib"]) - - if test -n "${ZLIB_HOME}" -a "${ZLIB_HOME}" != "yes" -a "${ZLIB_HOME}" != "no" ; then - ZLIB_CPPFLAGS="-I${ZLIB_HOME}/include" - ZLIB_LDFLAGS="-L${ZLIB_HOME}/lib" - fi - - ZLIB_OLD_LDFLAGS=$LDFLAGS - ZLIB_OLD_CPPFLAGS=$CPPFLAGS - LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS" - CPPFLAGS="$CPPFLAGS $ZLIB_CPPFLAGS" - AC_LANG_PUSH(C) - AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no]) - AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no]) - AC_LANG_POP(C) - LDFLAGS=$ZLIB_OLD_LDFLAGS - CPPFLAGS=$ZLIB_OLD_CPPFLAGS - if test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes" - then - HAVE_ZLIB=yes - AC_SUBST([ZLIB_CPPFLAGS]) - AC_SUBST([ZLIB_LDFLAGS]) - else - AC_MSG_FAILURE([cannot locate zlib.h and -lz, specify a valid zlib installation using --with-zlib=DIR]) - fi -]) diff --git a/test/Makefile b/test/Makefile deleted file mode 100644 index 1002d12840..0000000000 --- a/test/Makefile +++ /dev/null @@ -1,125 +0,0 @@ -# Where to find user code. -USER_DIR = .. - -# Points to the root of Google Test, relative to where this file is. -# Remember to tweak this if you move this file. -GTEST_DIR = $(USER_DIR)/test/googletest/googletest - -# Where to find sample files -SAMPLES_DIR = - -# URL to sync samples from -SAMPLES_URL = - -# Flags passed to the preprocessor. -# Set Google Test's header directory as a system directory, such that -# the compiler doesn't generate warnings in Google Test headers. -CPPFLAGS += -isystem $(GTEST_DIR)/include \ - -I$(USER_DIR)/include \ - -D_FILE_OFFSET_BITS=64 \ - -DFFMS_EXPORTS \ - -D__STDC_CONSTANT_MACROS \ - -DSAMPLES_DIR=$(SAMPLES_DIR) - -# Flags passed to the C++ compiler. -CXXFLAGS += -g -Wall -Wextra -pthread -std=c++11 -fvisibility=hidden - -# All tests produced by this Makefile. Remember to add new tests you -# created to the list. -TESTS = indexer \ - hdr \ - display_matrix - -RUNTESTS = $(subst $() $(),-run$() $(),$(TESTS))-run - -# All the sample files we need to sync -SAMPLES = test.mp4 \ - hdr10tags-both.mkv \ - hdr10tags-container.mkv \ - hdr10tags-stream.mp4 \ - qrvideo_hflip_90.mov \ - qrvideo_hflip_270.mov \ - qrvideo_vflip.mov \ - vp9_audfirst.webm \ - qrvideo_24fps_1elist_1ctts.mov \ - qrvideo_24fps_1elist_ends_last_bframe.mov \ - qrvideo_24fps_1elist_noctts.mov \ - qrvideo_24fps_2elist_elist1_dur_zero.mov \ - qrvideo_24fps_2elist_elist1_ends_bframe.mov \ - qrvideo_24fps_2s_3elist.mov \ - qrvideo_24fps_3elist_1ctts.mov \ - qrvideo_24fps_elist_starts_ctts_2ndsample.mov \ - qrvideo_stream_shorter_than_movie.mov - -# All Google Test headers. Usually you shouldn't change this -# definition. -GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h $(GTEST_DIR)/include/gtest/internal/*.h - -# House-keeping build targets. - -all: $(TESTS) - -run: all $(RUNTESTS) - -sync: - @for i in $(SAMPLES); do \ - if [ ! -f "$(SAMPLES_DIR)/$$i" ]; then \ - wget -O $(SAMPLES_DIR)/$$i $(SAMPLES_URL)/$$i; \ - fi \ - done - -clean: - rm -f $(TESTS) gtest.a gtest_main.a *.o - rm -rf .libs - -# Builds gtest.a and gtest_main.a. - -# Usually you shouldn't tweak such internal variables, indicated by a -# trailing _. -GTEST_SRCS_ = $(GTEST_DIR)/src/*.cc $(GTEST_DIR)/src/*.h $(GTEST_HEADERS) - -# For simplicity and to avoid depending on Google Test's -# implementation details, the dependencies specified below are -# conservative and not optimized. This is fine as Google Test -# compiles fast and for ordinary users its source rarely changes. -gtest-all.o: $(GTEST_SRCS_) - $(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c $(GTEST_DIR)/src/gtest-all.cc - -gtest_main.o: $(GTEST_SRCS_) - $(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c $(GTEST_DIR)/src/gtest_main.cc - -gtest.a: gtest-all.o - $(AR) $(ARFLAGS) $@ $^ - -gtest_main.a: gtest-all.o gtest_main.o - $(AR) $(ARFLAGS) $@ $^ - -tests.o: $(USER_DIR)/test/tests.cpp $(USER_DIR)/include/ffms.h $(GTEST_HEADERS) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/test/tests.cpp - -hdr.o: $(USER_DIR)/test/hdr.cpp $(USER_DIR)/include/ffms.h $(GTEST_HEADERS) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/test/hdr.cpp - -display_matrix.o: $(USER_DIR)/test/display_matrix.cpp $(USER_DIR)/include/ffms.h $(GTEST_HEADERS) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/test/display_matrix.cpp - -indexer.o: $(USER_DIR)/test/indexer.cpp $(USER_DIR)/include/ffms.h $(GTEST_HEADERS) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/test/indexer.cpp - -indexer: indexer.o tests.o gtest_main.a ../src/core/libffms2.la - ../libtool --tag=CXX --mode=link $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o indexer indexer.o tests.o gtest_main.a -lavutil ../src/core/libffms2.la - -indexer-run: - @./indexer - -hdr: hdr.o gtest_main.a ../src/core/libffms2.la - ../libtool --tag=CXX --mode=link $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o hdr hdr.o gtest_main.a -lavutil ../src/core/libffms2.la - -hdr-run: - @./hdr - -display_matrix: display_matrix.o gtest_main.a ../src/core/libffms2.la - ../libtool --tag=CXX --mode=link $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o display_matrix display_matrix.o gtest_main.a -lavutil ../src/core/libffms2.la - -display_matrix-run: - @./display_matrix diff --git a/test/googletest b/test/googletest deleted file mode 160000 index f5260ae757..0000000000 --- a/test/googletest +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f5260ae757a681566d8f7d0558b8dc0551036506 From 69f61131979c47158f915d82b32fcb3dc2dfe2b8 Mon Sep 17 00:00:00 2001 From: moi15moi Date: Mon, 6 Apr 2026 13:38:42 -0400 Subject: [PATCH 7/9] Add a test to verify that the header are indeed c99 The goal is to catch issue like this one: https://github.com/FFMS/ffms2/pull/472#discussion_r3036974578 --- test/meson.build | 12 ++++++++++++ test/test.c | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 test/test.c diff --git a/test/meson.build b/test/meson.build index a08325be5d..89d1f5ad8a 100644 --- a/test/meson.build +++ b/test/meson.build @@ -44,3 +44,15 @@ display_matrix = executable( ], ) test('display_matrix', display_matrix) + + +# Test that the header are indeed compatible with c99 +add_languages('c', native : false) +c_compiler = meson.get_compiler('c') +c99_header = executable( + 'c99_header', + files('test.c'), + dependencies : ffms2_dep, + override_options : {'c_std' : 'c99', 'werror' : true, 'warning_level' : '3'}, +) +test('c99_header', c99_header) diff --git a/test/test.c b/test/test.c new file mode 100644 index 0000000000..f56195effb --- /dev/null +++ b/test/test.c @@ -0,0 +1,7 @@ +// Include all ffms2 headers +#include +#include + +int main(void) { + return 0; +} From fef4ebf1a9bfc40c2b5df160b881d9ecdc794c33 Mon Sep 17 00:00:00 2001 From: moi15moi Date: Mon, 6 Apr 2026 16:21:32 -0400 Subject: [PATCH 8/9] Fix prototype error with header on clang Fix these errors reported by clang: ``` FAILED: [code=1] test/c99_header.p/test.c.o clang -Itest/c99_header.p -Itest -I../test -I../include -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c99 -O3 -pedantic -MD -MQ test/c99_header.p/test.c.o -MF test/c99_header.p/test.c.o.d -o test/c99_header.p/test.c.o -c ../test/test.c In file included from ../test/test.c:2: ../include/ffms.h:436:30: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 436 | FFMS_API(int) FFMS_GetVersion(); | ^ | void ../include/ffms.h:437:31: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 437 | FFMS_API(int) FFMS_GetLogLevel(); | ^ | void ``` --- include/ffms.h | 4 ++-- src/core/ffms.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/ffms.h b/include/ffms.h index 3f9d455117..0febda690d 100644 --- a/include/ffms.h +++ b/include/ffms.h @@ -433,8 +433,8 @@ typedef int (FFMS_CC *TIndexCallback)(int64_t Current, int64_t Total, void *ICPr /* Most functions return 0 on success */ /* Functions without error message output can be assumed to never fail in a graceful way */ FFMS_API(void) FFMS_Init(int, int); /* Pass 0 to both arguments, kept to partially preserve abi */ -FFMS_API(int) FFMS_GetVersion(); -FFMS_API(int) FFMS_GetLogLevel(); +FFMS_API(int) FFMS_GetVersion(void); +FFMS_API(int) FFMS_GetLogLevel(void); FFMS_API(void) FFMS_SetLogLevel(int Level); FFMS_API(FFMS_VideoSource *) FFMS_CreateVideoSource(const char *SourceFile, int Track, FFMS_Index *Index, int Threads, int SeekMode, FFMS_ErrorInfo *ErrorInfo); FFMS_API(FFMS_AudioSource *) FFMS_CreateAudioSource(const char *SourceFile, int Track, FFMS_Index *Index, int DelayMode, FFMS_ErrorInfo *ErrorInfo); diff --git a/src/core/ffms.cpp b/src/core/ffms.cpp index cbfe88e2a0..7aa9270259 100644 --- a/src/core/ffms.cpp +++ b/src/core/ffms.cpp @@ -87,11 +87,11 @@ FFMS_API(void) FFMS_Init(int, int) { }); } -FFMS_API(int) FFMS_GetVersion() { +FFMS_API(int) FFMS_GetVersion(void) { return FFMS_VERSION; } -FFMS_API(int) FFMS_GetLogLevel() { +FFMS_API(int) FFMS_GetLogLevel(void) { return av_log_get_level(); } From 841b72c6431d0ac35378418f8ca616134fa403b7 Mon Sep 17 00:00:00 2001 From: moi15moi Date: Sat, 25 Apr 2026 14:53:33 -0400 Subject: [PATCH 9/9] [CI] Use UCRT64 instead of MINGW64 Since 2026-03-15, MINGW64 is deprecated: https://www.msys2.org/news/#2026-03-15-deprecating-the-mingw64-environment --- .github/workflows/ci-meson.yml | 12 ++++++------ .github/workflows/ci-windows.yml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-meson.yml b/.github/workflows/ci-meson.yml index f9ebb14954..466d0d582d 100644 --- a/.github/workflows/ci-meson.yml +++ b/.github/workflows/ci-meson.yml @@ -56,16 +56,16 @@ jobs: brew update brew install autoconf automake libtool wget ffmpeg meson - - name: Setup MSYS2 (MINGW64) + - name: Setup MSYS2 (UCRT64) if: matrix.windows_env == 'msys2' uses: msys2/setup-msys2@v2 with: - msystem: MINGW64 + msystem: UCRT64 install: >- - mingw-w64-x86_64-ca-certificates - mingw-w64-x86_64-ffmpeg - mingw-w64-x86_64-meson - mingw-w64-x86_64-toolchain + mingw-w64-ucrt-x86_64-ca-certificates + mingw-w64-ucrt-x86_64-ffmpeg + mingw-w64-ucrt-x86_64-meson + mingw-w64-ucrt-x86_64-toolchain - name: Setup Cygwin if: matrix.windows_env == 'cygwin' diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 110afa516f..a0a3a3bad7 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -36,8 +36,8 @@ jobs: uses: msys2/setup-msys2@v2 id: msys2 with: - msystem: MINGW64 - install: mingw-w64-x86_64-pkgconf + msystem: UCRT64 + install: mingw-w64-ucrt-x86_64-pkgconf - name: Setup MSVC Developer Command Prompt uses: ilammy/msvc-dev-cmd@v1 @@ -46,7 +46,7 @@ jobs: - name: Configure with Meson env: - PKG_CONFIG: "${{ steps.msys2.outputs.msys2-location }}\\mingw64\\bin\\pkg-config.EXE" + PKG_CONFIG: "${{ steps.msys2.outputs.msys2-location }}\\ucrt64\\bin\\pkg-config.EXE" run: > meson setup builddir --buildtype=release