Merge pull request #2144 from CvH/9.0-tvh-ffmpegx

Tvheadend 4.2 rework to use ffmpegx
This commit is contained in:
MilhouseVH 2017-11-23 09:49:08 +00:00 committed by GitHub
commit d34853b033
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 95 additions and 200 deletions

View File

@ -0,0 +1,52 @@
From: CvH <namerp@googlemail.com>
Date: Wed, 22 Nov 2017 23:45:38 +0100
Subject: [PATCH] fix for kernel >=4.14
---
include/ca.h | 1 -
util/dst-utils/dst_test.c | 14 --------------
2 files changed, 15 deletions(-)
diff --git a/include/ca.h b/include/ca.h
index c18537f..5ad21c9 100644
--- a/include/ca.h
+++ b/include/ca.h
@@ -85,6 +85,5 @@ typedef struct ca_pid {
#define CA_GET_MSG _IOR('o', 132, ca_msg_t)
#define CA_SEND_MSG _IOW('o', 133, ca_msg_t)
#define CA_SET_DESCR _IOW('o', 134, ca_descr_t)
-#define CA_SET_PID _IOW('o', 135, ca_pid_t)
#endif
diff --git a/util/dst-utils/dst_test.c b/util/dst-utils/dst_test.c
index 74385de..5cf3bd8 100644
--- a/util/dst-utils/dst_test.c
+++ b/util/dst-utils/dst_test.c
@@ -111,16 +111,6 @@ static int dst_reset(int cafd)
return 0;
}
-static int dst_set_pid(int cafd)
-{
- if ((ioctl(cafd, CA_SET_PID)) < 0) {
- printf("%s: ioctl failed ..\n", __FUNCTION__);
- return -1;
- }
-
- return 0;
-}
-
static int dst_get_descr(int cafd)
{
if ((ioctl(cafd, CA_GET_DESCR_INFO)) < 0) {
@@ -229,10 +219,6 @@ int main(int argc, char *argv[])
printf("%s: Reset\n", __FUNCTION__);
dst_reset(cafd);
break;
- case 'p':
- printf("%s: PID\n", __FUNCTION__);
- dst_set_pid(cafd);
- break;
case 'g':
printf("%s: Get Desc\n", __FUNCTION__);
dst_get_descr(cafd);

View File

@ -1,3 +1,7 @@
113
- update to 4.2.4-23
- full transcoding support
112 112
- update to 4.2.3-20 - update to 4.2.3-20
- changed name - changed name
@ -46,4 +50,4 @@
- fix the XMLTV import script - fix the XMLTV import script
100 100
- initial LibreELEC version - initial LibreELEC version

View File

@ -17,16 +17,16 @@
################################################################################ ################################################################################
PKG_NAME="tvheadend42" PKG_NAME="tvheadend42"
PKG_VERSION="407c8a3" PKG_VERSION="ceaf330"
PKG_SHA256="8569ab42650ca02e47d3d88276342fe2ffde4f40bd11893a3bf6879a79f36fb3" PKG_SHA256="c6b3b366136d9e86630cb2ebd2cab823448d0eeb02ef15e72bc0accd8dc9d923"
PKG_VERSION_NUMBER="4.2.3-20" PKG_VERSION_NUMBER="4.2.4-23"
PKG_REV="112" PKG_REV="113"
PKG_ARCH="any" PKG_ARCH="any"
PKG_LICENSE="GPL" PKG_LICENSE="GPL"
PKG_SITE="http://www.tvheadend.org" PKG_SITE="http://www.tvheadend.org"
PKG_URL="https://github.com/tvheadend/tvheadend/archive/$PKG_VERSION.tar.gz" PKG_URL="https://github.com/tvheadend/tvheadend/archive/$PKG_VERSION.tar.gz"
PKG_SOURCE_DIR="tvheadend-${PKG_VERSION}*" PKG_SOURCE_DIR="tvheadend-${PKG_VERSION}*"
PKG_DEPENDS_TARGET="toolchain curl dvb-tools libdvbcsa libiconv openssl pngquant:host Python2:host yasm" PKG_DEPENDS_TARGET="toolchain avahi curl dvb-apps ffmpegx libdvbcsa libiconv openssl pngquant:host Python2:host"
PKG_SECTION="service" PKG_SECTION="service"
PKG_SHORTDESC="Tvheadend: a TV streaming server for Linux" PKG_SHORTDESC="Tvheadend: a TV streaming server for Linux"
PKG_LONGDESC="Tvheadend ($PKG_VERSION_NUMBER): is a TV streaming server for Linux supporting DVB-S/S2, DVB-C, DVB-T/T2, IPTV, SAT>IP, ATSC and ISDB-T" PKG_LONGDESC="Tvheadend ($PKG_VERSION_NUMBER): is a TV streaming server for Linux supporting DVB-S/S2, DVB-C, DVB-T/T2, IPTV, SAT>IP, ATSC and ISDB-T"
@ -35,19 +35,38 @@ PKG_IS_ADDON="yes"
PKG_ADDON_NAME="Tvheadend Server 4.2" PKG_ADDON_NAME="Tvheadend Server 4.2"
PKG_ADDON_TYPE="xbmc.service" PKG_ADDON_TYPE="xbmc.service"
# transcoding only for generic # basic transcoding options
if [ "$TARGET_ARCH" = x86_64 ]; then PKG_TVH_TRANSCODING="\
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET intel-vaapi-driver" --disable-ffmpeg_static \
TVH_TRANSCODING="--enable-ffmpeg_static --enable-libav --enable-libfdkaac --disable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --disable-qsv" --disable-libfdkaac_static \
else --disable-libopus_static \
TVH_TRANSCODING="--disable-ffmpeg_static --disable-libav" --disable-libtheora \
--disable-libtheora_static \
--disable-libvorbis_static \
--disable-libvpx_static \
--disable-libx264_static \
--disable-libx265_static \
--enable-libav \
--enable-libfdkaac \
--enable-libopus \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libx265"
# specific transcoding options
if [[ "$TARGET_ARCH" != "x86_64" ]]; then
PKG_TVH_TRANSCODING="$PKG_TVH_TRANSCODING \
--disable-libvpx \
--disable-libx265"
fi fi
PKG_CONFIGURE_OPTS_TARGET="--prefix=/usr \ PKG_CONFIGURE_OPTS_TARGET="--prefix=/usr \
--arch=$TARGET_ARCH \ --arch=$TARGET_ARCH \
--cpu=$TARGET_CPU \ --cpu=$TARGET_CPU \
--cc=$CC \ --cc=$CC \
--disable-avahi \ $PKG_TVH_TRANSCODING \
--enable-avahi \
--enable-bundle \ --enable-bundle \
--disable-dbus_1 \ --disable-dbus_1 \
--enable-dvbcsa \ --enable-dvbcsa \
@ -57,9 +76,9 @@ PKG_CONFIGURE_OPTS_TARGET="--prefix=/usr \
--enable-epoll \ --enable-epoll \
--enable-inotify \ --enable-inotify \
--enable-pngquant \ --enable-pngquant \
--disable-libmfx_static \
--disable-nvenc \ --disable-nvenc \
--disable-uriparser \ --disable-uriparser \
$TVH_TRANSCODING \
--enable-tvhcsa \ --enable-tvhcsa \
--enable-trace \ --enable-trace \
--nowerror \ --nowerror \
@ -76,30 +95,21 @@ pre_configure_target() {
cd $PKG_BUILD cd $PKG_BUILD
rm -rf .$TARGET_NAME rm -rf .$TARGET_NAME
# transcoding # pass ffmpegx to build
if [ "$TARGET_ARCH" = x86_64 ]; then PKG_CONFIG_PATH="$(get_build_dir ffmpegx)/.INSTALL_PKG/usr/local/lib/pkgconfig"
export AS=$TOOLCHAIN/bin/yasm CFLAGS="$CFLAGS -I$(get_build_dir ffmpegx)/.INSTALL_PKG/usr/local/include"
export LDFLAGS="$LDFLAGS -lX11 -lm -lvdpau -lva -lva-drm -lva-x11" LDFLAGS="$LDFLAGS -L$(get_build_dir ffmpegx)/.INSTALL_PKG/usr/local/lib"
export ARCH=$TARGET_ARCH
fi
export CROSS_COMPILE=$TARGET_PREFIX export CROSS_COMPILE="$TARGET_PREFIX"
export CFLAGS="$CFLAGS -I$SYSROOT_PREFIX/usr/include/iconv -L$SYSROOT_PREFIX/usr/lib/iconv" export CFLAGS="$CFLAGS -I$SYSROOT_PREFIX/usr/include/iconv -L$SYSROOT_PREFIX/usr/lib/iconv"
} }
# transcoding link tvheadend with g++
if [ "$TARGET_ARCH" = x86_64 ]; then
pre_make_target() {
export CXX=$CXX
}
fi
post_make_target() { post_make_target() {
$CC -O -fbuiltin -fomit-frame-pointer -fPIC -shared -o capmt_ca.so src/extra/capmt_ca.c -ldl $CC -O -fbuiltin -fomit-frame-pointer -fPIC -shared -o capmt_ca.so src/extra/capmt_ca.c -ldl
} }
makeinstall_target() { makeinstall_target() {
: # nothing to do here :
} }
addon() { addon() {

View File

@ -1,89 +0,0 @@
From: Team LibreELEC - https://LibreELEC.tv
Subject: adjust Tvheadend ffmpeg build to work with LibreELEC (transcoding) 07.05.2016
---
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -97,50 +97,65 @@ FFMPEG_CONFIG := \
PKG_CONFIG_LIBDIR=$(FFMPEG_LIBDIR)/pkgconfig $(PKG_CONFIG) \
--define-variable=prefix=$(FFMPEG_PREFIX) --static
+CFLAGS += -I${FFMPEG_PREFIX}/include
+LDFLAGS += ${FFMPEG_LIBDIR}/libavfilter.a
+LDFLAGS += ${FFMPEG_LIBDIR}/libswresample.a
+LDFLAGS += ${FFMPEG_LIBDIR}/libavresample.a
+LDFLAGS += ${FFMPEG_LIBDIR}/libswscale.a
+LDFLAGS += ${FFMPEG_LIBDIR}/libavformat.a
+LDFLAGS += ${FFMPEG_LIBDIR}/libavcodec.a
+LDFLAGS += ${FFMPEG_LIBDIR}/libavutil.a
+
ifeq ($(CONFIG_LIBX264_STATIC),yes)
FFMPEG_DEPS += libx264
+LDFLAGS += ${FFMPEG_LIBDIR}/libx264.a
endif
ifeq ($(CONFIG_LIBX265_STATIC),yes)
FFMPEG_DEPS += libx265
+LDFLAGS += ${FFMPEG_LIBDIR}/libx265.a
endif
ifeq ($(CONFIG_LIBVPX_STATIC),yes)
FFMPEG_DEPS += libvpx
+LDFLAGS += ${FFMPEG_LIBDIR}/libvpx.a
endif
ifeq ($(CONFIG_LIBOGG_STATIC),yes)
FFMPEG_DEPS += libogg
+LDFLAGS += ${FFMPEG_LIBDIR}/libogg.a
endif
ifeq ($(CONFIG_LIBTHEORA_STATIC),yes)
FFMPEG_DEPS += libtheoraenc libtheoradec libtheora
+LDFLAGS += ${FFMPEG_LIBDIR}/libtheora.a
+LDFLAGS += ${FFMPEG_LIBDIR}/libtheoradec.a
+LDFLAGS += ${FFMPEG_LIBDIR}/libtheoraenc.a
endif
ifeq ($(CONFIG_LIBVORBIS_STATIC),yes)
FFMPEG_DEPS += libvorbisfile libvorbisenc libvorbis
+LDFLAGS += ${FFMPEG_LIBDIR}/libvorbis.a
+LDFLAGS += ${FFMPEG_LIBDIR}/libvorbisenc.a
+LDFLAGS += ${FFMPEG_LIBDIR}/libvorbisfile.a
endif
ifeq ($(CONFIG_LIBFDKAAC_STATIC),yes)
FFMPEG_DEPS += libfdk-aac
+LDFLAGS += ${FFMPEG_LIBDIR}/libfdk-aac.a
endif
ifeq ($(CONFIG_LIBMFX_STATIC),yes)
FFMPEG_DEPS += libmfx
+LDFLAGS += ${FFMPEG_LIBDIR}/libmfx.a
endif
-LDFLAGS += $(foreach lib,$(FFMPEG_LIBS),$(FFMPEG_LIBDIR)/$(lib).a)
-LDFLAGS += $(foreach lib,$(FFMPEG_DEPS),$(FFMPEG_LIBDIR)/$(lib).a)
-
else # !FFMPEG_STATIC
FFMPEG_CONFIG := $(PKG_CONFIG)
endif # FFMPEG_STATIC
-CFLAGS += `$(FFMPEG_CONFIG) --cflags $(FFMPEG_LIBS)`
-LDFLAGS += `$(FFMPEG_CONFIG) --libs $(FFMPEG_LIBS)`
-
endif
# LIBAV ########################################################################
@@ -613,7 +628,7 @@ reconfigure:
# Binary
${PROG}: .config.mk make_webui $(OBJS)
- $(pCC) -o $@ $(OBJS) $(CFLAGS) $(LDFLAGS)
+ $(CXX) -o $@ $(OBJS) $(CFLAGS) $(LDFLAGS)
# Object
${BUILDDIR}/%.o: %.c

View File

@ -1,82 +0,0 @@
From: Team LibreELEC - https://LibreELEC.tv
Subject: adjust Tvheadend ffmpeg build to work with LibreELEC (transcoding) 07.05.2016
---
diff --git a/Makefile.ffmpeg b/Makefile.ffmpeg
--- a/Makefile.ffmpeg
+++ b/Makefile.ffmpeg
@@ -24,6 +24,9 @@ FFMPEG_HOST := $(ARCH)-linux-gnu
FFMPEG_TARGET := x86-linux-gcc
endif
+FFMPEG_HOST := $(ARCH)-libreelec-linux-gnu
+FFMPEG_TARGET := $(ARCH)-libreelec-linux-gnu
+
unexport CFLAGS
unexport LDFLAGS
@@ -145,7 +148,7 @@ $(LIB_ROOT)/$(YASM)/.tvh_download:
$(LIB_ROOT)/$(YASM)/.tvh_build: \
$(LIB_ROOT)/$(YASM)/.tvh_download
- cd $(LIB_ROOT)/$(YASM) && $(CONFIGURE)
+ cd $(LIB_ROOT)/$(YASM) && $(CONFIGURE) CC=$(HOST_CC)
DESTDIR=$(EBUILDIR) \
$(MAKE) -C $(LIB_ROOT)/$(YASM) install
@touch $@
@@ -238,6 +241,7 @@ $(LIB_ROOT)/$(LIBX265)/.tvh_build: \
cd $(LIB_ROOT)/$(LIBX265)/build/linux && cmake -G "Unix Makefiles" \
-DCMAKE_INSTALL_PREFIX="/ffmpeg" \
-DENABLE_SHARED:BOOL=OFF \
+ -DEXTRA_LINK_FLAGS="-ldl" \
../../source
DESTDIR=$(EBUILDIR) \
$(MAKE) -C $(LIB_ROOT)/$(LIBX265)/build/linux install
@@ -271,7 +275,7 @@ endif
ifeq (yes,$(CONFIG_LIBVPX_STATIC))
ifneq (,$(FFMPEG_TARGET))
-LIBVPX_TARGET := --target=$(FFMPEG_TARGET)
+LIBVPX_TARGET := --target=generic-gnu
endif
$(LIB_ROOT)/$(LIBVPX)/.tvh_download:
@@ -283,7 +287,7 @@ $(LIB_ROOT)/$(LIBVPX)/.tvh_build: \
$(LIB_ROOT)/$(YASM)/.tvh_build \
$(LIB_ROOT)/$(LIBVPX)/.tvh_download
cd $(LIB_ROOT)/$(LIBVPX) && \
- ASFLAGS="-DENABLE_PIC=1 -DPIC=1" $(CONFIGURE) \
+ ASFLAGS="-DENABLE_PIC=1 -DPIC=1" CROSS=$(FFMPEG_TARGET)- $(CONFIGURE) \
--extra-cflags="$(CFLAGS_PI)" \
--disable-examples \
--disable-docs \
@@ -359,7 +363,8 @@ $(LIB_ROOT)/$(LIBTHEORA)/.tvh_build: \
$(LIB_ROOT)/$(LIBTHEORA)/.tvh_download
cd $(LIB_ROOT)/$(LIBTHEORA) && \
CFLAGS="$(CFLAGS_PI)" $(CONFIGURE) \
- --with-ogg=$(EPREFIX) \
+ OGG_CFLAGS=-I$(EPREFIX)/include \
+ OGG_LIBS=-L$(EPREFIX)/lib \
--disable-examples \
--disable-spec \
$(LIBTHEORA_HOST)
@@ -406,7 +411,8 @@ $(LIB_ROOT)/$(LIBVORBIS)/.tvh_build: \
$(LIB_ROOT)/$(LIBVORBIS)/.tvh_download
cd $(LIB_ROOT)/$(LIBVORBIS) && \
CFLAGS="$(CFLAGS_PI)" $(CONFIGURE) \
- --with-ogg=$(EPREFIX)
+ OGG_CFLAGS=-I$(EPREFIX)/include \
+ OGG_LIBS=-L$(EPREFIX)/lib
DESTDIR=$(EBUILDIR) \
$(MAKE) -C $(LIB_ROOT)/$(LIBVORBIS) install
@touch $@
@@ -559,6 +565,8 @@ $(LIB_ROOT)/$(FFMPEG)/.tvh_build: \
$(LIB_ROOT)/$(LIBMFX)/.tvh_build \
$(LIB_ROOT)/$(FFMPEG)/.tvh_download
cd $(LIB_ROOT)/$(FFMPEG) && $(CONFIGURE) \
+ --cc=$(FFMPEG_HOST)-gcc \
+ --cxx=$(FFMPEG_HOST)-g++ \
--disable-all \
--enable-gpl \
--extra-cflags="$(ECFLAGS)" \