Patchwork [1/4] libav: add PACKAGECONFIG for theora, libvorbis, speex and openssl

login
register
mail settings
Submitter Matthieu CRAPET
Date May 21, 2014, 11:37 a.m.
Message ID <1400672277-7181-1-git-send-email-Matthieu.Crapet@ingenico.com>
Download mbox | patch
Permalink /patch/72489/
State New
Headers show

Comments

Matthieu CRAPET - May 21, 2014, 11:37 a.m.
Dropped libvorvis dependency because there is already a (better) builtin vorbis codec.
Don't confuse codec names: "vorbis" (builtin) and "libvorbis" (using external library).

Changes:
- add --enable-nonfree when faac or openssl are used
- add DESCRIPTION
- sort PACKAGECONFIG entries

Tested with libav-0.8.11 & libav-9.13.

Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
---
 meta/recipes-multimedia/libav/libav.inc | 39 ++++++++++++++++++++++++++-------
 1 file changed, 31 insertions(+), 8 deletions(-)
Matthieu CRAPET - June 2, 2014, 7:03 a.m.
Hi,

Should I rebase/repost this? Aside libav versions/pinning preferences, this single patch deserves to be commited.

Regards,
Matthieu


-----Message d'origine-----
De : openembedded-core-bounces@lists.openembedded.org [mailto:openembedded-core-bounces@lists.openembedded.org] De la part de Matthieu Crapet
Envoyé : mercredi 21 mai 2014 13:38
À : openembedded-core@lists.openembedded.org
Objet : [OE-core] [PATCH 1/4] libav: add PACKAGECONFIG for theora, libvorbis, speex and openssl

Dropped libvorvis dependency because there is already a (better) builtin vorbis codec.
Don't confuse codec names: "vorbis" (builtin) and "libvorbis" (using external library).

Changes:
- add --enable-nonfree when faac or openssl are used
- add DESCRIPTION
- sort PACKAGECONFIG entries

Tested with libav-0.8.11 & libav-9.13.

Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
---
 meta/recipes-multimedia/libav/libav.inc | 39 ++++++++++++++++++++++++++-------
 1 file changed, 31 insertions(+), 8 deletions(-)

[...]
Saul Wold - June 2, 2014, 3:30 p.m.
On 06/02/2014 12:03 AM, Matthieu CRAPET wrote:
> Hi,
>
> Should I rebase/repost this? Aside libav versions/pinning preferences, this single patch deserves to be commited.
>
Yes please, but I think you want to consider using 
bb.utils.contains_any() instead of your contains_one implementation.

Sau!

> Regards,
> Matthieu
>
>
> -----Message d'origine-----
> De : openembedded-core-bounces@lists.openembedded.org [mailto:openembedded-core-bounces@lists.openembedded.org] De la part de Matthieu Crapet
> Envoyé : mercredi 21 mai 2014 13:38
> À : openembedded-core@lists.openembedded.org
> Objet : [OE-core] [PATCH 1/4] libav: add PACKAGECONFIG for theora, libvorbis, speex and openssl
>
> Dropped libvorvis dependency because there is already a (better) builtin vorbis codec.
> Don't confuse codec names: "vorbis" (builtin) and "libvorbis" (using external library).
>
> Changes:
> - add --enable-nonfree when faac or openssl are used
> - add DESCRIPTION
> - sort PACKAGECONFIG entries
>
> Tested with libav-0.8.11 & libav-9.13.
>
> Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
> ---
>   meta/recipes-multimedia/libav/libav.inc | 39 ++++++++++++++++++++++++++-------
>   1 file changed, 31 insertions(+), 8 deletions(-)
>
> [...]
>
Matthieu CRAPET - June 4, 2014, 8 a.m.
Saul,

> bb.utils.contains_any() instead of your contains_one implementation.

It is different, that's why I have added it.

+# Check codecs that require --enable-nonfree
+USE_NONFREE = "${@contains_one('PACKAGECONFIG', [ 'faac', 'openssl' ], d)}"

contains_any will not work if PACKAGECONFIG have only one item (faac for example).

Should it be a possible addition to bitbake ?

Matthieu


-----Message d'origine-----
De : Saul Wold [mailto:sgw@linux.intel.com] 
Envoyé : lundi 2 juin 2014 17:31
À : Matthieu CRAPET; openembedded-core@lists.openembedded.org
Objet : Re: [OE-core] [PATCH 1/4] libav: add PACKAGECONFIG for theora, libvorbis, speex and openssl

