Skip to content

Commit

Permalink
ffmpeg: Call get_format to fix an issue with MMAL rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Apr 3, 2020
1 parent 10f00bf commit e1ad479
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
From 7adc8f706efab65d8d7e5f960690faca3d5c190d Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Sat, 4 Mar 2017 19:24:02 +0000
Subject: [PATCH] ffmpeg: Call get_format to fix an issue with MMAL rendering

---
libavcodec/dvdec.c | 7 +++++++
libavcodec/rv34.c | 6 +++++-
2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index 0b4c1bc..00081ef 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -49,6 +49,7 @@
#include "internal.h"
#include "put_bits.h"
#include "simple_idct.h"
+#include "thread.h"

typedef struct BlockInfo {
const uint32_t *factor_table;
@@ -196,6 +197,12 @@ static av_cold int dvvideo_decode_init(AVCodecContext *avctx)
s->idct_put[0] = idsp.idct_put;
s->idct_put[1] = ff_simple_idct248_put;

+ static const enum AVPixelFormat pix_fmts[] = {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+ };
+ avctx->pix_fmt = ff_get_format(avctx, pix_fmts);
+
return ff_dvvideo_init(avctx);
}

diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index aca8382..f473f6c 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -1493,7 +1493,11 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
ff_mpv_decode_init(s, avctx);
s->out_format = FMT_H263;

- avctx->pix_fmt = AV_PIX_FMT_YUV420P;
+ static const enum AVPixelFormat pix_fmts[] = {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+ };
+ avctx->pix_fmt = ff_get_format(avctx, pix_fmts);
avctx->has_b_frames = 1;
s->low_delay = 0;

--
2.7.4

2 changes: 2 additions & 0 deletions tools/depends/target/ffmpeg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ include ../../Makefile.include
include FFMPEG-VERSION
DEPS= ../../Makefile.include FFMPEG-VERSION Makefile \
pfcd_hevc_optimisations.patch \
0001-ffmpeg-Call-get_format-to-fix-an-issue-with-MMAL-ren.patch \

# set to "yes" to enable patching
# we don't apply patches until we move to a vanilla ffmpeg tarball
Expand Down Expand Up @@ -82,6 +83,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
cd $(PLATFORM); sed -i".bak" -e "s%pkg_config_default=pkg-config%export PKG_CONFIG_LIBDIR=$(PREFIX)/lib/pkgconfig \&\& pkg_config_default=$(NATIVEPREFIX)/bin/pkg-config%" configure
cd $(PLATFORM); patch -p1 < ../pfcd_hevc_optimisations.patch
cd $(PLATFORM); patch -p1 < ../0001-ffmpeg-Call-get_format-to-fix-an-issue-with-MMAL-ren.patch
cd $(PLATFORM);\
CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \
./configure $(ffmpg_config)
Expand Down

0 comments on commit e1ad479

Please sign in to comment.