From 57f424f50a0f3b32607f3eed68188429f4990202 Mon Sep 17 00:00:00 2001 From: Markham Date: Wed, 6 Oct 2021 14:27:25 +0200 Subject: [PATCH] bumb version ffmpeg-4.4 & bzip2-1.0.8 --- archive-patches/bzip2.patch | 40 +++++ .../3.3}/ffmpeg-3.3-aac.patch | 0 .../3.3}/ffmpeg-3.3-add_dash_demux.patch | 0 ...allow_to_choose_rtmp_impl_at_runtime.patch | 0 .../3.3}/ffmpeg-3.3-buffer-size.patch | 0 .../ffmpeg-3.3-chunked_transfer_fix_eof.patch | 0 .../ffmpeg-3.3-fix-edit-list-parsing.patch | 0 .../3.3}/ffmpeg-3.3-fix-hls.patch | 0 .../3.3}/ffmpeg-3.3-fix_mpegts.patch | 0 .../3.3}/ffmpeg-3.3-hls_replace_key_uri.patch | 0 ...-x86-yuv2rgb-Fix-build-without-SSSE3.patch | 43 +++++ ...264-skip-decode-if-pic-has-no-slices.patch | 36 ++++ .../4.4/0003-libavutil-Fix-mips-build.patch | 72 ++++++++ ...igure-add-extralibs-to-extralibs_xxx.patch | 47 +++++ .../ffmpeg-arm/4.4/ffmpeg-4.4-INT64-fix.patch | 17 ++ .../ffmpeg-arm/4.4/ffmpeg-4.4-dxva2.patch | 94 ++++++++++ .../ffmpeg-4.4-fix_edit_list_parsing.patch} | 2 +- .../4.4/ffmpeg-4.4-fix_mpegts.patch} | 2 +- .../4.4/ffmpeg-4.4-hls_replace_key_uri.patch} | 18 +- .../4.4/ffmpeg-4.4-increase_buffer_size.patch | 30 ++++ ...e-assembly-with-full-path-from-sourc.patch | 97 ++++++++++ .../4.4/ffmpeg-4.4-mips64_cpu_detection.patch | 32 ++++ .../4.4/ffmpeg-4.4-optimize_aac.patch} | 10 +- .../ffmpeg-4.4-recheck_discard_flags.patch} | 2 +- .../ffmpeg-arm/4.4/ffmpeg-4.4-rtsp.patch | 53 ++++++ .../ffmpeg-arm/4.4/replay_dash.patch | 11 ++ ...allow_to_choose_rtmp_impl_at_runtime.patch | 126 ------------- .../ffmpeg-07-increase_buffer_size.patch | 91 ---------- .../ffmpeg/ffmpeg-mips64_cpu_detection.patch | 30 ---- make/archives.mk | 3 + make/ffmpeg.mk | 168 ++++++++---------- make/libraries.mk | 15 ++ make/versions.mk | 7 +- 33 files changed, 685 insertions(+), 361 deletions(-) create mode 100644 archive-patches/bzip2.patch rename archive-patches/{ffmpeg => ffmpeg-arm/3.3}/ffmpeg-3.3-aac.patch (100%) rename archive-patches/{ffmpeg => ffmpeg-arm/3.3}/ffmpeg-3.3-add_dash_demux.patch (100%) rename archive-patches/{ffmpeg => ffmpeg-arm/3.3}/ffmpeg-3.3-allow_to_choose_rtmp_impl_at_runtime.patch (100%) rename archive-patches/{ffmpeg => ffmpeg-arm/3.3}/ffmpeg-3.3-buffer-size.patch (100%) rename archive-patches/{ffmpeg => ffmpeg-arm/3.3}/ffmpeg-3.3-chunked_transfer_fix_eof.patch (100%) rename archive-patches/{ffmpeg => ffmpeg-arm/3.3}/ffmpeg-3.3-fix-edit-list-parsing.patch (100%) rename archive-patches/{ffmpeg => ffmpeg-arm/3.3}/ffmpeg-3.3-fix-hls.patch (100%) rename archive-patches/{ffmpeg => ffmpeg-arm/3.3}/ffmpeg-3.3-fix_mpegts.patch (100%) rename archive-patches/{ffmpeg => ffmpeg-arm/3.3}/ffmpeg-3.3-hls_replace_key_uri.patch (100%) create mode 100644 archive-patches/ffmpeg-arm/4.4/0001-swscale-x86-yuv2rgb-Fix-build-without-SSSE3.patch create mode 100644 archive-patches/ffmpeg-arm/4.4/0002-avcodec-vaapi_h264-skip-decode-if-pic-has-no-slices.patch create mode 100644 archive-patches/ffmpeg-arm/4.4/0003-libavutil-Fix-mips-build.patch create mode 100644 archive-patches/ffmpeg-arm/4.4/0004-configure-add-extralibs-to-extralibs_xxx.patch create mode 100644 archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-INT64-fix.patch create mode 100644 archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-dxva2.patch rename archive-patches/{ffmpeg/ffmpeg-09-fix_edit_list_parsing.patch => ffmpeg-arm/4.4/ffmpeg-4.4-fix_edit_list_parsing.patch} (88%) rename archive-patches/{ffmpeg/ffmpeg-02-fix_mpegts.patch => ffmpeg-arm/4.4/ffmpeg-4.4-fix_mpegts.patch} (78%) rename archive-patches/{ffmpeg/ffmpeg-04-hls_replace_key_uri.patch => ffmpeg-arm/4.4/ffmpeg-4.4-hls_replace_key_uri.patch} (72%) create mode 100644 archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-increase_buffer_size.patch create mode 100644 archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-libavutil-include-assembly-with-full-path-from-sourc.patch create mode 100644 archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-mips64_cpu_detection.patch rename archive-patches/{ffmpeg/ffmpeg-06-optimize_aac.patch => ffmpeg-arm/4.4/ffmpeg-4.4-optimize_aac.patch} (82%) rename archive-patches/{ffmpeg/ffmpeg-08-recheck_discard_flags.patch => ffmpeg-arm/4.4/ffmpeg-4.4-recheck_discard_flags.patch} (94%) create mode 100644 archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-rtsp.patch create mode 100644 archive-patches/ffmpeg-arm/4.4/replay_dash.patch delete mode 100644 archive-patches/ffmpeg/ffmpeg-03-allow_to_choose_rtmp_impl_at_runtime.patch delete mode 100644 archive-patches/ffmpeg/ffmpeg-07-increase_buffer_size.patch delete mode 100644 archive-patches/ffmpeg/ffmpeg-mips64_cpu_detection.patch diff --git a/archive-patches/bzip2.patch b/archive-patches/bzip2.patch new file mode 100644 index 0000000..324e9a8 --- /dev/null +++ b/archive-patches/bzip2.patch @@ -0,0 +1,40 @@ +--- a/Makefile-libbz2_so ++++ b/Makefile-libbz2_so +@@ -22,9 +22,8 @@ + + + SHELL=/bin/sh +-CC=gcc + BIGFILES=-D_FILE_OFFSET_BITS=64 +-CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES) ++CFLAGS=-fpic -fPIC -Wall -pipe -Os -g0 $(BIGFILES) + + OBJS= blocksort.o \ + huffman.o \ +@@ -35,7 +34,7 @@ + bzlib.o + + all: $(OBJS) +- $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS) ++ $(CC) $(CFLAGS) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS) + $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8 + rm -f libbz2.so.1.0 + ln -s libbz2.so.1.0.8 libbz2.so.1.0 +@@ -57,3 +56,17 @@ + $(CC) $(CFLAGS) -c decompress.c + bzlib.o: bzlib.c + $(CC) $(CFLAGS) -c bzlib.c ++ ++install: ++ if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi ++ cp -f bzip2-shared $(PREFIX)/bin/bzip2 ++ chmod a+x $(PREFIX)/bin/bzip2 ++ if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi ++ cp -f bzlib.h $(PREFIX)/include ++ chmod a+r $(PREFIX)/include/bzlib.h ++ if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi ++ cp -f libbz2.so.1.0.8 $(PREFIX)/lib ++ chmod a+r $(PREFIX)/lib/libbz2.so.1.0.8 ++ ln -sf libbz2.so.1.0.8 $(PREFIX)/lib/libbz2.so.1.0 ++ ln -sf libbz2.so.1.0.8 $(PREFIX)/lib/libbz2.so.1 ++ ln -sf libbz2.so.1.0.8 $(PREFIX)/lib/libbz2.so diff --git a/archive-patches/ffmpeg/ffmpeg-3.3-aac.patch b/archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-aac.patch similarity index 100% rename from archive-patches/ffmpeg/ffmpeg-3.3-aac.patch rename to archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-aac.patch diff --git a/archive-patches/ffmpeg/ffmpeg-3.3-add_dash_demux.patch b/archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-add_dash_demux.patch similarity index 100% rename from archive-patches/ffmpeg/ffmpeg-3.3-add_dash_demux.patch rename to archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-add_dash_demux.patch diff --git a/archive-patches/ffmpeg/ffmpeg-3.3-allow_to_choose_rtmp_impl_at_runtime.patch b/archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-allow_to_choose_rtmp_impl_at_runtime.patch similarity index 100% rename from archive-patches/ffmpeg/ffmpeg-3.3-allow_to_choose_rtmp_impl_at_runtime.patch rename to archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-allow_to_choose_rtmp_impl_at_runtime.patch diff --git a/archive-patches/ffmpeg/ffmpeg-3.3-buffer-size.patch b/archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-buffer-size.patch similarity index 100% rename from archive-patches/ffmpeg/ffmpeg-3.3-buffer-size.patch rename to archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-buffer-size.patch diff --git a/archive-patches/ffmpeg/ffmpeg-3.3-chunked_transfer_fix_eof.patch b/archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-chunked_transfer_fix_eof.patch similarity index 100% rename from archive-patches/ffmpeg/ffmpeg-3.3-chunked_transfer_fix_eof.patch rename to archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-chunked_transfer_fix_eof.patch diff --git a/archive-patches/ffmpeg/ffmpeg-3.3-fix-edit-list-parsing.patch b/archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-fix-edit-list-parsing.patch similarity index 100% rename from archive-patches/ffmpeg/ffmpeg-3.3-fix-edit-list-parsing.patch rename to archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-fix-edit-list-parsing.patch diff --git a/archive-patches/ffmpeg/ffmpeg-3.3-fix-hls.patch b/archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-fix-hls.patch similarity index 100% rename from archive-patches/ffmpeg/ffmpeg-3.3-fix-hls.patch rename to archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-fix-hls.patch diff --git a/archive-patches/ffmpeg/ffmpeg-3.3-fix_mpegts.patch b/archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-fix_mpegts.patch similarity index 100% rename from archive-patches/ffmpeg/ffmpeg-3.3-fix_mpegts.patch rename to archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-fix_mpegts.patch diff --git a/archive-patches/ffmpeg/ffmpeg-3.3-hls_replace_key_uri.patch b/archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-hls_replace_key_uri.patch similarity index 100% rename from archive-patches/ffmpeg/ffmpeg-3.3-hls_replace_key_uri.patch rename to archive-patches/ffmpeg-arm/3.3/ffmpeg-3.3-hls_replace_key_uri.patch diff --git a/archive-patches/ffmpeg-arm/4.4/0001-swscale-x86-yuv2rgb-Fix-build-without-SSSE3.patch b/archive-patches/ffmpeg-arm/4.4/0001-swscale-x86-yuv2rgb-Fix-build-without-SSSE3.patch new file mode 100644 index 0000000..951ce41 --- /dev/null +++ b/archive-patches/ffmpeg-arm/4.4/0001-swscale-x86-yuv2rgb-Fix-build-without-SSSE3.patch @@ -0,0 +1,43 @@ +From bf8eae2d30a205bb76ac625e04c0351106981b9e Mon Sep 17 00:00:00 2001 +From: Parker Ernest <@> +Date: Sun, 23 Feb 2020 13:22:42 +0100 +Subject: [PATCH] swscale/x86/yuv2rgb: Fix build without SSSE3 + +commit fc6a5883d6af8cae0e96af84dda0ad74b360a084 breaks build on +x86_64 CPUs which do not have SSSE3, e.g. AMD Phenom-II + +Signed-off-by: Michael Niedermayer +[bernd.kuhls@t-online.de: + - retrieved from upstream patchwork: + https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200223122256.23402-1-michael@niedermayer.cc/ +] +Signed-off-by: Bernd Kuhls +[yann.morin.1998@free.fr: fix reference top patchwork and SoB order] +Signed-off-by: Yann E. MORIN +--- + libswscale/x86/yuv2rgb.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/libswscale/x86/yuv2rgb.c b/libswscale/x86/yuv2rgb.c +index c12e88cbb5..4791e5b93a 100644 +--- a/libswscale/x86/yuv2rgb.c ++++ b/libswscale/x86/yuv2rgb.c +@@ -83,6 +83,7 @@ av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c) + #if HAVE_X86ASM + int cpu_flags = av_get_cpu_flags(); + ++#if HAVE_SSSE3 + if (EXTERNAL_SSSE3(cpu_flags)) { + switch (c->dstFormat) { + case AV_PIX_FMT_RGB32: +@@ -111,6 +112,7 @@ av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c) + return yuv420_rgb15_ssse3; + } + } ++#endif + + if (EXTERNAL_MMXEXT(cpu_flags)) { + switch (c->dstFormat) { +-- +2.26.2 + diff --git a/archive-patches/ffmpeg-arm/4.4/0002-avcodec-vaapi_h264-skip-decode-if-pic-has-no-slices.patch b/archive-patches/ffmpeg-arm/4.4/0002-avcodec-vaapi_h264-skip-decode-if-pic-has-no-slices.patch new file mode 100644 index 0000000..2892df9 --- /dev/null +++ b/archive-patches/ffmpeg-arm/4.4/0002-avcodec-vaapi_h264-skip-decode-if-pic-has-no-slices.patch @@ -0,0 +1,36 @@ +From 2c6b3f357331e203ad87214984661c40704aceb7 Mon Sep 17 00:00:00 2001 +From: Rainer Hochecker +Date: Sat, 26 Jan 2019 19:48:35 +0100 +Subject: [PATCH] avcodec/vaapi_h264: skip decode if pic has no slices + +This fixes / workarounds https://bugs.freedesktop.org/show_bug.cgi?id=105368. +It was hit frequently when watching h264 channels received via DVB-X. +Corresponding kodi bug: https://github.com/xbmc/xbmc/issues/15704 + +Downloaded from Kodi ffmpeg repo: +https://github.com/xbmc/FFmpeg/commit/2c6b3f357331e203ad87214984661c40704aceb7 + +Patch was sent upstream: +http://ffmpeg.org/pipermail/ffmpeg-devel/2019-March/240863.html + +Signed-off-by: Bernd Kuhls +--- + libavcodec/vaapi_h264.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c +index dd2a6571604..e521a05c4ff 100644 +--- a/libavcodec/vaapi_h264.c ++++ b/libavcodec/vaapi_h264.c +@@ -314,6 +314,11 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx) + H264SliceContext *sl = &h->slice_ctx[0]; + int ret; + ++ if (pic->nb_slices == 0) { ++ ret = AVERROR_INVALIDDATA; ++ goto finish; ++ } ++ + ret = ff_vaapi_decode_issue(avctx, pic); + if (ret < 0) + goto finish; diff --git a/archive-patches/ffmpeg-arm/4.4/0003-libavutil-Fix-mips-build.patch b/archive-patches/ffmpeg-arm/4.4/0003-libavutil-Fix-mips-build.patch new file mode 100644 index 0000000..8b81e66 --- /dev/null +++ b/archive-patches/ffmpeg-arm/4.4/0003-libavutil-Fix-mips-build.patch @@ -0,0 +1,72 @@ +From 6e8daf0d502a2a822f1f08f42368d7d676dc1a9e Mon Sep 17 00:00:00 2001 +From: Bernd Kuhls +Date: Sun, 6 Jun 2021 08:54:53 +0200 +Subject: [PATCH] libavutil: Fix mips build + +Check for sys/auxv.h because not all toolchains contain this header. + +Fixes https://trac.ffmpeg.org/ticket/9138 + +Patch sent upstream: +http://ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281272.html + +Signed-off-by: Bernd Kuhls +--- + configure | 2 ++ + libavutil/mips/cpu.c | 6 +++--- + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/configure b/configure +index 6bfd98b384..773a7d516c 100755 +--- a/configure ++++ b/configure +@@ -2161,6 +2161,7 @@ HEADERS_LIST=" + opencv2_core_core_c_h + OpenGL_gl3_h + poll_h ++ sys_auxv_h + sys_param_h + sys_resource_h + sys_select_h +@@ -6218,6 +6219,7 @@ check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepa + check_headers windows.h + check_headers X11/extensions/XvMClib.h + check_headers asm/types.h ++check_headers sys/auxv.h + + # it seems there are versions of clang in some distros that try to use the + # gcc headers, which explodes for stdatomic +diff --git a/libavutil/mips/cpu.c b/libavutil/mips/cpu.c +index 59619d54de..19196de50b 100644 +--- a/libavutil/mips/cpu.c ++++ b/libavutil/mips/cpu.c +@@ -19,7 +19,7 @@ + #include "libavutil/cpu.h" + #include "libavutil/cpu_internal.h" + #include "config.h" +-#if defined __linux__ || defined __ANDROID__ ++#if (defined __linux__ || defined __ANDROID__) && HAVE_SYS_AUXV_H + #include + #include + #include +@@ -28,7 +28,7 @@ + #include "libavutil/avstring.h" + #endif + +-#if defined __linux__ || defined __ANDROID__ ++#if (defined __linux__ || defined __ANDROID__) && HAVE_SYS_AUXV_H + + #define HWCAP_LOONGSON_CPUCFG (1 << 14) + +@@ -105,7 +105,7 @@ static int cpu_flags_cpuinfo(void) + + int ff_get_cpu_flags_mips(void) + { +-#if defined __linux__ || defined __ANDROID__ ++#if (defined __linux__ || defined __ANDROID__) && HAVE_SYS_AUXV_H + if (cpucfg_available()) + return cpu_flags_cpucfg(); + else +-- +2.29.2 + diff --git a/archive-patches/ffmpeg-arm/4.4/0004-configure-add-extralibs-to-extralibs_xxx.patch b/archive-patches/ffmpeg-arm/4.4/0004-configure-add-extralibs-to-extralibs_xxx.patch new file mode 100644 index 0000000..dbc19c1 --- /dev/null +++ b/archive-patches/ffmpeg-arm/4.4/0004-configure-add-extralibs-to-extralibs_xxx.patch @@ -0,0 +1,47 @@ +From 0c288853630b7b4e004774c39945d4a804afcfa8 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Fri, 6 Aug 2021 09:17:20 +0200 +Subject: [PATCH] configure: add extralibs to extralibs_xxx + +Add extralibs to extralibs_xxx (e.g. extralibs_avformat) to allow +applications such as motion to retrieve ffmpeg dependencies such as +-latomic through pkg-config + +Signed-off-by: Fabrice Fontaine +[Upstream status: not upstreamable] +--- + configure | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/configure b/configure +index 0bb3a7cf2b..3bda99e415 100755 +--- a/configure ++++ b/configure +@@ -7602,15 +7602,15 @@ rpath=$(enabled rpath && echo "-Wl,-rpath,\${libdir}") + source_path=${source_path} + LIBPREF=${LIBPREF} + LIBSUF=${LIBSUF} +-extralibs_avutil="$avutil_extralibs" +-extralibs_avcodec="$avcodec_extralibs" +-extralibs_avformat="$avformat_extralibs" +-extralibs_avdevice="$avdevice_extralibs" +-extralibs_avfilter="$avfilter_extralibs" +-extralibs_avresample="$avresample_extralibs" +-extralibs_postproc="$postproc_extralibs" +-extralibs_swscale="$swscale_extralibs" +-extralibs_swresample="$swresample_extralibs" ++extralibs_avutil="$avutil_extralibs $extralibs" ++extralibs_avcodec="$avcodec_extralibs $extralibs" ++extralibs_avformat="$avformat_extralibs $extralibs" ++extralibs_avdevice="$avdevice_extralibs $extralibs" ++extralibs_avfilter="$avfilter_extralibs $extralibs" ++extralibs_avresample="$avresample_extralibs $extralibs" ++extralibs_postproc="$postproc_extralibs $extralibs" ++extralibs_swscale="$swscale_extralibs $extralibs" ++extralibs_swresample="$swresample_extralibs $extralibs" + EOF + + for lib in $LIBRARY_LIST; do +-- +2.30.2 + diff --git a/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-INT64-fix.patch b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-INT64-fix.patch new file mode 100644 index 0000000..37cc437 --- /dev/null +++ b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-INT64-fix.patch @@ -0,0 +1,17 @@ +--- a/libavutil/common.h_org 2020-05-16 14:06:14.551152997 +0200 ++++ b/libavutil/common.h 2020-05-17 18:59:28.020443989 +0200 +@@ -30,6 +30,14 @@ + #error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS + #endif + ++#ifndef INT64_MAX ++#define INT64_MAX 0x7fffffffffffffffLL ++#endif ++ ++#ifndef INT64_MIN ++#define INT64_MIN (-INT64_MAX - 1LL) ++#endif ++ + #include + #include + #include diff --git a/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-dxva2.patch b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-dxva2.patch new file mode 100644 index 0000000..de245df --- /dev/null +++ b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-dxva2.patch @@ -0,0 +1,94 @@ +--- a/libavcodec/dxva2.c ++++ b/libavcodec/dxva2.c +@@ -777,16 +777,18 @@ + #if CONFIG_D3D11VA + if (avctx->pix_fmt == AV_PIX_FMT_D3D11) + return (intptr_t)frame->data[1]; +- if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) { ++ if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD && surface) { + D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc; + ID3D11VideoDecoderOutputView_GetDesc((ID3D11VideoDecoderOutputView*) surface, &viewDesc); + return viewDesc.Texture2D.ArraySlice; + } + #endif + #if CONFIG_DXVA2 +- for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) { +- if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD && ctx->dxva2.surface[i] == surface) +- return i; ++ if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD) { ++ for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) { ++ if (ctx->dxva2.surface[i] == surface) ++ return i; ++ } + } + #endif + +--- a/libavcodec/dxva2_h264.c ++++ b/libavcodec/dxva2_h264.c +@@ -504,6 +504,14 @@ + + if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) + return -1; ++ ++ // Wait for an I-frame before start decoding. Workaround for ATI UVD and UVD+ GPUs ++ if (!h->got_first_iframe) { ++ if (!(ctx_pic->pp.wBitFields & (1 << 15))) ++ return -1; ++ h->got_first_iframe = 1; ++ } ++ + ret = ff_dxva2_common_end_frame(avctx, h->cur_pic_ptr->f, + &ctx_pic->pp, sizeof(ctx_pic->pp), + &ctx_pic->qm, sizeof(ctx_pic->qm), +--- a/libavcodec/h264_slice.c ++++ b/libavcodec/h264_slice.c +@@ -942,6 +942,7 @@ + + h->first_field = 0; + h->prev_interlaced_frame = 1; ++ h->got_first_iframe = 0; + + init_scan_tables(h); + ret = ff_h264_alloc_tables(h); +--- a/libavcodec/h264dec.c ++++ b/libavcodec/h264dec.c +@@ -442,6 +442,7 @@ + + h->next_outputed_poc = INT_MIN; + h->prev_interlaced_frame = 1; ++ h->got_first_iframe = 0; + idr(h); + + h->poc.prev_frame_num = -1; +--- a/libavcodec/h264dec.h ++++ b/libavcodec/h264dec.h +@@ -540,6 +540,8 @@ + * slices) anymore */ + int setup_finished; + ++ int got_first_iframe; ++ + int cur_chroma_format_idc; + int cur_bit_depth_luma; + int16_t slice_row[MAX_SLICES]; ///< to detect when MAX_SLICES is too low +--- a/libavformat/bintext.c ++++ b/libavformat/bintext.c +@@ -149,7 +149,7 @@ + return AVPROBE_SCORE_EXTENSION + 1; + + predict_width(&par, p->buf_size, got_width); +- if (par.width < 8) ++ if (par.width <= 0) + return 0; + calculate_height(&par, p->buf_size); + if (par.height <= 0) +@@ -195,8 +195,6 @@ + next_tag_read(s, &bin->fsize); + if (!bin->width) { + predict_width(st->codecpar, bin->fsize, got_width); +- if (st->codecpar->width < 8) +- return AVERROR_INVALIDDATA; + calculate_height(st->codecpar, bin->fsize); + } + avio_seek(pb, 0, SEEK_SET); + diff --git a/archive-patches/ffmpeg/ffmpeg-09-fix_edit_list_parsing.patch b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-fix_edit_list_parsing.patch similarity index 88% rename from archive-patches/ffmpeg/ffmpeg-09-fix_edit_list_parsing.patch rename to archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-fix_edit_list_parsing.patch index a182401..007f79c 100644 --- a/archive-patches/ffmpeg/ffmpeg-09-fix_edit_list_parsing.patch +++ b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-fix_edit_list_parsing.patch @@ -1,6 +1,6 @@ --- a/libavformat/mov.c +++ b/libavformat/mov.c -@@ -3558,8 +3558,10 @@ static void mov_fix_index(MOVContext *mov, AVStream *st) +@@ -3634,8 +3634,10 @@ if (ctts_data_old && ctts_index_old < ctts_count_old) { curr_ctts = ctts_data_old[ctts_index_old].duration; diff --git a/archive-patches/ffmpeg/ffmpeg-02-fix_mpegts.patch b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-fix_mpegts.patch similarity index 78% rename from archive-patches/ffmpeg/ffmpeg-02-fix_mpegts.patch rename to archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-fix_mpegts.patch index 83c7feb..5867d57 100644 --- a/archive-patches/ffmpeg/ffmpeg-02-fix_mpegts.patch +++ b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-fix_mpegts.patch @@ -1,6 +1,6 @@ --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c -@@ -1014,10 +1014,12 @@ static int new_pes_packet(PESContext *pes, AVPacket *pkt) +@@ -1018,10 +1018,12 @@ pes->buffer = NULL; reset_pes_packet_state(pes); diff --git a/archive-patches/ffmpeg/ffmpeg-04-hls_replace_key_uri.patch b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-hls_replace_key_uri.patch similarity index 72% rename from archive-patches/ffmpeg/ffmpeg-04-hls_replace_key_uri.patch rename to archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-hls_replace_key_uri.patch index f5e1101..21a11f2 100644 --- a/archive-patches/ffmpeg/ffmpeg-04-hls_replace_key_uri.patch +++ b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-hls_replace_key_uri.patch @@ -1,21 +1,21 @@ --- a/libavformat/hls.c +++ b/libavformat/hls.c -@@ -207,6 +207,8 @@ typedef struct HLSContext { - int max_reload; +@@ -212,6 +212,8 @@ int http_persistent; int http_multiple; + int http_seekable; + char *key_uri_replace_old; + char *key_uri_replace_new; AVIOContext *playlist_pb; } HLSContext; -@@ -1205,8 +1207,16 @@ static int open_input(HLSContext *c, struct playlist *pls, struct segment *seg, +@@ -1250,8 +1252,16 @@ } else if (seg->key_type == KEY_AES_128) { char iv[33], key[33], url[MAX_URL_SIZE]; if (strcmp(seg->key, pls->key_url)) { + char *key_url = NULL; AVIOContext *pb = NULL; -- if (open_url(pls->parent, &pb, seg->key, c->avio_opts, opts, NULL) == 0) { +- if (open_url(pls->parent, &pb, seg->key, &c->avio_opts, opts, NULL) == 0) { + if (NULL != c->key_uri_replace_old && \ + NULL != c-> key_uri_replace_new && \ + '\0' != c->key_uri_replace_old[0]) { @@ -23,11 +23,11 @@ + } else { + key_url = seg->key; + } -+ if (open_url(pls->parent, &pb, key_url, c->avio_opts, opts, NULL) == 0) { ++ if (open_url(pls->parent, &pb, key_url, &c->avio_opts, opts, NULL) == 0) { ret = avio_read(pb, pls->key, sizeof(pls->key)); if (ret != sizeof(pls->key)) { av_log(pls->parent, AV_LOG_ERROR, "Unable to read key file %s\n", -@@ -1218,6 +1228,8 @@ static int open_input(HLSContext *c, struct playlist *pls, struct segment *seg, +@@ -1263,6 +1273,8 @@ seg->key); } av_strlcpy(pls->key_url, seg->key, sizeof(pls->key_url)); @@ -36,10 +36,10 @@ } ff_data_to_hex(iv, seg->iv, sizeof(seg->iv), 0); ff_data_to_hex(key, pls->key, sizeof(pls->key), 0); -@@ -2319,6 +2331,8 @@ static const AVOption hls_options[] = { - OFFSET(http_persistent), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS }, - {"http_multiple", "Use multiple HTTP connections for fetching segments", +@@ -2399,6 +2411,8 @@ OFFSET(http_multiple), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, FLAGS}, + {"http_seekable", "Use HTTP partial requests, 0 = disable, 1 = enable, -1 = auto", + OFFSET(http_seekable), AV_OPT_TYPE_BOOL, { .i64 = -1}, -1, 1, FLAGS}, + { "key_uri_old", "allow to replace part of AES key uri - old", OFFSET(key_uri_replace_old), AV_OPT_TYPE_STRING, { .str = "" }, 0, 0, FLAGS }, + { "key_uri_new", "allow to replace part of AES key uri - new", OFFSET(key_uri_replace_new), AV_OPT_TYPE_STRING, { .str = "" }, 0, 0, FLAGS }, {NULL} diff --git a/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-increase_buffer_size.patch b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-increase_buffer_size.patch new file mode 100644 index 0000000..b51df0a --- /dev/null +++ b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-increase_buffer_size.patch @@ -0,0 +1,30 @@ +--- a/libavformat/aviobuf.c ++++ b/libavformat/aviobuf.c +@@ -33,7 +33,7 @@ + #include "url.h" + #include + +-#define IO_BUFFER_SIZE 32768 ++#define IO_BUFFER_SIZE 262144 + + /** + * Do seeks within this distance ahead of the current buffer by skipping +@@ -556,15 +556,15 @@ + } + + /* make buffer smaller in case it ended up large after probing */ +- if (s->read_packet && s->orig_buffer_size && s->buffer_size > s->orig_buffer_size && len >= s->orig_buffer_size) { ++ if (s->read_packet && s->buffer_size > max_buffer_size) { + if (dst == s->buffer && s->buf_ptr != dst) { +- int ret = ffio_set_buf_size(s, s->orig_buffer_size); ++ int ret = ffio_set_buf_size(s, max_buffer_size); + if (ret < 0) + av_log(s, AV_LOG_WARNING, "Failed to decrease buffer size\n"); + + s->checksum_ptr = dst = s->buffer; + } +- len = s->orig_buffer_size; ++ len = max_buffer_size; + } + + len = read_packet_wrapper(s, dst, len); diff --git a/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-libavutil-include-assembly-with-full-path-from-sourc.patch b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-libavutil-include-assembly-with-full-path-from-sourc.patch new file mode 100644 index 0000000..3b503c4 --- /dev/null +++ b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-libavutil-include-assembly-with-full-path-from-sourc.patch @@ -0,0 +1,97 @@ +From 24a58d70cbb3997e471366bd5afe54be9007bfb1 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Tue, 10 Nov 2020 15:32:14 +0000 +Subject: [PATCH] libavutil: include assembly with full path from source root + +Otherwise nasm writes the full host-specific paths into .o +output, which breaks binary reproducibility. + +Upstream-Status: Pending +Signed-off-by: Alexander Kanavin +--- + libavutil/x86/cpuid.asm | 2 +- + libavutil/x86/emms.asm | 2 +- + libavutil/x86/fixed_dsp.asm | 2 +- + libavutil/x86/float_dsp.asm | 2 +- + libavutil/x86/lls.asm | 2 +- + libavutil/x86/pixelutils.asm | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/libavutil/x86/cpuid.asm b/libavutil/x86/cpuid.asm +index c3f7866..766f77f 100644 +--- a/libavutil/x86/cpuid.asm ++++ b/libavutil/x86/cpuid.asm +@@ -21,7 +21,7 @@ + ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + ;****************************************************************************** + +-%include "x86util.asm" ++%include "libavutil/x86/x86util.asm" + + SECTION .text + +diff --git a/libavutil/x86/emms.asm b/libavutil/x86/emms.asm +index 8611762..df84f22 100644 +--- a/libavutil/x86/emms.asm ++++ b/libavutil/x86/emms.asm +@@ -18,7 +18,7 @@ + ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + ;****************************************************************************** + +-%include "x86util.asm" ++%include "libavutil/x86/x86util.asm" + + SECTION .text + +diff --git a/libavutil/x86/fixed_dsp.asm b/libavutil/x86/fixed_dsp.asm +index 979dd5c..2f41185 100644 +--- a/libavutil/x86/fixed_dsp.asm ++++ b/libavutil/x86/fixed_dsp.asm +@@ -20,7 +20,7 @@ + ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + ;****************************************************************************** + +-%include "x86util.asm" ++%include "libavutil/x86/x86util.asm" + + SECTION .text + +diff --git a/libavutil/x86/float_dsp.asm b/libavutil/x86/float_dsp.asm +index 517fd63..b773e61 100644 +--- a/libavutil/x86/float_dsp.asm ++++ b/libavutil/x86/float_dsp.asm +@@ -20,7 +20,7 @@ + ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + ;****************************************************************************** + +-%include "x86util.asm" ++%include "libavutil/x86/x86util.asm" + + SECTION_RODATA 32 + pd_reverse: dd 7, 6, 5, 4, 3, 2, 1, 0 +diff --git a/libavutil/x86/lls.asm b/libavutil/x86/lls.asm +index 317fba6..d2526d1 100644 +--- a/libavutil/x86/lls.asm ++++ b/libavutil/x86/lls.asm +@@ -20,7 +20,7 @@ + ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + ;****************************************************************************** + +-%include "x86util.asm" ++%include "libavutil/x86/x86util.asm" + + SECTION .text + +diff --git a/libavutil/x86/pixelutils.asm b/libavutil/x86/pixelutils.asm +index 36c57c5..8b45ead 100644 +--- a/libavutil/x86/pixelutils.asm ++++ b/libavutil/x86/pixelutils.asm +@@ -21,7 +21,7 @@ + ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + ;****************************************************************************** + +-%include "x86util.asm" ++%include "libavutil/x86/x86util.asm" + + SECTION .text + diff --git a/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-mips64_cpu_detection.patch b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-mips64_cpu_detection.patch new file mode 100644 index 0000000..5582ba4 --- /dev/null +++ b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-mips64_cpu_detection.patch @@ -0,0 +1,32 @@ +in OE we user mips32r2 and mips64r2 for mips arch versions +so there is no benefit of detecting it automatically by +poking at tools especially in cross env + +Fixes errors like + +linking -mnan=2008 module with previous -mnan=legacy modules +failed to merge target specific data of file + +-Khem +Upstream-Status: Inappropriate [OE-Specific] + +--- a/configure ++++ b/configure +@@ -5885,17 +5885,10 @@ + + # Check toolchain ISA level + if enabled mips64; then +- enabled mips64r6 && check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"' && +- disable mips64r2 +- + enabled mips64r2 && check_inline_asm mips64r2 '"dext $0, $0, 0, 1"' + + disable mips32r6 && disable mips32r5 && disable mips32r2 + else +- enabled mips32r6 && check_inline_asm mips32r6 '"aui $0, $0, 0"' && +- disable mips32r5 && disable mips32r2 +- +- enabled mips32r5 && check_inline_asm mips32r5 '"eretnc"' + enabled mips32r2 && check_inline_asm mips32r2 '"ext $0, $0, 0, 1"' + + disable mips64r6 && disable mips64r5 && disable mips64r2 diff --git a/archive-patches/ffmpeg/ffmpeg-06-optimize_aac.patch b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-optimize_aac.patch similarity index 82% rename from archive-patches/ffmpeg/ffmpeg-06-optimize_aac.patch rename to archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-optimize_aac.patch index e207f52..b46fa5f 100644 --- a/archive-patches/ffmpeg/ffmpeg-06-optimize_aac.patch +++ b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-optimize_aac.patch @@ -1,6 +1,6 @@ --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c -@@ -2482,7 +2482,7 @@ static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt, +@@ -2583,7 +2583,7 @@ * @param decode 1 if tool is used normally, 0 if tool is used in LTP. * @param coef spectral coefficients */ @@ -11,7 +11,7 @@ const int mmm = FFMIN(ics->tns_max_bands, ics->max_sfb); --- a/libavcodec/aacps.c +++ b/libavcodec/aacps.c -@@ -659,7 +659,7 @@ static void map_val_20_to_34(INTFLOAT par[PS_MAX_NR_IIDICC]) +@@ -396,7 +396,7 @@ par[ 1] = AAC_HALF_SUM(par[ 0], par[ 1]); } @@ -22,7 +22,7 @@ LOCAL_ALIGNED_16(INTFLOAT, transient_gain, [34], [PS_QMF_TIME_SLOTS]); --- a/libavcodec/fft_template.c +++ b/libavcodec/fft_template.c -@@ -562,7 +562,7 @@ static void fft##n(FFTComplex *z)\ +@@ -546,7 +546,7 @@ pass(z,FFT_NAME(ff_cos_##n),n4/2);\ } @@ -31,7 +31,7 @@ { FFTDouble t1, t2, t3, t4, t5, t6, t7, t8; -@@ -576,7 +576,7 @@ static void fft4(FFTComplex *z) +@@ -560,7 +560,7 @@ BF(z[2].im, z[0].im, t2, t5); } @@ -42,7 +42,7 @@ --- a/libavcodec/mdct_template.c +++ b/libavcodec/mdct_template.c -@@ -102,7 +102,7 @@ av_cold int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale) +@@ -102,7 +102,7 @@ * @param output N/2 samples * @param input N/2 samples */ diff --git a/archive-patches/ffmpeg/ffmpeg-08-recheck_discard_flags.patch b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-recheck_discard_flags.patch similarity index 94% rename from archive-patches/ffmpeg/ffmpeg-08-recheck_discard_flags.patch rename to archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-recheck_discard_flags.patch index 35e3be0..3f98f13 100644 --- a/archive-patches/ffmpeg/ffmpeg-08-recheck_discard_flags.patch +++ b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-recheck_discard_flags.patch @@ -1,6 +1,6 @@ --- a/libavformat/hls.c +++ b/libavformat/hls.c -@@ -2074,8 +2074,10 @@ +@@ -2165,8 +2165,10 @@ HLSContext *c = s->priv_data; int ret, i, minplaylist = -1; diff --git a/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-rtsp.patch b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-rtsp.patch new file mode 100644 index 0000000..20f83da --- /dev/null +++ b/archive-patches/ffmpeg-arm/4.4/ffmpeg-4.4-rtsp.patch @@ -0,0 +1,53 @@ +--- a/libavformat/rtsp.c ++++ b/libavformat/rtsp.c +@@ -2380,6 +2380,8 @@ static int sdp_read_header(AVFormatContext *s) + int size, i, err; + char *content; + char url[MAX_URL_SIZE]; ++ const char *p, *sp="", *sources="", *sp2, *sources2; ++ char sources_buf[1024]; + + if (!ff_network_init()) + return AVERROR(EIO); +@@ -2408,6 +2410,16 @@ static int sdp_read_header(AVFormatContext *s) + av_freep(&content); + if (err) goto fail; + ++ /* Search for sources= tag in original URL for rtp protocol only */ ++ if (strncmp(s->url, "rtp://", 6) == 0) { ++ p = strchr(s->url, '?'); ++ if (p && av_find_info_tag(sources_buf, sizeof(sources_buf), "sources", p)) { ++ /* av_log(s, AV_LOG_VERBOSE, "sdp_read_header found sources %s\n", sources_buf); */ ++ sp = sources_buf; ++ sources = "&sources="; ++ } ++ } ++ + /* open each RTP stream */ + for (i = 0; i < rt->nb_rtsp_streams; i++) { + char namebuf[50]; +@@ -2425,12 +2437,22 @@ static int sdp_read_header(AVFormatContext *s) + av_dict_free(&opts); + goto fail; + } ++ ++ /* Prepare to add sources to the url to be opened. ++ Otherwise the join to the source specific muliticast will be missing */ ++ sources2 = sources; ++ sp2 = sp; ++ /* ignore sources from original URL, when sources are already set in rtsp_st */ ++ if (rtsp_st->nb_include_source_addrs > 0) ++ sources2 = sp2 = ""; ++ + ff_url_join(url, sizeof(url), "rtp", NULL, + namebuf, rtsp_st->sdp_port, +- "?localport=%d&ttl=%d&connect=%d&write_to_source=%d", ++ "?localport=%d&ttl=%d&connect=%d&write_to_source=%d%s%s", + rtsp_st->sdp_port, rtsp_st->sdp_ttl, + rt->rtsp_flags & RTSP_FLAG_FILTER_SRC ? 1 : 0, +- rt->rtsp_flags & RTSP_FLAG_RTCP_TO_SOURCE ? 1 : 0); ++ rt->rtsp_flags & RTSP_FLAG_RTCP_TO_SOURCE ? 1 : 0, ++ sources2, sp2); + + append_source_addrs(url, sizeof(url), "sources", + rtsp_st->nb_include_source_addrs, diff --git a/archive-patches/ffmpeg-arm/4.4/replay_dash.patch b/archive-patches/ffmpeg-arm/4.4/replay_dash.patch new file mode 100644 index 0000000..3c3b4be --- /dev/null +++ b/archive-patches/ffmpeg-arm/4.4/replay_dash.patch @@ -0,0 +1,11 @@ +--- a/libavformat/dashdec.c ++++ b/libavformat/dashdec.c +@@ -1401,6 +1401,8 @@ static int64_t calc_cur_seg_no(AVFormatContext *s, struct representation *pls) + } else { + num = pls->first_seq_no + (((c->publish_time - c->time_shift_buffer_depth + pls->fragment_duration) - c->suggested_presentation_delay) * pls->fragment_timescale) / pls->fragment_duration; + } ++ } else if (c->period_start && c->availability_start_time && pls->fragment_timescale) { ++ num = pls->first_seq_no + (((get_current_time_in_sec() - (c->availability_start_time + c->period_start)) * pls->fragment_timescale) - pls->fragment_duration) / pls->fragment_duration; + } else { + num = pls->first_seq_no + (((get_current_time_in_sec() - c->availability_start_time) - c->suggested_presentation_delay) * pls->fragment_timescale) / pls->fragment_duration; + } diff --git a/archive-patches/ffmpeg/ffmpeg-03-allow_to_choose_rtmp_impl_at_runtime.patch b/archive-patches/ffmpeg/ffmpeg-03-allow_to_choose_rtmp_impl_at_runtime.patch deleted file mode 100644 index dd9192b..0000000 --- a/archive-patches/ffmpeg/ffmpeg-03-allow_to_choose_rtmp_impl_at_runtime.patch +++ /dev/null @@ -1,126 +0,0 @@ ---- a/configure -+++ b/configure -@@ -3353,10 +3353,8 @@ xv_outdev_deps="xlib" - # protocols - async_protocol_deps="threads" - bluray_protocol_deps="libbluray" --ffrtmpcrypt_protocol_conflict="librtmp_protocol" - ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl mbedtls" - ffrtmpcrypt_protocol_select="tcp_protocol" --ffrtmphttp_protocol_conflict="librtmp_protocol" - ffrtmphttp_protocol_select="http_protocol" - ftp_protocol_select="tcp_protocol" - gopher_protocol_select="network" -@@ -3369,20 +3367,18 @@ https_protocol_suggest="zlib" - icecast_protocol_select="http_protocol" - mmsh_protocol_select="http_protocol" - mmst_protocol_select="network" --rtmp_protocol_conflict="librtmp_protocol" --rtmp_protocol_select="tcp_protocol" --rtmp_protocol_suggest="zlib" --rtmpe_protocol_select="ffrtmpcrypt_protocol" --rtmpe_protocol_suggest="zlib" --rtmps_protocol_conflict="librtmp_protocol" --rtmps_protocol_select="tls_protocol" --rtmps_protocol_suggest="zlib" --rtmpt_protocol_select="ffrtmphttp_protocol" --rtmpt_protocol_suggest="zlib" --rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol" --rtmpte_protocol_suggest="zlib" --rtmpts_protocol_select="ffrtmphttp_protocol https_protocol" --rtmpts_protocol_suggest="zlib" -+ffrtmp_protocol_select="tcp_protocol" -+ffrtmp_protocol_suggest="zlib" -+ffrtmpe_protocol_select="ffrtmpcrypt_protocol" -+ffrtmpe_protocol_suggest="zlib" -+ffrtmps_protocol_select="tls_protocol" -+ffrtmps_protocol_suggest="zlib" -+ffrtmpt_protocol_select="ffrtmphttp_protocol" -+ffrtmpt_protocol_suggest="zlib" -+ffrtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol" -+ffrtmpte_protocol_suggest="zlib" -+ffrtmpts_protocol_select="ffrtmphttp_protocol https_protocol" -+ffrtmpts_protocol_suggest="zlib" - rtp_protocol_select="udp_protocol" - schannel_conflict="openssl gnutls libtls mbedtls" - sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags" ---- a/libavformat/Makefile -+++ b/libavformat/Makefile -@@ -599,12 +599,12 @@ OBJS-$(CONFIG_MMSH_PROTOCOL) += mmsh.o mms.o asf.o - OBJS-$(CONFIG_MMST_PROTOCOL) += mmst.o mms.o asf.o - OBJS-$(CONFIG_PIPE_PROTOCOL) += file.o - OBJS-$(CONFIG_PROMPEG_PROTOCOL) += prompeg.o --OBJS-$(CONFIG_RTMP_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o --OBJS-$(CONFIG_RTMPE_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o --OBJS-$(CONFIG_RTMPS_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o --OBJS-$(CONFIG_RTMPT_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o --OBJS-$(CONFIG_RTMPTE_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o --OBJS-$(CONFIG_RTMPTS_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o -+OBJS-$(CONFIG_FFRTMP_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o -+OBJS-$(CONFIG_FFRTMPE_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o -+OBJS-$(CONFIG_FFRTMPS_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o -+OBJS-$(CONFIG_FFRTMPT_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o -+OBJS-$(CONFIG_FFRTMPTE_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o -+OBJS-$(CONFIG_FFRTMPTS_PROTOCOL) += rtmpproto.o rtmpdigest.o rtmppkt.o - OBJS-$(CONFIG_RTP_PROTOCOL) += rtpproto.o ip.o - OBJS-$(CONFIG_SCTP_PROTOCOL) += sctp.o - OBJS-$(CONFIG_SRTP_PROTOCOL) += srtpproto.o srtp.o ---- a/libavformat/protocols.c -+++ b/libavformat/protocols.c -@@ -44,12 +44,12 @@ extern const URLProtocol ff_mmst_protocol; - extern const URLProtocol ff_md5_protocol; - extern const URLProtocol ff_pipe_protocol; - extern const URLProtocol ff_prompeg_protocol; --extern const URLProtocol ff_rtmp_protocol; --extern const URLProtocol ff_rtmpe_protocol; --extern const URLProtocol ff_rtmps_protocol; --extern const URLProtocol ff_rtmpt_protocol; --extern const URLProtocol ff_rtmpte_protocol; --extern const URLProtocol ff_rtmpts_protocol; -+extern const URLProtocol ff_ffrtmp_protocol; -+extern const URLProtocol ff_ffrtmpe_protocol; -+extern const URLProtocol ff_ffrtmps_protocol; -+extern const URLProtocol ff_ffrtmpt_protocol; -+extern const URLProtocol ff_ffrtmpte_protocol; -+extern const URLProtocol ff_ffrtmpts_protocol; - extern const URLProtocol ff_rtp_protocol; - extern const URLProtocol ff_sctp_protocol; - extern const URLProtocol ff_srtp_protocol; ---- a/libavformat/rtmpproto.c -+++ b/libavformat/rtmpproto.c -@@ -2592,7 +2592,7 @@ static int inject_fake_duration_metadata(RTMPContext *rt) - static int rtmp_open(URLContext *s, const char *uri, int flags, AVDictionary **opts) - { - RTMPContext *rt = s->priv_data; -- char proto[8], hostname[256], path[1024], auth[100], *fname; -+ char *proto, tmpProto[10], hostname[256], path[1024], auth[100], *fname; - char *old_app, *qmark, *n, fname_buffer[1024]; - uint8_t buf[2048]; - int port; -@@ -2603,7 +2603,9 @@ static int rtmp_open(URLContext *s, const char *uri, int flags, AVDictionary **o - - rt->is_input = !(flags & AVIO_FLAG_WRITE); - -- av_url_split(proto, sizeof(proto), auth, sizeof(auth), -+ memset(tmpProto, 0, sizeof(tmpProto)); -+ proto = &tmpProto[2]; -+ av_url_split(tmpProto, sizeof(tmpProto), auth, sizeof(auth), - hostname, sizeof(hostname), &port, - path, sizeof(path), s->filename); - -@@ -3137,9 +3139,9 @@ const URLProtocol ff_##flavor##_protocol = { \ - }; - - --RTMP_PROTOCOL(rtmp) --RTMP_PROTOCOL(rtmpe) --RTMP_PROTOCOL(rtmps) --RTMP_PROTOCOL(rtmpt) --RTMP_PROTOCOL(rtmpte) --RTMP_PROTOCOL(rtmpts) -+RTMP_PROTOCOL(ffrtmp) -+RTMP_PROTOCOL(ffrtmpe) -+RTMP_PROTOCOL(ffrtmps) -+RTMP_PROTOCOL(ffrtmpt) -+RTMP_PROTOCOL(ffrtmpte) -+RTMP_PROTOCOL(ffrtmpts) diff --git a/archive-patches/ffmpeg/ffmpeg-07-increase_buffer_size.patch b/archive-patches/ffmpeg/ffmpeg-07-increase_buffer_size.patch deleted file mode 100644 index 824dfbc..0000000 --- a/archive-patches/ffmpeg/ffmpeg-07-increase_buffer_size.patch +++ /dev/null @@ -1,91 +0,0 @@ ---- a/libavformat/avio.h -+++ b/libavformat/avio.h -@@ -290,13 +290,6 @@ typedef struct AVIOContext { - */ - int writeout_count; - -- /** -- * Original buffer size -- * used internally after probing and ensure seekback to reset the buffer size -- * This field is internal to libavformat and access from outside is not allowed. -- */ -- int orig_buffer_size; -- - /** - * Threshold to favor readahead over seek. - * This is current internal only, do not use from outside. ---- a/libavformat/aviobuf.c -+++ b/libavformat/aviobuf.c -@@ -33,7 +33,7 @@ - #include "url.h" - #include - --#define IO_BUFFER_SIZE 32768 -+#define IO_BUFFER_SIZE 262144 - - /** - * Do seeks within this distance ahead of the current buffer by skipping -@@ -90,7 +90,6 @@ int ffio_init_context(AVIOContext *s, - memset(s, 0, sizeof(AVIOContext)); - - s->buffer = buffer; -- s->orig_buffer_size = - s->buffer_size = buffer_size; - s->buf_ptr = buffer; - s->buf_ptr_max = buffer; -@@ -570,15 +569,16 @@ static void fill_buffer(AVIOContext *s) - } - - /* make buffer smaller in case it ended up large after probing */ -- if (s->read_packet && s->orig_buffer_size && s->buffer_size > s->orig_buffer_size && len >= s->orig_buffer_size) { -+ if (s->read_packet && s->buffer_size > max_buffer_size) { - if (dst == s->buffer && s->buf_ptr != dst) { -- int ret = ffio_set_buf_size(s, s->orig_buffer_size); -+ int ret = ffio_set_buf_size(s, max_buffer_size); - if (ret < 0) - av_log(s, AV_LOG_WARNING, "Failed to decrease buffer size\n"); - - s->checksum_ptr = dst = s->buffer; - } -- len = s->orig_buffer_size; -+ av_assert0(len >= max_buffer_size); -+ len = max_buffer_size; - } - - len = read_packet_wrapper(s, dst, len); -@@ -1086,7 +1086,6 @@ int ffio_set_buf_size(AVIOContext *s, int buf_size) - - av_free(s->buffer); - s->buffer = buffer; -- s->orig_buffer_size = - s->buffer_size = buf_size; - s->buf_ptr = s->buf_ptr_max = buffer; - url_resetbuf(s, s->write_flag ? AVIO_FLAG_WRITE : AVIO_FLAG_READ); ---- a/libavformat/utils.c -+++ b/libavformat/utils.c -@@ -138,6 +138,25 @@ FF_ENABLE_DEPRECATION_WARNINGS - #endif - #endif - -+void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size) -+{ -+ if (min_size < *size) -+ return ptr; -+ -+ min_size = FFMAX(17 * min_size / 16 + 32, min_size); -+ -+ ptr = av_realloc(ptr, min_size); -+ /* we could set this to the unmodified min_size but this is safer -+ * if the user lost the ptr and uses NULL now -+ */ -+ if (!ptr) -+ min_size = 0; -+ -+ *size = min_size; -+ -+ return ptr; -+} -+ - int64_t av_stream_get_end_pts(const AVStream *st) - { - if (st->internal->priv_pts) { diff --git a/archive-patches/ffmpeg/ffmpeg-mips64_cpu_detection.patch b/archive-patches/ffmpeg/ffmpeg-mips64_cpu_detection.patch deleted file mode 100644 index 5a78cb4..0000000 --- a/archive-patches/ffmpeg/ffmpeg-mips64_cpu_detection.patch +++ /dev/null @@ -1,30 +0,0 @@ -It will add -mips64r6 and -mips64r2 to cmdline which will -cause conflicts - -in OE we user mips32r2 and mips64r2 for mips arch versions -so there is no benefit of detecting it automatically by -poking at tools especially in cross env - -Fixes errors like - -linking -mnan=2008 module with previous -mnan=legacy modules -failed to merge target specific data of file - --Khem -Upstream-Status: Inappropriate [OE-Specific] - ---- a/configure -+++ b/configure -@@ -5758,12 +5758,9 @@ elif enabled mips; then - - # Enable minimum ISA based on selected options - if enabled mips64; then -- enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6' - enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2' - disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64' - else -- enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6' -- enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5' - enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2' - disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32' - fi diff --git a/make/archives.mk b/make/archives.mk index e4e425d..be15d56 100755 --- a/make/archives.mk +++ b/make/archives.mk @@ -9,6 +9,9 @@ $(ARCHIVE)/autofs-$(AUTOFS4_VER).tar.gz: $(ARCHIVE)/autofs-$(AUTOFS5_VER).tar.gz: $(WGET) https://www.kernel.org/pub/linux/daemons/autofs/v$(AUTOFS5_MAJOR)/autofs-$(AUTOFS5_VER).tar.gz +$(ARCHIVE)/bzip2-$(BZIP2_VER).tar.gz: + $(WGET) https://sourceware.org/pub/bzip2/bzip2-$(BZIP2_VER).tar.gz + $(ARCHIVE)/zlib-$(ZLIB_VER).tar.xz: $(WGET) http://downloads.sourceforge.net/project/libpng/zlib/$(ZLIB_VER)/zlib-$(ZLIB_VER).tar.xz diff --git a/make/ffmpeg.mk b/make/ffmpeg.mk index 8c09516..e58ad5c 100644 --- a/make/ffmpeg.mk +++ b/make/ffmpeg.mk @@ -129,21 +129,11 @@ FFMPEG_CONFIGURE = \ --disable-neon \ --disable-runtime-cpudetect \ --arch=arm \ - --pkg-config=pkg-config \ $(FFMPEG_OPTIONS) else ifeq ($(BOXTYPE), armbox) -ifeq ($(FFMPEG_VER), 3.3) -OPTIONAL = -FFMPRG_EXTRA_CFLAGS = -I$(TARGETPREFIX)/include/libxml2 -else -OPTIONAL = --disable-x86asm -OPTIONAL += --enable-libxml2 -FFMPRG_EXTRA_CFLAGS = -endif FFMPEG_CONFIGURE = \ - --disable-ffplay \ - --enable-ffprobe \ + --disable-ffprobe \ \ --disable-doc \ --disable-htmlpages \ @@ -154,27 +144,25 @@ FFMPEG_CONFIGURE = \ --disable-altivec \ --disable-amd3dnow \ --disable-amd3dnowext \ + --disable-armv5te \ + --disable-avx \ + --disable-avx2 \ + --disable-fast-unaligned \ + --disable-fma3 \ + --disable-fma4 \ + --disable-inline-asm \ + --disable-mips32r2 \ + --disable-mipsdsp \ + --disable-mipsdspr2 \ --disable-mmx \ --disable-mmxext \ --disable-sse \ --disable-sse2 \ --disable-sse3 \ - --disable-ssse3 \ --disable-sse4 \ --disable-sse42 \ - --disable-avx \ + --disable-ssse3 \ --disable-xop \ - --disable-fma3 \ - --disable-fma4 \ - --disable-avx2 \ - --disable-armv5te \ - --disable-armv6 \ - --disable-armv6t2 \ - --disable-inline-asm \ - --disable-mips32r2 \ - --disable-mipsdsp \ - --disable-mipsdspr2 \ - --disable-fast-unaligned \ \ --disable-dxva2 \ --disable-vaapi \ @@ -183,7 +171,6 @@ FFMPEG_CONFIGURE = \ --disable-muxers \ --enable-muxer=apng \ --enable-muxer=flac \ - --enable-muxer=mp3 \ --enable-muxer=h261 \ --enable-muxer=h263 \ --enable-muxer=h264 \ @@ -193,6 +180,7 @@ FFMPEG_CONFIGURE = \ --enable-muxer=m4v \ --enable-muxer=matroska \ --enable-muxer=mjpeg \ + --enable-muxer=mp3 \ --enable-muxer=mp4 \ --enable-muxer=mpeg1video \ --enable-muxer=mpeg2video \ @@ -212,8 +200,8 @@ FFMPEG_CONFIGURE = \ --enable-parser=hevc \ --enable-parser=mjpeg \ --enable-parser=mpeg4video \ - --enable-parser=mpegvideo \ --enable-parser=mpegaudio \ + --enable-parser=mpegvideo \ --enable-parser=png \ --enable-parser=vc1 \ --enable-parser=vorbis \ @@ -255,10 +243,10 @@ FFMPEG_CONFIGURE = \ --enable-decoder=adpcm_yamaha \ --enable-decoder=alac \ --enable-decoder=ape \ + --enable-decoder=ass \ --enable-decoder=atrac1 \ --enable-decoder=atrac3 \ --enable-decoder=atrac3p \ - --enable-decoder=ass \ --enable-decoder=cook \ --enable-decoder=dca \ --enable-decoder=dsd_lsbf \ @@ -273,6 +261,7 @@ FFMPEG_CONFIGURE = \ --enable-decoder=flv \ --enable-decoder=g723_1 \ --enable-decoder=g729 \ + --enable-decoder=gif \ --enable-decoder=h261 \ --enable-decoder=h263 \ --enable-decoder=h263i \ @@ -289,9 +278,13 @@ FFMPEG_CONFIGURE = \ --enable-decoder=mlp \ --enable-decoder=movtext \ --enable-decoder=mp1 \ + --enable-decoder=mp2 \ --enable-decoder=mp3 \ --enable-decoder=mp3adu \ + --enable-decoder=mp3adufloat \ + --enable-decoder=mp3float \ --enable-decoder=mp3on4 \ + --enable-decoder=mp3on4float \ --enable-decoder=mpeg1video \ --enable-decoder=mpeg2video \ --enable-decoder=mpeg4 \ @@ -326,7 +319,6 @@ FFMPEG_CONFIGURE = \ --enable-decoder=pcm_u32be \ --enable-decoder=pcm_u32le \ --enable-decoder=pcm_u8 \ - --enable-decoder=pcm_zork \ --enable-decoder=pgssub \ --enable-decoder=png \ --enable-decoder=qcelp \ @@ -335,8 +327,8 @@ FFMPEG_CONFIGURE = \ --enable-decoder=ra_288 \ --enable-decoder=ralf \ --enable-decoder=s302m \ - --enable-decoder=sipr \ --enable-decoder=shorten \ + --enable-decoder=sipr \ --enable-decoder=sonic \ --enable-decoder=srt \ --enable-decoder=ssa \ @@ -349,12 +341,12 @@ FFMPEG_CONFIGURE = \ --enable-decoder=truespeech \ --enable-decoder=tta \ --enable-decoder=vorbis \ + --enable-decoder=wavpack \ --enable-decoder=wmalossless \ --enable-decoder=wmapro \ --enable-decoder=wmav1 \ --enable-decoder=wmav2 \ --enable-decoder=wmavoice \ - --enable-decoder=wavpack \ --enable-decoder=xsub \ \ --disable-demuxers \ @@ -363,11 +355,12 @@ FFMPEG_CONFIGURE = \ --enable-demuxer=apng \ --enable-demuxer=ass \ --enable-demuxer=avi \ - --enable-demuxer=dts \ --enable-demuxer=dash \ + --enable-demuxer=dts \ --enable-demuxer=ffmetadata \ --enable-demuxer=flac \ --enable-demuxer=flv \ + --enable-demuxer=gif \ --enable-demuxer=h264 \ --enable-demuxer=hls \ --enable-demuxer=live_flv \ @@ -382,16 +375,16 @@ FFMPEG_CONFIGURE = \ --enable-demuxer=mjpeg \ --enable-demuxer=mov \ --enable-demuxer=mp3 \ + --enable-demuxer=mpegps \ --enable-demuxer=mpegts \ --enable-demuxer=mpegtsraw \ - --enable-demuxer=mpegps \ --enable-demuxer=mpegvideo \ --enable-demuxer=mpjpeg \ --enable-demuxer=ogg \ --enable-demuxer=pcm_s16be \ --enable-demuxer=pcm_s16le \ - --enable-demuxer=realtext \ --enable-demuxer=rawvideo \ + --enable-demuxer=realtext \ --enable-demuxer=rm \ --enable-demuxer=rtp \ --enable-demuxer=rtsp \ @@ -401,10 +394,12 @@ FFMPEG_CONFIGURE = \ --enable-demuxer=webm_dash_manifest \ \ --disable-filters \ - --enable-filter=scale \ --enable-filter=drawtext \ + --enable-filter=overlay \ + --enable-filter=scale \ \ --enable-bsfs \ + --enable-bzlib \ --enable-libass \ --enable-libbluray \ --enable-libfreetype \ @@ -413,30 +408,21 @@ FFMPEG_CONFIGURE = \ --enable-nonfree \ --enable-openssl \ --enable-zlib \ - --disable-bzlib \ + \ --disable-xlib \ --disable-libxcb \ --disable-libxcb-shm \ --disable-libxcb-xfixes \ --disable-libxcb-shape \ \ - --enable-shared \ - --enable-small \ - --enable-stripping \ - --disable-static \ - --disable-debug \ --disable-runtime-cpudetect \ --enable-pic \ --enable-pthreads \ + --enable-small \ + --enable-swresample \ --enable-hardcoded-tables \ - \ - --pkg-config=pkg-config \ - --enable-cross-compile \ - --extra-cflags="$(FFMPRG_EXTRA_CFLAGS)" \ --arch=arm \ - --target-os=linux \ - --bindir=/bin \ - $(OPTIONAL) + --bindir=/bin else $(error Boxtype = $(BOXTYPE) not supported) endif @@ -450,53 +436,58 @@ FFMPEG_CONFIGURE += --disable-iconv FFMPEG_CONFIGURE += --cpu=armv6 --disable-vfp --extra-cflags="-I$(TARGETPREFIX)/include" endif ifeq ($(BOXTYPE), armbox) -FFMPEG_DEP = $(D)/libass $(D)/alsa-lib -FFMPEG_CONFIGURE += --cpu=cortex-a15 --disable-vfp --extra-cflags="-Wno-deprecated-declarations -I$(TARGETPREFIX)/include" +FFMPEG_DEP = $(D)/bzip2 $(D)/libass $(D)/alsa-lib +FFMPEG_CONFIGURE += \ + --enable-armv6 \ + --enable-armv6t2 \ + --enable-neon \ + --enable-vfp \ + \ + --cpu=cortex-a15 endif - -# -# ffmpeg_patch -# ifeq ($(FFMPEG_VER), 3.3) -FFMPEG_PATCH = ffmpeg-$(FFMPEG_VER)-aac.patch -FFMPEG_PATCH += ffmpeg-$(FFMPEG_VER)-add_dash_demux.patch -FFMPEG_PATCH += ffmpeg-$(FFMPEG_VER)-allow_to_choose_rtmp_impl_at_runtime.patch -FFMPEG_PATCH += ffmpeg-$(FFMPEG_VER)-buffer-size.patch -FFMPEG_PATCH += ffmpeg-$(FFMPEG_VER)-chunked_transfer_fix_eof.patch -FFMPEG_PATCH += ffmpeg-$(FFMPEG_VER)-fix-edit-list-parsing.patch -FFMPEG_PATCH += ffmpeg-$(FFMPEG_VER)-fix-hls.patch -FFMPEG_PATCH += ffmpeg-$(FFMPEG_VER)-fix_mpegts.patch -FFMPEG_PATCH += ffmpeg-$(FFMPEG_VER)-hls_replace_key_uri.patch +FFMPEG_CONFIGURE += else -FFMPEG_PATCH = ffmpeg-02-fix_mpegts.patch -FFMPEG_PATCH += ffmpeg-03-allow_to_choose_rtmp_impl_at_runtime.patch -FFMPEG_PATCH += ffmpeg-04-hls_replace_key_uri.patch -FFMPEG_PATCH += ffmpeg-06-optimize_aac.patch -FFMPEG_PATCH += ffmpeg-07-increase_buffer_size.patch -FFMPEG_PATCH += ffmpeg-08-recheck_discard_flags.patch -FFMPEG_PATCH += ffmpeg-09-fix_edit_list_parsing.patch -FFMPEG_PATCH += ffmpeg-mips64_cpu_detection.patch +FFMPEG_CONFIGURE += \ + --disable-x86asm \ + --enable-libxml2 endif +FFMPEG_CONF_OPTS = \ + --cross-prefix=$(TARGET)- \ + --prefix=/ \ + --mandir=/.remove \ + --datadir=/.remove \ + --docdir=/.remove \ + --target-os=linux \ + --disable-debug \ + --disable-stripping \ + --disable-static \ + --enable-shared \ + --disable-extra-warnings \ + --disable-postproc \ + --logfile=$(BUILD_TMP)/Config-ffmpeg-$(FFMPEG_VER).log \ + --pkg-config="$(PKG_CONFIG)" \ + --extra-cflags="-I$(TARGETPREFIX)/include-Wno-deprecated-declarations" \ + --extra-ldflags="-L$(TARGETPREFIX)/lib -lz" + +# +# ffmpeg build +# + ffmpeg-armbox: $(ARCHIVE)/ffmpeg-$(FFMPEG_VER).tar.xz | $(TARGETPREFIX) $(START_BUILD) $(REMOVE)/ffmpeg-$(FFMPEG_VER) $(UNTAR)/ffmpeg-$(FFMPEG_VER).tar.xz set -e; pushd $(BUILD_TMP)/ffmpeg-$(FFMPEG_VER) && \ - for i in $(FFMPEG_PATCH); do \ + for i in $(PATCHES)/ffmpeg-arm/$(FFMPEG_VER)/*.patch; do \ echo -e "==> $(TERM_RED)Applying Patch:$(TERM_NORMAL) $$i"; \ - $(PATCH)/ffmpeg/$$i; \ + patch -p1 < $$i; \ done; \ $(BUILDENV) \ ./configure \ $(FFMPEG_CONFIGURE) \ - --extra-ldflags="-L$(TARGETPREFIX)/lib -lz" \ - --logfile=$(BUILD_TMP)/Config-ffmpeg-$(FFMPEG_VER).log \ - --cross-prefix=$(TARGET)- \ - --prefix=/ \ - --mandir=/.remove \ - --datadir=/.remove \ - --docdir=/.remove; \ + $(FFMPEG_CONF_OPTS); \ $(MAKE) && \ $(MAKE) install DESTDIR=$(TARGETPREFIX) $(REWRITE_PKGCONF) $(PKG_CONFIG_PATH)/libavfilter.pc @@ -526,13 +517,7 @@ ffmpeg-coolstream: $(ARCHIVE)/ffmpeg-git-$(FFMPEG_GIT).tar.gz | $(TARGETPREFIX) $(BUILDENV) \ ./configure \ $(FFMPEG_CONFIGURE) \ - --extra-ldflags="-L$(TARGETPREFIX)/lib -lz" \ - --logfile=$(BUILD_TMP)/Config-ffmpeg-$(FFMPEG_GIT).log \ - --cross-prefix=$(TARGET)- \ - --prefix=/ \ - --mandir=/.remove \ - --datadir=/.remove \ - --docdir=/.remove; \ + $(FFMPEG_CONF_OPTS); \ $(MAKE) && \ $(MAKE) install DESTDIR=$(TARGETPREFIX) $(REWRITE_PKGCONF) $(PKG_CONFIG_PATH)/libavfilter.pc @@ -557,13 +542,7 @@ ffmpeg-git: $(ARCHIVE)/ffmpeg-git-$(FFMPEG_GIT).tar.gz | $(TARGETPREFIX) $(BUILDENV) \ ./configure \ $(FFMPEG_CONFIGURE) \ - --extra-ldflags="-L$(TARGETPREFIX)/lib -lz" \ - --logfile=$(BUILD_TMP)/Config-ffmpeg-$(FFMPEG_VER).log \ - --cross-prefix=$(TARGET)- \ - --prefix=/ \ - --mandir=/.remove \ - --datadir=/.remove \ - --docdir=/.remove; \ + $(FFMPEG_CONF_OPTS); \ $(MAKE) && \ $(MAKE) install DESTDIR=$(TARGETPREFIX) $(REWRITE_PKGCONF) $(PKG_CONFIG_PATH)/libavfilter.pc @@ -575,7 +554,6 @@ ffmpeg-git: $(ARCHIVE)/ffmpeg-git-$(FFMPEG_GIT).tar.gz | $(TARGETPREFIX) test -e $(PKG_CONFIG_PATH)/libswscale.pc && $(REWRITE_PKGCONF) $(PKG_CONFIG_PATH)/libswscale.pc || true $(REMOVE)/ffmpeg-git-$(FFMPEG_GIT) -$(D)/ffmpeg: $(D)/librtmp $(D)/libxml2 $(D)/libroxml $(FFMPEG_DEP) +$(D)/ffmpeg: $(D)/librtmp $(D)/libxml2 $(D)/libroxml $(D)/libbluray $(FFMPEG_DEP) $(MAKE) ffmpeg-$(BOXTYPE) $(TOUCH) - diff --git a/make/libraries.mk b/make/libraries.mk index 767ec6b..faad1a8 100755 --- a/make/libraries.mk +++ b/make/libraries.mk @@ -12,6 +12,19 @@ ncurses-prereq: false; \ fi +$(D)/bzip2: $(ARCHIVE)/bzip2-$(BZIP2_VER).tar.gz | $(TARGETPREFIX) + $(START_BUILD) + $(UNTAR)/bzip2-$(BZIP2_VER).tar.gz + pushd $(BUILD_TMP)/bzip2-$(BZIP2_VER) && \ + $(call apply_patches, bzip2.patch) && \ + mv Makefile-libbz2_so Makefile && \ + CC=$(TARGET)-gcc \ + $(MAKE); \ + $(MAKE) install PREFIX=$(TARGETPREFIX) + rm -f $(addprefix $(TARGETPREFIX)/bin/,bzip2) + $(REMOVE)/bzip2-$(BZIP2_VER) + $(TOUCH) + $(D)/libass: $(D)/freetype $(D)/libfribidi $(ARCHIVE)/libass-$(LIBASS_VER).tar.xz | $(TARGETPREFIX) $(START_BUILD) $(UNTAR)/libass-$(LIBASS_VER).tar.xz @@ -647,6 +660,7 @@ $(D)/libxml2: $(ARCHIVE)/libxml2-$(LIBXML2_VER).tar.gz | $(TARGETPREFIX) --without-mem-debug \ --without-lzma \ --without-schematron \ + --with-tree \ $(NEVIS_XML2_FLAGS) && \ $(MAKE) all && \ $(MAKE) install DESTDIR=$(TARGETPREFIX) && \ @@ -654,6 +668,7 @@ $(D)/libxml2: $(ARCHIVE)/libxml2-$(LIBXML2_VER).tar.gz | $(TARGETPREFIX) mv $(TARGETPREFIX)/bin/xml2-config $(HOSTPREFIX)/bin $(REWRITE_LIBTOOL)/libxml2.la $(REWRITE_PKGCONF) $(PKG_CONFIG_PATH)/libxml-2.0.pc + rm -rf $(TARGETPREFIX)/lib/cmake rm -rf $(TARGETPREFIX)/lib/xml2Conf.sh $(REMOVE)/libxml2-$(LIBXML2_VER) $(TOUCH) diff --git a/make/versions.mk b/make/versions.mk index be32a81..7d899f1 100644 --- a/make/versions.mk +++ b/make/versions.mk @@ -12,6 +12,9 @@ AUTOFS5_VER = $(AUTOFS5_MAJOR).$(AUTOFS5_MINOR).$(AUTOFS5_MICRO) BUSYBOX_VER = 1.32.1 +# bzip2 ist ein freies Komprimierungsprogramm zur verlustfreien Kompression von Dateien, entwickelt von Julian Seward +BZIP2_VER = 1.0.8 + # cortex-strings; optimized string routines for ARM and AArch64 CORTEX_STRINGS_VER = 48fd30c @@ -71,8 +74,8 @@ FBSHOT_VER = 0.3 # FFMPEG | A complete, cross-platform solution to record, convert and stream audio and video ifeq ($(BOXTYPE), armbox) -FFMPEG_VER = 3.3 -#FFMPEG_VER = 4.2.1 +#FFMPEG_VER = 3.3 +FFMPEG_VER = 4.4 else FFMPEG_GIT = 2ba896f endif -- 2.39.5