Skip to content

Commit aca6d30

Browse files
committed
Include dav1d in releases
Scrcpy supports AV1, but no decoder was provided in binary releases. Include dav1d: - <https://www.videolan.org/projects/dav1d.html> - <https://code.videolan.org/videolan/dav1d> Fixes #4744 <#4744> PR #5644 <#5644>
1 parent f2018e0 commit aca6d30

File tree

5 files changed

+76
-0
lines changed

5 files changed

+76
-0
lines changed

app/deps/dav1d.sh

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
4+
cd "$DEPS_DIR"
5+
. common
6+
process_args "$@"
7+
8+
VERSION=1.5.0
9+
FILENAME=dav1d-$VERSION.tar.gz
10+
PROJECT_DIR=dav1d-$VERSION
11+
SHA256SUM=78b15d9954b513ea92d27f39362535ded2243e1b0924fde39f37a31ebed5f76b
12+
13+
cd "$SOURCES_DIR"
14+
15+
if [[ -d "$PROJECT_DIR" ]]
16+
then
17+
echo "$PWD/$PROJECT_DIR" found
18+
else
19+
get_file "https://code.videolan.org/videolan/dav1d/-/archive/$VERSION/$FILENAME" "$FILENAME" "$SHA256SUM"
20+
tar xf "$FILENAME" # First level directory is "$PROJECT_DIR"
21+
fi
22+
23+
mkdir -p "$BUILD_DIR/$PROJECT_DIR"
24+
cd "$BUILD_DIR/$PROJECT_DIR"
25+
26+
if [[ -d "$DIRNAME" ]]
27+
then
28+
echo "'$PWD/$DIRNAME' already exists, not reconfigured"
29+
cd "$DIRNAME"
30+
else
31+
mkdir "$DIRNAME"
32+
cd "$DIRNAME"
33+
34+
conf=(
35+
--prefix="$INSTALL_DIR/$DIRNAME"
36+
--libdir=lib
37+
-Denable_tests=false
38+
-Denable_tools=false
39+
# Always build dav1d statically
40+
--default-library=static
41+
)
42+
43+
if [[ "$BUILD_TYPE" == cross ]]
44+
then
45+
case "$HOST" in
46+
win32)
47+
conf+=(
48+
--cross-file="$SOURCES_DIR/$PROJECT_DIR/package/crossfiles/i686-w64-mingw32.meson"
49+
)
50+
;;
51+
52+
win64)
53+
conf+=(
54+
--cross-file="$SOURCES_DIR/$PROJECT_DIR/package/crossfiles/x86_64-w64-mingw32.meson"
55+
)
56+
;;
57+
58+
*)
59+
echo "Unsupported host: $HOST" >&2
60+
exit 1
61+
esac
62+
fi
63+
64+
meson setup . "$SOURCES_DIR/$PROJECT_DIR" "${conf[@]}"
65+
fi
66+
67+
ninja
68+
ninja install

app/deps/ffmpeg.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ else
4343
export PKG_CONFIG_PATH="/opt/homebrew/opt/zlib/lib/pkgconfig"
4444
fi
4545

46+
export PKG_CONFIG_PATH="$INSTALL_DIR/$DIRNAME/lib/pkgconfig:$PKG_CONFIG_PATH"
47+
4648
conf=(
4749
--prefix="$INSTALL_DIR/$DIRNAME"
50+
--pkg-config-flags="--static"
4851
--extra-cflags="-O2 -fPIC"
4952
--disable-programs
5053
--disable-doc
@@ -57,9 +60,11 @@ else
5760
--disable-vaapi
5861
--disable-vdpau
5962
--enable-swresample
63+
--enable-libdav1d
6064
--enable-decoder=h264
6165
--enable-decoder=hevc
6266
--enable-decoder=av1
67+
--enable-decoder=libdav1d
6368
--enable-decoder=pcm_s16le
6469
--enable-decoder=opus
6570
--enable-decoder=aac

release/build_linux.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ LINUX_BUILD_DIR="$WORK_DIR/build-linux-$ARCH"
1515

1616
app/deps/adb_linux.sh
1717
app/deps/sdl.sh linux native static
18+
app/deps/dav1d.sh linux native static
1819
app/deps/ffmpeg.sh linux native static
1920
app/deps/libusb.sh linux native static
2021

release/build_macos.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ MACOS_BUILD_DIR="$WORK_DIR/build-macos-$ARCH"
1515

1616
app/deps/adb_macos.sh
1717
app/deps/sdl.sh macos native static
18+
app/deps/dav1d.sh macos native static
1819
app/deps/ffmpeg.sh macos native static
1920
app/deps/libusb.sh macos native static
2021

release/build_windows.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ WINXX_BUILD_DIR="$WORK_DIR/build-$WINXX"
2222

2323
app/deps/adb_windows.sh
2424
app/deps/sdl.sh $WINXX cross shared
25+
app/deps/dav1d.sh $WINXX cross shared
2526
app/deps/ffmpeg.sh $WINXX cross shared
2627
app/deps/libusb.sh $WINXX cross shared
2728

0 commit comments

Comments
 (0)