ffmpeg_4.0.bb 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. LICENSE = "BSD & GPLv2+ & LGPLv2.1+ & MIT"
  8. LICENSE_${PN} = "GPLv2+"
  9. LICENSE_libavcodec = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
  10. LICENSE_libavdevice = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
  11. LICENSE_libavfilter = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
  12. LICENSE_libavformat = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
  13. LICENSE_libavresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
  14. LICENSE_libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
  15. LICENSE_libpostproc = "GPLv2+"
  16. LICENSE_libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
  17. LICENSE_libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
  18. LICENSE_FLAGS = "commercial"
  19. LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
  20. file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
  21. file://COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
  22. file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
  23. SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \
  24. file://mips64_cpu_detection.patch \
  25. "
  26. SRC_URI[md5sum] = "1cc9e8cb027b9fd4c54f598f51002c19"
  27. SRC_URI[sha256sum] = "ed945daf40b124e77a685893cc025d086f638bc703183460aff49508edb3a43f"
  28. # Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717
  29. ARM_INSTRUCTION_SET_armv4 = "arm"
  30. ARM_INSTRUCTION_SET_armv5 = "arm"
  31. ARM_INSTRUCTION_SET_armv6 = "arm"
  32. # Should be API compatible with libav (which was a fork of ffmpeg)
  33. # libpostproc was previously packaged from a separate recipe
  34. PROVIDES = "libav libpostproc"
  35. DEPENDS = "alsa-lib zlib libogg yasm-native"
  36. inherit autotools pkgconfig
  37. PACKAGECONFIG ??= "avdevice avfilter avcodec avformat swresample swscale postproc \
  38. bzlib gpl lzma theora x264 \
  39. ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv', '', d)}"
  40. # libraries to build in addition to avutil
  41. PACKAGECONFIG[avdevice] = "--enable-avdevice,--disable-avdevice"
  42. PACKAGECONFIG[avfilter] = "--enable-avfilter,--disable-avfilter"
  43. PACKAGECONFIG[avcodec] = "--enable-avcodec,--disable-avcodec"
  44. PACKAGECONFIG[avformat] = "--enable-avformat,--disable-avformat"
  45. PACKAGECONFIG[swresample] = "--enable-swresample,--disable-swresample"
  46. PACKAGECONFIG[swscale] = "--enable-swscale,--disable-swscale"
  47. PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc"
  48. PACKAGECONFIG[avresample] = "--enable-avresample,--disable-avresample"
  49. # features to support
  50. PACKAGECONFIG[bzlib] = "--enable-bzlib,--disable-bzlib,bzip2"
  51. PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl"
  52. PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm"
  53. PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
  54. PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis"
  55. PACKAGECONFIG[lzma] = "--enable-lzma,--disable-lzma,xz"
  56. PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame"
  57. PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
  58. PACKAGECONFIG[sdl2] = "--enable-sdl2,--disable-sdl2,virtual/libsdl2"
  59. PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex"
  60. PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora"
  61. PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
  62. PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau"
  63. PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
  64. PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
  65. PACKAGECONFIG[xv] = "--enable-outdev=xv,--disable-outdev=xv,libxv"
  66. # Check codecs that require --enable-nonfree
  67. USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'openssl' ], 'yes', '', d)}"
  68. def cpu(d):
  69. for arg in (d.getVar('TUNE_CCARGS') or '').split():
  70. if arg.startswith('-mcpu='):
  71. return arg[6:]
  72. return 'generic'
  73. EXTRA_OECONF = " \
  74. --disable-stripping \
  75. --enable-pic \
  76. --enable-shared \
  77. --enable-pthreads \
  78. --disable-libxcb \
  79. --disable-libxcb-shm \
  80. --disable-libxcb-xfixes \
  81. --disable-libxcb-shape \
  82. ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \
  83. \
  84. --cross-prefix=${TARGET_PREFIX} \
  85. \
  86. --ld="${CCLD}" \
  87. --cc="${CC}" \
  88. --cxx="${CXX}" \
  89. --arch=${TARGET_ARCH} \
  90. --target-os="linux" \
  91. --enable-cross-compile \
  92. --extra-cflags="${TARGET_CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
  93. --extra-ldflags="${TARGET_LDFLAGS}" \
  94. --sysroot="${STAGING_DIR_TARGET}" \
  95. --enable-hardcoded-tables \
  96. ${EXTRA_FFCONF} \
  97. --libdir=${libdir} \
  98. --shlibdir=${libdir} \
  99. --datadir=${datadir}/ffmpeg \
  100. ${@bb.utils.contains('AVAILTUNES', 'mips32r2', '', '--disable-mipsdsp --disable-mipsdspr2', d)} \
  101. --cpu=${@cpu(d)} \
  102. --pkg-config=pkg-config \
  103. "
  104. EXTRA_OECONF_append_linux-gnux32 = " --disable-asm"
  105. do_configure() {
  106. ${S}/configure ${EXTRA_OECONF}
  107. }
  108. PACKAGES =+ "libavcodec \
  109. libavdevice \
  110. libavfilter \
  111. libavformat \
  112. libavresample \
  113. libavutil \
  114. libpostproc \
  115. libswresample \
  116. libswscale"
  117. FILES_libavcodec = "${libdir}/libavcodec${SOLIBS}"
  118. FILES_libavdevice = "${libdir}/libavdevice${SOLIBS}"
  119. FILES_libavfilter = "${libdir}/libavfilter${SOLIBS}"
  120. FILES_libavformat = "${libdir}/libavformat${SOLIBS}"
  121. FILES_libavresample = "${libdir}/libavresample${SOLIBS}"
  122. FILES_libavutil = "${libdir}/libavutil${SOLIBS}"
  123. FILES_libpostproc = "${libdir}/libpostproc${SOLIBS}"
  124. FILES_libswresample = "${libdir}/libswresample${SOLIBS}"
  125. FILES_libswscale = "${libdir}/libswscale${SOLIBS}"
  126. # ffmpeg disables PIC on some platforms (e.g. x86-32)
  127. INSANE_SKIP_${MLPREFIX}libavcodec = "textrel"
  128. INSANE_SKIP_${MLPREFIX}libavdevice = "textrel"
  129. INSANE_SKIP_${MLPREFIX}libavfilter = "textrel"
  130. INSANE_SKIP_${MLPREFIX}libavformat = "textrel"
  131. INSANE_SKIP_${MLPREFIX}libavutil = "textrel"
  132. INSANE_SKIP_${MLPREFIX}libavresample = "textrel"
  133. INSANE_SKIP_${MLPREFIX}libswscale = "textrel"
  134. INSANE_SKIP_${MLPREFIX}libswresample = "textrel"
  135. INSANE_SKIP_${MLPREFIX}libpostproc = "textrel"