Skip to contentSkip to conversation

ffmpeg: consolidate duplicated config options

PATCH New Danomi Manchego 2 participants 6 messages Sep 9, 2014 – Sep 21, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ffmpeg: consolidate duplicated config options

Commit 62ab07ef769bd6504fe1db144aaac3fd45db9dad added a bunch of hard-coded options. Some of these options are then again added (or negated) based on kconfig settings. This patch removes the hard coded swscale and postproc settings, as they are enabled or disabled later. It also moves the --disable-pic lower as an else clause to the part that adds --enable-pic.

---
 package/ffmpeg/ffmpeg.mk |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
package/ffmpeg/ffmpeg.mk +2 -3
index 6771309..2c52183 100644
@@ -22,15 +22,12 @@ FFMPEG_CONF_OPT = \
 	--disable-debug \
 	--disable-version3 \
 	--enable-logging \
-	--disable-pic \
 	--enable-optimizations \
 	--disable-extra-warnings \
 	--disable-ffprobe \
 	--enable-avdevice \
 	--enable-avcodec \
 	--enable-avformat \
-	--enable-swscale \
-	--enable-postproc \
 	--disable-x11grab \
 	--enable-network \
 	--disable-gray \
@@ -312,6 +309,8 @@ endif
 
 ifeq ($(BR2_PREFER_STATIC_LIB),)
 FFMPEG_CONF_OPT += --enable-pic
+else
+FFMPEG_CONF_OPT += --disable-pic
 endif
 
 FFMPEG_CONF_OPT += $(call qstrip,$(BR2_PACKAGE_FFMPEG_EXTRACONF))
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 2/3 ffmpeg: enable or disable debug based on BR2_ENABLE_DEBUG

Rather than hard-code --disable-debug, selectively enable or disable based on BR2_ENABLE_DEBUG.

(Similar to gst1-libav.)

---
 package/ffmpeg/ffmpeg.mk |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
package/ffmpeg/ffmpeg.mk +7 -2
index 2c52183..d50720b 100644
@@ -17,9 +17,8 @@ FFMPEG_LICENSE_FILES += COPYING.GPLv2
 endif
 
 FFMPEG_CONF_OPT = \
-	--prefix=/usr		\
+	--prefix=/usr \
 	--enable-avfilter \
-	--disable-debug \
 	--disable-version3 \
 	--enable-logging \
 	--enable-optimizations \
@@ -68,6 +67,12 @@ FFMPEG_CONF_OPT = \
 
 FFMPEG_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv)
 
+ifeq ($(BR2_ENABLE_DEBUG),y)
+FFMPEG_CONF_OPT += --enable-debug
+else
+FFMPEG_CONF_OPT += --disable-debug
+endif
+
 ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
 FFMPEG_CONF_OPT += --enable-gpl
 else
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/3 ffmpeg: enable or disable debug based on BR2_ENABLE_DEBUG

Dear Danomi Manchego,

package/ffmpeg/ffmpeg.mk FFMPEG_LICENSE_FILES += COPYING.GPLv2 · line 20

Quoted 3 lines · Danomi Manchego

FFMPEG_CONF_OPT = \

package/ffmpeg/ffmpeg.mk +1 -1
-	--prefix=/usr		\
+	--prefix=/usr \

Unrelated change, so I removed this change from the patch.

Quoted 8 lines
package/ffmpeg/ffmpeg.mk +0 -1
 	--enable-avfilter \
-	--disable-debug \
 	--disable-version3 \
 	--enable-logging \
 	--enable-optimizations \
@@ -68,6 +67,12 @@ FFMPEG_CONF_OPT = \
 
 FFMPEG_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv)

package/ffmpeg/ffmpeg.mk FFMPEG_CONF_OPT = \ · line 78

Quoted 10 lines
package/ffmpeg/ffmpeg.mk +6 -0
 
+ifeq ($(BR2_ENABLE_DEBUG),y)
+FFMPEG_CONF_OPT += --enable-debug
+else
+FFMPEG_CONF_OPT += --disable-debug
+endif
+
 ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
 FFMPEG_CONF_OPT += --enable-gpl
 else

Other than that, applied, thanks!

Thomas

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

PATCH 3/3 ffmpeg: add --pkg-config to configure options

In reply to Danomi Manchego

The ffmpeg does not understand the PKG_CONFIG env variable, so it throws a line like this at the end of its configuration:

WARNING: .../output/host/usr/bin/arm-none-linux-gnueabi-pkg-config not found, library detection may fail.

