Skip to contentSkip to conversation

ffmpeg: add BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS

PATCH New Vicente Olivert Riera 3 participants 5 messages May 26, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ffmpeg: add BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS

---
 package/ffmpeg/Config.in                | 8 ++++++--
 package/gstreamer1/gst1-libav/Config.in | 2 +-
 package/kodi/Config.in                  | 1 +
 package/minidlna/Config.in              | 4 ++--
 package/mpd/Config.in                   | 2 +-
 package/mpv/Config.in                   | 4 ++--
 package/opencv/Config.in                | 2 +-
 package/opencv3/Config.in               | 2 +-
 package/squeezelite/Config.in           | 2 +-
 package/tovid/Config.in                 | 4 +++-
 10 files changed, 19 insertions(+), 12 deletions(-)
package/ffmpeg/Config.in +6 -2
index a273aea..6b7a6e7 100644
@@ -1,7 +1,11 @@
+config BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
+	bool
+	# fenv.h lacks FE_INVALID, FE_OVERFLOW & FE_UNDERFLOW on nios2
+	default y if !BR2_nios2
+
 menuconfig BR2_PACKAGE_FFMPEG
 	bool "ffmpeg"
-	# fenv.h lacks FE_INVALID, FE_OVERFLOW & FE_UNDERFLOW on nios2
-	depends on !BR2_nios2
+	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	help
 	  FFmpeg is a complete, cross-platform solution to record, convert
 	  and stream audio and video.
package/gstreamer1/gst1-libav/Config.in +1 -1
index 8c3c834..23d78b6 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_GST1_LIBAV
 	bool "gst1-libav"
-	depends on !BR2_nios2 # ffmpeg
+	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	select BR2_PACKAGE_FFMPEG
 	select BR2_PACKAGE_FFMPEG_SWSCALE
 	select BR2_PACKAGE_GST1_PLUGINS_BASE
package/kodi/Config.in +1 -0
index ff2e75c..d9760ca 100644
@@ -1,6 +1,7 @@
 config BR2_PACKAGE_KODI_ARCH_SUPPORTS
 	bool
 	default y if (BR2_arm || (BR2_mipsel && BR2_TOOLCHAIN_USES_GLIBC) || BR2_i386 || BR2_x86_64) \
+		&& BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS \
 		&& BR2_PACKAGE_BOOST_ARCH_SUPPORTS \
 		&& BR2_TOOLCHAIN_HAS_SYNC_8
 
package/minidlna/Config.in +2 -2
index 999ea01..c900143 100644
@@ -4,6 +4,7 @@ config BR2_PACKAGE_MINIDLNA
 	depends on BR2_USE_WCHAR # flac
 	depends on BR2_USE_MMU # fork
 	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	select BR2_PACKAGE_FFMPEG
 	select BR2_PACKAGE_FLAC
 	select BR2_PACKAGE_LIBVORBIS # selects libogg
@@ -13,7 +14,6 @@ config BR2_PACKAGE_MINIDLNA
 	select BR2_PACKAGE_JPEG
 	select BR2_PACKAGE_SQLITE
 	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
-	depends on !BR2_nios2 # ffmpeg
 	help
 	  MiniDLNA (aka ReadyDLNA) is server software with the aim of being
 	  fully compliant with DLNA/UPnP-AV clients.
@@ -22,6 +22,6 @@ config BR2_PACKAGE_MINIDLNA
 
 comment "minidlna needs a toolchain w/ dynamic library, threads, wchar"
 	depends on BR2_USE_MMU
-	depends on !BR2_nios2
+	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR || \
 		BR2_STATIC_LIBS
package/mpd/Config.in +1 -1
index 3ac806f..31be8bb 100644
@@ -77,8 +77,8 @@ config BR2_PACKAGE_MPD_FAAD2
 
 config BR2_PACKAGE_MPD_FFMPEG
 	bool "ffmpeg"
+	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	select BR2_PACKAGE_FFMPEG
-	depends on !BR2_nios2 # ffmpeg
 	help
 	  Enable ffmpeg input support.
 	  Select this if you want to play back files supported by
package/mpv/Config.in +2 -2
index b354d4d..1cef6c5 100644
@@ -1,7 +1,7 @@
 config BR2_PACKAGE_MPV
 	bool "mpv"
-	depends on !BR2_nios2 # ffmpeg
 	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
 	select BR2_PACKAGE_FFMPEG
 	select BR2_PACKAGE_FFMPEG_SWSCALE
@@ -15,5 +15,5 @@ config BR2_PACKAGE_MPV
 	  https://mpv.io/
 
 comment "mpv needs a toolchain w/ threads"
-	depends on !BR2_nios2
+	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	depends on !BR2_TOOLCHAIN_HAS_THREADS
package/opencv/Config.in +1 -1
index 05c1fc1..c046baa 100644
@@ -191,10 +191,10 @@ comment "3rd party support"
 
 config BR2_PACKAGE_OPENCV_WITH_FFMPEG
 	bool "ffmpeg support"
