ffmpeg: reorganize patchset and configure option handling

Apply v4l2-drmprime and v4l2-request patches for all projects/devices
except RPi4 and use configure options to enable/disable the required
features.

The RPi4 patch already includes v4l2-request patches, so only add the
v4l2-drmprime patch in addition to that - this is needed for H264
hardware decoding.

RPi4 configure options have been adapted to the updated RPi patch.

Misc LibreELEC patches are now in the "libreelec" patch dir and
included for all projects/devices.

Signed-off-by: Matthias Reichl <hias@horus.com>
This commit is contained in:
Matthias Reichl 2020-07-09 13:47:47 +02:00
parent 8dbeb6faec
commit 014f61eed0

View File

@ -17,25 +17,43 @@ get_graphicdrivers
PKG_FFMPEG_HWACCEL="--enable-hwaccels"
PKG_FFMPEG_RPI="--disable-mmal"
if [ "${PROJECT}" = "RPi" -a "${DEVICE}" = "RPi4" ]; then
PKG_PATCH_DIRS="rpi v4l2-drmprime"
PKG_FFMPEG_RPI+=" --disable-rpi --enable-sand"
else
PKG_PATCH_DIRS="v4l2-request v4l2-drmprime"
fi
PKG_PATCH_DIRS+=" libreelec"
if [ "${V4L2_SUPPORT}" = "yes" ]; then
PKG_DEPENDS_TARGET+=" libdrm"
PKG_NEED_UNPACK+=" $(get_pkg_directory libdrm)"
PKG_FFMPEG_V4L2="--enable-v4l2_m2m --enable-libdrm"
if [ "${PROJECT}" = "RPi" ]; then
PKG_FFMPEG_RPI="--disable-rpi --disable-mmal"
if [ "${DEVICE}" = "RPi4" ]; then
PKG_DEPENDS_TARGET+=" systemd"
PKG_NEED_UNPACK+=" $(get_pkg_directory systemd)"
PKG_FFMPEG_V4L2+=" --enable-libudev \
--enable-v4l2-request"
PKG_FFMPEG_HWACCEL="--disable-hwaccel=h264_v4l2request \
--disable-hwaccel=mpeg2_v4l2request \
--disable-hwaccel=vp8_v4l2request"
fi
if [ "${PROJECT}" = "Allwinner" -o "${PROJECT}" = "Rockchip" ]; then
PKG_V4L2_REQUEST="yes"
elif [ "${PROJECT}" = "RPi" -a "${DEVICE}" = "RPi4" ]; then
PKG_V4L2_REQUEST="yes"
PKG_FFMPEG_HWACCEL="--disable-hwaccel=h264_v4l2request \
--disable-hwaccel=mpeg2_v4l2request \
--disable-hwaccel=vp8_v4l2request \
--disable-hwaccel=vp9_v4l2request"
else
PKG_V4L2_REQUEST="no"
fi
if [ "${PKG_V4L2_REQUEST}" = "yes" ]; then
PKG_DEPENDS_TARGET+=" systemd"
PKG_NEED_UNPACK+=" $(get_pkg_directory systemd)"
PKG_FFMPEG_V4L2+=" --enable-libudev --enable-v4l2-request"
else
PKG_FFMPEG_V4L2+=" --disable-libudev --disable-v4l2-request"
fi
else
PKG_FFMPEG_V4L2="--disable-v4l2_m2m"
PKG_FFMPEG_V4L2="--disable-v4l2_m2m --disable-libudev --disable-v4l2-request"
fi
if [ "${VAAPI_SUPPORT}" = "yes" ]; then
@ -54,12 +72,6 @@ else
PKG_FFMPEG_VDPAU="--disable-vdpau"
fi
if [ "${PROJECT}" = "Allwinner" -o "${PROJECT}" = "Rockchip" ]; then
PKG_DEPENDS_TARGET+=" libdrm systemd" # systemd is needed for libudev
PKG_NEED_UNPACK+=" $(get_pkg_directory libdrm) $(get_pkg_directory systemd)"
PKG_FFMPEG_V4L2_REQUEST="--enable-v4l2-request --enable-libudev --enable-libdrm"
fi
if build_with_debug; then
PKG_FFMPEG_DEBUG="--enable-debug --disable-stripping"
else
@ -80,6 +92,8 @@ if target_has_feature "(neon|sse)"; then
PKG_DEPENDS_TARGET+=" dav1d"
PKG_NEED_UNPACK+=" $(get_pkg_directory dav1d)"
PKG_FFMPEG_AV1="--enable-libdav1d"
else
PKG_FFMPEG_AV1="--disable-libdav1d"
fi
pre_configure_target() {
@ -141,7 +155,6 @@ configure_target() {
${PKG_FFMPEG_VAAPI} \
${PKG_FFMPEG_VDPAU} \
${PKG_FFMPEG_RPI} \
${PKG_FFMPEG_V4L2_REQUEST} \
--enable-runtime-cpudetect \
--disable-hardcoded-tables \
--disable-encoders \