diff options
Diffstat (limited to 'meta/recipes-multimedia/ffmpeg/ffmpeg_4.2.2.bb')
-rw-r--r-- | meta/recipes-multimedia/ffmpeg/ffmpeg_4.2.2.bb | 158 |
1 files changed, 158 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg_4.2.2.bb b/meta/recipes-multimedia/ffmpeg/ffmpeg_4.2.2.bb new file mode 100644 index 0000000000..a3cf0c1a37 --- /dev/null +++ b/meta/recipes-multimedia/ffmpeg/ffmpeg_4.2.2.bb | |||
@@ -0,0 +1,158 @@ | |||
1 | SUMMARY = "A complete, cross-platform solution to record, convert and stream audio and video." | ||
2 | DESCRIPTION = "FFmpeg is the leading multimedia framework, able to decode, encode, transcode, \ | ||
3 | mux, demux, stream, filter and play pretty much anything that humans and machines \ | ||
4 | have created. It supports the most obscure ancient formats up to the cutting edge." | ||
5 | HOMEPAGE = "https://www.ffmpeg.org/" | ||
6 | SECTION = "libs" | ||
7 | |||
8 | LICENSE = "BSD & GPLv2+ & LGPLv2.1+ & MIT" | ||
9 | LICENSE_${PN} = "GPLv2+" | ||
10 | LICENSE_libavcodec = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" | ||
11 | LICENSE_libavdevice = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" | ||
12 | LICENSE_libavfilter = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" | ||
13 | LICENSE_libavformat = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" | ||
14 | LICENSE_libavresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" | ||
15 | LICENSE_libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" | ||
16 | LICENSE_libpostproc = "GPLv2+" | ||
17 | LICENSE_libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" | ||
18 | LICENSE_libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}" | ||
19 | LICENSE_FLAGS = "commercial" | ||
20 | |||
21 | LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | ||
22 | file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \ | ||
23 | file://COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \ | ||
24 | file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02" | ||
25 | |||
26 | SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \ | ||
27 | file://mips64_cpu_detection.patch \ | ||
28 | " | ||
29 | SRC_URI[md5sum] = "348956fc2faa57a2f79bbb84ded9fbc3" | ||
30 | SRC_URI[sha256sum] = "cb754255ab0ee2ea5f66f8850e1bd6ad5cac1cd855d0a2f4990fb8c668b0d29c" | ||
31 | |||
32 | # Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717 | ||
33 | ARM_INSTRUCTION_SET_armv4 = "arm" | ||
34 | ARM_INSTRUCTION_SET_armv5 = "arm" | ||
35 | ARM_INSTRUCTION_SET_armv6 = "arm" | ||
36 | |||
37 | # Should be API compatible with libav (which was a fork of ffmpeg) | ||
38 | # libpostproc was previously packaged from a separate recipe | ||
39 | PROVIDES = "libav libpostproc" | ||
40 | |||
41 | DEPENDS = "nasm-native" | ||
42 | |||
43 | inherit autotools pkgconfig | ||
44 | |||
45 | PACKAGECONFIG ??= "avdevice avfilter avcodec avformat swresample swscale postproc avresample \ | ||
46 | alsa bzlib gpl lzma theora x264 zlib \ | ||
47 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv xcb', '', d)}" | ||
48 | |||
49 | # libraries to build in addition to avutil | ||
50 | PACKAGECONFIG[avdevice] = "--enable-avdevice,--disable-avdevice" | ||
51 | PACKAGECONFIG[avfilter] = "--enable-avfilter,--disable-avfilter" | ||
52 | PACKAGECONFIG[avcodec] = "--enable-avcodec,--disable-avcodec" | ||
53 | PACKAGECONFIG[avformat] = "--enable-avformat,--disable-avformat" | ||
54 | PACKAGECONFIG[swresample] = "--enable-swresample,--disable-swresample" | ||
55 | PACKAGECONFIG[swscale] = "--enable-swscale,--disable-swscale" | ||
56 | PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc" | ||
57 | PACKAGECONFIG[avresample] = "--enable-avresample,--disable-avresample" | ||
58 | |||
59 | # features to support | ||
60 | PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib" | ||
61 | PACKAGECONFIG[bzlib] = "--enable-bzlib,--disable-bzlib,bzip2" | ||
62 | PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl" | ||
63 | PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm" | ||
64 | PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack" | ||
65 | PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis" | ||
66 | PACKAGECONFIG[lzma] = "--enable-lzma,--disable-lzma,xz" | ||
67 | PACKAGECONFIG[mfx] = "--enable-libmfx,--disable-libmfx,intel-mediasdk" | ||
68 | PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame" | ||
69 | PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl" | ||
70 | PACKAGECONFIG[sdl2] = "--enable-sdl2,--disable-sdl2,virtual/libsdl2" | ||
71 | PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex" | ||
72 | PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora libogg" | ||
73 | PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva" | ||
74 | PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau" | ||
75 | PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx" | ||
76 | PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264" | ||
77 | PACKAGECONFIG[xcb] = "--enable-libxcb,--disable-libxcb,libxcb" | ||
78 | PACKAGECONFIG[xv] = "--enable-outdev=xv,--disable-outdev=xv,libxv" | ||
79 | PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib" | ||
80 | |||
81 | # Check codecs that require --enable-nonfree | ||
82 | USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'openssl' ], 'yes', '', d)}" | ||
83 | |||
84 | def cpu(d): | ||
85 | for arg in (d.getVar('TUNE_CCARGS') or '').split(): | ||
86 | if arg.startswith('-mcpu='): | ||
87 | return arg[6:] | ||
88 | return 'generic' | ||
89 | |||
90 | EXTRA_OECONF = " \ | ||
91 | --disable-stripping \ | ||
92 | --enable-pic \ | ||
93 | --enable-shared \ | ||
94 | --enable-pthreads \ | ||
95 | ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \ | ||
96 | \ | ||
97 | --cross-prefix=${TARGET_PREFIX} \ | ||
98 | \ | ||
99 | --ld="${CCLD}" \ | ||
100 | --cc="${CC}" \ | ||
101 | --cxx="${CXX}" \ | ||
102 | --arch=${TARGET_ARCH} \ | ||
103 | --target-os="linux" \ | ||
104 | --enable-cross-compile \ | ||
105 | --extra-cflags="${CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \ | ||
106 | --extra-ldflags="${LDFLAGS}" \ | ||
107 | --sysroot="${STAGING_DIR_TARGET}" \ | ||
108 | ${EXTRA_FFCONF} \ | ||
109 | --libdir=${libdir} \ | ||
110 | --shlibdir=${libdir} \ | ||
111 | --datadir=${datadir}/ffmpeg \ | ||
112 | ${@bb.utils.contains('AVAILTUNES', 'mips32r2', '', '--disable-mipsdsp --disable-mipsdspr2', d)} \ | ||
113 | --cpu=${@cpu(d)} \ | ||
114 | --pkg-config=pkg-config \ | ||
115 | " | ||
116 | |||
117 | EXTRA_OECONF_append_linux-gnux32 = " --disable-asm" | ||
118 | # gold crashes on x86, another solution is to --disable-asm but thats more hacky | ||
119 | # ld.gold: internal error in relocate_section, at ../../gold/i386.cc:3684 | ||
120 | |||
121 | LDFLAGS_append_x86 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}" | ||
122 | |||
123 | EXTRA_OEMAKE = "V=1" | ||
124 | |||
125 | do_configure() { | ||
126 | ${S}/configure ${EXTRA_OECONF} | ||
127 | } | ||
128 | |||
129 | PACKAGES =+ "libavcodec \ | ||
130 | libavdevice \ | ||
131 | libavfilter \ | ||
132 | libavformat \ | ||
133 | libavresample \ | ||
134 | libavutil \ | ||
135 | libpostproc \ | ||
136 | libswresample \ | ||
137 | libswscale" | ||
138 | |||
139 | FILES_libavcodec = "${libdir}/libavcodec${SOLIBS}" | ||
140 | FILES_libavdevice = "${libdir}/libavdevice${SOLIBS}" | ||
141 | FILES_libavfilter = "${libdir}/libavfilter${SOLIBS}" | ||
142 | FILES_libavformat = "${libdir}/libavformat${SOLIBS}" | ||
143 | FILES_libavresample = "${libdir}/libavresample${SOLIBS}" | ||
144 | FILES_libavutil = "${libdir}/libavutil${SOLIBS}" | ||
145 | FILES_libpostproc = "${libdir}/libpostproc${SOLIBS}" | ||
146 | FILES_libswresample = "${libdir}/libswresample${SOLIBS}" | ||
147 | FILES_libswscale = "${libdir}/libswscale${SOLIBS}" | ||
148 | |||
149 | # ffmpeg disables PIC on some platforms (e.g. x86-32) | ||
150 | INSANE_SKIP_${MLPREFIX}libavcodec = "textrel" | ||
151 | INSANE_SKIP_${MLPREFIX}libavdevice = "textrel" | ||
152 | INSANE_SKIP_${MLPREFIX}libavfilter = "textrel" | ||
153 | INSANE_SKIP_${MLPREFIX}libavformat = "textrel" | ||
154 | INSANE_SKIP_${MLPREFIX}libavutil = "textrel" | ||
155 | INSANE_SKIP_${MLPREFIX}libavresample = "textrel" | ||
156 | INSANE_SKIP_${MLPREFIX}libswscale = "textrel" | ||
157 | INSANE_SKIP_${MLPREFIX}libswresample = "textrel" | ||
158 | INSANE_SKIP_${MLPREFIX}libpostproc = "textrel" | ||