diff options
Diffstat (limited to 'meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb')
| -rw-r--r-- | meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb | 170 |
1 files changed, 170 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb b/meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb new file mode 100644 index 0000000000..9dd56fbba4 --- /dev/null +++ b/meta/recipes-multimedia/ffmpeg/ffmpeg_4.3.2.bb | |||
| @@ -0,0 +1,170 @@ | |||
| 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 | file://0001-libavutil-include-assembly-with-full-path-from-sourc.patch \ | ||
| 29 | " | ||
| 30 | SRC_URI[sha256sum] = "46e4e64f1dd0233cbc0934b9f1c0da676008cad34725113fb7f802cfa84ccddb" | ||
| 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 pic pthreads shared theora x264 zlib \ | ||
| 47 | ${@bb.utils.contains('AVAILTUNES', 'mips32r2', 'mips32r2', '', d)} \ | ||
| 48 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv xcb', '', d)}" | ||
| 49 | |||
| 50 | # libraries to build in addition to avutil | ||
| 51 | PACKAGECONFIG[avdevice] = "--enable-avdevice,--disable-avdevice" | ||
| 52 | PACKAGECONFIG[avfilter] = "--enable-avfilter,--disable-avfilter" | ||
| 53 | PACKAGECONFIG[avcodec] = "--enable-avcodec,--disable-avcodec" | ||
| 54 | PACKAGECONFIG[avformat] = "--enable-avformat,--disable-avformat" | ||
| 55 | PACKAGECONFIG[swresample] = "--enable-swresample,--disable-swresample" | ||
| 56 | PACKAGECONFIG[swscale] = "--enable-swscale,--disable-swscale" | ||
| 57 | PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc" | ||
| 58 | PACKAGECONFIG[avresample] = "--enable-avresample,--disable-avresample" | ||
| 59 | |||
| 60 | # features to support | ||
| 61 | PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib" | ||
| 62 | PACKAGECONFIG[altivec] = "--enable-altivec,--disable-altivec," | ||
| 63 | PACKAGECONFIG[bzlib] = "--enable-bzlib,--disable-bzlib,bzip2" | ||
| 64 | PACKAGECONFIG[fdk-aac] = "--enable-libfdk-aac --enable-nonfree,--disable-libfdk-aac,fdk-aac" | ||
| 65 | PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl" | ||
| 66 | PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm" | ||
| 67 | PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack" | ||
| 68 | PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis" | ||
| 69 | PACKAGECONFIG[lzma] = "--enable-lzma,--disable-lzma,xz" | ||
| 70 | PACKAGECONFIG[mfx] = "--enable-libmfx,--disable-libmfx,intel-mediasdk" | ||
| 71 | PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame" | ||
| 72 | PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl" | ||
| 73 | PACKAGECONFIG[sdl2] = "--enable-sdl2,--disable-sdl2,virtual/libsdl2" | ||
| 74 | PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex" | ||
| 75 | PACKAGECONFIG[srt] = "--enable-libsrt,--disable-libsrt,srt" | ||
| 76 | PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora libogg" | ||
| 77 | PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva" | ||
| 78 | PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau" | ||
| 79 | PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx" | ||
| 80 | PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264" | ||
| 81 | PACKAGECONFIG[x265] = "--enable-libx265,--disable-libx265,x265" | ||
| 82 | PACKAGECONFIG[xcb] = "--enable-libxcb,--disable-libxcb,libxcb" | ||
| 83 | PACKAGECONFIG[xv] = "--enable-outdev=xv,--disable-outdev=xv,libxv" | ||
| 84 | PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib" | ||
| 85 | |||
| 86 | # other configuration options | ||
| 87 | PACKAGECONFIG[mips32r2] = ",--disable-mipsdsp --disable-mipsdspr2" | ||
| 88 | PACKAGECONFIG[pic] = "--enable-pic" | ||
| 89 | PACKAGECONFIG[pthreads] = "--enable-pthreads,--disable-pthreads" | ||
| 90 | PACKAGECONFIG[shared] = "--enable-shared" | ||
| 91 | PACKAGECONFIG[strip] = ",--disable-stripping" | ||
| 92 | |||
| 93 | # Check codecs that require --enable-nonfree | ||
| 94 | USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'openssl' ], 'yes', '', d)}" | ||
| 95 | |||
| 96 | def cpu(d): | ||
| 97 | for arg in (d.getVar('TUNE_CCARGS') or '').split(): | ||
| 98 | if arg.startswith('-mcpu='): | ||
| 99 | return arg[6:] | ||
| 100 | return 'generic' | ||
| 101 | |||
| 102 | EXTRA_OECONF = " \ | ||
| 103 | ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \ | ||
| 104 | \ | ||
| 105 | --cross-prefix=${TARGET_PREFIX} \ | ||
| 106 | \ | ||
| 107 | --ld="${CCLD}" \ | ||
| 108 | --cc="${CC}" \ | ||
| 109 | --cxx="${CXX}" \ | ||
| 110 | --arch=${TARGET_ARCH} \ | ||
| 111 | --target-os="linux" \ | ||
| 112 | --enable-cross-compile \ | ||
| 113 | --extra-cflags="${CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \ | ||
| 114 | --extra-ldflags="${LDFLAGS}" \ | ||
| 115 | --sysroot="${STAGING_DIR_TARGET}" \ | ||
| 116 | ${EXTRA_FFCONF} \ | ||
| 117 | --libdir=${libdir} \ | ||
| 118 | --shlibdir=${libdir} \ | ||
| 119 | --datadir=${datadir}/ffmpeg \ | ||
| 120 | --cpu=${@cpu(d)} \ | ||
| 121 | --pkg-config=pkg-config \ | ||
| 122 | " | ||
| 123 | |||
| 124 | EXTRA_OECONF_append_linux-gnux32 = " --disable-asm" | ||
| 125 | # gold crashes on x86, another solution is to --disable-asm but thats more hacky | ||
| 126 | # ld.gold: internal error in relocate_section, at ../../gold/i386.cc:3684 | ||
| 127 | |||
| 128 | LDFLAGS_append_x86 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}" | ||
| 129 | |||
| 130 | EXTRA_OEMAKE = "V=1" | ||
| 131 | |||
| 132 | do_configure() { | ||
| 133 | ${S}/configure ${EXTRA_OECONF} | ||
| 134 | } | ||
| 135 | |||
| 136 | # patch out build host paths for reproducibility | ||
| 137 | do_compile_prepend_class-target() { | ||
| 138 | sed -i -e "s,${WORKDIR},,g" ${B}/config.h | ||
| 139 | } | ||
| 140 | |||
| 141 | PACKAGES =+ "libavcodec \ | ||
| 142 | libavdevice \ | ||
| 143 | libavfilter \ | ||
| 144 | libavformat \ | ||
| 145 | libavresample \ | ||
| 146 | libavutil \ | ||
| 147 | libpostproc \ | ||
| 148 | libswresample \ | ||
| 149 | libswscale" | ||
| 150 | |||
| 151 | FILES_libavcodec = "${libdir}/libavcodec${SOLIBS}" | ||
| 152 | FILES_libavdevice = "${libdir}/libavdevice${SOLIBS}" | ||
| 153 | FILES_libavfilter = "${libdir}/libavfilter${SOLIBS}" | ||
| 154 | FILES_libavformat = "${libdir}/libavformat${SOLIBS}" | ||
| 155 | FILES_libavresample = "${libdir}/libavresample${SOLIBS}" | ||
| 156 | FILES_libavutil = "${libdir}/libavutil${SOLIBS}" | ||
| 157 | FILES_libpostproc = "${libdir}/libpostproc${SOLIBS}" | ||
| 158 | FILES_libswresample = "${libdir}/libswresample${SOLIBS}" | ||
| 159 | FILES_libswscale = "${libdir}/libswscale${SOLIBS}" | ||
| 160 | |||
| 161 | # ffmpeg disables PIC on some platforms (e.g. x86-32) | ||
| 162 | INSANE_SKIP_${MLPREFIX}libavcodec = "textrel" | ||
| 163 | INSANE_SKIP_${MLPREFIX}libavdevice = "textrel" | ||
| 164 | INSANE_SKIP_${MLPREFIX}libavfilter = "textrel" | ||
| 165 | INSANE_SKIP_${MLPREFIX}libavformat = "textrel" | ||
| 166 | INSANE_SKIP_${MLPREFIX}libavutil = "textrel" | ||
| 167 | INSANE_SKIP_${MLPREFIX}libavresample = "textrel" | ||
| 168 | INSANE_SKIP_${MLPREFIX}libswscale = "textrel" | ||
| 169 | INSANE_SKIP_${MLPREFIX}libswresample = "textrel" | ||
| 170 | INSANE_SKIP_${MLPREFIX}libpostproc = "textrel" | ||
