mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-02 07:27:49 +00:00
ffmpeg: use popcornmix's V4L2 patches on RPi
sourced from https://github.com/popcornmix/xbmc/blob/gbm/tools/depends/target/ffmpeg/0001-rpi-Add-hevc-acceleration.patch Signed-off-by: Matthias Reichl <hias@horus.com>
This commit is contained in:
parent
c6a853757b
commit
1d02f6e9d5
@ -16,11 +16,28 @@ PKG_BUILD_FLAGS="-gold"
|
|||||||
# Dependencies
|
# Dependencies
|
||||||
get_graphicdrivers
|
get_graphicdrivers
|
||||||
|
|
||||||
|
PKG_FFMPEG_HWACCEL="--enable-hwaccels"
|
||||||
|
|
||||||
if [ "${V4L2_SUPPORT}" = "yes" ]; then
|
if [ "${V4L2_SUPPORT}" = "yes" ]; then
|
||||||
PKG_DEPENDS_TARGET+=" libdrm"
|
PKG_DEPENDS_TARGET+=" libdrm"
|
||||||
PKG_NEED_UNPACK+=" $(get_pkg_directory libdrm)"
|
PKG_NEED_UNPACK+=" $(get_pkg_directory libdrm)"
|
||||||
PKG_PATCH_DIRS+=" v4l2"
|
|
||||||
PKG_FFMPEG_V4L2="--enable-v4l2_m2m --enable-libdrm"
|
PKG_FFMPEG_V4L2="--enable-v4l2_m2m --enable-libdrm"
|
||||||
|
|
||||||
|
if [ "${PROJECT}" = "RPi" ]; then
|
||||||
|
PKG_PATCH_DIRS+=" v4l2-rpi"
|
||||||
|
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
|
||||||
|
else
|
||||||
|
PKG_PATCH_DIRS+=" v4l2"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
PKG_FFMPEG_V4L2="--disable-v4l2_m2m"
|
PKG_FFMPEG_V4L2="--disable-v4l2_m2m"
|
||||||
fi
|
fi
|
||||||
@ -58,6 +75,8 @@ if [ "${KODIPLAYER_DRIVER}" = "bcm2835-driver" ]; then
|
|||||||
PKG_DEPENDS_TARGET+=" bcm2835-driver"
|
PKG_DEPENDS_TARGET+=" bcm2835-driver"
|
||||||
PKG_NEED_UNPACK+=" $(get_pkg_directory bcm2835-driver)"
|
PKG_NEED_UNPACK+=" $(get_pkg_directory bcm2835-driver)"
|
||||||
PKG_PATCH_DIRS+=" rpi-hevc"
|
PKG_PATCH_DIRS+=" rpi-hevc"
|
||||||
|
PKG_FFMPEG_LIBS="-lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lvcsm"
|
||||||
|
PKG_FFMPEG_RPI="--enable-rpi --enable-mmal"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if target_has_feature neon; then
|
if target_has_feature neon; then
|
||||||
@ -79,11 +98,6 @@ fi
|
|||||||
pre_configure_target() {
|
pre_configure_target() {
|
||||||
cd ${PKG_BUILD}
|
cd ${PKG_BUILD}
|
||||||
rm -rf .${TARGET_NAME}
|
rm -rf .${TARGET_NAME}
|
||||||
|
|
||||||
if [ "${KODIPLAYER_DRIVER}" = "bcm2835-driver" ]; then
|
|
||||||
PKG_FFMPEG_LIBS="-lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lvcsm"
|
|
||||||
PKG_FFMPEG_RPI="--enable-rpi"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_target() {
|
configure_target() {
|
||||||
@ -149,7 +163,7 @@ configure_target() {
|
|||||||
--enable-encoder=wmav2 \
|
--enable-encoder=wmav2 \
|
||||||
--enable-encoder=mjpeg \
|
--enable-encoder=mjpeg \
|
||||||
--enable-encoder=png \
|
--enable-encoder=png \
|
||||||
--enable-hwaccels \
|
${PKG_FFMPEG_HWACCEL} \
|
||||||
--disable-muxers \
|
--disable-muxers \
|
||||||
--enable-muxer=spdif \
|
--enable-muxer=spdif \
|
||||||
--enable-muxer=adts \
|
--enable-muxer=adts \
|
||||||
|
@ -0,0 +1,78 @@
|
|||||||
|
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
|
||||||
|
index fd87481a1c..d234271c5b 100644
|
||||||
|
--- a/libavcodec/avcodec.h
|
||||||
|
+++ b/libavcodec/avcodec.h
|
||||||
|
@@ -2612,7 +2612,6 @@ typedef struct AVCodecContext {
|
||||||
|
#define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders.
|
||||||
|
#define FF_BUG_TRUNCATED 16384
|
||||||
|
#define FF_BUG_IEDGE 32768
|
||||||
|
-#define FF_BUG_GMC_UNSUPPORTED (1<<30)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* strictly follow the standard (MPEG-4, ...).
|
||||||
|
diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
|
||||||
|
index 1bbb83eda3..12c63245f8 100644
|
||||||
|
--- a/libavcodec/libdav1d.c
|
||||||
|
+++ b/libavcodec/libdav1d.c
|
||||||
|
@@ -53,16 +53,6 @@ static const enum AVPixelFormat pix_fmt_rgb[3] = {
|
||||||
|
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRP12,
|
||||||
|
};
|
||||||
|
|
||||||
|
-static enum AVPixelFormat libdav1d_get_format(AVCodecContext *avctx, const Dav1dPicture *p)
|
||||||
|
-{
|
||||||
|
- enum AVPixelFormat pix_fmts[2], *fmt = pix_fmts;
|
||||||
|
-
|
||||||
|
- *fmt++ = pix_fmt[p->p.layout][p->seq_hdr->hbd];
|
||||||
|
- *fmt = AV_PIX_FMT_NONE;
|
||||||
|
-
|
||||||
|
- return ff_get_format(avctx, pix_fmts);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
static void libdav1d_log_callback(void *opaque, const char *fmt, va_list vl)
|
||||||
|
{
|
||||||
|
AVCodecContext *c = opaque;
|
||||||
|
@@ -239,7 +229,6 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
|
||||||
|
c->profile = p->seq_hdr->profile;
|
||||||
|
c->level = ((p->seq_hdr->operating_points[0].major_level - 2) << 2)
|
||||||
|
| p->seq_hdr->operating_points[0].minor_level;
|
||||||
|
- frame->format = c->pix_fmt = libdav1d_get_format(c, p);
|
||||||
|
frame->width = p->p.w;
|
||||||
|
frame->height = p->p.h;
|
||||||
|
if (c->width != p->p.w || c->height != p->p.h) {
|
||||||
|
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
|
||||||
|
index fa208660c8..055afabc7e 100644
|
||||||
|
--- a/libavcodec/mpeg4videodec.c
|
||||||
|
+++ b/libavcodec/mpeg4videodec.c
|
||||||
|
@@ -2662,9 +2662,6 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx)
|
||||||
|
|
||||||
|
if (ctx->divx_version >= 0)
|
||||||
|
s->workaround_bugs |= FF_BUG_HPEL_CHROMA;
|
||||||
|
-
|
||||||
|
- if (ctx->num_sprite_warping_points > 1)
|
||||||
|
- s->workaround_bugs |= FF_BUG_GMC_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (s->workaround_bugs & FF_BUG_STD_QPEL) {
|
||||||
|
@@ -2689,7 +2686,6 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx)
|
||||||
|
s->workaround_bugs, ctx->lavc_build, ctx->xvid_build,
|
||||||
|
ctx->divx_version, ctx->divx_build, s->divx_packed ? "p" : "");
|
||||||
|
|
||||||
|
- avctx->workaround_bugs = s->workaround_bugs;
|
||||||
|
if (CONFIG_MPEG4_DECODER && ctx->xvid_build >= 0 &&
|
||||||
|
s->codec_id == AV_CODEC_ID_MPEG4 &&
|
||||||
|
avctx->idct_algo == FF_IDCT_AUTO) {
|
||||||
|
diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
|
||||||
|
index 6fb32fac77..d0df061e4d 100644
|
||||||
|
--- a/libswscale/yuv2rgb.c
|
||||||
|
+++ b/libswscale/yuv2rgb.c
|
||||||
|
@@ -687,6 +687,10 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c)
|
||||||
|
if (t)
|
||||||
|
return t;
|
||||||
|
|
||||||
|
+ av_log(c, AV_LOG_WARNING,
|
||||||
|
+ "No accelerated colorspace conversion found from %s to %s.\n",
|
||||||
|
+ av_get_pix_fmt_name(c->srcFormat), av_get_pix_fmt_name(c->dstFormat));
|
||||||
|
+
|
||||||
|
switch (c->dstFormat) {
|
||||||
|
case AV_PIX_FMT_BGR48BE:
|
||||||
|
case AV_PIX_FMT_BGR48LE:
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user