Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1d8947a
create a cross-platform CI using conan
mmomtchev Feb 27, 2026
ff510b2
install libva-dev on ubuntu
mmomtchev Feb 27, 2026
327946b
proper capitalization of conan opts
mmomtchev Feb 27, 2026
4b2fa51
cancel the previous running workflow
mmomtchev Feb 27, 2026
66b4258
it is matrix.platform
mmomtchev Feb 27, 2026
d42ec66
install libvdpau-dev on ubuntu
mmomtchev Feb 27, 2026
c3e2054
install the X11 dev libraries
mmomtchev Feb 27, 2026
3d394bf
cache conan artifacts but restart from scratch once per week
mmomtchev Feb 27, 2026
c3ceaa3
check this later
mmomtchev Feb 27, 2026
7145c73
start by installing conan
mmomtchev Feb 27, 2026
8198a6f
try leaving conan to install all missing packages
mmomtchev Feb 27, 2026
a5f16d3
try using sudo on ubuntu
mmomtchev Feb 27, 2026
3b20a3a
create a conanfile.py to tweak settings
mmomtchev Feb 27, 2026
038228f
it is tests/
mmomtchev Feb 27, 2026
1ce771c
it is cmake --build .
mmomtchev Feb 27, 2026
4f9a5c6
use a conan profile
mmomtchev Feb 27, 2026
30ae309
drop the conan-CMake integration and use pkg-config
mmomtchev Feb 27, 2026
495ebc2
no need to touch this
mmomtchev Feb 27, 2026
90352af
fix a typo
mmomtchev Feb 27, 2026
99243bc
start with the shared build
mmomtchev Feb 27, 2026
330c352
add catch2
mmomtchev Feb 27, 2026
ef1b03a
it is ctest
mmomtchev Feb 27, 2026
be43ab9
the CMake build expects catch2 to be checked out in the tree
mmomtchev Feb 27, 2026
0d3de00
try adding pkgconf on Windows
mmomtchev Feb 27, 2026
7b123b4
use separate conan caches for each version
mmomtchev Feb 27, 2026
3e0dbf0
use separate commands for Windows and macOS/Linux
mmomtchev Feb 27, 2026
a9d7b9d
swap the shells
mmomtchev Feb 27, 2026
a978950
correct commands
mmomtchev Feb 27, 2026
06cbff9
enable postproc on all versions
mmomtchev Feb 27, 2026
193dc67
try generating everything with bash
mmomtchev Feb 27, 2026
6691259
try without seting the shell
mmomtchev Feb 27, 2026
694add2
use gh to delete the cache once per week
mmomtchev Feb 27, 2026
234d7e2
pass the token to gh
mmomtchev Feb 27, 2026
870f4b0
source using powershell
mmomtchev Feb 27, 2026
72ddcd6
enable powershell environment in conan
mmomtchev Feb 27, 2026
94ec671
try with cmd and call
mmomtchev Feb 27, 2026
4a3ddcc
use long instead of ssize_t which does not exist with MSVC
mmomtchev Feb 27, 2026
a6c09b2
to_string requires <string>
mmomtchev Feb 27, 2026
1d9deff
skip api2-remux on Windows
mmomtchev Feb 27, 2026
3051f37
replace `ssize_t` with `long`, does not exist in MSVC
mmomtchev Feb 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions .github/workflows/conan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Cross-platform build using conan

on:
push:
branches: [ "**" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: '34 5 * * 5'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

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:
- name: Restart from scratch every Friday
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
with:
submodules: true

- 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 }}-${{ matrix.ffmpeg}}-cmake

- 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 (Windows)
shell: cmd
run: |
call conanbuild.bat
call conanrun.bat
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: bash
run: |
source conanbuild.sh
source conanrun.sh
cmake -DCMAKE_BUILD_TYPE=Release ..
working-directory: ${{ github.workspace }}/build
if: runner.os != 'Windows'
env:
PKG_CONFIG_PATH: ${{ github.workspace }}/build

- name: Build (Windows)
shell: cmd
run: |
call conanbuild.bat
call conanrun.bat
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

- name: Run the unit tests (Windows)
shell: cmd
run: |
call conanrun.bat
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
5 changes: 4 additions & 1 deletion example/api2-samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion example/api2-samples/api2-decode-audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion example/api2-samples/api2-decode-encode-audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion example/api2-samples/api2-decode-encode-video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int main(int argc, char **argv)
// INPUT
//
FormatContext ictx;
ssize_t videoStream = -1;
long videoStream = -1;
VideoDecoderContext vdec;
Stream vst;

Expand Down
2 changes: 1 addition & 1 deletion example/api2-samples/api2-decode-filter-encode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions example/api2-samples/api2-decode-overlay-encode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int main(int argc, char **argv)
// INPUT
//
FormatContext ictx;
ssize_t videoStream = -1;
long videoStream = -1;
VideoDecoderContext vdec;
Stream vst;

Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion example/api2-samples/api2-decode-rasample-audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion example/api2-samples/api2-decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions example/api2-samples/api2-dict-basic.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <iostream>
#include <string>

#include "avcpp/av.h"
#include "avcpp/dictionary.h"
Expand Down
2 changes: 1 addition & 1 deletion example/api2-samples/api2-hw-encode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ int main(int argc, char **argv) {
// INPUT
//
FormatContext ictx;
ssize_t videoStream = -1;
long videoStream = -1;
// VideoDecoderContext vdec;
Stream vst;

Expand Down
2 changes: 1 addition & 1 deletion example/api2-samples/api2-scale-video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ int main(int argc, char **argv)
// INPUT
//
FormatContext ictx;
ssize_t videoStream = -1;
long videoStream = -1;
VideoDecoderContext vdec;
Stream vst;

Expand Down
4 changes: 2 additions & 2 deletions tests/FormatCustomIO_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -333,4 +333,4 @@ TEST_CASE("Format Custom IO checks", "[FormatCustomIo]")
}
}

#endif
#endif
8 changes: 8 additions & 0 deletions tests/conan/conan.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include(default)

[conf]
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=true

[settings]
compiler.cppstd=20
26 changes: 26 additions & 0 deletions tests/conan/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from conan import ConanFile

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"
}
generators = 'PkgConfigDeps'

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
self.options["ffmpeg"].shared = True
self.options["ffmpeg"].postproc = True

Loading