Skip to contentSkip to conversation

gst1-libav: pass --cpu config option to bundled ffmpeg

PATCH New Gustavo Zacarias 3 participants 5 messages Mar 30, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gst1-libav: pass --cpu config option to bundled ffmpeg

Like the proper ffmpeg package does, fixes:
http://autobuild.buildroot.net/results/a46/a462dae8df2450bc0f72cbed6125e106454bde0f/

---
 package/gstreamer1/gst1-libav/gst1-libav.mk | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
package/gstreamer1/gst1-libav/gst1-libav.mk +7 -2
index 496190e..8f892d0 100644
@@ -7,9 +7,7 @@
 GST1_LIBAV_VERSION = 1.8.0
 GST1_LIBAV_SOURCE = gst-libav-$(GST1_LIBAV_VERSION).tar.xz
 GST1_LIBAV_SITE = http://gstreamer.freedesktop.org/src/gst-libav
-
 GST1_LIBAV_DEPENDENCIES = host-pkgconf gstreamer1 gst1-plugins-base
-
 GST1_LIBAV_CONF_EXTRA_OPTS = --cross-prefix=$(TARGET_CROSS) --target-os=linux
 
 ifeq ($(BR2_PACKAGE_ZLIB),y)
@@ -26,6 +24,13 @@ else
 GST1_LIBAV_CONF_EXTRA_OPTS += --disable-bzlib
 endif
 
+# Generic CPU setup for bundled ffmpeg
+ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),)
+GST1_LIBAV_CONF_EXTRA_OPTS += --cpu=$(BR2_GCC_TARGET_CPU)
+else ifneq ($(call qstrip,$(BR2_GCC_TARGET_ARCH)),)
+GST1_LIBAV_CONF_EXTRA_OPTS += --cpu=$(BR2_GCC_TARGET_ARCH)
+endif
+
 ifeq ($(BR2_X86_CPU_HAS_MMX),y)
 GST1_LIBAV_CONF_EXTRA_OPTS += --enable-yasm
 GST1_LIBAV_DEPENDENCIES += host-yasm
Signature · 1 line
2.7.3
#1 lore raw

PATCH 1/1 gst1-libav: pass --cpu config option to bundled ffmpeg

Hello,

Quoted 7 lines · Gustavo Zacarias

Like the proper ffmpeg package does, fixes:
http://autobuild.buildroot.net/results/a46/a462dae8df2450bc0f72cbed6125e106454bde0f/

---
 package/gstreamer1/gst1-libav/gst1-libav.mk | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

<rant>Can I say, once again, how much I hate bundled libraries?</rant>

Applied, thanks!

Thomas

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

PATCH 1/1 gst1-libav: pass --cpu config option to bundled ffmpeg

Quoted 5 lines · Thomas Petazzoni

<rant>Can I say, once again, how much I hate bundled libraries?</rant>

Applied, thanks!

Thomas

Heh, you're not alone.
Ideally we can unbundle, we just need to find out all of the options the gst component needs from ffmpeg.
Right now for gst-libav-1.8.0 it bundles ffmpeg 3.0 so having the bump is kind of a prerequisite, i'll look into it and also adding the (surely complicated) licensing info.
Unbundling would get rid of all the duplication in ffmpeg conditions, i went for minimal in this case to fix mips, but there are other discrepancies/lack of optimizations.
Regards.

#3 lore raw

PATCH 1/1 gst1-libav: pass --cpu config option to bundled ffmpeg

In reply to Gustavo Zacarias
Quoted 2 lines · Gustavo Zacarias

Like the proper ffmpeg package does, fixes:
http://autobuild.buildroot.net/results/a46/a462dae8df2450bc0f72cbed6125e106454bde0f/

So, you didn't need to pass --sysroot for Sourcery toolchains, like I had to
in my v2 of this patch [1]? (I've marked [1] as Superseded now. Probably if my commit log would have been a little terser, it would already have been applied :-)

Regards,
Arnout

[1] http://patchwork.ozlabs.org/patch/589657/

Quoted 35 lines
---
  package/gstreamer1/gst1-libav/gst1-libav.mk | 9 +++++++--
  1 file changed, 7 insertions(+), 2 deletions(-)
package/gstreamer1/gst1-libav/gst1-libav.mk +7 -2
index 496190e..8f892d0 100644
@@ -7,9 +7,7 @@
  GST1_LIBAV_VERSION = 1.8.0
  GST1_LIBAV_SOURCE = gst-libav-$(GST1_LIBAV_VERSION).tar.xz
  GST1_LIBAV_SITE = http://gstreamer.freedesktop.org/src/gst-libav
-
  GST1_LIBAV_DEPENDENCIES = host-pkgconf gstreamer1 gst1-plugins-base
-
  GST1_LIBAV_CONF_EXTRA_OPTS = --cross-prefix=$(TARGET_CROSS) --target-os=linux
 
  ifeq ($(BR2_PACKAGE_ZLIB),y)
@@ -26,6 +24,13 @@ else
  GST1_LIBAV_CONF_EXTRA_OPTS += --disable-bzlib
  endif
 
+# Generic CPU setup for bundled ffmpeg
+ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),)
+GST1_LIBAV_CONF_EXTRA_OPTS += --cpu=$(BR2_GCC_TARGET_CPU)
+else ifneq ($(call qstrip,$(BR2_GCC_TARGET_ARCH)),)
+GST1_LIBAV_CONF_EXTRA_OPTS += --cpu=$(BR2_GCC_TARGET_ARCH)
+endif
+
  ifeq ($(BR2_X86_CPU_HAS_MMX),y)
  GST1_LIBAV_CONF_EXTRA_OPTS += --enable-yasm
  GST1_LIBAV_DEPENDENCIES += host-yasm
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#4 lore raw

PATCH 1/1 gst1-libav: pass --cpu config option to bundled ffmpeg

Quoted 9 lines · Arnout Vandecappelle

So, you didn't need to pass --sysroot for Sourcery toolchains, like I
had to in my v2 of this patch [1]? (I've marked [1] as Superseded now. Probably if my commit log would have been a little terser, it would already have been applied :-)

Regards,
Arnout

[1] http://patchwork.ozlabs.org/patch/589657/

No, it worked right away.
Anyway http://patchwork.ozlabs.org/patch/603578/ handles this the way it should be :)
When i noticed the license info was missing i wanted to avoid the super headache besides potentially duplicating ffmpeg package optimizations and size on the target and, well, making the package trivial. gst1-libav bundles ffmpeg 3.0 which we'll soon get, and anyway it also works with our current 2.8.6 version as well.
Regards.