mirror of
https://github.com/BtbN/FFmpeg-Builds.git
synced 2025-06-13 05:47:39 +02:00
Enable libva on Windows
I was not able to get the driver to work at all. It just crashes a lot, but since it has no averse side-effects (hopefully), let's just enable it by default.
This commit is contained in:
@ -4,7 +4,10 @@ SCRIPT_REPO="https://github.com/intel/libva.git"
|
|||||||
SCRIPT_COMMIT="7d6c7d482b9d2330b1f3a8bac13a6a3205f33382"
|
SCRIPT_COMMIT="7d6c7d482b9d2330b1f3a8bac13a6a3205f33382"
|
||||||
|
|
||||||
ffbuild_enabled() {
|
ffbuild_enabled() {
|
||||||
[[ $TARGET != linux* ]] && return -1
|
[[ $ADDINS_STR == *4.4* && $TARGET == win* ]] && return -1
|
||||||
|
[[ $ADDINS_STR == *5.0* && $TARGET == win* ]] && return -1
|
||||||
|
[[ $ADDINS_STR == *5.1* && $TARGET == win* ]] && return -1
|
||||||
|
[[ $ADDINS_STR == *6.0* && $TARGET == win* ]] && return -1
|
||||||
[[ $TARGET == linuxarm64 ]] && return -1
|
[[ $TARGET == linuxarm64 ]] && return -1
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -12,25 +15,35 @@ ffbuild_enabled() {
|
|||||||
ffbuild_dockerbuild() {
|
ffbuild_dockerbuild() {
|
||||||
cd "$FFBUILD_DLDIR/$SELF"
|
cd "$FFBUILD_DLDIR/$SELF"
|
||||||
|
|
||||||
autoreconf -i
|
# This works around an issue of our libxcb-dri3 implib-wrapper not exporting data symbols.
|
||||||
|
# Under normal circumstances, this would break horribly.
|
||||||
|
# But we only want to generate another import lib for libva, so it doesn't matter.
|
||||||
|
echo "#include <xcb/xcbext.h>" >> va/x11/va_dri3.c
|
||||||
|
echo "xcb_extension_t xcb_dri3_id;" >> va/x11/va_dri3.c
|
||||||
|
|
||||||
|
mkdir mybuild && cd mybuild
|
||||||
|
|
||||||
local myconf=(
|
local myconf=(
|
||||||
--prefix="$FFBUILD_PREFIX"
|
--prefix="$FFBUILD_PREFIX"
|
||||||
--enable-shared
|
--buildtype=release
|
||||||
--disable-static
|
--default-library=shared
|
||||||
--with-pic
|
-Denable_docs=false
|
||||||
--disable-docs
|
|
||||||
--enable-drm
|
|
||||||
--enable-x11
|
|
||||||
--disable-glx
|
|
||||||
--disable-wayland
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if [[ $TARGET == linux64 ]]; then
|
if [[ $TARGET == linux64 ]]; then
|
||||||
myconf+=(
|
myconf+=(
|
||||||
--host="$FFBUILD_TOOLCHAIN"
|
--cross-file=/cross.meson
|
||||||
--with-drivers-path="/usr/lib/x86_64-linux-gnu/dri"
|
|
||||||
--sysconfdir="/etc"
|
--sysconfdir="/etc"
|
||||||
|
-Ddriverdir="/usr/lib/x86_64-linux-gnu/dri"
|
||||||
|
-Ddisable_drm=false
|
||||||
|
-Dwith_x11=yes
|
||||||
|
-Dwith_glx=no
|
||||||
|
-Dwith_wayland=no
|
||||||
|
)
|
||||||
|
elif [[ $TARGET == win* ]]; then
|
||||||
|
myconf+=(
|
||||||
|
--cross-file=/cross.meson
|
||||||
|
-Dwith_win32=yes
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
echo "Unknown target"
|
echo "Unknown target"
|
||||||
@ -40,16 +53,27 @@ ffbuild_dockerbuild() {
|
|||||||
export CFLAGS="$RAW_CFLAGS"
|
export CFLAGS="$RAW_CFLAGS"
|
||||||
export LDFLAFS="$RAW_LDFLAGS"
|
export LDFLAFS="$RAW_LDFLAGS"
|
||||||
|
|
||||||
./configure "${myconf[@]}"
|
meson "${myconf[@]}" ..
|
||||||
make -j$(nproc)
|
ninja -j"$(nproc)"
|
||||||
make install
|
ninja install
|
||||||
|
|
||||||
gen-implib "$FFBUILD_PREFIX"/lib/{libva.so.2,libva.a}
|
if [[ $TARGET == linux* ]]; then
|
||||||
gen-implib "$FFBUILD_PREFIX"/lib/{libva-drm.so.2,libva-drm.a}
|
gen-implib "$FFBUILD_PREFIX"/lib/{libva.so.2,libva.a}
|
||||||
gen-implib "$FFBUILD_PREFIX"/lib/{libva-x11.so.2,libva-x11.a}
|
gen-implib "$FFBUILD_PREFIX"/lib/{libva-drm.so.2,libva-drm.a}
|
||||||
rm "$FFBUILD_PREFIX"/lib/libva{,-drm,-x11}{.so*,.la}
|
gen-implib "$FFBUILD_PREFIX"/lib/{libva-x11.so.2,libva-x11.a}
|
||||||
|
rm "$FFBUILD_PREFIX"/lib/libva{,-drm,-x11}.so*
|
||||||
|
|
||||||
echo "Libs: -ldl" >> "$FFBUILD_PREFIX"/lib/pkgconfig/libva.pc
|
echo "Libs: -ldl" >> "$FFBUILD_PREFIX"/lib/pkgconfig/libva.pc
|
||||||
|
elif [[ $TARGET == win* ]]; then
|
||||||
|
"$FFBUILD_CROSS_PREFIX"gendef - "$FFBUILD_PREFIX"/bin/libva.dll > libva.def
|
||||||
|
"$FFBUILD_CROSS_PREFIX"gendef - "$FFBUILD_PREFIX"/bin/libva_win32.dll > libva_win32.def
|
||||||
|
"$FFBUILD_CROSS_PREFIX"dlltool --input-def libva.def --output-delaylib "$FFBUILD_PREFIX"/lib/libva.a
|
||||||
|
"$FFBUILD_CROSS_PREFIX"dlltool --input-def libva_win32.def --output-delaylib "$FFBUILD_PREFIX"/lib/libva_win32.a
|
||||||
|
rm "$FFBUILD_PREFIX"/bin/libva*.dll "$FFBUILD_PREFIX"/lib/libva*.dll.a
|
||||||
|
else
|
||||||
|
echo "Unknown target"
|
||||||
|
return -1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
ffbuild_configure() {
|
ffbuild_configure() {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
SCRIPT_SKIP="1"
|
SCRIPT_SKIP="1"
|
||||||
|
|
||||||
ffbuild_enabled() {
|
ffbuild_enabled() {
|
||||||
[[ $TARGET != linux* ]] && return -1
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12,6 +11,8 @@ ffbuild_dockerdl() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ffbuild_dockerbuild() {
|
ffbuild_dockerbuild() {
|
||||||
rm "$FFBUILD_PREFIX"/lib/lib*.so* || true
|
if [[ $TARGET == linux* ]]; then
|
||||||
rm "$FFBUILD_PREFIX"/lib/*.la || true
|
rm "$FFBUILD_PREFIX"/lib/lib*.so* || true
|
||||||
|
rm "$FFBUILD_PREFIX"/lib/*.la || true
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user