On 06/02/2014 12:03 AM, Matthieu CRAPET wrote:
> Hi,
>
> Should I rebase/repost this? Aside libav versions/pinning preferences, this single patch deserves to be commited.
>
Yes please, but I think you want to consider using
bb.utils.contains_any() instead of your contains_one implementation.

Sau!

> Regards,
> Matthieu
>
>
> -----Message d'origine-----
> De : openembedded-core-bounces@lists.openembedded.org 
> [mailto:openembedded-core-bounces@lists.openembedded.org] De la part 
> de Matthieu Crapet Envoyé : mercredi 21 mai 2014 13:38 À : 
> openembedded-core@lists.openembedded.org
> Objet : [OE-core] [PATCH 1/4] libav: add PACKAGECONFIG for theora, 
> libvorbis, speex and openssl
>
> Dropped libvorvis dependency because there is already a (better) builtin vorbis codec.
> Don't confuse codec names: "vorbis" (builtin) and "libvorbis" (using external library).
>
> Changes:
> - add --enable-nonfree when faac or openssl are used
> - add DESCRIPTION
> - sort PACKAGECONFIG entries
>
> Tested with libav-0.8.11 & libav-9.13.
>
> Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
> ---
>   meta/recipes-multimedia/libav/libav.inc | 39 ++++++++++++++++++++++++++-------
>   1 file changed, 31 insertions(+), 8 deletions(-)
>
> [...]
>

Patch

diff --git a/meta/recipes-multimedia/libav/libav.inc b/meta/recipes-multimedia/libav/libav.inc
index a05a2a6..0bcdedc 100644
--- a/meta/recipes-multimedia/libav/libav.inc
+++ b/meta/recipes-multimedia/libav/libav.inc
@@ -1,6 +1,12 @@ 
-SUMMARY = "A complete, cross-platform solution to record, convert and stream audio and video"
+SUMMARY = "Open source audio and video processing tools and librairies"
+DESCRIPTION = "Libav is a friendly and community-driven effort to provide its users \
+               with a set of portable, functional and high-performance libraries for \
+               dealing with multimedia formats of all sorts. It originates from the \
+               FFmpeg codebase, but goes its own way these days, providing its users \
+               with reliable releases and a clear vision how to go forward."
 HOMEPAGE = "http://libav.org/"
 SECTION = "libs"
+
 LICENSE = "GPLv2+"
 LICENSE_FLAGS = "commercial"
 
@@ -9,7 +15,7 @@  PROVIDES = "ffmpeg"
 
 ARM_INSTRUCTION_SET = "arm"
 
-DEPENDS = "zlib libogg libvorbis libtheora yasm-native"
+DEPENDS = "zlib libogg yasm-native"
 
 INC_PR = "r8"
 
@@ -23,21 +29,29 @@  BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"
 EXTRA_FFCONF_armv7a = "--cpu=cortex-a8"
 EXTRA_FFCONF ?= ""
 
-PACKAGECONFIG ??= "bzip2 x264 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
-PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
+PACKAGECONFIG ??= "bzip2 x264 theora ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
 PACKAGECONFIG[bzip2] = "--enable-bzlib,--disable-bzlib,bzip2"
-PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger"
+PACKAGECONFIG[faac] = "--enable-libfaac,--disable-libfaac,faac"
 PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm"
-PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
-PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
+PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
+PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis"
 PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame"
-PACKAGECONFIG[faac] = "--enable-libfaac,--disable-libfaac,faac"
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
+PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger"
+PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex"
+PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora"
+PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
 PACKAGECONFIG[x11] = "--enable-x11grab,--disable-x11grab,virtual/libx11 libxfixes libxext xproto virtual/libsdl"
+PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
+
+# Check codecs that require --enable-nonfree
+USE_NONFREE = "${@contains_one('PACKAGECONFIG', [ 'faac', 'openssl' ], d)}"
 
 EXTRA_OECONF = " \
     --enable-shared \
     --enable-pthreads \
     --enable-gpl \
+    ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \
     --enable-avfilter \
     \
     --cross-prefix=${TARGET_PREFIX} \
@@ -91,6 +105,15 @@  LEAD_SONAME = "libavcodec.so"
 
 FILES_${PN}-dev = "${includedir}"
 
+def contains_one(variable, checkvalues, d):
+    val = d.getVar(variable, True)
+    if not val:
+        return ''
+    val = set(val.split())
+    if val.intersection(checkvalues):
+        return 'yes'
+    return ''
+
 python populate_packages_prepend() {
     av_libdir = d.expand('${libdir}')
     av_pkgconfig = d.expand('${libdir}/pkgconfig')