|
| 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.gz \ |
| 27 | + " |
| 28 | +SRC_URI[md5sum] = "94bbb1f7fd302448a643b0f048df4534" |
| 29 | +SRC_URI[sha256sum] = "b43b1b888ed5885760f10452fb2b9f5d1b384c49f6273e2e66129d9a3c7a837e" |
| 30 | + |
| 31 | +# Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717 |
| 32 | +ARM_INSTRUCTION_SET = "arm" |
| 33 | + |
| 34 | +# Should be API compatible with libav (which was a fork of ffmpeg) |
| 35 | +# libpostproc was previously packaged from a separate recipe |
| 36 | +PROVIDES = "libav libpostproc" |
| 37 | + |
| 38 | +DEPENDS = "alsa-lib zlib libogg yasm-native" |
| 39 | + |
| 40 | +inherit autotools pkgconfig |
| 41 | + |
| 42 | +PACKAGECONFIG ??= "avresample avdevice avfilter avcodec avformat swresample swscale postproc \ |
| 43 | + bzlib gpl theora x264 \ |
| 44 | + ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv', '', d)}" |
| 45 | + |
| 46 | +# libraries to build in addition to avutil |
| 47 | +PACKAGECONFIG[avdevice] = "--enable-avdevice,--disable-avdevice" |
| 48 | +PACKAGECONFIG[avfilter] = "--enable-avfilter,--disable-avfilter" |
| 49 | +PACKAGECONFIG[avcodec] = "--enable-avcodec,--disable-avcodec" |
| 50 | +PACKAGECONFIG[avformat] = "--enable-avformat,--disable-avformat" |
| 51 | +PACKAGECONFIG[swresample] = "--enable-swresample,--disable-swresample" |
| 52 | +PACKAGECONFIG[swscale] = "--enable-swscale,--disable-swscale" |
| 53 | +PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc" |
| 54 | +PACKAGECONFIG[avresample] = "--enable-avresample,--disable-avresample" |
| 55 | + |
| 56 | +# features to support |
| 57 | +PACKAGECONFIG[bzlib] = "--enable-bzlib,--disable-bzlib,bzip2" |
| 58 | +PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl" |
| 59 | +PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm" |
| 60 | +PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack" |
| 61 | +PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis" |
| 62 | +PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame" |
| 63 | +PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl" |
| 64 | +PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger" |
| 65 | +PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex" |
| 66 | +PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora" |
| 67 | +PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva" |
| 68 | +PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau" |
| 69 | +PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx" |
| 70 | +PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264" |
| 71 | +PACKAGECONFIG[xv] = "--enable-outdev=xv,--disable-outdev=xv,libxv" |
| 72 | + |
| 73 | +# Check codecs that require --enable-nonfree |
| 74 | +USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'openssl' ], 'yes', '', d)}" |
| 75 | + |
| 76 | +def cpu(d): |
| 77 | + for arg in (d.getVar('TUNE_CCARGS') or '').split(): |
| 78 | + if arg.startswith('-mcpu='): |
| 79 | + return arg[6:] |
| 80 | + return 'generic' |
| 81 | + |
| 82 | +EXTRA_OECONF = " \ |
| 83 | + --disable-stripping \ |
| 84 | + --enable-pic \ |
| 85 | + --enable-shared \ |
| 86 | + --enable-pthreads \ |
| 87 | + ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \ |
| 88 | + \ |
| 89 | + --cross-prefix=${TARGET_PREFIX} \ |
| 90 | + \ |
| 91 | + --ld="${CCLD}" \ |
| 92 | + --cc="${CC}" \ |
| 93 | + --cxx="${CXX}" \ |
| 94 | + --arch=${TARGET_ARCH} \ |
| 95 | + --target-os="linux" \ |
| 96 | + --enable-cross-compile \ |
| 97 | + --extra-cflags="${TARGET_CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \ |
| 98 | + --extra-ldflags="${TARGET_LDFLAGS}" \ |
| 99 | + --sysroot="${STAGING_DIR_TARGET}" \ |
| 100 | + --enable-hardcoded-tables \ |
| 101 | + ${EXTRA_FFCONF} \ |
| 102 | + --libdir=${libdir} \ |
| 103 | + --shlibdir=${libdir} \ |
| 104 | + --datadir=${datadir}/ffmpeg \ |
| 105 | + --cpu=${@cpu(d)} \ |
| 106 | + --pkg-config=pkg-config \ |
| 107 | +" |
| 108 | + |
| 109 | +EXTRA_OECONF_append_linux-gnux32 = " --disable-asm" |
| 110 | + |
| 111 | +do_configure() { |
| 112 | + ${S}/configure ${EXTRA_OECONF} |
| 113 | +} |
| 114 | + |
| 115 | +PACKAGES =+ "libavcodec \ |
| 116 | + libavdevice \ |
| 117 | + libavfilter \ |
| 118 | + libavformat \ |
| 119 | + libavresample \ |
| 120 | + libavutil \ |
| 121 | + libpostproc \ |
| 122 | + libswresample \ |
| 123 | + libswscale" |
| 124 | + |
| 125 | +FILES_libavcodec = "${libdir}/libavcodec${SOLIBS}" |
| 126 | +FILES_libavdevice = "${libdir}/libavdevice${SOLIBS}" |
| 127 | +FILES_libavfilter = "${libdir}/libavfilter${SOLIBS}" |
| 128 | +FILES_libavformat = "${libdir}/libavformat${SOLIBS}" |
| 129 | +FILES_libavresample = "${libdir}/libavresample${SOLIBS}" |
| 130 | +FILES_libavutil = "${libdir}/libavutil${SOLIBS}" |
| 131 | +FILES_libpostproc = "${libdir}/libpostproc${SOLIBS}" |
| 132 | +FILES_libswresample = "${libdir}/libswresample${SOLIBS}" |
| 133 | +FILES_libswscale = "${libdir}/libswscale${SOLIBS}" |
| 134 | + |
| 135 | +# ffmpeg disables PIC on some platforms (e.g. x86-32) |
| 136 | +INSANE_SKIP_${MLPREFIX}libavcodec = "textrel" |
| 137 | +INSANE_SKIP_${MLPREFIX}libavdevice = "textrel" |
| 138 | +INSANE_SKIP_${MLPREFIX}libavfilter = "textrel" |
| 139 | +INSANE_SKIP_${MLPREFIX}libavformat = "textrel" |
| 140 | +INSANE_SKIP_${MLPREFIX}libavutil = "textrel" |
| 141 | +INSANE_SKIP_${MLPREFIX}libavresample = "textrel" |
| 142 | +INSANE_SKIP_${MLPREFIX}libswscale = "textrel" |
| 143 | +INSANE_SKIP_${MLPREFIX}libswresample = "textrel" |
| 144 | +INSANE_SKIP_${MLPREFIX}libpostproc = "textrel" |
0 commit comments