+	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	select BR2_PACKAGE_BZIP2
 	select BR2_PACKAGE_FFMPEG
 	select BR2_PACKAGE_FFMPEG_SWSCALE
-	depends on !BR2_nios2 # ffmpeg
 	help
 	  Use ffmpeg from the target system.
 
package/opencv3/Config.in +1 -1
index 9629a64..2f4aa7a 100644
@@ -242,11 +242,11 @@ comment "3rd party support"
 
 config BR2_PACKAGE_OPENCV3_WITH_FFMPEG
 	bool "ffmpeg support"
+	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	select BR2_PACKAGE_BZIP2
 	select BR2_PACKAGE_FFMPEG
 	select BR2_PACKAGE_FFMPEG_AVRESAMPLE
 	select BR2_PACKAGE_FFMPEG_SWSCALE
-	depends on !BR2_nios2 # ffmpeg
 	help
 	  Use ffmpeg from the target system.
 
package/squeezelite/Config.in +1 -1
index 1c2960e..79d2947 100644
@@ -21,8 +21,8 @@ if BR2_PACKAGE_SQUEEZELITE
 config BR2_PACKAGE_SQUEEZELITE_FFMPEG
 	bool "Enable WMA and ALAC decoding"
 	default y
+	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	select BR2_PACKAGE_FFMPEG
-	depends on !BR2_nios2 # ffmpeg
 
 config BR2_PACKAGE_SQUEEZELITE_DSD
 	bool "Enable DSD decoding"
package/tovid/Config.in +3 -1
index 093bfdf..1288f84 100644
@@ -5,7 +5,7 @@ config BR2_PACKAGE_TOVID
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_USE_WCHAR
 	depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3
-	depends on !BR2_nios2 # ffmpeg
+	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	depends on BR2_PACKAGE_MPLAYER_ARCH_SUPPORTS
 	# The below dependencies are runtime dependencies only
 	select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # procps_ng
@@ -28,6 +28,7 @@ config BR2_PACKAGE_TOVID
 
 comment "tovid needs a toolchain w/ threads, C++, wchar"
 	depends on BR2_USE_MMU
+	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	depends on BR2_PACKAGE_MPLAYER_ARCH_SUPPORTS
 	depends on !BR2_TOOLCHAIN_HAS_THREADS \
 		|| !BR2_INSTALL_LIBSTDCPP \
@@ -35,4 +36,5 @@ comment "tovid needs a toolchain w/ threads, C++, wchar"
 
 comment "tovid depends on python or python3"
 	depends on !BR2_PACKAGE_PYTHON && !BR2_PACKAGE_PYTHON3
+	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	depends on BR2_PACKAGE_MPLAYER_ARCH_SUPPORTS
Signature · 1 line
2.7.3
#1 lore raw

PATCH 2/2 ffmpeg: disable for mips64r2 and mips64r6

MIPS architecture detection is not accurate and is always detected as mips64 even if we are using mips64r2 or mips64r6. Due to that, ffmpeg's build system will pass the -mips64 flag which will conflict with the -march option that our toolchain wrapper uses, and it will fail to build showing errors like this one:

error: '-mips64' conflicts with the other architecture options, which specify a mips64r2 processor

This problem has been already fixed upstream, but we would need to backport 17 patches plus some changes in the ffmpeg.mk file. This is too much, so better to just disable ffmpeg for mips64r2 and mips64r6 for the upcoming Buildroot release.

This commit can be reverted in the next ffmpeg's version bump.

Fixes:

http://autobuild.buildroot.net/results/7fd/7fd8187c0110cdcac622e667f4a81d2db84f11ef/

---
 package/ffmpeg/Config.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/ffmpeg/Config.in +2 -1
index 6b7a6e7..096ff95 100644
@@ -1,7 +1,8 @@
 config BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	bool
 	# fenv.h lacks FE_INVALID, FE_OVERFLOW & FE_UNDERFLOW on nios2
-	default y if !BR2_nios2
+	# ffmpeg's configure script only supports mips64 (r1) variant
+	default y if !BR2_nios2 && !BR2_mips_64r2 && !BR2_mips_64r6
 
 menuconfig BR2_PACKAGE_FFMPEG
 	bool "ffmpeg"
Signature · 1 line
2.7.3
#4 lore raw

PATCH 1/2 ffmpeg: add BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS

In reply to Vicente Olivert Riera

Hello,

Quoted 13 lines · Vicente Olivert Riera
---
 package/ffmpeg/Config.in                | 8 ++++++--
 package/gstreamer1/gst1-libav/Config.in | 2 +-
 package/kodi/Config.in                  | 1 +
 package/minidlna/Config.in              | 4 ++--
 package/mpd/Config.in                   | 2 +-
 package/mpv/Config.in                   | 4 ++--
 package/opencv/Config.in                | 2 +-
 package/opencv3/Config.in               | 2 +-
 package/squeezelite/Config.in           | 2 +-
 package/tovid/Config.in                 | 4 +++-
 10 files changed, 19 insertions(+), 12 deletions(-)

Both applied to master, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com