Apparently, some of the indevs and outdevs need a pkg-config. This patch adds the --pkg-config to let ffmpeg know where it is.

---
 package/ffmpeg/ffmpeg.mk |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
package/ffmpeg/ffmpeg.mk +3 -2
index d50720b..b1d524e 100644
@@ -65,7 +65,7 @@ FFMPEG_CONF_OPT = \
 	--disable-symver \
 	--disable-doc
 
-FFMPEG_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv)
+FFMPEG_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv) host-pkgconf
 
 ifeq ($(BR2_ENABLE_DEBUG),y)
 FFMPEG_CONF_OPT += --enable-debug
@@ -327,13 +327,14 @@ define FFMPEG_CONFIGURE_CMDS
 	$(TARGET_CONFIGURE_ARGS) \
 	$(FFMPEG_CONF_ENV) \
 	./configure \
-		--enable-cross-compile	\
+		--enable-cross-compile \
 		--cross-prefix=$(TARGET_CROSS) \
 		--sysroot=$(STAGING_DIR) \
 		--host-cc="$(HOSTCC)" \
 		--arch=$(BR2_ARCH) \
 		--target-os="linux" \
 		--disable-stripping \
+		--pkg-config="$(PKG_CONFIG_HOST_BINARY)" \
 		$(if $(BR2_GCC_TARGET_TUNE),--cpu=$(BR2_GCC_TARGET_TUNE)) \
 		$(SHARED_STATIC_LIBS_OPTS) \
 		$(FFMPEG_CONF_OPT) \
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 3/3 ffmpeg: add --pkg-config to configure options

Dear Danomi Manchego,

Quoted 28 lines · Danomi Manchego

The ffmpeg does not understand the PKG_CONFIG env variable, so it throws a line like this at the end of its configuration:

WARNING: .../output/host/usr/bin/arm-none-linux-gnueabi-pkg-config not found, library detection may fail.

Apparently, some of the indevs and outdevs need a pkg-config. This patch adds the --pkg-config to let ffmpeg know where it is.

---
 package/ffmpeg/ffmpeg.mk |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
package/ffmpeg/ffmpeg.mk +1 -1
index d50720b..b1d524e 100644
@@ -65,7 +65,7 @@ FFMPEG_CONF_OPT = \
 	--disable-symver \
 	--disable-doc
 
-FFMPEG_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv)
+FFMPEG_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv) host-pkgconf
 
 ifeq ($(BR2_ENABLE_DEBUG),y)
 FFMPEG_CONF_OPT += --enable-debug

package/ffmpeg/ffmpeg.mk define FFMPEG_CONFIGURE_CMDS · line 330

Quoted 5 lines
package/ffmpeg/ffmpeg.mk +1 -1
@@ -327,13 +327,14 @@ define FFMPEG_CONFIGURE_CMDS
 	$(TARGET_CONFIGURE_ARGS) \
 	$(FFMPEG_CONF_ENV) \
 	./configure \
-		--enable-cross-compile	\
+		--enable-cross-compile \

Unrelated change.

package/ffmpeg/ffmpeg.mk define FFMPEG_CONFIGURE_CMDS · line 340

Quoted 10 lines
package/ffmpeg/ffmpeg.mk +1 -0
 		--cross-prefix=$(TARGET_CROSS) \
 		--sysroot=$(STAGING_DIR) \
 		--host-cc="$(HOSTCC)" \
 		--arch=$(BR2_ARCH) \
 		--target-os="linux" \
 		--disable-stripping \
+		--pkg-config="$(PKG_CONFIG_HOST_BINARY)" \
 		$(if $(BR2_GCC_TARGET_TUNE),--cpu=$(BR2_GCC_TARGET_TUNE)) \
 		$(SHARED_STATIC_LIBS_OPTS) \
 		$(FFMPEG_CONF_OPT) \

So I've removed the unrelated change, and committed your patch.

Thanks!

Thomas

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

PATCH 1/3 ffmpeg: consolidate duplicated config options

In reply to Danomi Manchego

Dear Danomi Manchego,

Quoted 11 lines · Danomi Manchego

Commit 62ab07ef769bd6504fe1db144aaac3fd45db9dad added a bunch of hard-coded options. Some of these options are then again added (or negated) based on kconfig settings. This patch removes the hard coded swscale and postproc settings, as they are enabled or disabled later. It also moves the --disable-pic lower as an else clause to the part that adds --enable-pic.

---
 package/ffmpeg/ffmpeg.mk |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Applied, thanks.

Thomas

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