From 1d8947a1c6be51f39549e9b7262a6cd3eb5a9a60 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 14:10:53 +0100 Subject: [PATCH 01/40] create a cross-platform CI using conan --- .github/workflows/conan.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/conan.yml diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml new file mode 100644 index 00000000..66be7524 --- /dev/null +++ b/.github/workflows/conan.yml @@ -0,0 +1,34 @@ +name: Cross-platform build using conan + +on: + push: + branches: [ "**" ] + pull_request: + branches: [ "master" ] + schedule: + - cron: '34 5 * * 5' + +jobs: + CMake: + runs-on: ${{ matrix.platform }} + strategy: + fail-fast: false + matrix: + platform: [ ubuntu-latest, macos-latest, windows-latest ] + ffmpeg: [ 8.0.1, 7.1.3, 6.1.1 ] + + steps: + - uses: conan-io/setup-conan@v1 + - uses: actions/checkout@v6 + + - run: conan profile detect --force + - run: conan install --requires ffmpeg/${{ matrix.ffmpeg }} -b=missing -g cmaketoolchain -g cmakedeps -of build + + - run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" .. + working-directory: ${{ github.workspace }}/build + + - run: cmake --build + working-directory: ${{ github.workspace }}/build + + - run: cmake --test + working-directory: ${{ github.workspace }}/build From ff510b2b62ae562bb8c75a22716f49f3dc5a7039 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 14:19:07 +0100 Subject: [PATCH 02/40] install libva-dev on ubuntu --- .github/workflows/conan.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 66be7524..5b118879 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -21,6 +21,10 @@ jobs: - uses: conan-io/setup-conan@v1 - uses: actions/checkout@v6 + - name: (if on Ubuntu) install fonts + run: sudo apt-get install -y libva-dev || true + if: ${{ contains(inputs.platform, 'ubuntu') }} + - run: conan profile detect --force - run: conan install --requires ffmpeg/${{ matrix.ffmpeg }} -b=missing -g cmaketoolchain -g cmakedeps -of build From 327946bd138d3fd0a5189e3e081c503fa236238b Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 14:19:53 +0100 Subject: [PATCH 03/40] proper capitalization of conan opts --- .github/workflows/conan.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 5b118879..b8ce607e 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -21,12 +21,12 @@ jobs: - uses: conan-io/setup-conan@v1 - uses: actions/checkout@v6 - - name: (if on Ubuntu) install fonts + - name: (if on Ubuntu) install libva-dev run: sudo apt-get install -y libva-dev || true if: ${{ contains(inputs.platform, 'ubuntu') }} - run: conan profile detect --force - - run: conan install --requires ffmpeg/${{ matrix.ffmpeg }} -b=missing -g cmaketoolchain -g cmakedeps -of build + - run: conan install --requires ffmpeg/${{ matrix.ffmpeg }} -b=missing -g CMakeToolchain -g CMakeDeps -of build - run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" .. working-directory: ${{ github.workspace }}/build From 4b2fa51184002a15c6bf422749b1f1ee9d91566d Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 14:21:47 +0100 Subject: [PATCH 04/40] cancel the previous running workflow --- .github/workflows/conan.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index b8ce607e..f7062300 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -8,6 +8,10 @@ on: schedule: - cron: '34 5 * * 5' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: CMake: runs-on: ${{ matrix.platform }} From 66b42586628c0d92d508d6e2ed37adb99d890be6 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 14:23:08 +0100 Subject: [PATCH 05/40] it is matrix.platform --- .github/workflows/conan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index f7062300..9235daa9 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -27,7 +27,7 @@ jobs: - name: (if on Ubuntu) install libva-dev run: sudo apt-get install -y libva-dev || true - if: ${{ contains(inputs.platform, 'ubuntu') }} + if: ${{ contains(matrix.platform, 'ubuntu') }} - run: conan profile detect --force - run: conan install --requires ffmpeg/${{ matrix.ffmpeg }} -b=missing -g CMakeToolchain -g CMakeDeps -of build From d42ec66dd48ecb274dc1c4688a72df32ac219d9a Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 14:24:47 +0100 Subject: [PATCH 06/40] install libvdpau-dev on ubuntu --- .github/workflows/conan.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 9235daa9..85ecc602 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -25,8 +25,8 @@ jobs: - uses: conan-io/setup-conan@v1 - uses: actions/checkout@v6 - - name: (if on Ubuntu) install libva-dev - run: sudo apt-get install -y libva-dev || true + - name: (if on Ubuntu) install system libraries + run: sudo apt-get install -y libva-dev libvdpau-dev || true if: ${{ contains(matrix.platform, 'ubuntu') }} - run: conan profile detect --force From c3e2054719e3658cace363aa962e6ac0edba3759 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 14:27:09 +0100 Subject: [PATCH 07/40] install the X11 dev libraries --- .github/workflows/conan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 85ecc602..348cf7d5 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v6 - name: (if on Ubuntu) install system libraries - run: sudo apt-get install -y libva-dev libvdpau-dev || true + run: sudo apt-get install -y libva-dev libvdpau-dev libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev || true if: ${{ contains(matrix.platform, 'ubuntu') }} - run: conan profile detect --force From 3d394bfdf622f2c57b8459e10ff1b65246f18481 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 14:32:58 +0100 Subject: [PATCH 08/40] cache conan artifacts but restart from scratch once per week --- .github/workflows/conan.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 348cf7d5..7968250b 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -22,6 +22,21 @@ jobs: ffmpeg: [ 8.0.1, 7.1.3, 6.1.1 ] steps: + - name: Get conan home + shell: bash + id: conan_home + run: echo path=`conan config home` >> $GITHUB_OUTPUT + - name: Cache conan artifacts + id: conan-artifacts + uses: actions/cache@v5 + with: + path: ${{ steps.conan_home.outputs.path }} + key: conan-${{ matrix.platform }}-cmake + - name: Restart from scratch every Friday + run: rm -rf ${{ steps.conan_home.outputs.path }} + shell: bash + if: github.event_name == 'schedule' + - uses: conan-io/setup-conan@v1 - uses: actions/checkout@v6 From c3ceaa32f7eb1f177d328a60a60182f41dea023a Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 14:36:18 +0100 Subject: [PATCH 09/40] check this later --- src/CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 15931d2c..6f370e28 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -106,14 +106,14 @@ if (AVCPP_NOT_SUBPROJECT) # APPEND # FILE ${CMAKE_CURRENT_BINARY_DIR}/avcpp-targets.cmake) - install(TARGETS ${AV_TARGETS} FFmpeg - EXPORT avcpp-targets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/avcpp - PRIVATE_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/avcpp - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/avcpp) + #install(TARGETS ${AV_TARGETS} FFmpeg + # EXPORT avcpp-targets + # LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + # ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + # RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + # INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/avcpp + # PRIVATE_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/avcpp + # PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/avcpp) #cmake_policy(SET CMP0022 OLD) install(EXPORT avcpp-targets From 7145c73394ec12aaf2b951196c990de012cf9ffc Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 14:39:02 +0100 Subject: [PATCH 10/40] start by installing conan --- .github/workflows/conan.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 7968250b..55bf853a 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -22,6 +22,9 @@ jobs: ffmpeg: [ 8.0.1, 7.1.3, 6.1.1 ] steps: + - uses: conan-io/setup-conan@v1 + - uses: actions/checkout@v6 + - name: Get conan home shell: bash id: conan_home @@ -37,9 +40,6 @@ jobs: shell: bash if: github.event_name == 'schedule' - - uses: conan-io/setup-conan@v1 - - uses: actions/checkout@v6 - - name: (if on Ubuntu) install system libraries run: sudo apt-get install -y libva-dev libvdpau-dev libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev || true if: ${{ contains(matrix.platform, 'ubuntu') }} From 8198a6ffae44a53448e4611f1728f23090c2599c Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 14:41:31 +0100 Subject: [PATCH 11/40] try leaving conan to install all missing packages --- .github/workflows/conan.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 55bf853a..d4a5908f 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -40,12 +40,8 @@ jobs: shell: bash if: github.event_name == 'schedule' - - name: (if on Ubuntu) install system libraries - run: sudo apt-get install -y libva-dev libvdpau-dev libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev || true - if: ${{ contains(matrix.platform, 'ubuntu') }} - - run: conan profile detect --force - - run: conan install --requires ffmpeg/${{ matrix.ffmpeg }} -b=missing -g CMakeToolchain -g CMakeDeps -of build + - run: conan install --requires ffmpeg/${{ matrix.ffmpeg }} -b=missing -g CMakeToolchain -g CMakeDeps -of build -c tools.system.package_manager:mode=install - run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" .. working-directory: ${{ github.workspace }}/build From a5f16d39e21e5faa3e6b4decb58214053f1a3427 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 14:46:26 +0100 Subject: [PATCH 12/40] try using sudo on ubuntu --- .github/workflows/conan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index d4a5908f..8c5a0f00 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -41,7 +41,7 @@ jobs: if: github.event_name == 'schedule' - run: conan profile detect --force - - run: conan install --requires ffmpeg/${{ matrix.ffmpeg }} -b=missing -g CMakeToolchain -g CMakeDeps -of build -c tools.system.package_manager:mode=install + - run: conan install --requires ffmpeg/${{ matrix.ffmpeg }} -b=missing -g CMakeToolchain -g CMakeDeps -of build -c tools.system.package_manager:mode=install -c tools.system.package_manager:sudo=true - run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" .. working-directory: ${{ github.workspace }}/build From 3b20a3a96d8b3e71eaa8b43c2267d612a42ccf0b Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 15:32:56 +0100 Subject: [PATCH 13/40] create a conanfile.py to tweak settings --- .github/workflows/conan.yml | 3 ++- src/CMakeLists.txt | 20 ++++++++++++-------- tests/conan/conanfile.py | 28 ++++++++++++++++++++++++++++ tests/conan/global.conf | 2 ++ 4 files changed, 44 insertions(+), 9 deletions(-) create mode 100644 tests/conan/conanfile.py create mode 100644 tests/conan/global.conf diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 8c5a0f00..17f7d311 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -41,7 +41,8 @@ jobs: if: github.event_name == 'schedule' - run: conan profile detect --force - - run: conan install --requires ffmpeg/${{ matrix.ffmpeg }} -b=missing -g CMakeToolchain -g CMakeDeps -of build -c tools.system.package_manager:mode=install -c tools.system.package_manager:sudo=true + - run: conan config install test/conan/global.conf + - run: conan install test/conan -b=missing -of build -o ffmpeg=${{ matrix.ffmpeg }} -o build=CMake - run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" .. working-directory: ${{ github.workspace }}/build diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6f370e28..9951808b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -106,14 +106,18 @@ if (AVCPP_NOT_SUBPROJECT) # APPEND # FILE ${CMAKE_CURRENT_BINARY_DIR}/avcpp-targets.cmake) - #install(TARGETS ${AV_TARGETS} FFmpeg - # EXPORT avcpp-targets - # LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - # ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - # RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - # INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/avcpp - # PRIVATE_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/avcpp - # PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/avcpp) + # FFmpeg may not come from us + if (TARGET FFmpeg) + SET(TARGET_FFMPEG FFmpeg) + endif () + install(TARGETS ${AV_TARGETS} ${TARGET_FFMPEG} + EXPORT avcpp-targets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/avcpp + PRIVATE_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/avcpp + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/avcpp) #cmake_policy(SET CMP0022 OLD) install(EXPORT avcpp-targets diff --git a/tests/conan/conanfile.py b/tests/conan/conanfile.py new file mode 100644 index 00000000..d98ec547 --- /dev/null +++ b/tests/conan/conanfile.py @@ -0,0 +1,28 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeDeps, CMakeToolchain +import os + +required_conan_version = ">=2.0" + +class Avcpp(ConanFile): + settings = "os", "arch", "compiler", "build_type" + options = { + "ffmpeg": ["8.0.1", "7.1.3", "6.1.1"], + "build": [ "CMake", "meson" ] + } + default_options = { + "ffmpeg": "8.0.1", + "build": "CMake" + } + + def requirements(self): + self.requires(f"ffmpeg/{self.options.ffmpeg}", transitive_headers=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("ffmpeg", "cmake_file_name", "FFmpeg") + deps.set_property("ffmpeg", "cmake_target_name", "FFmpeg::FFmpeg") + deps.generate() diff --git a/tests/conan/global.conf b/tests/conan/global.conf new file mode 100644 index 00000000..0bad6b45 --- /dev/null +++ b/tests/conan/global.conf @@ -0,0 +1,2 @@ +tools.system.package_manager:mode=install +tools.system.package_manager:sudo=true From 038228f84e433dbd9c786f4cec72f23d580696d9 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 15:34:17 +0100 Subject: [PATCH 14/40] it is tests/ --- .github/workflows/conan.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 17f7d311..774590bb 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -41,8 +41,8 @@ jobs: if: github.event_name == 'schedule' - run: conan profile detect --force - - run: conan config install test/conan/global.conf - - run: conan install test/conan -b=missing -of build -o ffmpeg=${{ matrix.ffmpeg }} -o build=CMake + - run: conan config install tests/conan/global.conf + - run: conan install tests/conan -b=missing -of build -o ffmpeg=${{ matrix.ffmpeg }} -o build=CMake - run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" .. working-directory: ${{ github.workspace }}/build From 1ce771cdefc6ae99112ff567fadfec5964253e6a Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 15:43:04 +0100 Subject: [PATCH 15/40] it is cmake --build . --- .github/workflows/conan.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 774590bb..60878f88 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -47,8 +47,8 @@ jobs: - run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" .. working-directory: ${{ github.workspace }}/build - - run: cmake --build + - run: cmake --build . working-directory: ${{ github.workspace }}/build - - run: cmake --test + - run: cmake --test . working-directory: ${{ github.workspace }}/build From 4f9a5c6afbc8ffce289caf82a7c9dbe439af4af4 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 15:57:21 +0100 Subject: [PATCH 16/40] use a conan profile --- .github/workflows/conan.yml | 3 +-- tests/conan/{global.conf => conan.profile} | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) rename tests/conan/{global.conf => conan.profile} (59%) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 60878f88..87972942 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -41,8 +41,7 @@ jobs: if: github.event_name == 'schedule' - run: conan profile detect --force - - run: conan config install tests/conan/global.conf - - run: conan install tests/conan -b=missing -of build -o ffmpeg=${{ matrix.ffmpeg }} -o build=CMake + - run: conan install tests/conan -pr:a=tests/conan/conan.profile -b=missing -of build -o ffmpeg=${{ matrix.ffmpeg }} -o build=CMake - run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" .. working-directory: ${{ github.workspace }}/build diff --git a/tests/conan/global.conf b/tests/conan/conan.profile similarity index 59% rename from tests/conan/global.conf rename to tests/conan/conan.profile index 0bad6b45..3b7a9980 100644 --- a/tests/conan/global.conf +++ b/tests/conan/conan.profile @@ -1,2 +1,8 @@ +include(default) + +[conf] tools.system.package_manager:mode=install tools.system.package_manager:sudo=true + +[settings] +compiler.cppstd=20 From 30ae3098cbf4338b057294ec1c4f497e01eec624 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 16:01:34 +0100 Subject: [PATCH 17/40] drop the conan-CMake integration and use pkg-config --- tests/conan/conanfile.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/tests/conan/conanfile.py b/tests/conan/conanfile.py index d98ec547..a2c6750d 100644 --- a/tests/conan/conanfile.py +++ b/tests/conan/conanfile.py @@ -1,6 +1,4 @@ from conan import ConanFile -from conan.tools.cmake import CMakeDeps, CMakeToolchain -import os required_conan_version = ">=2.0" @@ -14,15 +12,7 @@ class Avcpp(ConanFile): "ffmpeg": "8.0.1", "build": "CMake" } + generators = 'PkgConfigDeps' def requirements(self): self.requires(f"ffmpeg/{self.options.ffmpeg}", transitive_headers=True) - - def generate(self): - tc = CMakeToolchain(self) - tc.generate() - - deps = CMakeDeps(self) - deps.set_property("ffmpeg", "cmake_file_name", "FFmpeg") - deps.set_property("ffmpeg", "cmake_target_name", "FFmpeg::FFmpeg") - deps.generate() From 495ebc230f4407971b5567d406facc88c1bbdae6 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 16:02:45 +0100 Subject: [PATCH 18/40] no need to touch this --- .github/workflows/conan.yml | 4 +++- src/CMakeLists.txt | 6 +----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 87972942..31ac6dd5 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -43,8 +43,10 @@ jobs: - run: conan profile detect --force - run: conan install tests/conan -pr:a=tests/conan/conan.profile -b=missing -of build -o ffmpeg=${{ matrix.ffmpeg }} -o build=CMake - - run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" .. + - run: cmake -DCMAKE_BUILD_TYPE=Release .. working-directory: ${{ github.workspace }}/build + env: + PKG_CONFIG_PATH: ${{ github.workspace }}/build - run: cmake --build . working-directory: ${{ github.workspace }}/build diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9951808b..2d9137be 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -106,11 +106,7 @@ if (AVCPP_NOT_SUBPROJECT) # APPEND # FILE ${CMAKE_CURRENT_BINARY_DIR}/avcpp-targets.cmake) - # FFmpeg may not come from us - if (TARGET FFmpeg) - SET(TARGET_FFMPEG FFmpeg) - endif () - install(TARGETS ${AV_TARGETS} ${TARGET_FFMPEG} + install(TARGETS ${AV_TARGETS} FFmpeg} EXPORT avcpp-targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} From 90352af92bbc99dbe5b9975a9f380671e8c76a46 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 16:15:23 +0100 Subject: [PATCH 19/40] fix a typo --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2d9137be..15931d2c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -106,7 +106,7 @@ if (AVCPP_NOT_SUBPROJECT) # APPEND # FILE ${CMAKE_CURRENT_BINARY_DIR}/avcpp-targets.cmake) - install(TARGETS ${AV_TARGETS} FFmpeg} + install(TARGETS ${AV_TARGETS} FFmpeg EXPORT avcpp-targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} From 99243bccf81f1edb4bf359c9516a53fe409940f5 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 16:44:03 +0100 Subject: [PATCH 20/40] start with the shared build --- tests/conan/conanfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/conan/conanfile.py b/tests/conan/conanfile.py index a2c6750d..01d20177 100644 --- a/tests/conan/conanfile.py +++ b/tests/conan/conanfile.py @@ -16,3 +16,7 @@ class Avcpp(ConanFile): def requirements(self): self.requires(f"ffmpeg/{self.options.ffmpeg}", transitive_headers=True) + + def configure(self): + self.options["ffmpeg"].fPIC = True + self.options["ffmpeg"].shared = True From 330c352c2b80c4cae41c61ef99e6628b4cb68ea0 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 16:54:01 +0100 Subject: [PATCH 21/40] add catch2 --- tests/conan/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/conan/conanfile.py b/tests/conan/conanfile.py index 01d20177..6a92d156 100644 --- a/tests/conan/conanfile.py +++ b/tests/conan/conanfile.py @@ -16,6 +16,7 @@ class Avcpp(ConanFile): def requirements(self): self.requires(f"ffmpeg/{self.options.ffmpeg}", transitive_headers=True) + self.requires("catch2/3.13.0") def configure(self): self.options["ffmpeg"].fPIC = True From ef1b03aaf5db0103cb0207e06de96c87558554e4 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 16:54:09 +0100 Subject: [PATCH 22/40] it is ctest --- .github/workflows/conan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 31ac6dd5..01bd6152 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -51,5 +51,5 @@ jobs: - run: cmake --build . working-directory: ${{ github.workspace }}/build - - run: cmake --test . + - run: ctest --output-on-failure working-directory: ${{ github.workspace }}/build From be43ab909441e9ef25ade228565da0dc1fd4c84d Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 17:08:10 +0100 Subject: [PATCH 23/40] the CMake build expects catch2 to be checked out in the tree --- .github/workflows/conan.yml | 2 ++ tests/conan/conanfile.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 01bd6152..dbcba2a3 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -24,6 +24,8 @@ jobs: steps: - uses: conan-io/setup-conan@v1 - uses: actions/checkout@v6 + with: + submodules: true - name: Get conan home shell: bash diff --git a/tests/conan/conanfile.py b/tests/conan/conanfile.py index 6a92d156..01d20177 100644 --- a/tests/conan/conanfile.py +++ b/tests/conan/conanfile.py @@ -16,7 +16,6 @@ class Avcpp(ConanFile): def requirements(self): self.requires(f"ffmpeg/{self.options.ffmpeg}", transitive_headers=True) - self.requires("catch2/3.13.0") def configure(self): self.options["ffmpeg"].fPIC = True From 0d3de0082caf102df228af0a8476d2d361ba6f07 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 18:27:46 +0100 Subject: [PATCH 24/40] try adding pkgconf on Windows --- .github/workflows/conan.yml | 6 +++++- tests/conan/conanfile.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index dbcba2a3..f46f401a 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -45,7 +45,11 @@ jobs: - run: conan profile detect --force - run: conan install tests/conan -pr:a=tests/conan/conan.profile -b=missing -of build -o ffmpeg=${{ matrix.ffmpeg }} -o build=CMake - - run: cmake -DCMAKE_BUILD_TYPE=Release .. + - name: Generate CMake build + shell: bash + run: | + source conanbuild.sh + cmake -DCMAKE_BUILD_TYPE=Release .. working-directory: ${{ github.workspace }}/build env: PKG_CONFIG_PATH: ${{ github.workspace }}/build diff --git a/tests/conan/conanfile.py b/tests/conan/conanfile.py index 01d20177..4b2b2f80 100644 --- a/tests/conan/conanfile.py +++ b/tests/conan/conanfile.py @@ -16,6 +16,8 @@ class Avcpp(ConanFile): def requirements(self): self.requires(f"ffmpeg/{self.options.ffmpeg}", transitive_headers=True) + if self.settings.os == 'Windows': + self.tool_requires("pkgconf/2.5.1") def configure(self): self.options["ffmpeg"].fPIC = True From 7b123b4289e188cc125308463b1b54ac768efa85 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 18:32:26 +0100 Subject: [PATCH 25/40] use separate conan caches for each version --- .github/workflows/conan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index f46f401a..2e56aa51 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -36,7 +36,7 @@ jobs: uses: actions/cache@v5 with: path: ${{ steps.conan_home.outputs.path }} - key: conan-${{ matrix.platform }}-cmake + key: conan-${{ matrix.platform }}-${{ matrix.ffmpeg}}-cmake - name: Restart from scratch every Friday run: rm -rf ${{ steps.conan_home.outputs.path }} shell: bash From 3e0dbf0e0c47eaefa1ff4e737809e1c07cb6e1ac Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 18:45:50 +0100 Subject: [PATCH 26/40] use separate commands for Windows and macOS/Linux --- .github/workflows/conan.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 2e56aa51..befda2c9 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -45,12 +45,24 @@ jobs: - run: conan profile detect --force - run: conan install tests/conan -pr:a=tests/conan/conan.profile -b=missing -of build -o ffmpeg=${{ matrix.ffmpeg }} -o build=CMake - - name: Generate CMake build + - name: Generate CMake build (Windows) shell: bash run: | source conanbuild.sh cmake -DCMAKE_BUILD_TYPE=Release .. working-directory: ${{ github.workspace }}/build + if: runner.os == 'Windows' + env: + PKG_CONFIG_EXECUTABLE: pkgconf.exe + PKG_CONFIG_PATH: ${{ github.workspace }}/build + + - name: Generate CMake build (Linux/macOS) + shell: cmd + run: | + conanbuild.bat + cmake -DCMAKE_BUILD_TYPE=Release .. + working-directory: ${{ github.workspace }}/build + if: runner.os != 'Windows' env: PKG_CONFIG_PATH: ${{ github.workspace }}/build From a9d7b9d4ced377d881593cc996af51c5065f6953 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 18:52:31 +0100 Subject: [PATCH 27/40] swap the shells --- .github/workflows/conan.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index befda2c9..f65536a7 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -46,7 +46,7 @@ jobs: - run: conan install tests/conan -pr:a=tests/conan/conan.profile -b=missing -of build -o ffmpeg=${{ matrix.ffmpeg }} -o build=CMake - name: Generate CMake build (Windows) - shell: bash + shell: cmd run: | source conanbuild.sh cmake -DCMAKE_BUILD_TYPE=Release .. @@ -57,7 +57,7 @@ jobs: PKG_CONFIG_PATH: ${{ github.workspace }}/build - name: Generate CMake build (Linux/macOS) - shell: cmd + shell: bash run: | conanbuild.bat cmake -DCMAKE_BUILD_TYPE=Release .. From a9789509d8c65c06775761e6895ccde84cc9bcc4 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 19:01:27 +0100 Subject: [PATCH 28/40] correct commands --- .github/workflows/conan.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index f65536a7..3a1deaa2 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -48,7 +48,7 @@ jobs: - name: Generate CMake build (Windows) shell: cmd run: | - source conanbuild.sh + conanbuild.bat cmake -DCMAKE_BUILD_TYPE=Release .. working-directory: ${{ github.workspace }}/build if: runner.os == 'Windows' @@ -59,7 +59,7 @@ jobs: - name: Generate CMake build (Linux/macOS) shell: bash run: | - conanbuild.bat + source conanbuild.sh cmake -DCMAKE_BUILD_TYPE=Release .. working-directory: ${{ github.workspace }}/build if: runner.os != 'Windows' From 06cbff9c3b1a0d766a990108b83f8a5bcaa7df80 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 19:14:17 +0100 Subject: [PATCH 29/40] enable postproc on all versions --- tests/conan/conanfile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/conan/conanfile.py b/tests/conan/conanfile.py index 4b2b2f80..168f5fbb 100644 --- a/tests/conan/conanfile.py +++ b/tests/conan/conanfile.py @@ -20,5 +20,7 @@ def requirements(self): self.tool_requires("pkgconf/2.5.1") def configure(self): - self.options["ffmpeg"].fPIC = True - self.options["ffmpeg"].shared = True + self.options["ffmpeg"].fPIC = True + self.options["ffmpeg"].shared = True + self.options["ffmpeg"].postproc = True + \ No newline at end of file From 193dc67e4e4ab6d773734a01ddfcfdd59c99149c Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 19:21:11 +0100 Subject: [PATCH 30/40] try generating everything with bash --- .github/workflows/conan.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 3a1deaa2..21a4927c 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -43,12 +43,14 @@ jobs: if: github.event_name == 'schedule' - run: conan profile detect --force + shell: bash - run: conan install tests/conan -pr:a=tests/conan/conan.profile -b=missing -of build -o ffmpeg=${{ matrix.ffmpeg }} -o build=CMake + shell: bash - name: Generate CMake build (Windows) - shell: cmd + shell: bash run: | - conanbuild.bat + source conanbuild.sh cmake -DCMAKE_BUILD_TYPE=Release .. working-directory: ${{ github.workspace }}/build if: runner.os == 'Windows' From 669125969b34a2c3c7f7ad84cb03c4c90c2d6fad Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 19:43:45 +0100 Subject: [PATCH 31/40] try without seting the shell --- .github/workflows/conan.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 21a4927c..3c288fd0 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -43,14 +43,12 @@ jobs: if: github.event_name == 'schedule' - run: conan profile detect --force - shell: bash - run: conan install tests/conan -pr:a=tests/conan/conan.profile -b=missing -of build -o ffmpeg=${{ matrix.ffmpeg }} -o build=CMake - shell: bash - name: Generate CMake build (Windows) - shell: bash run: | - source conanbuild.sh + conanbuild + conanrun cmake -DCMAKE_BUILD_TYPE=Release .. working-directory: ${{ github.workspace }}/build if: runner.os == 'Windows' @@ -62,6 +60,7 @@ jobs: shell: bash run: | source conanbuild.sh + source conanrun.sh cmake -DCMAKE_BUILD_TYPE=Release .. working-directory: ${{ github.workspace }}/build if: runner.os != 'Windows' From 694add20079f3d9f27b56df0e27ee5bdc8e94f6a Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 19:50:23 +0100 Subject: [PATCH 32/40] use gh to delete the cache once per week --- .github/workflows/conan.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 3c288fd0..f56f8a29 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -22,6 +22,11 @@ jobs: ffmpeg: [ 8.0.1, 7.1.3, 6.1.1 ] steps: + - name: Restart from scratch every Friday + run: gh cache delete --all + shell: bash + if: github.event_name == 'schedule' + - uses: conan-io/setup-conan@v1 - uses: actions/checkout@v6 with: @@ -37,10 +42,6 @@ jobs: with: path: ${{ steps.conan_home.outputs.path }} key: conan-${{ matrix.platform }}-${{ matrix.ffmpeg}}-cmake - - name: Restart from scratch every Friday - run: rm -rf ${{ steps.conan_home.outputs.path }} - shell: bash - if: github.event_name == 'schedule' - run: conan profile detect --force - run: conan install tests/conan -pr:a=tests/conan/conan.profile -b=missing -of build -o ffmpeg=${{ matrix.ffmpeg }} -o build=CMake From 234d7e28f787d6714f9c329b0241fbdbd8e54e6d Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 19:50:57 +0100 Subject: [PATCH 33/40] pass the token to gh --- .github/workflows/conan.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index f56f8a29..bd0629d8 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -26,6 +26,8 @@ jobs: run: gh cache delete --all shell: bash if: github.event_name == 'schedule' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: conan-io/setup-conan@v1 - uses: actions/checkout@v6 From 870f4b02ed2982b90f48eec60180dcba370bcf09 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 20:01:45 +0100 Subject: [PATCH 34/40] source using powershell --- .github/workflows/conan.yml | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index bd0629d8..f3daac03 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -50,8 +50,8 @@ jobs: - name: Generate CMake build (Windows) run: | - conanbuild - conanrun + . .\conanbuild.ps1 + . .\conanrun.ps1 cmake -DCMAKE_BUILD_TYPE=Release .. working-directory: ${{ github.workspace }}/build if: runner.os == 'Windows' @@ -70,8 +70,32 @@ jobs: env: PKG_CONFIG_PATH: ${{ github.workspace }}/build - - run: cmake --build . + - name: Build (Windows) + run: | + . .\conanbuild.ps1 + . .\conanrun.ps1 + cmake --build . + if: runner.os == 'Windows' + working-directory: ${{ github.workspace }}/build + + - name: Build (Linux/macOS) + run: | + source conanbuild.sh + source conanrun.sh + cmake --build . + if: runner.os != 'Windows' working-directory: ${{ github.workspace }}/build - - run: ctest --output-on-failure + - name: Run the unit tests (Windows) + run: | + . .\conanrun.ps1 + ctest --output-on-failure + if: runner.os == 'Windows' + working-directory: ${{ github.workspace }}/build + + - name: Run the unit tests (Linux/macOS) + run: | + source conanrun.sh + ctest --output-on-failure + if: runner.os != 'Windows' working-directory: ${{ github.workspace }}/build From 72ddcd651ac70977f61fec2135a0298546cc1688 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 20:19:26 +0100 Subject: [PATCH 35/40] enable powershell environment in conan --- tests/conan/conan.profile | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/conan/conan.profile b/tests/conan/conan.profile index 3b7a9980..d817943d 100644 --- a/tests/conan/conan.profile +++ b/tests/conan/conan.profile @@ -3,6 +3,7 @@ include(default) [conf] tools.system.package_manager:mode=install tools.system.package_manager:sudo=true +tools.env.virtualenv:powershell=pwsh.EXE [settings] compiler.cppstd=20 From 94ec671b467afaa92a40775141eb8aff0b1f7355 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 20:24:31 +0100 Subject: [PATCH 36/40] try with cmd and call --- .github/workflows/conan.yml | 13 ++++++++----- tests/conan/conan.profile | 1 - 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index f3daac03..b5acb73a 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -49,9 +49,10 @@ jobs: - run: conan install tests/conan -pr:a=tests/conan/conan.profile -b=missing -of build -o ffmpeg=${{ matrix.ffmpeg }} -o build=CMake - name: Generate CMake build (Windows) + shell: cmd run: | - . .\conanbuild.ps1 - . .\conanrun.ps1 + call conanbuild.bat + call conanrun.bat cmake -DCMAKE_BUILD_TYPE=Release .. working-directory: ${{ github.workspace }}/build if: runner.os == 'Windows' @@ -71,9 +72,10 @@ jobs: PKG_CONFIG_PATH: ${{ github.workspace }}/build - name: Build (Windows) + shell: cmd run: | - . .\conanbuild.ps1 - . .\conanrun.ps1 + call conanbuild.bat + call conanrun.bat cmake --build . if: runner.os == 'Windows' working-directory: ${{ github.workspace }}/build @@ -87,8 +89,9 @@ jobs: working-directory: ${{ github.workspace }}/build - name: Run the unit tests (Windows) + shell: cmd run: | - . .\conanrun.ps1 + call conanrun.bat ctest --output-on-failure if: runner.os == 'Windows' working-directory: ${{ github.workspace }}/build diff --git a/tests/conan/conan.profile b/tests/conan/conan.profile index d817943d..3b7a9980 100644 --- a/tests/conan/conan.profile +++ b/tests/conan/conan.profile @@ -3,7 +3,6 @@ include(default) [conf] tools.system.package_manager:mode=install tools.system.package_manager:sudo=true -tools.env.virtualenv:powershell=pwsh.EXE [settings] compiler.cppstd=20 From 4a3ddcc65aa66156c494aff7b1e574c6e561d8e6 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 20:48:07 +0100 Subject: [PATCH 37/40] use long instead of ssize_t which does not exist with MSVC --- example/api2-samples/api2-decode-audio.cpp | 2 +- example/api2-samples/api2-decode-encode-audio.cpp | 2 +- example/api2-samples/api2-decode-encode-video.cpp | 2 +- example/api2-samples/api2-decode-filter-encode.cpp | 2 +- example/api2-samples/api2-decode-overlay-encode.cpp | 4 ++-- example/api2-samples/api2-decode-rasample-audio.cpp | 2 +- example/api2-samples/api2-decode.cpp | 2 +- example/api2-samples/api2-hw-encode.cpp | 2 +- example/api2-samples/api2-scale-video.cpp | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/example/api2-samples/api2-decode-audio.cpp b/example/api2-samples/api2-decode-audio.cpp index bf7201b4..759eecd3 100644 --- a/example/api2-samples/api2-decode-audio.cpp +++ b/example/api2-samples/api2-decode-audio.cpp @@ -31,7 +31,7 @@ int main(int argc, char **argv) string uri {argv[1]}; - ssize_t audioStream = -1; + long audioStream = -1; AudioDecoderContext adec; Stream ast; error_code ec; diff --git a/example/api2-samples/api2-decode-encode-audio.cpp b/example/api2-samples/api2-decode-encode-audio.cpp index 0da58569..39040a26 100644 --- a/example/api2-samples/api2-decode-encode-audio.cpp +++ b/example/api2-samples/api2-decode-encode-audio.cpp @@ -32,7 +32,7 @@ int main(int argc, char **argv) string uri (argv[1]); string out (argv[2]); - ssize_t audioStream = -1; + long audioStream = -1; AudioDecoderContext adec; Stream ast; error_code ec; diff --git a/example/api2-samples/api2-decode-encode-video.cpp b/example/api2-samples/api2-decode-encode-video.cpp index cd2c220b..52529667 100644 --- a/example/api2-samples/api2-decode-encode-video.cpp +++ b/example/api2-samples/api2-decode-encode-video.cpp @@ -38,7 +38,7 @@ int main(int argc, char **argv) // INPUT // FormatContext ictx; - ssize_t videoStream = -1; + long videoStream = -1; VideoDecoderContext vdec; Stream vst; diff --git a/example/api2-samples/api2-decode-filter-encode.cpp b/example/api2-samples/api2-decode-filter-encode.cpp index 9f53ec75..85b9d9fd 100644 --- a/example/api2-samples/api2-decode-filter-encode.cpp +++ b/example/api2-samples/api2-decode-filter-encode.cpp @@ -39,7 +39,7 @@ int main(int argc, char **argv) string uri{argv[1]}; string out{argv[2]}; - ssize_t videoStream = -1; + long videoStream = -1; VideoDecoderContext vdec; Stream vst; error_code ec; diff --git a/example/api2-samples/api2-decode-overlay-encode.cpp b/example/api2-samples/api2-decode-overlay-encode.cpp index 170f9b1d..b6ddbf44 100644 --- a/example/api2-samples/api2-decode-overlay-encode.cpp +++ b/example/api2-samples/api2-decode-overlay-encode.cpp @@ -42,7 +42,7 @@ int main(int argc, char **argv) // INPUT // FormatContext ictx; - ssize_t videoStream = -1; + long videoStream = -1; VideoDecoderContext vdec; Stream vst; @@ -91,7 +91,7 @@ int main(int argc, char **argv) // STATIC IMAGE (more or less identical to INPUT) // FormatContext static_image_ctx; - ssize_t imageStream = -1; + long imageStream = -1; VideoDecoderContext static_image_dec; Stream image_st; diff --git a/example/api2-samples/api2-decode-rasample-audio.cpp b/example/api2-samples/api2-decode-rasample-audio.cpp index a83e2302..a87ec597 100644 --- a/example/api2-samples/api2-decode-rasample-audio.cpp +++ b/example/api2-samples/api2-decode-rasample-audio.cpp @@ -31,7 +31,7 @@ int main(int argc, char **argv) string uri {argv[1]}; - ssize_t audioStream = -1; + long audioStream = -1; AudioDecoderContext adec; Stream ast; error_code ec; diff --git a/example/api2-samples/api2-decode.cpp b/example/api2-samples/api2-decode.cpp index 1c126cd5..0ecb75a1 100644 --- a/example/api2-samples/api2-decode.cpp +++ b/example/api2-samples/api2-decode.cpp @@ -33,7 +33,7 @@ int main(int argc, char **argv) string uri {argv[1]}; - ssize_t videoStream = -1; + long videoStream = -1; VideoDecoderContext vdec; Stream vst; error_code ec; diff --git a/example/api2-samples/api2-hw-encode.cpp b/example/api2-samples/api2-hw-encode.cpp index 8b1cd3ae..1fe67d66 100644 --- a/example/api2-samples/api2-hw-encode.cpp +++ b/example/api2-samples/api2-hw-encode.cpp @@ -86,7 +86,7 @@ int main(int argc, char **argv) { // INPUT // FormatContext ictx; - ssize_t videoStream = -1; + long videoStream = -1; // VideoDecoderContext vdec; Stream vst; diff --git a/example/api2-samples/api2-scale-video.cpp b/example/api2-samples/api2-scale-video.cpp index c75a96e9..6c6248dd 100644 --- a/example/api2-samples/api2-scale-video.cpp +++ b/example/api2-samples/api2-scale-video.cpp @@ -41,7 +41,7 @@ int main(int argc, char **argv) // INPUT // FormatContext ictx; - ssize_t videoStream = -1; + long videoStream = -1; VideoDecoderContext vdec; Stream vst; From a6c09b21b64a94eeb378cbad66994cc4d4ce77f5 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 21:11:15 +0100 Subject: [PATCH 38/40] to_string requires --- example/api2-samples/api2-dict-basic.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/example/api2-samples/api2-dict-basic.cpp b/example/api2-samples/api2-dict-basic.cpp index 8a2074dd..874032b1 100644 --- a/example/api2-samples/api2-dict-basic.cpp +++ b/example/api2-samples/api2-dict-basic.cpp @@ -1,4 +1,5 @@ #include +#include #include "avcpp/av.h" #include "avcpp/dictionary.h" From 1d9deffa6fbd04c5f84eb3b60549c8fd4ec00b10 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Fri, 27 Feb 2026 21:16:10 +0100 Subject: [PATCH 39/40] skip api2-remux on Windows --- example/api2-samples/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/example/api2-samples/CMakeLists.txt b/example/api2-samples/CMakeLists.txt index a4ec3a05..c50220ec 100644 --- a/example/api2-samples/CMakeLists.txt +++ b/example/api2-samples/CMakeLists.txt @@ -23,11 +23,14 @@ set(TARGETS api2-dict-basic api2-timestamp api2-demux-seek - api2-remux api2-hw-encode api2-decode-raw-h264 ) +if(NOT WIN32) + list(APPEND TARGETS api2-remux) +endif() + if (AV_DISABLE_AVFORMAT) list(REMOVE_ITEM TARGETS api2-decode From 3051f376bd5d694401f18ad18ff8b596cb82b46d Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Sat, 28 Feb 2026 15:29:07 +0100 Subject: [PATCH 40/40] replace `ssize_t` with `long`, does not exist in MSVC --- tests/FormatCustomIO_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/FormatCustomIO_test.cpp b/tests/FormatCustomIO_test.cpp index 0a6fec98..a0c45bd0 100644 --- a/tests/FormatCustomIO_test.cpp +++ b/tests/FormatCustomIO_test.cpp @@ -95,7 +95,7 @@ struct TestBufferIo : public av::CustomIO return _buffer.size(); } - ssize_t cur = -1; + long cur = -1; if (whence == SEEK_CUR) { cur = std::distance(_buffer.begin(), _pos); @@ -333,4 +333,4 @@ TEST_CASE("Format Custom IO checks", "[FormatCustomIo]") } } -#endif \ No newline at end of file +#endif