ffmpeg: work around hard/soft float configs for libffmpeg-full

Hard float includes: mp3lame
Soft float includes: shine (mp3 encoder)

libx264 is included when selected iff BUILD_PATENTED is true.

fdk-aac will not be available in libffmpeg-full due to incompatible license with libx264.
Custom builds can override licensing restrictions but results may not be re-distributable.

Signed-off-by: Ted Hess <thess@kitschensync.net>
This commit is contained in:
Ted Hess
2018-11-09 14:00:02 -05:00
parent 1ec36271be
commit 4e8dd36499
+18 -21
View File
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ffmpeg PKG_NAME:=ffmpeg
PKG_VERSION:=3.2.12 PKG_VERSION:=3.2.12
PKG_RELEASE:=1 PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://ffmpeg.org/releases/ PKG_SOURCE_URL:=https://ffmpeg.org/releases/
@@ -277,7 +277,7 @@ endef
define Package/ffserver define Package/ffserver
$(call Package/ffserver/Default) $(call Package/ffmpeg/Default)
SECTION:=multimedia SECTION:=multimedia
CATEGORY:=Multimedia CATEGORY:=Multimedia
TITLE+= streaming server TITLE+= streaming server
@@ -341,13 +341,10 @@ endef
define Package/libffmpeg-full define Package/libffmpeg-full
$(call Package/libffmpeg/Default) $(call Package/libffmpeg/Default)
TITLE+= (full) TITLE+= (full)
DEPENDS+= +alsa-lib +PACKAGE_libopus:libopus DEPENDS+= +alsa-lib +PACKAGE_libopus:libopus \
ifeq ($(CONFIG_SOFT_FLOAT),y) +SOFT_FLOAT:shine \
DEPENDS+= +PACKAGE_shine:shine +!SOFT_FLOAT:lame-lib \
else +PACKAGE_libx264:libx264
DEPENDS+= +PACKAGE_lame-lib:lame-lib +PACKAGE_libx264:libx264 +PACKAGE_fdk-aac:fdk-aac
endif
VARIANT:=full VARIANT:=full
endef endef
@@ -490,15 +487,15 @@ ifeq ($(BUILD_VARIANT),full)
FFMPEG_CONFIGURE+= --enable-small FFMPEG_CONFIGURE+= --enable-small
endif endif
FFMPEG_CONFIGURE+= $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame) FFMPEG_CONFIGURE+= $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame)
# x264 support and fdk-aac support can't coexist and be distributed. endif
# Prioritize x264 over fdk-aac in default builds (maintain status-quo). # x264 support and fdk-aac support can't coexist and be distributed.
ifeq ($(CONFIG_PACKAGE_libx264),y) # Prioritize x264 over fdk-aac in default builds (maintain status-quo).
FFMPEG_CONFIGURE+= \ ifneq ($(CONFIG_PACKAGE_libx264),)
--enable-gpl \ FFMPEG_CONFIGURE+= \
--enable-libx264 --enable-gpl \
else --enable-libx264
FFMPEG_CONFIGURE+= $(if $(CONFIG_PACKAGE_fdk-aac),--enable-libfdk-aac) else
endif FFMPEG_CONFIGURE+= $(if $(CONFIG_PACKAGE_fdk-aac),--enable-libfdk-aac)
endif endif
endif endif
@@ -570,7 +567,7 @@ ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libshine),y)
--enable-libshine --enable-encoder=libshine --enable-libshine --enable-encoder=libshine
endif endif
ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),y) ifneq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libx264),)
FFMPEG_CONFIGURE+= \ FFMPEG_CONFIGURE+= \
--enable-libx264 --enable-encoder=libx264 --enable-libx264 --enable-encoder=libx264
endif endif
@@ -655,7 +652,7 @@ define Build/InstallDev/full
$(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale} $(1)/usr/include/ $(CP) $(PKG_INSTALL_DIR)/usr/include/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale} $(1)/usr/include/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.{a,so*} $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.{a,so*} $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.pc $(1)/usr/lib/pkgconfig/
ifeq ($(CONFIG_PACKAGE_libx264),y) ifneq ($(CONFIG_PACKAGE_libx264),)
$(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/ $(CP) $(PKG_INSTALL_DIR)/usr/include/libpostproc $(1)/usr/include/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.{a,so*} $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpostproc.pc $(1)/usr/lib/pkgconfig/
@@ -721,7 +718,7 @@ endef
define Package/libffmpeg-full/install define Package/libffmpeg-full/install
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.so.* $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{avcodec,avdevice,avfilter,avformat,avresample,avutil,swresample,swscale}.so.* $(1)/usr/lib/
ifeq ($(CONFIG_PACKAGE_libx264),y) ifneq ($(CONFIG_PACKAGE_libx264),)
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpostproc.so.* $(1)/usr/lib/
endif endif
endef endef