1*4882a593Smuzhiyun################################################################################ 2*4882a593Smuzhiyun# 3*4882a593Smuzhiyun# ffmpeg 4*4882a593Smuzhiyun# 5*4882a593Smuzhiyun################################################################################ 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunFFMPEG_VERSION = 4.4.1 8*4882a593SmuzhiyunFFMPEG_SOURCE = ffmpeg-$(FFMPEG_VERSION).tar.xz 9*4882a593SmuzhiyunFFMPEG_SITE = http://ffmpeg.org/releases 10*4882a593SmuzhiyunFFMPEG_INSTALL_STAGING = YES 11*4882a593Smuzhiyun 12*4882a593SmuzhiyunFFMPEG_LICENSE = LGPL-2.1+, libjpeg license 13*4882a593SmuzhiyunFFMPEG_LICENSE_FILES = LICENSE.md COPYING.LGPLv2.1 14*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FFMPEG_GPL),y) 15*4882a593SmuzhiyunFFMPEG_LICENSE += and GPL-2.0+ 16*4882a593SmuzhiyunFFMPEG_LICENSE_FILES += COPYING.GPLv2 17*4882a593Smuzhiyunendif 18*4882a593Smuzhiyun 19*4882a593SmuzhiyunFFMPEG_CPE_ID_VENDOR = ffmpeg 20*4882a593Smuzhiyun 21*4882a593SmuzhiyunFFMPEG_CONF_OPTS = \ 22*4882a593Smuzhiyun --prefix=/usr \ 23*4882a593Smuzhiyun --enable-avfilter \ 24*4882a593Smuzhiyun --disable-version3 \ 25*4882a593Smuzhiyun --enable-logging \ 26*4882a593Smuzhiyun --enable-optimizations \ 27*4882a593Smuzhiyun --disable-extra-warnings \ 28*4882a593Smuzhiyun --enable-avdevice \ 29*4882a593Smuzhiyun --enable-avcodec \ 30*4882a593Smuzhiyun --enable-avformat \ 31*4882a593Smuzhiyun --enable-network \ 32*4882a593Smuzhiyun --disable-gray \ 33*4882a593Smuzhiyun --enable-swscale-alpha \ 34*4882a593Smuzhiyun --disable-small \ 35*4882a593Smuzhiyun --enable-dct \ 36*4882a593Smuzhiyun --enable-fft \ 37*4882a593Smuzhiyun --enable-mdct \ 38*4882a593Smuzhiyun --enable-rdft \ 39*4882a593Smuzhiyun --disable-crystalhd \ 40*4882a593Smuzhiyun --disable-dxva2 \ 41*4882a593Smuzhiyun --enable-runtime-cpudetect \ 42*4882a593Smuzhiyun --disable-hardcoded-tables \ 43*4882a593Smuzhiyun --disable-mipsdsp \ 44*4882a593Smuzhiyun --disable-mipsdspr2 \ 45*4882a593Smuzhiyun --disable-msa \ 46*4882a593Smuzhiyun --enable-hwaccels \ 47*4882a593Smuzhiyun --disable-cuda \ 48*4882a593Smuzhiyun --disable-cuvid \ 49*4882a593Smuzhiyun --disable-nvenc \ 50*4882a593Smuzhiyun --disable-avisynth \ 51*4882a593Smuzhiyun --disable-frei0r \ 52*4882a593Smuzhiyun --disable-libopencore-amrnb \ 53*4882a593Smuzhiyun --disable-libopencore-amrwb \ 54*4882a593Smuzhiyun --disable-libdc1394 \ 55*4882a593Smuzhiyun --disable-libgsm \ 56*4882a593Smuzhiyun --disable-libilbc \ 57*4882a593Smuzhiyun --disable-libvo-amrwbenc \ 58*4882a593Smuzhiyun --disable-symver \ 59*4882a593Smuzhiyun --disable-doc 60*4882a593Smuzhiyun 61*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += host-pkgconf 62*4882a593Smuzhiyun 63*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FFMPEG_GPL),y) 64*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-gpl 65*4882a593Smuzhiyunelse 66*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-gpl 67*4882a593Smuzhiyunendif 68*4882a593Smuzhiyun 69*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FFMPEG_NONFREE),y) 70*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-nonfree 71*4882a593Smuzhiyunelse 72*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-nonfree 73*4882a593Smuzhiyunendif 74*4882a593Smuzhiyun 75*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FFMPEG_FFMPEG),y) 76*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-ffmpeg 77*4882a593Smuzhiyunelse 78*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-ffmpeg 79*4882a593Smuzhiyunendif 80*4882a593Smuzhiyun 81*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FFMPEG_FFPLAY),y) 82*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += sdl2 83*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-ffplay 84*4882a593SmuzhiyunFFMPEG_CONF_ENV += SDL_CONFIG=$(STAGING_DIR)/usr/bin/sdl2-config 85*4882a593Smuzhiyunelse 86*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-ffplay 87*4882a593Smuzhiyunendif 88*4882a593Smuzhiyun 89*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBV4L),y) 90*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += libv4l 91*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libv4l2 92*4882a593Smuzhiyunelse 93*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libv4l2 94*4882a593Smuzhiyunendif 95*4882a593Smuzhiyun 96*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FFMPEG_AVRESAMPLE),y) 97*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-avresample 98*4882a593Smuzhiyunelse 99*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-avresample 100*4882a593Smuzhiyunendif 101*4882a593Smuzhiyun 102*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FFMPEG_FFPROBE),y) 103*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-ffprobe 104*4882a593Smuzhiyunelse 105*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-ffprobe 106*4882a593Smuzhiyunendif 107*4882a593Smuzhiyun 108*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FFMPEG_XCBGRAB),y) 109*4882a593SmuzhiyunFFMPEG_CONF_OPTS += \ 110*4882a593Smuzhiyun --enable-libxcb \ 111*4882a593Smuzhiyun --enable-libxcb-shape \ 112*4882a593Smuzhiyun --enable-libxcb-shm \ 113*4882a593Smuzhiyun --enable-libxcb-xfixes 114*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += libxcb 115*4882a593Smuzhiyunelse 116*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libxcb 117*4882a593Smuzhiyunendif 118*4882a593Smuzhiyun 119*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FFMPEG_POSTPROC),y) 120*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-postproc 121*4882a593Smuzhiyunelse 122*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-postproc 123*4882a593Smuzhiyunendif 124*4882a593Smuzhiyun 125*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE),y) 126*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-swscale 127*4882a593Smuzhiyunelse 128*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-swscale 129*4882a593Smuzhiyunendif 130*4882a593Smuzhiyun 131*4882a593Smuzhiyunifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),all) 132*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-encoders \ 133*4882a593Smuzhiyun $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),--enable-encoder=$(x)) 134*4882a593Smuzhiyunendif 135*4882a593Smuzhiyun 136*4882a593Smuzhiyunifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),all) 137*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-decoders \ 138*4882a593Smuzhiyun $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),--enable-decoder=$(x)) 139*4882a593Smuzhiyunendif 140*4882a593Smuzhiyun 141*4882a593Smuzhiyunifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),all) 142*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-muxers \ 143*4882a593Smuzhiyun $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),--enable-muxer=$(x)) 144*4882a593Smuzhiyunendif 145*4882a593Smuzhiyun 146*4882a593Smuzhiyunifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),all) 147*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-demuxers \ 148*4882a593Smuzhiyun $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),--enable-demuxer=$(x)) 149*4882a593Smuzhiyunendif 150*4882a593Smuzhiyun 151*4882a593Smuzhiyunifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),all) 152*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-parsers \ 153*4882a593Smuzhiyun $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),--enable-parser=$(x)) 154*4882a593Smuzhiyunendif 155*4882a593Smuzhiyun 156*4882a593Smuzhiyunifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),all) 157*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-bsfs \ 158*4882a593Smuzhiyun $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),--enable-bsf=$(x)) 159*4882a593Smuzhiyunendif 160*4882a593Smuzhiyun 161*4882a593Smuzhiyunifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),all) 162*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-protocols \ 163*4882a593Smuzhiyun $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),--enable-protocol=$(x)) 164*4882a593Smuzhiyunendif 165*4882a593Smuzhiyun 166*4882a593Smuzhiyunifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),all) 167*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-filters \ 168*4882a593Smuzhiyun $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),--enable-filter=$(x)) 169*4882a593Smuzhiyunendif 170*4882a593Smuzhiyun 171*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FFMPEG_INDEVS),y) 172*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-indevs 173*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_ALSA_LIB),y) 174*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-alsa 175*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += alsa-lib 176*4882a593Smuzhiyunelse 177*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-alsa 178*4882a593Smuzhiyunendif 179*4882a593Smuzhiyunelse 180*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-indevs 181*4882a593Smuzhiyunendif 182*4882a593Smuzhiyun 183*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FFMPEG_OUTDEVS),y) 184*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-outdevs 185*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_ALSA_LIB),y) 186*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += alsa-lib 187*4882a593Smuzhiyunendif 188*4882a593Smuzhiyunelse 189*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-outdevs 190*4882a593Smuzhiyunendif 191*4882a593Smuzhiyun 192*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) 193*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-pthreads 194*4882a593Smuzhiyunelse 195*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-pthreads 196*4882a593Smuzhiyunendif 197*4882a593Smuzhiyun 198*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_ZLIB),y) 199*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-zlib 200*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += zlib 201*4882a593Smuzhiyunelse 202*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-zlib 203*4882a593Smuzhiyunendif 204*4882a593Smuzhiyun 205*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_BZIP2),y) 206*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-bzlib 207*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += bzip2 208*4882a593Smuzhiyunelse 209*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-bzlib 210*4882a593Smuzhiyunendif 211*4882a593Smuzhiyun 212*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FDK_AAC)$(BR2_PACKAGE_FFMPEG_NONFREE),yy) 213*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libfdk-aac 214*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += fdk-aac 215*4882a593Smuzhiyunelse 216*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libfdk-aac 217*4882a593Smuzhiyunendif 218*4882a593Smuzhiyun 219*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FFMPEG_GPL)$(BR2_PACKAGE_LIBCDIO_PARANOIA),yy) 220*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libcdio 221*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += libcdio-paranoia 222*4882a593Smuzhiyunelse 223*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libcdio 224*4882a593Smuzhiyunendif 225*4882a593Smuzhiyun 226*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_GNUTLS),y) 227*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-gnutls --disable-openssl 228*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += gnutls 229*4882a593Smuzhiyunelse 230*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-gnutls 231*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_OPENSSL),y) 232*4882a593Smuzhiyun# openssl isn't license compatible with GPL 233*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FFMPEG_GPL)x$(BR2_PACKAGE_FFMPEG_NONFREE),yx) 234*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-openssl 235*4882a593Smuzhiyunelse 236*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-openssl 237*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += openssl 238*4882a593Smuzhiyunendif 239*4882a593Smuzhiyunelse 240*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-openssl 241*4882a593Smuzhiyunendif 242*4882a593Smuzhiyunendif 243*4882a593Smuzhiyun 244*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FFMPEG_GPL)$(BR2_PACKAGE_LIBEBUR128),yy) 245*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += libebur128 246*4882a593Smuzhiyunendif 247*4882a593Smuzhiyun 248*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBDRM),y) 249*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libdrm 250*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += libdrm 251*4882a593Smuzhiyunelse 252*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libdrm 253*4882a593Smuzhiyunendif 254*4882a593Smuzhiyun 255*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBOPENH264),y) 256*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libopenh264 257*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += libopenh264 258*4882a593Smuzhiyunelse 259*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libopenh264 260*4882a593Smuzhiyunendif 261*4882a593Smuzhiyun 262*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBVORBIS),y) 263*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += libvorbis 264*4882a593SmuzhiyunFFMPEG_CONF_OPTS += \ 265*4882a593Smuzhiyun --enable-libvorbis \ 266*4882a593Smuzhiyun --enable-muxer=ogg \ 267*4882a593Smuzhiyun --enable-encoder=libvorbis 268*4882a593Smuzhiyunendif 269*4882a593Smuzhiyun 270*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBVA),y) 271*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-vaapi 272*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += libva 273*4882a593Smuzhiyunelse 274*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-vaapi 275*4882a593Smuzhiyunendif 276*4882a593Smuzhiyun 277*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBVDPAU),y) 278*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-vdpau 279*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += libvdpau 280*4882a593Smuzhiyunelse 281*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-vdpau 282*4882a593Smuzhiyunendif 283*4882a593Smuzhiyun 284*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_RPI_USERLAND),y) 285*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-mmal --enable-omx --enable-omx-rpi \ 286*4882a593Smuzhiyun --extra-cflags=-I$(STAGING_DIR)/usr/include/IL 287*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += rpi-userland 288*4882a593Smuzhiyunelse 289*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-mmal --disable-omx --disable-omx-rpi 290*4882a593Smuzhiyunendif 291*4882a593Smuzhiyun 292*4882a593Smuzhiyun# To avoid a circular dependency only use opencv if opencv itself does 293*4882a593Smuzhiyun# not depend on ffmpeg. 294*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_OPENCV3_LIB_IMGPROC)x$(BR2_PACKAGE_OPENCV3_WITH_FFMPEG),yx) 295*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libopencv 296*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += opencv3 297*4882a593Smuzhiyunelse 298*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libopencv 299*4882a593Smuzhiyunendif 300*4882a593Smuzhiyun 301*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_OPUS),y) 302*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libopus 303*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += opus 304*4882a593Smuzhiyunelse 305*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libopus 306*4882a593Smuzhiyunendif 307*4882a593Smuzhiyun 308*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBVPX),y) 309*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libvpx 310*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += libvpx 311*4882a593Smuzhiyunelse 312*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libvpx 313*4882a593Smuzhiyunendif 314*4882a593Smuzhiyun 315*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBASS),y) 316*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libass 317*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += libass 318*4882a593Smuzhiyunelse 319*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libass 320*4882a593Smuzhiyunendif 321*4882a593Smuzhiyun 322*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBBLURAY),y) 323*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libbluray 324*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += libbluray 325*4882a593Smuzhiyunelse 326*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libbluray 327*4882a593Smuzhiyunendif 328*4882a593Smuzhiyun 329*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_INTEL_MEDIASDK),y) 330*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libmfx 331*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += intel-mediasdk 332*4882a593Smuzhiyunelse 333*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libmfx 334*4882a593Smuzhiyunendif 335*4882a593Smuzhiyun 336*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_RTMPDUMP),y) 337*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-librtmp 338*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += rtmpdump 339*4882a593Smuzhiyunelse 340*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-librtmp 341*4882a593Smuzhiyunendif 342*4882a593Smuzhiyun 343*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LAME),y) 344*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libmp3lame 345*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += lame 346*4882a593Smuzhiyunelse 347*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libmp3lame 348*4882a593Smuzhiyunendif 349*4882a593Smuzhiyun 350*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBMODPLUG),y) 351*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libmodplug 352*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += libmodplug 353*4882a593Smuzhiyunelse 354*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libmodplug 355*4882a593Smuzhiyunendif 356*4882a593Smuzhiyun 357*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_SPEEX),y) 358*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libspeex 359*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += speex 360*4882a593Smuzhiyunelse 361*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libspeex 362*4882a593Smuzhiyunendif 363*4882a593Smuzhiyun 364*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBTHEORA),y) 365*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libtheora 366*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += libtheora 367*4882a593Smuzhiyunelse 368*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libtheora 369*4882a593Smuzhiyunendif 370*4882a593Smuzhiyun 371*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBICONV),y) 372*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-iconv 373*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += libiconv 374*4882a593Smuzhiyunelse 375*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-iconv 376*4882a593Smuzhiyunendif 377*4882a593Smuzhiyun 378*4882a593Smuzhiyun# ffmpeg freetype support require fenv.h which is only 379*4882a593Smuzhiyun# available/working on glibc. 380*4882a593Smuzhiyun# The microblaze variant doesn't provide the needed exceptions 381*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FREETYPE)$(BR2_TOOLCHAIN_USES_GLIBC)x$(BR2_microblaze),yyx) 382*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libfreetype 383*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += freetype 384*4882a593Smuzhiyunelse 385*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libfreetype 386*4882a593Smuzhiyunendif 387*4882a593Smuzhiyun 388*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_FONTCONFIG),y) 389*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-fontconfig 390*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += fontconfig 391*4882a593Smuzhiyunelse 392*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-fontconfig 393*4882a593Smuzhiyunendif 394*4882a593Smuzhiyun 395*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_OPENJPEG),y) 396*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libopenjpeg 397*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += openjpeg 398*4882a593Smuzhiyunelse 399*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libopenjpeg 400*4882a593Smuzhiyunendif 401*4882a593Smuzhiyun 402*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_X264)$(BR2_PACKAGE_FFMPEG_GPL),yy) 403*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libx264 404*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += x264 405*4882a593Smuzhiyunelse 406*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libx264 407*4882a593Smuzhiyunendif 408*4882a593Smuzhiyun 409*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_X265)$(BR2_PACKAGE_FFMPEG_GPL),yy) 410*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libx265 411*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += x265 412*4882a593Smuzhiyunelse 413*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libx265 414*4882a593Smuzhiyunendif 415*4882a593Smuzhiyun 416*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_DAV1D),y) 417*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-libdav1d 418*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += dav1d 419*4882a593Smuzhiyunelse 420*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-libdav1d 421*4882a593Smuzhiyunendif 422*4882a593Smuzhiyun 423*4882a593Smuzhiyunifeq ($(BR2_X86_CPU_HAS_MMX),y) 424*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-x86asm 425*4882a593SmuzhiyunFFMPEG_DEPENDENCIES += host-nasm 426*4882a593Smuzhiyunelse 427*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-x86asm 428*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-mmx 429*4882a593Smuzhiyunendif 430*4882a593Smuzhiyun 431*4882a593Smuzhiyunifeq ($(BR2_X86_CPU_HAS_SSE),y) 432*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-sse 433*4882a593Smuzhiyunelse 434*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-sse 435*4882a593Smuzhiyunendif 436*4882a593Smuzhiyun 437*4882a593Smuzhiyunifeq ($(BR2_X86_CPU_HAS_SSE2),y) 438*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-sse2 439*4882a593Smuzhiyunelse 440*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-sse2 441*4882a593Smuzhiyunendif 442*4882a593Smuzhiyun 443*4882a593Smuzhiyunifeq ($(BR2_X86_CPU_HAS_SSE3),y) 444*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-sse3 445*4882a593Smuzhiyunelse 446*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-sse3 447*4882a593Smuzhiyunendif 448*4882a593Smuzhiyun 449*4882a593Smuzhiyunifeq ($(BR2_X86_CPU_HAS_SSSE3),y) 450*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-ssse3 451*4882a593Smuzhiyunelse 452*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-ssse3 453*4882a593Smuzhiyunendif 454*4882a593Smuzhiyun 455*4882a593Smuzhiyunifeq ($(BR2_X86_CPU_HAS_SSE4),y) 456*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-sse4 457*4882a593Smuzhiyunelse 458*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-sse4 459*4882a593Smuzhiyunendif 460*4882a593Smuzhiyun 461*4882a593Smuzhiyunifeq ($(BR2_X86_CPU_HAS_SSE42),y) 462*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-sse42 463*4882a593Smuzhiyunelse 464*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-sse42 465*4882a593Smuzhiyunendif 466*4882a593Smuzhiyun 467*4882a593Smuzhiyunifeq ($(BR2_X86_CPU_HAS_AVX),y) 468*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-avx 469*4882a593Smuzhiyunelse 470*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-avx 471*4882a593Smuzhiyunendif 472*4882a593Smuzhiyun 473*4882a593Smuzhiyunifeq ($(BR2_X86_CPU_HAS_AVX2),y) 474*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-avx2 475*4882a593Smuzhiyunelse 476*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-avx2 477*4882a593Smuzhiyunendif 478*4882a593Smuzhiyun 479*4882a593Smuzhiyun# Explicitly disable everything that doesn't match for ARM 480*4882a593Smuzhiyun# FFMPEG "autodetects" by compiling an extended instruction via AS 481*4882a593Smuzhiyun# This works on compilers that aren't built for generic by default 482*4882a593Smuzhiyunifeq ($(BR2_ARM_CPU_ARMV4),y) 483*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-armv5te 484*4882a593Smuzhiyunendif 485*4882a593Smuzhiyunifeq ($(BR2_ARM_CPU_ARMV6)$(BR2_ARM_CPU_ARMV7A),y) 486*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-armv6 487*4882a593Smuzhiyunelse 488*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-armv6 --disable-armv6t2 489*4882a593Smuzhiyunendif 490*4882a593Smuzhiyunifeq ($(BR2_ARM_CPU_HAS_VFPV2),y) 491*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-vfp 492*4882a593Smuzhiyunelse 493*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-vfp 494*4882a593Smuzhiyunendif 495*4882a593Smuzhiyunifeq ($(BR2_ARM_CPU_HAS_NEON),y) 496*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-neon 497*4882a593Smuzhiyunelse ifeq ($(BR2_aarch64),y) 498*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-neon 499*4882a593Smuzhiyunelse 500*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-neon 501*4882a593Smuzhiyunendif 502*4882a593Smuzhiyun 503*4882a593Smuzhiyunifeq ($(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y) 504*4882a593Smuzhiyunifeq ($(BR2_MIPS_SOFT_FLOAT),y) 505*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-mipsfpu 506*4882a593Smuzhiyunelse 507*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-mipsfpu 508*4882a593Smuzhiyunendif 509*4882a593Smuzhiyun 510*4882a593Smuzhiyun# Fix build failure on several missing assembly instructions 511*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-asm 512*4882a593Smuzhiyunendif # MIPS 513*4882a593Smuzhiyun 514*4882a593Smuzhiyunifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y) 515*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-altivec 516*4882a593Smuzhiyunelse 517*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-altivec 518*4882a593Smuzhiyunendif 519*4882a593Smuzhiyun 520*4882a593Smuzhiyun# Uses __atomic_fetch_add_4 521*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) 522*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --extra-libs=-latomic 523*4882a593Smuzhiyunendif 524*4882a593Smuzhiyun 525*4882a593Smuzhiyunifeq ($(BR2_STATIC_LIBS),) 526*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --enable-pic 527*4882a593Smuzhiyunelse 528*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-pic 529*4882a593Smuzhiyunendif 530*4882a593Smuzhiyun 531*4882a593Smuzhiyun# Default to --cpu=generic for MIPS architecture, in order to avoid a 532*4882a593Smuzhiyun# warning from ffmpeg's configure script. 533*4882a593Smuzhiyunifeq ($(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y) 534*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --cpu=generic 535*4882a593Smuzhiyunelse ifneq ($(GCC_TARGET_CPU),) 536*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --cpu="$(GCC_TARGET_CPU)" 537*4882a593Smuzhiyunelse ifneq ($(GCC_TARGET_ARCH),) 538*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --cpu="$(GCC_TARGET_ARCH)" 539*4882a593Smuzhiyunendif 540*4882a593Smuzhiyun 541*4882a593SmuzhiyunFFMPEG_CFLAGS = $(TARGET_CFLAGS) 542*4882a593Smuzhiyun 543*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y) 544*4882a593SmuzhiyunFFMPEG_CONF_OPTS += --disable-optimizations 545*4882a593SmuzhiyunFFMPEG_CFLAGS += -O0 546*4882a593Smuzhiyunendif 547*4882a593Smuzhiyun 548*4882a593SmuzhiyunFFMPEG_CONF_ENV += CFLAGS="$(FFMPEG_CFLAGS)" 549*4882a593SmuzhiyunFFMPEG_CONF_OPTS += $(call qstrip,$(BR2_PACKAGE_FFMPEG_EXTRACONF)) 550*4882a593Smuzhiyun 551*4882a593Smuzhiyun# Override FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others 552*4882a593Smuzhiyundefine FFMPEG_CONFIGURE_CMDS 553*4882a593Smuzhiyun (cd $(FFMPEG_SRCDIR) && rm -rf config.cache && \ 554*4882a593Smuzhiyun $(TARGET_CONFIGURE_OPTS) \ 555*4882a593Smuzhiyun $(TARGET_CONFIGURE_ARGS) \ 556*4882a593Smuzhiyun $(FFMPEG_CONF_ENV) \ 557*4882a593Smuzhiyun ./configure \ 558*4882a593Smuzhiyun --enable-cross-compile \ 559*4882a593Smuzhiyun --cross-prefix=$(TARGET_CROSS) \ 560*4882a593Smuzhiyun --sysroot=$(STAGING_DIR) \ 561*4882a593Smuzhiyun --host-cc="$(HOSTCC)" \ 562*4882a593Smuzhiyun --arch=$(BR2_ARCH) \ 563*4882a593Smuzhiyun --target-os="linux" \ 564*4882a593Smuzhiyun --disable-stripping \ 565*4882a593Smuzhiyun --pkg-config="$(PKG_CONFIG_HOST_BINARY)" \ 566*4882a593Smuzhiyun $(SHARED_STATIC_LIBS_OPTS) \ 567*4882a593Smuzhiyun $(FFMPEG_CONF_OPTS) \ 568*4882a593Smuzhiyun ) 569*4882a593Smuzhiyunendef 570*4882a593Smuzhiyun 571*4882a593Smuzhiyundefine FFMPEG_REMOVE_EXAMPLE_SRC_FILES 572*4882a593Smuzhiyun rm -rf $(TARGET_DIR)/usr/share/ffmpeg/examples 573*4882a593Smuzhiyunendef 574*4882a593SmuzhiyunFFMPEG_POST_INSTALL_TARGET_HOOKS += FFMPEG_REMOVE_EXAMPLE_SRC_FILES 575*4882a593Smuzhiyun 576*4882a593Smuzhiyun$(eval $(autotools-package)) 577