summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/libav/libav.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-multimedia/libav/libav.inc')
-rw-r--r--meta/recipes-multimedia/libav/libav.inc129
1 files changed, 129 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/libav/libav.inc b/meta/recipes-multimedia/libav/libav.inc
new file mode 100644
index 0000000000..eae190d6ea
--- /dev/null
+++ b/meta/recipes-multimedia/libav/libav.inc
@@ -0,0 +1,129 @@
1SUMMARY = "A complete, cross-platform solution to record, convert and stream audio and video."
2HOMEPAGE = "http://libav.org/"
3SECTION = "libs"
4LICENSE = "GPLv2+"
5LICENSE_FLAGS = "commercial"
6
7# Provides ffmpeg compat, see http://libav.org/about.html
8PROVIDES = "ffmpeg"
9
10ARM_INSTRUCTION_SET = "arm"
11
12DEPENDS = "virtual/libsdl zlib libogg libvorbis libtheora yasm-native"
13
14INC_PR = "r8"
15
16inherit autotools pkgconfig
17
18B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
19
20FULL_OPTIMIZATION_armv7a = "-fexpensive-optimizations -fomit-frame-pointer -O4 -ffast-math"
21BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"
22
23EXTRA_FFCONF_armv7a = "--cpu=cortex-a8"
24EXTRA_FFCONF ?= ""
25
26PACKAGECONFIG ??= "bzip2 x264 x11"
27PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
28PACKAGECONFIG[bzip2] = "--enable-bzlib,--disable-bzlib,bzip2"
29PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger"
30PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm"
31PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
32PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
33PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame"
34PACKAGECONFIG[faac] = "--enable-libfaac,--disable-libfaac,faac"
35PACKAGECONFIG[x11] = "--enable-x11grab,--disable-x11grab,virtual/libx11 libxfixes libxext xproto"
36
37EXTRA_OECONF = " \
38 --enable-shared \
39 --enable-pthreads \
40 --enable-gpl \
41 --enable-avfilter \
42 \
43 --cross-prefix=${TARGET_PREFIX} \
44 --prefix=${prefix} \
45 \
46 --enable-avserver \
47 --enable-avplay \
48 --enable-libtheora \
49 --enable-libvorbis \
50 --arch=${TARGET_ARCH} \
51 --target-os="linux" \
52 --enable-cross-compile \
53 --extra-cflags="${TARGET_CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
54 --extra-ldflags="${TARGET_LDFLAGS}" \
55 --sysroot="${STAGING_DIR_TARGET}" \
56 --enable-hardcoded-tables \
57 ${EXTRA_FFCONF} \
58"
59
60do_configure() {
61 # We don't have TARGET_PREFIX-pkgconfig
62 sed -i '/pkg_config_default="${cross_prefix}${pkg_config_default}"/d' ${S}/configure
63 mkdir -p ${B}
64 cd ${B}
65 ${S}/configure ${EXTRA_OECONF}
66 sed -i -e s:Os:O4:g ${B}/config.h
67}
68
69do_install_append() {
70 install -m 0644 ${S}/libavfilter/*.h ${D}${includedir}/libavfilter/
71}
72
73FFMPEG_LIBS = "libavcodec libavdevice libavformat \
74 libavutil libpostproc libswscale libavfilter"
75
76PACKAGES += "${PN}-vhook-dbg ${PN}-vhook ffmpeg-x264-presets"
77
78RSUGGESTS_${PN} = "mplayer"
79FILES_${PN} = "${bindir}"
80FILES_${PN}-dev = "${includedir}/${PN}"
81
82FILES_${PN}-vhook = "${libdir}/vhook"
83FILES_${PN}-vhook-dbg += "${libdir}/vhook/.debug"
84
85FILES_ffmpeg-x264-presets = "${datadir}/*.avpreset"
86
87LEAD_SONAME = "libavcodec.so"
88
89FILES_${PN}-dev = "${includedir}"
90
91python populate_packages_prepend() {
92 av_libdir = d.expand('${libdir}')
93 av_pkgconfig = d.expand('${libdir}/pkgconfig')
94
95 # Runtime package
96 do_split_packages(d, av_libdir, '^lib(.*)\.so\..*',
97 output_pattern='lib%s',
98 description='libav %s library',
99 extra_depends='',
100 prepend=True,
101 allow_links=True)
102
103 # Development packages (-dev, -staticdev)
104 do_split_packages(d, av_libdir, '^lib(.*)\.so$',
105 output_pattern='lib%s-dev',
106 description='libav %s development package',
107 extra_depends='${PN}-dev',
108 prepend=True,
109 allow_links=True)
110 do_split_packages(d, av_pkgconfig, '^lib(.*)\.pc$',
111 output_pattern='lib%s-dev',
112 description='libav %s development package',
113 extra_depends='${PN}-dev',
114 prepend=True)
115 do_split_packages(d, av_libdir, '^lib(.*)\.a$',
116 output_pattern='lib%s-staticdev',
117 description='libav %s development package - static library',
118 extra_depends='${PN}-dev',
119 prepend=True,
120 allow_links=True)
121
122 if d.getVar('TARGET_ARCH', True) == 'i586':
123 # libav can't be build with -fPIC for 32-bit x86
124 pkgs = d.getVar('PACKAGES', True).split()
125 for pkg in pkgs:
126 d.appendVar('INSANE_SKIP_%s' % pkg, ' textrel')
127}
128
129PACKAGES_DYNAMIC += "^lib(av(codec|device|filter|format|util)|postproc).*"