-
Notifications
You must be signed in to change notification settings - Fork 6
184 lines (180 loc) · 8.45 KB
/
gst-libav1.0.yml
File metadata and controls
184 lines (180 loc) · 8.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: gst-libav1.0 Build and Test
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_and_test:
name: Build & Test gst-libav1.0
runs-on: ubuntu-latest
container:
image: debian:bookworm
options: --user root
timeout-minutes: 60
strategy:
matrix:
gst_ref: [ 'master', 'debian/1.26.2-1', 'debian/1.26.3-1' ]
fail-fast: false
steps:
- name: Checkout gnutls-wolfssl repository
uses: actions/checkout@v4
- name: Install Meson and ninja
run: |
apt-get update
apt-get install -y sudo meson ninja-build
- name: Install GStreamer ≥1.26 dev-packages
run: |
apt-get update
apt-get install -y \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
gstreamer1.0-tools
- name: Install build tools & dependencies
run: |
apt-get install -y \
build-essential autoconf automake pkg-config yasm git \
meson ninja-build cmake \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
libavcodec-dev libavformat-dev libavutil-dev libavfilter-dev \
gstreamer1.0-tools \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-libav \
gnulib autopoint gperf gtk-doc-tools nettle-dev \
clang libtasn1-bin libtasn1-6-dev libunistring-dev \
libp11-kit-dev libunbound-dev wget gtk-doc-tools libswscale-dev libswresample-dev nasm \
python3-pip flex bison libgirepository1.0-dev python3-dev
pip3 install --break-system-packages --upgrade meson
- name: Restore cached gnutls-wolfssl
id: cache-gnutls
uses: actions/cache@v4
with:
path: |
/opt/gnutls
/opt/wolfssl
/opt/wolfssl-gnutls-wrapper
key: gnutls-wolfssl-${{ runner.os }}-${{ hashFiles('setup.sh', 'wolfssl-gnutls-wrapper/**', 'wolfssl/**', 'gnutls/**') }}
restore-keys: |
gnutls-wolfssl-${{ runner.os }}-
- name: Build GnuTLS with wolfSSL provider
if: steps.cache-gnutls.outputs.cache-hit != 'true'
run: |
GNUTLS_INSTALL=/opt/gnutls WOLFSSL_INSTALL=/opt/wolfssl ./setup.sh
- name: Verify GnuTLS install
run: |
test -d /opt/gnutls/lib || (echo "/opt/gnutls/lib missing" && exit 1)
- name: Restore cached GStreamer
id: cache-gstreamer
uses: actions/cache@v4
with:
path: /opt/gstreamer
key: gstreamer-1.26.2-${{ runner.os }}-bookworm
restore-keys: |
gstreamer-1.26.2-${{ runner.os }}-
- name: Build GStreamer 1.26.2 from source
if: steps.cache-gstreamer.outputs.cache-hit != 'true'
run: |
pip3 install --break-system-packages meson ninja
git clone https://github.com/GStreamer/gstreamer.git gstreamer-source
cd gstreamer-source
git checkout 1.26.2
meson setup build \
--prefix=/opt/gstreamer \
--libdir=lib \
-Dgood=enabled \
-Dbad=enabled \
-Dugly=enabled \
-Dlibav=disabled \
-Ddevtools=disabled \
-Dsharp=disabled \
-Dpython=disabled \
-Drs=disabled \
-Dgst-plugins-bad:vulkan=disabled \
-Dgst-plugins-bad:nvcodec=disabled \
-Dgst-plugins-bad:qsv=disabled
ninja -C build
ninja -C build install
cd ..
rm -rf gstreamer-source
- name: Build FFmpeg with GnuTLS & MPEG-4 encoder
run: |
cd $RUNNER_WORKSPACE
git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg-gnutls
cd ffmpeg-gnutls
export PKG_CONFIG_PATH="/opt/gnutls/lib/pkgconfig:/opt/gstreamer/lib/pkgconfig"
export CPPFLAGS="-I/opt/gnutls/include -I/opt/gstreamer/include"
export LDFLAGS="-L/opt/gnutls/lib -L/opt/gstreamer/lib -Wl,-rpath,/opt/gnutls/lib -Wl,-rpath,/opt/gstreamer/lib"
export LD_LIBRARY_PATH="/opt/gnutls/lib:/opt/gstreamer/lib:$LD_LIBRARY_PATH"
./configure \
--prefix=/opt/ffmpeg-gnutls \
--disable-openssl \
--enable-gnutls \
--enable-encoder=mpeg4 \
--enable-shared
make -j"$(nproc)" && make install
- name: Verify libav* link against custom GnuTLS
run: |
export PKG_CONFIG_PATH="/opt/gnutls/lib/pkgconfig:/opt/ffmpeg-gnutls/lib/pkgconfig:/opt/gstreamer/lib/pkgconfig:$PKG_CONFIG_PATH"
export CPPFLAGS="-I/opt/gnutls/include -I/opt/ffmpeg-gnutls/include -I/opt/gstreamer/include $CPPFLAGS"
export LDFLAGS="-L/opt/gnutls/lib -L/opt/ffmpeg-gnutls/lib -L/opt/gstreamer/lib \
-Wl,-rpath,/opt/gnutls/lib -Wl,-rpath=/opt/ffmpeg-gnutls/lib -Wl,-rpath,/opt/gstreamer/lib $LDFLAGS"
export LD_LIBRARY_PATH="/opt/gnutls/lib:/opt/ffmpeg-gnutls/lib:/opt/gstreamer/lib:$LD_LIBRARY_PATH"
for lib in libavformat.so.62 libavfilter.so.11; do
echo ">>> ldd for $lib:"
ldd /opt/ffmpeg-gnutls/lib/$lib
if ! ldd /opt/ffmpeg-gnutls/lib/$lib \
| grep -q '/opt/gnutls/lib/libgnutls.so.30'; then
echo "✖ $lib is NOT using custom GnuTLS"
exit 1
fi
echo "✔ $lib is using custom GnuTLS"
done
- name: Clone & checkout gst-libav1.0 @ ${{ matrix.gst_ref }}
run: |
git clone https://salsa.debian.org/gstreamer-team/gst-libav1.0.git gst-libav
cd gst-libav
git fetch --tags
git checkout ${{ matrix.gst_ref }}
- name: Build gst-libav1.0 (${{ matrix.gst_ref }})
working-directory: gst-libav
run: |
export PKG_CONFIG_PATH="/opt/gnutls/lib/pkgconfig:/opt/ffmpeg-gnutls/lib/pkgconfig:/opt/gstreamer/lib/pkgconfig:$PKG_CONFIG_PATH"
export CPPFLAGS="-I/opt/gnutls/include -I/opt/ffmpeg-gnutls/include -I/opt/gstreamer/include $CPPFLAGS"
export LDFLAGS="-L/opt/gnutls/lib -L/opt/ffmpeg-gnutls/lib -L/opt/gstreamer/lib \
-Wl,-rpath,/opt/gnutls/lib -Wl,-rpath=/opt/ffmpeg-gnutls/lib -Wl,-rpath,/opt/gstreamer/lib $LDFLAGS"
export LD_LIBRARY_PATH="/opt/gnutls/lib:/opt/ffmpeg-gnutls/lib:/opt/gstreamer/lib:$LD_LIBRARY_PATH"
rm -rf build
meson setup build --prefix=/usr -Ddoc=disabled -Dtests=enabled
ninja -C build
- name: Smoke-test plugin with gst-inspect & playbin
working-directory: gst-libav
run: |
export PKG_CONFIG_PATH="/opt/gnutls/lib/pkgconfig:/opt/ffmpeg-gnutls/lib/pkgconfig:/opt/gstreamer/lib/pkgconfig:$PKG_CONFIG_PATH"
export CPPFLAGS="-I/opt/gnutls/include -I/opt/ffmpeg-gnutls/include -I/opt/gstreamer/include $CPPFLAGS"
export LDFLAGS="-L/opt/gnutls/lib -L/opt/ffmpeg-gnutls/lib -L/opt/gstreamer/lib \
-Wl,-rpath,/opt/gnutls/lib -Wl,-rpath=/opt/ffmpeg-gnutls/lib -Wl,-rpath,/opt/gstreamer/lib $LDFLAGS"
export LD_LIBRARY_PATH="/opt/gnutls/lib:/opt/ffmpeg-gnutls/lib:/opt/gstreamer/lib:$LD_LIBRARY_PATH"
PAGER=cat \
GST_PLUGIN_PATH=$(pwd)/build \
GST_PLUGIN_SYSTEM_PATH_1_0=/opt/gstreamer/lib/gstreamer-1.0 \
/opt/gstreamer/bin/gst-inspect-1.0 libav
timeout 30s env \
GST_PLUGIN_PATH=$(pwd)/build \
GST_PLUGIN_SYSTEM_PATH_1_0=/opt/gstreamer/lib/gstreamer-1.0 \
/opt/gstreamer/bin/gst-launch-1.0 -v playbin \
uri=https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8 || test $? -eq 124
- name: Run upstream gst-libav tests
working-directory: gst-libav
run: |
export PKG_CONFIG_PATH="/opt/gnutls/lib/pkgconfig:/opt/ffmpeg-gnutls/lib/pkgconfig:/opt/gstreamer/lib/pkgconfig:$PKG_CONFIG_PATH"
export CPPFLAGS="-I/opt/gnutls/include -I/opt/ffmpeg-gnutls/include -I/opt/gstreamer/include $CPPFLAGS"
export LDFLAGS="-L/opt/gnutls/lib -L/opt/ffmpeg-gnutls/lib -L/opt/gstreamer/lib \
-Wl,-rpath,/opt/gnutls/lib -Wl,-rpath=/opt/ffmpeg-gnutls/lib -Wl,-rpath,/opt/gstreamer/lib $LDFLAGS"
export LD_LIBRARY_PATH="/opt/gnutls/lib:/opt/ffmpeg-gnutls/lib:/opt/gstreamer/lib:$LD_LIBRARY_PATH"
export WGW_LOGGING=1
meson test -C build --print-errorlogs