Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/devel/libcec/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ PKG_CMAKE_OPTS_TARGET="-DBUILD_SHARED_LIBS=1 \
-DHAVE_AOCEC_API=0 -DHAVE_AMLOGIC_API=0 \
-DHAVE_GIT_BIN=0"

if [ "$PROJECT" = "RPi" ]; then
if [ "$KODIPLAYER_DRIVER" = "bcm2835-driver" ]; then
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET bcm2835-driver"
else
PKG_CMAKE_OPTS_TARGET+=" -DHAVE_RPI_LIB=0"
fi

# libX11 and xrandr to read the sink's EDID, used to determine the PC's HDMI physical address
Expand All @@ -35,7 +37,7 @@ else
fi

pre_configure_target() {
if [ "$PROJECT" = "RPi" ]; then
if [ "$KODIPLAYER_DRIVER" = "bcm2835-driver" ]; then
# detecting RPi support fails without -lvchiq_arm
export LDFLAGS="$LDFLAGS -lvchiq_arm"
fi
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
From c7852992ed9c4973e83d961fcf92b6be316e6b60 Mon Sep 17 00:00:00 2001
From: popcornmix <[email protected]>
Date: Mon, 16 Mar 2020 20:38:37 +0000
Subject: [PATCH 1/3] vc4_hdmi: Reduce max pixel rate to hide 4k modes

vc4_hdmi: Increase pixel clock to 162MHz for 1920x1200@60
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 2d608cf9dff9..152c9d8c2898 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -1791,7 +1791,7 @@ static const struct vc4_hdmi_variant bcm2835_variant = {
static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = {
.id = 0,
.audio_available = true,
- .max_pixel_clock = 297000000,
+ .max_pixel_clock = 162000000,
.cec_input_clock = 27000000,
.registers = vc5_hdmi_hdmi0_fields,
.num_registers = ARRAY_SIZE(vc5_hdmi_hdmi0_fields),
@@ -1819,7 +1819,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = {
static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = {
.id = 1,
.audio_available = true,
- .max_pixel_clock = 297000000,
+ .max_pixel_clock = 162000000,
.cec_input_clock = 27000000,
.registers = vc5_hdmi_hdmi1_fields,
.num_registers = ARRAY_SIZE(vc5_hdmi_hdmi1_fields),
--
2.20.1


From cc54619b00f89058791d3211843d043caad0cf0c Mon Sep 17 00:00:00 2001
From: popcornmix <[email protected]>
Date: Tue, 10 Mar 2020 22:19:51 +0000
Subject: [PATCH 2/3] vc4_hdmi: Set channel mapping as expected by kodi

---
drivers/gpu/drm/vc4/vc4_hdmi.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 152c9d8c2898..057595ec853d 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -775,6 +775,10 @@ static u32 vc4_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask)
int i;
u32 channel_map = 0;

+ /* hack: return the mapping expected by kodi until we have a way of configuring this */
+ if (channel_mask == 0xff)
+ return 0xb13f88;
+
for (i = 0; i < 8; i++) {
if (channel_mask & BIT(i))
channel_map |= i << (3 * i);
@@ -787,6 +791,10 @@ static u32 vc5_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask)
int i;
u32 channel_map = 0;

+ /* hack: return the mapping expected by kodi until we have a way of configuring this */
+ if (channel_mask == 0xff)
+ return 0x54237610;
+
for (i = 0; i < 8; i++) {
if (channel_mask & BIT(i))
channel_map |= i << (4 * i);
--
2.20.1


From c8d2ab620ecb95cd12708876000a76fc003990bb Mon Sep 17 00:00:00 2001
From: popcornmix <[email protected]>
Date: Tue, 10 Mar 2020 23:07:11 +0000
Subject: [PATCH 3/3] vc4_hdmi: Set channel_allocation to something plausible

---
drivers/gpu/drm/vc4/vc4_hdmi.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 057595ec853d..2a733ab5343c 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -329,6 +329,17 @@ static void vc4_hdmi_set_spd_infoframe(struct drm_encoder *encoder)

static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder)
{
+ static const u8 cea_map[] = {
+ 0xff, // 0
+ 0xff, // 1
+ 0x00, // 2.0
+ 0x01, // 2.1
+ 0x03, // 3.1
+ 0x09, // 4.1
+ 0x0b, // 5.1
+ 0x12, // 7.0
+ 0x13, // 7.1
+ };
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
union hdmi_infoframe frame;
int ret;
@@ -339,6 +350,10 @@ static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder)
frame.audio.sample_frequency = HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM;
frame.audio.sample_size = HDMI_AUDIO_SAMPLE_SIZE_STREAM;
frame.audio.channels = vc4_hdmi->audio.channels;
+ if (frame.audio.channels < 2 || frame.audio.channels > 8)
+ DRM_ERROR("Unable to map channels: %d\n", frame.audio.channels);
+ else
+ frame.audio.channel_allocation = cea_map[frame.audio.channels];

vc4_hdmi_write_infoframe(encoder, &frame);
}
--
2.20.1

28 changes: 21 additions & 7 deletions packages/multimedia/ffmpeg/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,28 @@ PKG_BUILD_FLAGS="-gold"
# Dependencies
get_graphicdrivers

PKG_FFMPEG_HWACCEL="--enable-hwaccels"

if [ "${V4L2_SUPPORT}" = "yes" ]; then
PKG_DEPENDS_TARGET+=" libdrm"
PKG_NEED_UNPACK+=" $(get_pkg_directory libdrm)"
PKG_PATCH_DIRS+=" v4l2"
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
PKG_FFMPEG_V4L2="--disable-v4l2_m2m"
fi
Expand Down Expand Up @@ -58,6 +75,8 @@ if [ "${KODIPLAYER_DRIVER}" = "bcm2835-driver" ]; then
PKG_DEPENDS_TARGET+=" bcm2835-driver"
PKG_NEED_UNPACK+=" $(get_pkg_directory bcm2835-driver)"
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

if target_has_feature neon; then
Expand All @@ -79,11 +98,6 @@ fi
pre_configure_target() {
cd ${PKG_BUILD}
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() {
Expand Down Expand Up @@ -149,7 +163,7 @@ configure_target() {
--enable-encoder=wmav2 \
--enable-encoder=mjpeg \
--enable-encoder=png \
--enable-hwaccels \
${PKG_FFMPEG_HWACCEL} \
--disable-muxers \
--enable-muxer=spdif \
--enable-muxer=adts \
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Loading