ffmpeg: update to ffmpeg-e115b34 (4.0-Leia-Alpha-1)

This commit is contained in:
MilhouseVH 2018-05-01 22:09:45 +01:00
parent 42acde68d5
commit d45d201322
4 changed files with 3953 additions and 27485 deletions

View File

@ -17,9 +17,9 @@
################################################################################
PKG_NAME="ffmpeg"
# Current branch is: release/3.4-kodi
PKG_VERSION="f96fd5c"
PKG_SHA256="35ccc07c72b203101030a35b4bb11779365adb7bbf143ef1d68a1f87c781e38b"
# Current branch is: release/4.0-kodi
PKG_VERSION="e115b34"
PKG_SHA256="d9aa2a281f002982474b45980553d3669a8c79021cf08e4cfcff5dd6e8e81268"
PKG_ARCH="any"
PKG_LICENSE="LGPLv2.1+"
PKG_SITE="https://ffmpeg.org"
@ -127,7 +127,6 @@ configure_target() {
--disable-extra-warnings \
--disable-ffprobe \
--disable-ffplay \
--disable-ffserver \
--enable-ffmpeg \
--enable-avdevice \
--enable-avcodec \

View File

@ -1,168 +0,0 @@
From ed4a91d4f4bd7ab99f2be901285b20a0cde52902 Mon Sep 17 00:00:00 2001
From: LongChair <longchair@hotmail.com>
Date: Sat, 6 Jan 2018 09:36:58 +0100
Subject: [PATCH] avcodec/rkmpp : Fix broken build due to missing control
operation
This patch is taking care of https://trac.ffmpeg.org/ticket/6834.
It seems that one of the control operations that was available to get
the free decoders input slots was removed.
There is another control operation to retrieve the used slots. Given
that the input slot count is hardcoded to 4 in mpp at this point,
replacing the old control operation by the other one.
This was tested on Rockchip ROCK64.
Signed-off-by: wm4 <nfxjfg@googlemail.com>
(cherry picked from commit c6f84106366c6f243a8b07dbffcc7880009aa904)
---
configure | 6 ++----
libavcodec/rkmppdec.c | 10 ++++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/configure b/configure
index 1797c5dd4f..4db1c9b73f 100755
--- a/configure
+++ b/configure
@@ -6077,10 +6077,8 @@ enabled openssl && { use_pkg_config openssl openssl openssl/ssl.h OPEN
check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
die "ERROR: openssl not found"; }
-enabled rkmpp && { { require_pkg_config rockchip_mpp rockchip_mpp rockchip/rk_mpi.h mpp_create ||
- die "ERROR : Rockchip MPP was not found."; } &&
- { check_func_headers rockchip/rk_mpi_cmd.h "MPP_DEC_GET_FREE_PACKET_SLOT_COUNT" ||
- die "ERROR: Rockchip MPP is outdated, please get a more recent one."; } &&
+enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
+ require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create &&
{ enabled libdrm ||
die "ERROR: rkmpp requires --enable-libdrm"; }
}
diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c
index bdf4dc4208..ebc021e3d8 100644
--- a/libavcodec/rkmppdec.c
+++ b/libavcodec/rkmppdec.c
@@ -39,6 +39,7 @@
#define RECEIVE_FRAME_TIMEOUT 100
#define FRAMEGROUP_MAX_FRAMES 16
+#define INPUT_MAX_PACKETS 4
typedef struct {
MppCtx ctx;
@@ -514,16 +515,17 @@ static int rkmpp_receive_frame(AVCodecContext *avctx, AVFrame *frame)
RKMPPDecoder *decoder = (RKMPPDecoder *)rk_context->decoder_ref->data;
int ret = MPP_NOK;
AVPacket pkt = {0};
- RK_S32 freeslots;
+ RK_S32 usedslots, freeslots;
if (!decoder->eos_reached) {
// we get the available slots in decoder
- ret = decoder->mpi->control(decoder->ctx, MPP_DEC_GET_FREE_PACKET_SLOT_COUNT, &freeslots);
+ ret = decoder->mpi->control(decoder->ctx, MPP_DEC_GET_STREAM_COUNT, &usedslots);
if (ret != MPP_OK) {
- av_log(avctx, AV_LOG_ERROR, "Failed to get decoder free slots (code = %d).\n", ret);
+ av_log(avctx, AV_LOG_ERROR, "Failed to get decoder used slots (code = %d).\n", ret);
return ret;
}
+ freeslots = INPUT_MAX_PACKETS - usedslots;
if (freeslots > 0) {
ret = ff_decode_get_packet(avctx, &pkt);
if (ret < 0 && ret != AVERROR_EOF) {
@@ -540,7 +542,7 @@ static int rkmpp_receive_frame(AVCodecContext *avctx, AVFrame *frame)
}
// make sure we keep decoder full
- if (freeslots > 1 && decoder->first_frame)
+ if (freeslots > 1)
return AVERROR(EAGAIN);
}
From 617c895d27198bb9391a001932e288d1dfe4f728 Mon Sep 17 00:00:00 2001
From: LongChair <longchair@hotmail.com>
Date: Tue, 2 Jan 2018 12:38:01 +0100
Subject: [PATCH] avcodec/rkmpp : remove stream start retries before first
frame.
those were needed because of some odd mpp behavior that seems to have
been fixed.
Makes the code cleaner.
Signed-off-by: wm4 <nfxjfg@googlemail.com>
(cherry picked from commit 2ca65fc7b74444edd51d5803a2c1e05a801a6023)
---
libavcodec/rkmppdec.c | 24 +++---------------------
1 file changed, 3 insertions(+), 21 deletions(-)
diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c
index ebc021e3d8..9dfeb742ab 100644
--- a/libavcodec/rkmppdec.c
+++ b/libavcodec/rkmppdec.c
@@ -46,7 +46,6 @@ typedef struct {
MppApi *mpi;
MppBufferGroup frame_group;
- char first_frame;
char first_packet;
char eos_reached;
@@ -328,28 +327,14 @@ static int rkmpp_retrieve_frame(AVCodecContext *avctx, AVFrame *frame)
MppBuffer buffer = NULL;
AVDRMFrameDescriptor *desc = NULL;
AVDRMLayerDescriptor *layer = NULL;
- int retrycount = 0;
int mode;
MppFrameFormat mppformat;
uint32_t drmformat;
- // on start of decoding, MPP can return -1, which is supposed to be expected
- // this is due to some internal MPP init which is not completed, that will
- // only happen in the first few frames queries, but should not be interpreted
- // as an error, Therefore we need to retry a couple times when we get -1
- // in order to let it time to complete it's init, then we sleep a bit between retries.
-retry_get_frame:
ret = decoder->mpi->decode_get_frame(decoder->ctx, &mppframe);
- if (ret != MPP_OK && ret != MPP_ERR_TIMEOUT && !decoder->first_frame) {
- if (retrycount < 5) {
- av_log(avctx, AV_LOG_DEBUG, "Failed to get a frame, retrying (code = %d, retrycount = %d)\n", ret, retrycount);
- usleep(10000);
- retrycount++;
- goto retry_get_frame;
- } else {
- av_log(avctx, AV_LOG_ERROR, "Failed to get a frame from MPP (code = %d)\n", ret);
- goto fail;
- }
+ if (ret != MPP_OK && ret != MPP_ERR_TIMEOUT) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to get a frame from MPP (code = %d)\n", ret);
+ goto fail;
}
if (mppframe) {
@@ -365,7 +350,6 @@ retry_get_frame:
avctx->height = mpp_frame_get_height(mppframe);
decoder->mpi->control(decoder->ctx, MPP_DEC_SET_INFO_CHANGE_READY, NULL);
- decoder->first_frame = 1;
av_buffer_unref(&decoder->frames_ref);
@@ -479,7 +463,6 @@ retry_get_frame:
goto fail;
}
- decoder->first_frame = 0;
return 0;
} else {
av_log(avctx, AV_LOG_ERROR, "Failed to retrieve the frame buffer, frame is dropped (code = %d)\n", ret);
@@ -559,7 +542,6 @@ static void rkmpp_flush(AVCodecContext *avctx)
ret = decoder->mpi->reset(decoder->ctx);
if (ret == MPP_OK) {
- decoder->first_frame = 1;
decoder->first_packet = 1;
} else
av_log(avctx, AV_LOG_ERROR, "Failed to reset MPI (code = %d)\n", ret);

View File

@ -1,7 +1,7 @@
From e75d7807cc97b3ddd8d8f6fe2fcf3dc4de58863f Mon Sep 17 00:00:00 2001
From 20af7af23a9f366476e67669f14957dfaf58f141 Mon Sep 17 00:00:00 2001
From: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Sat, 9 Jan 2016 16:34:09 +0100
Subject: [PATCH 1/4] avcodec: add h264_mvc codec id and profiles
Subject: [PATCH 1/3] avcodec: add h264_mvc codec id and profiles
---
libavcodec/avcodec.h | 3 +++
@ -11,10 +11,10 @@ Subject: [PATCH 1/4] avcodec: add h264_mvc codec id and profiles
4 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 6c4b011b5c..8f1f5a3e53 100644
index d962b9cf0a..4c4581c895 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -449,6 +449,8 @@ enum AVCodecID {
@@ -447,6 +447,8 @@ enum AVCodecID {
AV_CODEC_ID_GDV,
AV_CODEC_ID_FITS,
@ -23,7 +23,7 @@ index 6c4b011b5c..8f1f5a3e53 100644
/* various PCM "codecs" */
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
AV_CODEC_ID_PCM_S16LE = 0x10000,
@@ -3318,6 +3320,7 @@ typedef struct AVCodecContext {
@@ -2895,6 +2897,7 @@ typedef struct AVCodecContext {
#define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
#define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
#define FF_PROFILE_H264_CAVLC_444 44
@ -32,12 +32,12 @@ index 6c4b011b5c..8f1f5a3e53 100644
#define FF_PROFILE_VC1_SIMPLE 0
#define FF_PROFILE_VC1_MAIN 1
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 6a13bbbf0e..03ae4838d2 100644
index 79552a910d..b55955476c 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1665,6 +1665,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_LOSSLESS,
.mime_types= MT("image/png"),
@@ -1647,6 +1647,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("FITS (Flexible Image Transport System)"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
},
+ {
+ .id = AV_CODEC_ID_H264_MVC,
@ -50,7 +50,7 @@ index 6a13bbbf0e..03ae4838d2 100644
/* various PCM "codecs" */
{
diff --git a/libavcodec/profiles.c b/libavcodec/profiles.c
index 30498efedf..9d3cf4b535 100644
index d7dc960f36..e4651f12f9 100644
--- a/libavcodec/profiles.c
+++ b/libavcodec/profiles.c
@@ -72,6 +72,7 @@ const AVProfile ff_h264_profiles[] = {
@ -62,7 +62,7 @@ index 30498efedf..9d3cf4b535 100644
};
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 53cbcfb543..f93f06fcfb 100644
index 37a6aa8bff..52c5b659c4 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -701,7 +701,7 @@ static const StreamType ISO_types[] = {
@ -78,31 +78,19 @@ index 53cbcfb543..f93f06fcfb 100644
2.14.1
From 51f6cec0b87840c32482df5d2b09f50d503d2b2b Mon Sep 17 00:00:00 2001
From 0f3fda4e348e6b12570f5d279713f6da46511846 Mon Sep 17 00:00:00 2001
From: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Sat, 9 Jan 2016 16:34:40 +0100
Subject: [PATCH 2/4] h264_parser: add support for parsing h264 mvc NALUs
Subject: [PATCH 2/3] h264_parser: add support for parsing h264 mvc NALUs
---
libavcodec/allcodecs.c | 1 +
libavcodec/h264.h | 2 ++
libavcodec/h264_parser.c | 34 ++++++++++++++++++++++++++++++----
libavcodec/parser.c | 1 +
3 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 5361a22141..a5289a5e14 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -732,6 +732,7 @@ static void register_all(void)
REGISTER_PARSER(H261, h261);
REGISTER_PARSER(H263, h263);
REGISTER_PARSER(H264, h264);
+ REGISTER_PARSER(H264_MVC, h264_mvc);
REGISTER_PARSER(HEVC, hevc);
REGISTER_PARSER(MJPEG, mjpeg);
REGISTER_PARSER(MLP, mlp);
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 86df5eb9b3..22c4f1d82a 100644
index 650580bf3a..c44a0cbedd 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -41,7 +41,9 @@ enum {
@ -114,9 +102,9 @@ index 86df5eb9b3..22c4f1d82a 100644
+ H264_NAL_SLICE_EXT = 20,
};
#endif /* AVCODEC_H264_H */
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index dd0a965af0..855c74896e 100644
index 1a9840a62c..be8b9db9b0 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -62,6 +62,7 @@ typedef struct H264ParseContext {
@ -148,7 +136,7 @@ index dd0a965af0..855c74896e 100644
continue;
}
state = 7;
@@ -594,7 +599,8 @@ static int h264_parse(AVCodecParserContext *s,
@@ -601,7 +606,8 @@ static int h264_parse(AVCodecParserContext *s,
}
}
@ -158,7 +146,7 @@ index dd0a965af0..855c74896e 100644
if (avctx->framerate.num)
avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));
@@ -651,7 +657,7 @@ static int h264_split(AVCodecContext *avctx,
@@ -658,7 +664,7 @@ static int h264_split(AVCodecContext *avctx,
if ((state & 0xFFFFFF00) != 0x100)
break;
nalu_type = state & 0x1F;
@ -167,7 +155,7 @@ index dd0a965af0..855c74896e 100644
has_sps = 1;
} else if (nalu_type == H264_NAL_PPS)
has_pps = 1;
@@ -703,3 +709,23 @@ AVCodecParser ff_h264_parser = {
@@ -710,3 +716,23 @@ AVCodecParser ff_h264_parser = {
.parser_close = h264_close,
.split = h264_split,
};
@ -191,14 +179,26 @@ index dd0a965af0..855c74896e 100644
+ .parser_close = h264_close,
+ .split = h264_split,
+};
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index f43b197d5e..f96e005ef3 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -54,6 +54,7 @@ extern AVCodecParser ff_gsm_parser;
extern AVCodecParser ff_h261_parser;
extern AVCodecParser ff_h263_parser;
extern AVCodecParser ff_h264_parser;
+extern AVCodecParser ff_h264_mvc_parser;
extern AVCodecParser ff_hevc_parser;
extern AVCodecParser ff_mjpeg_parser;
extern AVCodecParser ff_mlp_parser;
--
2.14.1
From 6edab559331e83ad11e7940233dbbaae121e528c Mon Sep 17 00:00:00 2001
From cdd668dc436b9c78dcb31df477e329492356e7ec Mon Sep 17 00:00:00 2001
From: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Tue, 28 Nov 2017 16:12:12 +0000
Subject: [PATCH 3/4] h264_parser: force grabing a new timestamp until a frame
Subject: [PATCH 3/3] h264_parser: force grabing a new timestamp until a frame
start was found
---
@ -206,10 +206,10 @@ Subject: [PATCH 3/4] h264_parser: force grabing a new timestamp until a frame
1 file changed, 3 insertions(+)
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 855c74896e..90a99a19a8 100644
index be8b9db9b0..81c9a1bbae 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -587,6 +587,9 @@ static int h264_parse(AVCodecParserContext *s,
@@ -594,6 +594,9 @@ static int h264_parse(AVCodecParserContext *s,
} else {
next = h264_find_frame_end(p, buf, buf_size, avctx);
@ -222,62 +222,3 @@ index 855c74896e..90a99a19a8 100644
--
2.14.1
From 2263d8d3a16ccf886c3692597331779a726373b5 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Sun, 21 Jan 2018 20:31:31 +0000
Subject: [PATCH 4/4] fixup
---
libavcodec/extract_extradata_bsf.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/libavcodec/extract_extradata_bsf.c b/libavcodec/extract_extradata_bsf.c
index ed6509c681..188e62a42d 100644
--- a/libavcodec/extract_extradata_bsf.c
+++ b/libavcodec/extract_extradata_bsf.c
@@ -56,7 +56,7 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,
HEVC_NAL_VPS, HEVC_NAL_SPS, HEVC_NAL_PPS,
};
static const int extradata_nal_types_h264[] = {
- H264_NAL_SPS, H264_NAL_PPS,
+ H264_NAL_SPS, H264_NAL_SPS_SUBSET, H264_NAL_PPS,
};
ExtractExtradataContext *s = ctx->priv_data;
@@ -88,14 +88,14 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,
if (nal->type == HEVC_NAL_SPS) has_sps = 1;
if (nal->type == HEVC_NAL_VPS) has_vps = 1;
} else {
- if (nal->type == H264_NAL_SPS) has_sps = 1;
+ if (nal->type == H264_NAL_SPS || nal->type == H264_NAL_SPS_SUBSET) has_sps = 1;
}
}
}
if (extradata_size &&
((ctx->par_in->codec_id == AV_CODEC_ID_HEVC && has_sps && has_vps) ||
- (ctx->par_in->codec_id == AV_CODEC_ID_H264 && has_sps))) {
+ ((ctx->par_in->codec_id == AV_CODEC_ID_H264 || ctx->par_in->codec_id == AV_CODEC_ID_H264_MVC) && has_sps))) {
AVBufferRef *filtered_buf;
uint8_t *extradata, *filtered_data;
@@ -247,6 +247,7 @@ static const struct {
} extract_tab[] = {
{ AV_CODEC_ID_CAVS, extract_extradata_mpeg4 },
{ AV_CODEC_ID_H264, extract_extradata_h2645 },
+ { AV_CODEC_ID_H264_MVC, extract_extradata_h2645 },
{ AV_CODEC_ID_HEVC, extract_extradata_h2645 },
{ AV_CODEC_ID_MPEG1VIDEO, extract_extradata_mpeg12 },
{ AV_CODEC_ID_MPEG2VIDEO, extract_extradata_mpeg12 },
@@ -306,6 +307,7 @@ fail:
static const enum AVCodecID codec_ids[] = {
AV_CODEC_ID_CAVS,
AV_CODEC_ID_H264,
+ AV_CODEC_ID_H264_MVC,
AV_CODEC_ID_HEVC,
AV_CODEC_ID_MPEG1VIDEO,
AV_CODEC_ID_MPEG2VIDEO,
--
2.14.1