From: Jaroslav Kysela Date: Mon, 8 Oct 2018 15:25:42 +0000 (+0200) Subject: Makefile.ffmpeg: more sync with master X-Git-Tag: v4.2.7^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0678cb1adf310873d73f5e8fcd9407c7c9db7d29;p=thirdparty%2Ftvheadend.git Makefile.ffmpeg: more sync with master --- diff --git a/Makefile.ffmpeg b/Makefile.ffmpeg index 906cab5cd..d405932cb 100644 --- a/Makefile.ffmpeg +++ b/Makefile.ffmpeg @@ -159,6 +159,7 @@ ELIBS := -L$(EPREFIX)/lib -ldl CONFIGURE := FFMPEG_PREFIX=$(EPREFIX) \ PKG_CONFIG=$(ROOTDIR)/support/pkg-config.ffmpeg \ ./configure --prefix=/ffmpeg --enable-static --disable-shared +CONFIGURE_PI := CC="$(COMPILER) $(CFLAGS_PI)" $(CONFIGURE) # ############################################################################## # NASM @@ -168,10 +169,12 @@ $(LIB_ROOT)/$(NASM)/.tvh_download: $(call DOWNLOAD,$(NASM_URL),$(LIB_ROOT)/$(NASM_TB),$(NASM_SHA1)) $(call UNTAR,$(NASM_TB),z) $(call PATCH,$(NASM),$(NASM_DIFFS)) + @touch $@ $(LIB_ROOT)/$(NASM)/.tvh_build: \ $(LIB_ROOT)/$(NASM)/.tvh_download cd $(LIB_ROOT)/$(NASM) && $(CONFIGURE_PI) \ + --libdir=/$(EPREFIX0)/lib INSTALLROOT=$(EBUILDIR) \ $(MAKE) -C $(LIB_ROOT)/$(NASM) install @touch $@ @@ -185,6 +188,7 @@ ifeq (yes,$(CONFIG_LIBX264)) EXTLIBS += libx264 ENCODERS += libx264 +FFMPEG_DIFFS += ffmpeg.libx264.diff endif @@ -245,6 +249,7 @@ ifeq (yes,$(CONFIG_LIBX265)) EXTLIBS += libx265 ENCODERS += libx265 +FFMPEG_DIFFS += ffmpeg.libx265.diff endif @@ -266,6 +271,10 @@ $(LIB_ROOT)/$(LIBX265)/.tvh_build: \ ../../source DESTDIR=$(EBUILDIR) \ $(MAKE) -C $(LIB_ROOT)/$(LIBX265)/build/linux install + mv $(EPREFIX)/lib/pkgconfig/x265.pc $(EPREFIX)/lib/pkgconfig/x265.pc.old + sed -e 's,-ldl,-ldl -lpthread,g' \ + < $(EPREFIX)/lib/pkgconfig/x265.pc.old \ + > $(EPREFIX)/lib/pkgconfig/x265.pc @touch $@ else @@ -313,7 +322,7 @@ $(LIB_ROOT)/$(LIBVPX)/.tvh_build: \ --disable-examples \ --disable-docs \ --disable-unit-tests \ - $(LIBVPX_TARGET) + $(LIBVPX_TARGET) DIST_DIR=$(EPREFIX) \ $(MAKE) -C $(LIB_ROOT)/$(LIBVPX) install @touch $@ @@ -346,7 +355,7 @@ $(LIB_ROOT)/$(LIBOGG)/.tvh_build: \ $(LIB_ROOT)/$(NASM)/.tvh_build \ $(LIB_ROOT)/$(LIBOGG)/.tvh_download cd $(LIB_ROOT)/$(LIBOGG) && \ - CFLAGS="$(CFLAGS_PI)" $(CONFIGURE) \ + $(CONFIGURE_PI) \ --libdir=/$(EPREFIX0)/lib DESTDIR=$(EBUILDIR) \ $(MAKE) -C $(LIB_ROOT)/$(LIBOGG) install @@ -385,7 +394,7 @@ $(LIB_ROOT)/$(LIBTHEORA)/.tvh_build: \ $(LIB_ROOT)/$(LIBOGG)/.tvh_build \ $(LIB_ROOT)/$(LIBTHEORA)/.tvh_download cd $(LIB_ROOT)/$(LIBTHEORA) && \ - CFLAGS="$(CFLAGS_PI)" $(CONFIGURE) \ + $(CONFIGURE_PI) \ --libdir=/$(EPREFIX0)/lib \ --with-ogg=$(EPREFIX) \ --disable-examples \ @@ -433,7 +442,7 @@ $(LIB_ROOT)/$(LIBVORBIS)/.tvh_build: \ $(LIB_ROOT)/$(LIBOGG)/.tvh_build \ $(LIB_ROOT)/$(LIBVORBIS)/.tvh_download cd $(LIB_ROOT)/$(LIBVORBIS) && \ - CFLAGS="$(CFLAGS_PI)" $(CONFIGURE) \ + $(CONFIGURE_PI) \ --libdir=/$(EPREFIX0)/lib \ --with-ogg=$(EPREFIX) DESTDIR=$(EBUILDIR) \ @@ -586,6 +595,7 @@ $(LIB_ROOT)/$(FFMPEG)/.tvh_download: @mkdir -p $(EBUILDIR) $(call DOWNLOAD,$(FFMPEG_URL),$(LIB_ROOT)/$(FFMPEG_TB),$(FFMPEG_SHA1)) $(call UNTAR,$(FFMPEG_TB),j) + $(call PATCH,$(FFMPEG),$(FFMPEG_DIFFS)) @touch $@ $(LIB_ROOT)/$(FFMPEG)/.tvh_build: \ @@ -611,7 +621,13 @@ $(LIB_ROOT)/$(FFMPEG)/.tvh_build: \ $(foreach encoder,$(ENCODERS),--enable-encoder=$(encoder)) \ $(foreach muxer,$(MUXERS),--enable-muxer=$(muxer)) \ $(foreach bsf,$(BSFS),--enable-bsf=$(bsf)) \ - $(foreach filter,$(FILTERS),--enable-filter=$(filter)) + $(foreach filter,$(FILTERS),--enable-filter=$(filter)) \ + --disable-programs \ + --disable-doc \ + --disable-htmlpages \ + --disable-manpages \ + --disable-podpages \ + --disable-txtpages DESTDIR=$(EBUILDIR) \ $(MAKE) -C $(LIB_ROOT)/$(FFMPEG) install @touch $@ diff --git a/support/patches/ffmpeg.libx264.diff b/support/patches/ffmpeg.libx264.diff new file mode 100644 index 000000000..5e28ee409 --- /dev/null +++ b/support/patches/ffmpeg.libx264.diff @@ -0,0 +1,12 @@ +diff -urN ../ffmpeg-3.1.2.orig/libavcodec/libx264.c ./libavcodec/libx264.c +--- ../ffmpeg-3.1.2.orig/libavcodec/libx264.c 2016-08-09 00:53:26.000000000 +0200 ++++ ./libavcodec/libx264.c 2016-08-22 07:46:36.641867975 +0200 +@@ -902,7 +902,7 @@ + static const AVOption options[] = { + { "preset", "Set the encoding preset (cf. x264 --fullhelp)", OFFSET(preset), AV_OPT_TYPE_STRING, { .str = "medium" }, 0, 0, VE}, + { "tune", "Tune the encoding params (cf. x264 --fullhelp)", OFFSET(tune), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE}, +- { "profile", "Set profile restrictions (cf. x264 --fullhelp) ", OFFSET(profile), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE}, ++ { "x264profile", "Set profile restrictions (cf. x264 --fullhelp) ", OFFSET(profile), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE}, + { "fastfirstpass", "Use fast settings when encoding first pass", OFFSET(fastfirstpass), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE}, + {"level", "Specify level (as defined by Annex A)", OFFSET(level), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE}, + {"passlogfile", "Filename for 2 pass stats", OFFSET(stats), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE}, diff --git a/support/patches/ffmpeg.libx265.diff b/support/patches/ffmpeg.libx265.diff new file mode 100644 index 000000000..7589e148d --- /dev/null +++ b/support/patches/ffmpeg.libx265.diff @@ -0,0 +1,44 @@ +diff -urN ../ffmpeg-3.1.3.orig/libavcodec/libx265.c ./libavcodec/libx265.c +--- ../ffmpeg-3.1.3.orig/libavcodec/libx265.c 2016-06-27 01:54:29.000000000 +0200 ++++ ./libavcodec/libx265.c 2016-08-31 13:52:05.599612289 +0200 +@@ -252,6 +252,7 @@ + int nnal; + int ret; + int i; ++ int pict_type; + + ctx->api->picture_init(ctx->params, &x265pic); + +@@ -299,22 +300,27 @@ + pkt->pts = x265pic_out.pts; + pkt->dts = x265pic_out.dts; + +-#if FF_API_CODED_FRAME +-FF_DISABLE_DEPRECATION_WARNINGS + switch (x265pic_out.sliceType) { + case X265_TYPE_IDR: + case X265_TYPE_I: +- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I; ++ pict_type = AV_PICTURE_TYPE_I; + break; + case X265_TYPE_P: +- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P; ++ pict_type = AV_PICTURE_TYPE_P; + break; + case X265_TYPE_B: +- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_B; ++ pict_type = AV_PICTURE_TYPE_B; ++ break; ++ default: ++ pict_type = AV_PICTURE_TYPE_NONE; + break; + } ++#if FF_API_CODED_FRAME ++FF_DISABLE_DEPRECATION_WARNINGS ++ avctx->coded_frame->pict_type = pict_type; + FF_ENABLE_DEPRECATION_WARNINGS + #endif ++ ff_side_data_set_encoder_stats(pkt, -1, NULL, 0, pict_type); + + *got_packet = 1; + return 0;